• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:40
CEST 06:40
KST 13:40
  • 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
Code S Season 1 - RO8 Preview3[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10
Community News
Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced9
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
RSL Revival: Season 5 - Qualifiers and Main Event GSL Code S Season 1 (2026) Sparkling Tuna Cup - Weekly Open Tournament StarCraft Evolution League (SC Evo Biweekly) 2026 GSL Season 2 Qualifiers
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ (Spoiler) Asl ro8 D winner interview BW General Discussion Do we have a pimpest plays list? AI Question
Tourneys
[ASL21] Ro8 Day 4 [BSL22] RO16 Group Stage - 02 - 10 May [ASL21] Ro8 Day 3 [Megathread] Daily Proleagues
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Nintendo Switch Thread Dawn of War IV Stormgate/Frost Giant Megathread OutLive 25 (RTS Game) Daigo vs Menard Best of 10
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread 3D technology/software discussion Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Movie Stars In Video Games: …
TrAiDoS
ramps on octagon
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1257 users

The Big Programming Thread - Page 32

Forum Index > General Forum
Post a Reply
Prev 1 30 31 32 33 34 1032 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 States17281 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 States17281 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 States17281 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
Australia2163 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 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 4h 50m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 173
Nina 85
StarCraft: Brood War
GuemChi 5446
SilentControl 19
Noble 15
Icarus 8
Dota 2
monkeys_forever584
NeuroSwarm103
Counter-Strike
tarik_tv4591
m0e_tv460
Super Smash Bros
Mew2King118
Other Games
summit1g8394
C9.Mang0672
WinterStarcraft363
Sick188
Maynarde105
ViBE96
ROOTCatZ3
Organizations
Other Games
gamesdonequick1123
BasetradeTV417
Dota 2
PGL Dota 2 - Main Stream29
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• practicex 44
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo860
• Rush683
• Stunt402
Upcoming Events
GSL
4h 50m
SHIN vs Zoun
ByuN vs herO
OSC
6h 20m
OSC
8h 20m
Replay Cast
19h 20m
Escore
1d 5h
The PondCast
1d 5h
WardiTV Invitational
1d 6h
Zoun vs Ryung
Lambo vs ShoWTimE
Big Brain Bouts
1d 11h
Fjant vs Bly
Serral vs Shameless
OSC
1d 17h
Replay Cast
1d 19h
[ Show More ]
CranKy Ducklings
2 days
RSL Revival
2 days
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
2 days
Krystianer vs TriGGeR
Cure vs Rogue
uThermal 2v2 Circuit
2 days
BSL
2 days
Artosis vs TerrOr
spx vs StRyKeR
Replay Cast
2 days
Sparkling Tuna Cup
3 days
RSL Revival
3 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
3 days
BSL
3 days
Dewalt vs DragOn
Aether vs Jimin
GSL
4 days
Afreeca Starleague
4 days
Soma vs Leta
Monday Night Weeklies
4 days
CranKy Ducklings
5 days
Afreeca Starleague
5 days
Light vs Flash
Replay Cast
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-05-05
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026

Upcoming

Escore Tournament S2: W6
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
YSL S3
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
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 © 2026 TLnet. All Rights Reserved.