• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:16
CEST 21:16
KST 04:16
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL56Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event19Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
Statistics for vetoed/disliked maps The SCII GOAT: A statistical Evaluation Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap The GOAT ranking of GOAT rankings
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series Korean Starcraft League Week 77 Master Swan Open (Global Bronze-Master 2) [GSL 2025] Code S: Season 2 - Semi Finals & Finals
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Flash Announces Hiatus From ASL Player “Jedi” cheat on CSL Replays question BW General Discussion BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[Megathread] Daily Proleagues [BSL20] Grand Finals - Sunday 20:00 CET Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile What do you want from future RTS games? Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Trading/Investing Thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 632 users

The Big Programming Thread - Page 32

Forum Index > General Forum
Post a Reply
Prev 1 30 31 32 33 34 1031 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
imDerek
Profile Blog Joined August 2007
United States1944 Posts
January 04 2011 03:27 GMT
#621
shell sort - it's pretty neat but not sure if it is widely used in practice
heap sort can be done in-place by heapifying the array directly (assuming you are sorting an array)
quick sort - randomize the pivot choice will give you expected O(n log n) running time. it's actually pretty good in practice.

Heapsort and quicksort are both nice comparison based sorting algorithms. Also consider mergesort which is O(n log n) running time and it is also a stable sort, and easily scalable.

Quicksort and switching to insertion sort on base cases (eg. when length is <= some number) does pretty well.
Least favorite progamers: Leta, Zero, Mind, Shine, free, really <-- newly added
Craton
Profile Blog Joined December 2009
United States17246 Posts
Last Edited: 2011-01-04 15:47:33
January 04 2011 14:46 GMT
#622
On January 04 2011 10:39 hucskool wrote:
If you are still having issues with this and you are using MS SQL Server 05 (or higher), you could probably do this with a OUTER APPLY. I'm not sure what your schema looks like and I don't have anything here at home to check the syntax with but something like this would let you access the itmcheckout record for the given item id.



SELECT DISTINCT itm.*, ua.lastName + ', ' + ua.firstName as responsible_party,
itmstatref.item_status_ref_name as item_status_ref_name,
itmtyperef.item_type_name as item_type_name,
itmcheckout.*
FROM ITEM itm
INNER JOIN USERACCOUNTS ua ON ua.userUID=itm.userUID
INNER JOIN ITEM_STATUS itmstat ON itm.item_id=itmstat.item_id
INNER JOIN ITEM_STATUS_REF itmstatref ON itmstat.item_status_ref_id=itmstatref.item_status_ref_id
INNER JOIN ITEM_TYPE_REF itmtyperef ON itm.item_type_id=itmtyperef.item_type_id
OUTER APPLY
(
SELECT MAX(itmcheckout.item_checkin_dt) as item_checkin_dt, itmcheckout.item_checkout_dt, uac.lastName + ', ' + uac.firstName as checked_out_by
FROM item_checkout itmcheckout INNER JOIN USERACCOUNTS uac on itmcheckout.userUID=uac.userUID
WHERE itmcheckout.item_id=itm.item_id
GROUP BY itmcheckout.item_checkin_dt, itmcheckout.item_checkout_dt, uac.firstName, uac.LastName
) as itmcheckout
ORDER BY itm.item_id, itm.item_inv_no

Huzzah. I think this will get me where I need to be.

Full thing:
+ Show Spoiler +
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sp_InventoryItem_select]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[sp_InventoryItem_select]
GO

CREATE PROCEDURE [dbo].[sp_InventoryItem_select]
(
@mode varchar(20) = null,
@item_id int = null,
@item_name varchar(50) = null,
@item_inv_no numeric(18, 0) = null,
@item_type_id int = null,
@item_enable_checkout bit = null,
@userUID int = null
)
WITH ENCRYPTION
AS
SET NOCOUNT ON
begin
SELECT DISTINCT itm.*, ua.lastName + ', ' + ua.firstName as responsible_party,
itmstatref.item_status_ref_name as item_status_ref_name,
itmtyperef.item_type_name as item_type_name,
itmcheckout.*
FROM ITEM itm
INNER JOIN USERACCOUNTS ua ON ua.userUID=itm.userUID
INNER JOIN ITEM_STATUS itmstat ON itm.item_id=itmstat.item_id
INNER JOIN ITEM_STATUS_REF itmstatref ON itmstat.item_status_ref_id=itmstatref.item_status_ref_id
INNER JOIN ITEM_TYPE_REF itmtyperef ON itm.item_type_id=itmtyperef.item_type_id
OUTER APPLY
(
SELECT MAX(itmcheckout.item_checkin_dt) as item_checkin_dt, itmcheckout.item_checkout_dt, uac.lastName + ', ' + uac.firstName as checked_out_by
FROM item_checkout itmcheckout INNER JOIN USERACCOUNTS uac on itmcheckout.userUID=uac.userUID
WHERE itmcheckout.item_id=itm.item_id
GROUP BY itmcheckout.item_checkin_dt, itmcheckout.item_checkout_dt, uac.firstName, uac.LastName
) as itmcheckout
WHERE (@item_id is null or itm.item_id = @item_id)
and (@item_name is null or itm.item_name = @item_name)
and (@item_inv_no is null or itm.item_inv_no = @item_inv_no)
and (@item_type_id is null or itm.item_type_id = @item_type_id)
and (@item_enable_checkout is null or itm.item_enable_checkout = @item_enable_checkout)
and (@userUID is null or itm.userUID = @userUID)
ORDER BY itm.item_id, itm.item_inv_no
end
GO
twitch.tv/cratonz
Senx
Profile Blog Joined March 2008
Sweden5901 Posts
January 04 2011 17:16 GMT
#623
Can anyone help me out with actionscript 3.0 a bit? Im quite the newbie at it. Im making an asteroids game and im right now wanting to control the spaceship from left to right. Most of the game must be controlled from external .as files.

So here's what I want to do: I want to add my movieclip(a spaceship) to the stage through an external .as file, but I keep getting an error.

Here's the code for the actionscript file:

package {

import flash.display.MovieClip;
import flash.events.*;

public class Spaceship extends MovieClip {
public function Space () {

onClipEvent(enterFrame)
if(Key.isDown(Key.LEFT)){
_x -= 6;
}else if(Key.isDown(Key.RIGHT)){
_x += 6;
}
}
}
}

in the .fla file:
addChild(Spaceship);


Error message:
TypeError: Error #1034: Type Coercion failed: cannot convert Spaceship$ to flash.display.DisplayObject.
at Gustaf_fla::MainTimeline/frame1()

I've been reading up that I need some sort of var code to store the creation/removal of this movieclip instance, but im not sure how to use it.. any ideas?
"trash micro but win - its marine" MC commentary during HSC 4
XuoriG
Profile Blog Joined October 2007
Canada165 Posts
January 05 2011 01:06 GMT
#624
+ Show Spoiler +
<html>
<head>
<style type="text/css">
li
{
display:inline;
}
body
{
background-color:black;
}
a:link,a:visited
{
display:block;
color:white;
background-color:green;
font-weight:bold;
width:140px;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase
}
a:hover,a:active
{
background-color:red;
}
ul
{
list-style-type:none;
margin:0;
padding:0;
border:5px white;
padding-top:5px;
padding-bottom:5px;
}

</style>
</head>
<body>
<ul>
<li><a href="#">Biographie</a></li>
<li><a href="#">Multimedia</a></li>
<li><a href="#">Discographie</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Liens</a></li>
<li><a href="#">Blablabla</a></li>
</ul>
</body>
</html>


Hey guys, i'm a total noob at programming for now, but I've been working on improving my skills lately. (I've been messing around with HTML CSS and Javascript)

Anyways, for fun I tried to do a horizontal menu with hover stuff. But I cant get it to be horizontal... Vertical menu works though. It seems like my : display:inline; doesnt have any effect...

I've tryed using float:left and it works but I really wanted to make the other way work.

Could any body tell me why it doesnt seem to recognise the inline?

Thanks a lot, this thread is really encouraging.
Nizaris
Profile Joined May 2010
Belgium2230 Posts
Last Edited: 2011-01-05 01:20:08
January 05 2011 01:10 GMT
#625
On January 05 2011 10:06 Rutluv wrote:
+ Show Spoiler +
<html>
<head>
<style type="text/css">
li
{
display:inline;
}
body
{
background-color:black;
}
a:link,a:visited
{
display:block;
color:white;
background-color:green;
font-weight:bold;
width:140px;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase
}
a:hover,a:active
{
background-color:red;
}
ul
{
list-style-type:none;
margin:0;
padding:0;
border:5px white;
padding-top:5px;
padding-bottom:5px;
}

</style>
</head>
<body>
<ul>
<li><a href="#">Biographie</a></li>
<li><a href="#">Multimedia</a></li>
<li><a href="#">Discographie</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Liens</a></li>
<li><a href="#">Blablabla</a></li>
</ul>
</body>
</html>


Hey guys, i'm a total noob at programming for now, but I've been working on improving my skills lately. (I've been messing around with HTML CSS and Javascript)

Anyways, for fun I tried to do a horizontal menu with hover stuff. But I cant get it to be horizontal... Vertical menu works though. It seems like my : display:inline; doesnt have any effect...

I've tryed using float:left and it works but I really wanted to make the other way work.

Could any body tell me why it doesnt seem to recognise the inline?

Thanks a lot, this thread is really encouraging.


If you want the items to be horizontal the easiest way is to put them in a table. or position divs individually. Can't say why inline doesn't work sry i don't use it, but i'm fairly certain you wouldn't use it to put items horizontally.

something like+ Show Spoiler +
<table>
<tr>
<td>item 1</td>
<td>item 2</td>
<td>item 3</td>
<td>item 4</td>
</tr>
</table>


float: left is usually bad, except in a few cases. it'll end up screwing up your stuff if they don't exactly all have the same height.
Adeny
Profile Blog Joined January 2009
Norway1233 Posts
January 05 2011 04:48 GMT
#626
Anyone have the breakdown on ELO? Finding it hard to google out formulas to copy-paste, I don't want the deep mathematical stuff, I know the basic outline and just want to implement it for fun.
Craton
Profile Blog Joined December 2009
United States17246 Posts
Last Edited: 2011-01-05 15:37:45
January 05 2011 15:31 GMT
#627
On January 05 2011 10:06 Rutluv wrote:
+ Show Spoiler +
<html>
<head>
<style type="text/css">
li
{
display:inline;
}
body
{
background-color:black;
}
a:link,a:visited
{
display:block;
color:white;
background-color:green;
font-weight:bold;
width:140px;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase
}
a:hover,a:active
{
background-color:red;
}
ul
{
list-style-type:none;
margin:0;
padding:0;
border:5px white;
padding-top:5px;
padding-bottom:5px;
}

</style>
</head>
<body>
<ul>
<li><a href="#">Biographie</a></li>
<li><a href="#">Multimedia</a></li>
<li><a href="#">Discographie</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Liens</a></li>
<li><a href="#">Blablabla</a></li>
</ul>
</body>
</html>


Hey guys, i'm a total noob at programming for now, but I've been working on improving my skills lately. (I've been messing around with HTML CSS and Javascript)

Anyways, for fun I tried to do a horizontal menu with hover stuff. But I cant get it to be horizontal... Vertical menu works though. It seems like my : display:inline; doesnt have any effect...

I've tryed using float:left and it works but I really wanted to make the other way work.

Could any body tell me why it doesnt seem to recognise the inline?

Thanks a lot, this thread is really encouraging.

Well, HTML and CSS aren't programming per se.

To answer your question: you have the CSS for your links set as block, but your list items set as inline. You aren't allowed to have both, as they are mutually exclusive. The block style, in this case, is taking precedence, which is why you get them on multiple lines (I believe this is because <a> is the innermost style). Delete "display:block;" inside
a:link,a:visited
{
display:block;
color:white;
background-color:green;
font-weight:bold;
width:140px;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase
}
twitch.tv/cratonz
zingmars
Profile Joined April 2010
Latvia189 Posts
January 05 2011 15:44 GMT
#628
OP should add these sites to the 1st post of this thread:
PHP: Zend - Devzone
C++: Learn C++ in 21 days
I'm sure I could find/remember more, but heh, might do that later.
That said - Is there any *FUN* way to learn C++? The guides always seem to be really boring. Usually video tutorials seem to be more fun to watch however they too usually become boring/generic after awhile. Any suggestions?
"I think there is a world market for maybe five computers." -- Thomas Watson
enigmaticcam
Profile Blog Joined October 2010
United States280 Posts
January 05 2011 21:14 GMT
#629
On January 05 2011 13:48 Adeny wrote:
Anyone have the breakdown on ELO? Finding it hard to google out formulas to copy-paste, I don't want the deep mathematical stuff, I know the basic outline and just want to implement it for fun.

Some key things to consider are: (1) how to manage provisional ratings for new players, (2) how inflated you want the numbers to be (K constant), (3) chronological order of events, and (4) does ELO make sense with the tournament format.

(1) How to manage provisional ratings for new players.
I recommend you check out http://www.chessatwork.com/help/index.php?help=faq, under "How is my rating calculated?" It's a very simple and nice explanation on how they manage new players, and I think it works great. I've used their system before in my own implementation.

(2) How inflated you want the numbers to be (K constant).
If you've googled the actual ELO mathematical equations, you'll come across the K constant. It's basically a constant that determines how much you want the numbers to fluctuate. The higher the constant, the larger the numbers will change after a given match. In the official Chess ELO format, they use a larger constant if you're below 2400, but a smaller constant above 2400. You don't have to do that, but it's something to think about

(3) Chronological order of events.
It's very important that ratings are calculated in the chronological order they happened. If you calculate them as they happen, this isn't a problem. But sometimes that's not always the case. You might enter two or three tournaments worth of data at once, and later learn there was some other tournament in between that you forgot to input, and you've basically got to recalculate from the very beginning. You'll need to account for that if you're developing some kind of program for this.

(4) Does ELO make sense with the tournament format.
The simple fact is, ELO makes no sense at all for the standard brackets you typically see. You know, those that work great when the number of participants is a factor of 2 (2,4,8,16,32,64). Especially ones that are seeded properly based on historical results. Those kinds of tournaments produce accurate ELO ratings for just the top three or so, because they play the most games. ELO is much better for swiss or round-robin tournaments.
Osmoses
Profile Blog Joined October 2008
Sweden5302 Posts
Last Edited: 2011-01-05 21:32:39
January 05 2011 21:31 GMT
#630
On January 05 2011 02:16 Senx wrote:
Can anyone help me out with actionscript 3.0 a bit? Im quite the newbie at it. Im making an asteroids game and im right now wanting to control the spaceship from left to right. Most of the game must be controlled from external .as files.

So here's what I want to do: I want to add my movieclip(a spaceship) to the stage through an external .as file, but I keep getting an error.

Here's the code for the actionscript file:

package {

import flash.display.MovieClip;
import flash.events.*;

public class Spaceship extends MovieClip {
public function Space () {

onClipEvent(enterFrame)
if(Key.isDown(Key.LEFT)){
_x -= 6;
}else if(Key.isDown(Key.RIGHT)){
_x += 6;
}
}
}
}

in the .fla file:
addChild(Spaceship);


Error message:
TypeError: Error #1034: Type Coercion failed: cannot convert Spaceship$ to flash.display.DisplayObject.
at Gustaf_fla::MainTimeline/frame1()

I've been reading up that I need some sort of var code to store the creation/removal of this movieclip instance, but im not sure how to use it.. any ideas?

Well from what I can see, first of all you need a constructor for your spaceship class, as I'm pretty sure as3 does not support default constructors. Basically I'm thinking you probably want your Space function to be named Spaceship.

Also, onClipEvent I think is an as2 function. Try

addEventListener(Event.ENTER_FRAME, function(evt:Event){ //code });

in the fla instead. The EnterFrame event does not deal in keystrokes however, so I suggest you make a different listener for that.

addEventListener(KeyboardEvent.KEY_UP, function(evt:Event){ if(evt.keyCode == 123) etc });

in the fla should work.

edit: oh yeah, and you need to instansiate the spaceship class,


var myVariable = new spaceShip();
addChild(myVariable);
Excuse me hun, but what is your name? Vivian? I woke up next to you naked and, uh, did we, um?
zoombini
Profile Joined June 2010
United States67 Posts
January 05 2011 22:22 GMT
#631
On January 04 2011 08:15 uNiGNoRe wrote:
Show nested quote +
On January 04 2011 03:25 Phunkapotamus wrote:
icystorage:
You shouldn't need to include "Node.h" for a struct definition and for this to compile. Your latest snippet will work. However, if you wish to use the 'node' struct outside of the current file it would be better practice to move the definition elsewhere- such that you can use it in multiple places easier.

For c++ you don't need to put 'struct' every time you use your 'node'. If you're getting errors relating to how 'node' is used, then you may be compiling as c instead of c++. My snippet has a solution that works for both.

If I may, I would like to recommend that you work towards a better variable naming conventions. Taking your example, mixed with bigpet's, this is how we would like to see code in the game industry:

+ Show Spoiler +

typedef struct _IcyNode
{
int m_data;
_IcyNode* m_next;
} IcyNode;

IcyNode* BuildOneTwoThree()
{
const int icyNodeSize = sizeof(IcyNode);
IcyNode* oneNode = static_cast< IcyNode* >(malloc(icyNodeSize));
oneNode->m_data = 1;
IcyNode* twoNode = static_cast< IcyNode* >(malloc(icyNodeSize));
twoNode ->m_data = 2;
IcyNode* threeNode = static_cast< IcyNode* >(malloc(icyNodeSize));
threeNode ->m_data = 3;

oneNode->m_next = twoNode;
twoNode->m_next = threeNode;
threeNode->m_next = NULL;

return oneNode;
}

int main()
{
BuildOneTwoThree();
return 0;
}


I have a question: why do you use
IcyNode* oneNode = static_cast< IcyNode* >(malloc(icyNodeSize));

instead of
IcyNode* oneNode = (IcyNode*)malloc(icyNodeSize);


You should check this out for an explanation of C++ casts: http://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-and-reinterpret-cast-be-used
SaYyId
Profile Joined August 2010
Portugal277 Posts
January 05 2011 22:40 GMT
#632
Pretty bold request, but can anyone here teach me how to code? The basics and such, nothing too fancy, as I remember being on MPGH looking like a noob that was there just for the hacks, not giving anithing in return. I really feel like I should learn how to code.
No Strings. No attachments.
Adeny
Profile Blog Joined January 2009
Norway1233 Posts
January 06 2011 02:28 GMT
#633
On January 06 2011 06:14 enigmaticcam wrote:
Show nested quote +
On January 05 2011 13:48 Adeny wrote:
Anyone have the breakdown on ELO? Finding it hard to google out formulas to copy-paste, I don't want the deep mathematical stuff, I know the basic outline and just want to implement it for fun.

Some key things to consider are: (1) how to manage provisional ratings for new players, (2) how inflated you want the numbers to be (K constant), (3) chronological order of events, and (4) does ELO make sense with the tournament format.

(1) How to manage provisional ratings for new players.
I recommend you check out http://www.chessatwork.com/help/index.php?help=faq, under "How is my rating calculated?" It's a very simple and nice explanation on how they manage new players, and I think it works great. I've used their system before in my own implementation.

(2) How inflated you want the numbers to be (K constant).
If you've googled the actual ELO mathematical equations, you'll come across the K constant. It's basically a constant that determines how much you want the numbers to fluctuate. The higher the constant, the larger the numbers will change after a given match. In the official Chess ELO format, they use a larger constant if you're below 2400, but a smaller constant above 2400. You don't have to do that, but it's something to think about

(3) Chronological order of events.
It's very important that ratings are calculated in the chronological order they happened. If you calculate them as they happen, this isn't a problem. But sometimes that's not always the case. You might enter two or three tournaments worth of data at once, and later learn there was some other tournament in between that you forgot to input, and you've basically got to recalculate from the very beginning. You'll need to account for that if you're developing some kind of program for this.

(4) Does ELO make sense with the tournament format.
The simple fact is, ELO makes no sense at all for the standard brackets you typically see. You know, those that work great when the number of participants is a factor of 2 (2,4,8,16,32,64). Especially ones that are seeded properly based on historical results. Those kinds of tournaments produce accurate ELO ratings for just the top three or so, because they play the most games. ELO is much better for swiss or round-robin tournaments.


Sick reply, thanks a lot!
Craton
Profile Blog Joined December 2009
United States17246 Posts
January 06 2011 05:14 GMT
#634
On January 06 2011 07:40 SaYyId wrote:
Pretty bold request, but can anyone here teach me how to code? The basics and such, nothing too fancy, as I remember being on MPGH looking like a noob that was there just for the hacks, not giving anithing in return. I really feel like I should learn how to code.

Pick some basic tutorials and run with them. Should be plenty on the OP links.
twitch.tv/cratonz
enigmaticcam
Profile Blog Joined October 2010
United States280 Posts
January 06 2011 18:44 GMT
#635
On January 06 2011 11:28 Adeny wrote:

Sick reply, thanks a lot!

No problem
RainWhisper
Profile Joined May 2009
United Arab Emirates333 Posts
January 07 2011 01:47 GMT
#636
Guys, ive finally caved and ive come here. Im trying to develop something, AND ITS FOR TEAM LIQUID yay!!! But alas i hit a pylon wall and i need major help with RegExp(Regular Expressions). I believe PERL RegExp.

If this makes ANY sense to you than you are probably the person i need

RegExp="(?siU)Featured Streams.*<h>(.*)Live Streams"

Anyone familiar with this type of Regular expressions, i need a gosu. I can understand this, but i need to basically write a way more complex Regular Expression.
Hi can i get one McGracken please?
uNiGNoRe
Profile Blog Joined June 2007
Germany1115 Posts
January 07 2011 02:30 GMT
#637
On January 06 2011 07:22 zoombini wrote:
Show nested quote +
On January 04 2011 08:15 uNiGNoRe wrote:
On January 04 2011 03:25 Phunkapotamus wrote:
icystorage:
You shouldn't need to include "Node.h" for a struct definition and for this to compile. Your latest snippet will work. However, if you wish to use the 'node' struct outside of the current file it would be better practice to move the definition elsewhere- such that you can use it in multiple places easier.

For c++ you don't need to put 'struct' every time you use your 'node'. If you're getting errors relating to how 'node' is used, then you may be compiling as c instead of c++. My snippet has a solution that works for both.

If I may, I would like to recommend that you work towards a better variable naming conventions. Taking your example, mixed with bigpet's, this is how we would like to see code in the game industry:

+ Show Spoiler +

typedef struct _IcyNode
{
int m_data;
_IcyNode* m_next;
} IcyNode;

IcyNode* BuildOneTwoThree()
{
const int icyNodeSize = sizeof(IcyNode);
IcyNode* oneNode = static_cast< IcyNode* >(malloc(icyNodeSize));
oneNode->m_data = 1;
IcyNode* twoNode = static_cast< IcyNode* >(malloc(icyNodeSize));
twoNode ->m_data = 2;
IcyNode* threeNode = static_cast< IcyNode* >(malloc(icyNodeSize));
threeNode ->m_data = 3;

oneNode->m_next = twoNode;
twoNode->m_next = threeNode;
threeNode->m_next = NULL;

return oneNode;
}

int main()
{
BuildOneTwoThree();
return 0;
}


I have a question: why do you use
IcyNode* oneNode = static_cast< IcyNode* >(malloc(icyNodeSize));

instead of
IcyNode* oneNode = (IcyNode*)malloc(icyNodeSize);


You should check this out for an explanation of C++ casts: http://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-and-reinterpret-cast-be-used

Thank you. Very helpful. But after reading that and some other sources, I cannot imagine when using dynamic_cast would actually be a good idea. I mean, if you need to cast a pointer where you aren't sure what it points to even at runtime, you should probably rethink you code...

Now another question: I'm currently reading the OpenGL Programming Guide parallel to a computer graphics course at the university. I'd like to program a 3D graphics engine to put that into practice. My question is, can anyone recommend a good (english) book about OpenGL programming? Especially if it covers features that were added with later OpenGL releases since the guide covers only 1.0 and 1.1. And/or a book that focuses on programming a game graphics engine with OpenGL?
berated-
Profile Blog Joined February 2007
United States1134 Posts
Last Edited: 2011-01-07 02:49:02
January 07 2011 02:48 GMT
#638
On January 06 2011 00:31 Craton wrote:
Show nested quote +
On January 05 2011 10:06 Rutluv wrote:
+ Show Spoiler +
<html>
<head>
<style type="text/css">
li
{
display:inline;
}
body
{
background-color:black;
}
a:link,a:visited
{
display:block;
color:white;
background-color:green;
font-weight:bold;
width:140px;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase
}
a:hover,a:active
{
background-color:red;
}
ul
{
list-style-type:none;
margin:0;
padding:0;
border:5px white;
padding-top:5px;
padding-bottom:5px;
}

</style>
</head>
<body>
<ul>
<li><a href="#">Biographie</a></li>
<li><a href="#">Multimedia</a></li>
<li><a href="#">Discographie</a></li>
<li><a href="#">Contact</a></li>
<li><a href="#">Liens</a></li>
<li><a href="#">Blablabla</a></li>
</ul>
</body>
</html>


Hey guys, i'm a total noob at programming for now, but I've been working on improving my skills lately. (I've been messing around with HTML CSS and Javascript)

Anyways, for fun I tried to do a horizontal menu with hover stuff. But I cant get it to be horizontal... Vertical menu works though. It seems like my : display:inline; doesnt have any effect...

I've tryed using float:left and it works but I really wanted to make the other way work.

Could any body tell me why it doesnt seem to recognise the inline?

Thanks a lot, this thread is really encouraging.

Well, HTML and CSS aren't programming per se.

To answer your question: you have the CSS for your links set as block, but your list items set as inline. You aren't allowed to have both, as they are mutually exclusive. The block style, in this case, is taking precedence, which is why you get them on multiple lines (I believe this is because <a> is the innermost style). Delete "display:block;" inside
a:link,a:visited
{
display:block;
color:white;
background-color:green;
font-weight:bold;
width:140px;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase
}



First and foremost rutluv, unless you are just leaving out the doctype while pasting in your code, you really need to make sure you add one to your html pages. It will save you a lot of headache on your future learnings...

Reading about why you need a doctype

In your example its displaying on each line because the a is a block, as craton pointed out. The li are still trying to display inline but it isn't visible because the li has no other styles.

Yes its painful to get right cross browser but the float based navigation style is going to be a better implementation until the mythical inline block finally becomes consistent across browsers because the floated li will allow for you to nest block level elements inside of them, unlike the inline elements as you have already figured out.
gravity
Profile Joined March 2004
Australia1847 Posts
January 07 2011 03:41 GMT
#639
On January 07 2011 11:30 uNiGNoRe wrote:
Now another question: I'm currently reading the OpenGL Programming Guide parallel to a computer graphics course at the university. I'd like to program a 3D graphics engine to put that into practice. My question is, can anyone recommend a good (english) book about OpenGL programming? Especially if it covers features that were added with later OpenGL releases since the guide covers only 1.0 and 1.1. And/or a book that focuses on programming a game graphics engine with OpenGL?

I'm currently reading OpenGL SuperBible 5th edition. It's very clearly written and focuses on OpenGL 3.0+.
Bigpet
Profile Joined July 2010
Germany533 Posts
January 07 2011 05:51 GMT
#640
On January 07 2011 10:47 MarwanBaki wrote:
Guys, ive finally caved and ive come here. Im trying to develop something, AND ITS FOR TEAM LIQUID yay!!! But alas i hit a pylon wall and i need major help with RegExp(Regular Expressions). I believe PERL RegExp.

If this makes ANY sense to you than you are probably the person i need

RegExp="(?siU)Featured Streams.*<h>(.*)Live Streams"

Anyone familiar with this type of Regular expressions, i need a gosu. I can understand this, but i need to basically write a way more complex Regular Expression.


I am sorry but your post contains no question other then "can anybody help me?".
Please just ask your question and we'll answer it.

Also you could ask the guys resposible for the site if they'll maybe make a XML interface or a seperate simple website like teamliquid.net/streams.php to ease both your task and their netload.
Because parsing a full website when asking the programmers could spare you a lot of trouble is really silly.
I'm NOT the caster with a similar nick
Prev 1 30 31 32 33 34 1031 Next
Please log in or register to reply.
Live Events Refresh
FEL
16:00
Cracov 2025: Qualifier #1
RotterdaM825
IndyStarCraft 281
CranKy Ducklings212
Liquipedia
PSISTORM Gaming Misc
15:55
FSL team league: ASP vs PTB
Freeedom9
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 825
IndyStarCraft 281
JuggernautJason82
ProTech60
StarCraft: Brood War
Calm 4614
firebathero 298
JulyZerg 133
BRAT_OK 95
Rock 38
LancerX 14
Stormgate
Nathanias44
Dota 2
monkeys_forever211
LuMiX1
League of Legends
Grubby2300
Dendi1486
Counter-Strike
fl0m1952
Super Smash Bros
Westballz39
Heroes of the Storm
Khaldor330
Liquid`Hasu281
Other Games
FrodaN1489
Mlord584
KnowMe128
Trikslyr46
Sick45
Organizations
Other Games
EGCTV1382
StarCraft 2
angryscii 17
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 24 non-featured ]
StarCraft 2
• Berry_CruncH71
• printf 70
• tFFMrPink 24
• iHatsuTV 9
• OhrlRock 3
• Kozan
• Migwel
• sooper7s
• AfreecaTV YouTube
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• Azhi_Dahaki30
• Pr0nogo 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota2820
• WagamamaTV663
• Ler97
League of Legends
• Jankos1813
• Doublelift1602
Other Games
• imaqtpie966
• Shiphtur491
Upcoming Events
RSL Revival
14h 44m
Clem vs Classic
SHIN vs Cure
FEL
16h 44m
WardiTV European League
16h 44m
BSL: ProLeague
22h 44m
Dewalt vs Bonyth
Replay Cast
2 days
Sparkling Tuna Cup
2 days
WardiTV European League
2 days
The PondCast
3 days
Replay Cast
4 days
RSL Revival
4 days
[ Show More ]
Replay Cast
5 days
RSL Revival
5 days
FEL
5 days
RSL Revival
6 days
FEL
6 days
FEL
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.