• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 02:51
CET 08:51
KST 16:51
  • 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
HomeStory Cup 28 - Info & Preview11Rongyi Cup S3 - Preview & Info3herO wins SC2 All-Star Invitational14SC2 All-Star Invitational: Tournament Preview5RSL Revival - 2025 Season Finals Preview8
Community News
Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win3Weekly Cups (Jan 12-18): herO, MaxPax, Solar win0BSL Season 2025 - Full Overview and Conclusion8Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets4$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)38
StarCraft 2
General
HomeStory Cup 28 - Info & Preview StarCraft 2 Not at the Esports World Cup 2026 Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win Oliveira Would Have Returned If EWC Continued herO wins SC2 All-Star Invitational
Tourneys
HomeStory Cup 28 KSL Week 85 $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) OSC Season 13 World Championship $70 Prize Pool Ladder Legends Academy Weekly Open!
Strategy
Simple Questions Simple Answers
Custom Maps
[A] Starcraft Sound Mod
External Content
Mutation # 510 Safety Violation Mutation # 509 Doomsday Report Mutation # 508 Violent Night Mutation # 507 Well Trained
Brood War
General
BW General Discussion Can someone share very abbreviated BW cliffnotes? [ASL21] Potential Map Candidates BGH Auto Balance -> http://bghmmr.eu/ Bleak Future After Failed ProGaming Career
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 Azhi's Colosseum - Season 2 [BSL21] Non-Korean Championship - Starts Jan 10
Strategy
Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Nintendo Switch Thread Battle Aces/David Kim RTS Megathread Path of Exile Mobile Legends: Bang Bang 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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
Magis TV – Easy Way to Stream Movies, TV Shows US Politics Mega-thread Canadian Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread
Fan Clubs
The herO Fan Club! The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Let's Get Creative–Video Gam…
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2362 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 States17275 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 States17275 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 States17275 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
Australia1988 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
Replay Cast
00:00
Korean StarCraft League #85
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
FoxeR 85
StarCraft: Brood War
Shuttle 959
firebathero 450
Larva 357
EffOrt 298
Shinee 77
IntoTheRainbow 70
Bale 28
soO 27
ToSsGirL 24
Noble 21
[ Show more ]
910 9
Sharp 6
Dewaltoss 1
Dota 2
NeuroSwarm179
League of Legends
JimRising 585
Other Games
summit1g8226
WinterStarcraft536
Happy98
febbydoto30
Organizations
Other Games
gamesdonequick716
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH144
• Adnapsc2 5
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1321
• Stunt347
Upcoming Events
HomeStory Cup
4h 9m
ShoWTimE vs sOs
Serral vs Reynor
Zoun vs HeRoMaRinE
Clem vs Lambo
OSC
5h 9m
Replay Cast
16h 9m
Replay Cast
1d 16h
Wardi Open
2 days
WardiTV Invitational
3 days
Replay Cast
3 days
The PondCast
4 days
WardiTV Invitational
4 days
Replay Cast
4 days
Liquipedia Results

Completed

Proleague 2026-01-31
OSC Championship Season 13
Underdog Cup #3

Ongoing

CSL 2025 WINTER (S19)
KCM Race Survival 2026 Season 1
Acropolis #4 - TS4
Rongyi Cup S3
HSC XXVIII
Nations Cup 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8

Upcoming

Escore Tournament S1: W7
Escore Tournament S1: W8
Acropolis #4
IPSL Spring 2026
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
LiuLi Cup: 2025 Grand Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 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.