• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 08:56
CET 14:56
KST 22:56
  • 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
TL.net Map Contest #21: Winners10Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
StarCraft, SC2, HotS, WC3, Returning to Blizzcon!33$5,000+ WardiTV 2025 Championship6[BSL21] RO32 Group Stage4Weekly Cups (Oct 26-Nov 2): Liquid, Clem, Solar win; LAN in Philly2Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win10
StarCraft 2
General
Mech is the composition that needs teleportation t TL.net Map Contest #21: Winners Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win RotterdaM "Serral is the GOAT, and it's not close" 5.0.15 Patch Balance Hotfix (2025-10-8)
Tourneys
Constellation Cup - Main Event - Stellar Fest $5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament Merivale 8 Open - LAN - Stellar Fest Sea Duckling Open (Global, Bronze-Diamond)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace
Brood War
General
[ASL20] Ask the mapmakers — Drop your questions BW General Discussion [BSL21] RO32 Group Stage BGH Auto Balance -> http://bghmmr.eu/ SnOw's ASL S20 Finals Review
Tourneys
[Megathread] Daily Proleagues [ASL20] Grand Finals [BSL21] RO32 Group B - Sunday 21:00 CET [BSL21] RO32 Group A - Saturday 21:00 CET
Strategy
Current Meta PvZ map balance How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile Should offensive tower rushing be viable in RTS games? Dawn of War IV
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine YouTube Thread Dating: How's your luck?
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Why we need SC3
Hildegard
Reality "theory" prov…
perfectspheres
Our Last Hope in th…
KrillinFromwales
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1426 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 States17264 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 States17264 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 States17264 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
CranKy Ducklings
10:00
Sea Duckling Open #140
CranKy Ducklings84
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 198
Railgan 42
Creator 14
StarCraft: Brood War
Sea 6776
Horang2 4135
GuemChi 1585
Jaedong 890
actioN 290
Mini 250
BeSt 249
Soma 228
Killer 218
EffOrt 205
[ Show more ]
Rush 172
Mind 105
Hyun 95
Bonyth 72
ToSsGirL 67
Backho 60
PianO 34
JYJ32
sas.Sziky 32
Aegong 28
zelot 23
Terrorterran 14
soO 11
sorry 10
HiyA 7
Sacsri 7
Dota 2
Gorgc5272
singsing2292
qojqva1976
Dendi596
XcaliburYe219
BananaSlamJamma107
Heroes of the Storm
Khaldor214
Other Games
B2W.Neo1235
Sick275
Lowko237
Fuzer 197
Hui .121
XaKoH 87
nookyyy 56
MindelVK20
Organizations
StarCraft 2
WardiTV622
Counter-Strike
PGL231
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• StrangeGG 73
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2101
League of Legends
• Stunt689
• HappyZerGling108
Upcoming Events
IPSL
4h 4m
dxtr13 vs OldBoy
Napoleon vs Doodle
LAN Event
4h 4m
Lambo vs Clem
Scarlett vs TriGGeR
ByuN vs TBD
Zoun vs TBD
BSL 21
6h 4m
Gosudark vs Kyrie
Gypsy vs OyAji
UltrA vs Radley
Dandy vs Ptak
Replay Cast
9h 4m
Sparkling Tuna Cup
20h 4m
WardiTV Korean Royale
22h 4m
LAN Event
1d 1h
IPSL
1d 4h
JDConan vs WIZARD
WolFix vs Cross
BSL 21
1d 6h
spx vs rasowy
HBO vs KameZerg
Cross vs Razz
dxtr13 vs ZZZero
Replay Cast
1d 19h
[ Show More ]
Wardi Open
1d 22h
WardiTV Korean Royale
2 days
Replay Cast
3 days
Kung Fu Cup
3 days
Classic vs Solar
herO vs Cure
Reynor vs GuMiho
ByuN vs ShoWTimE
Tenacious Turtle Tussle
4 days
The PondCast
4 days
RSL Revival
4 days
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
4 days
WardiTV Korean Royale
4 days
RSL Revival
5 days
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
5 days
CranKy Ducklings
6 days
RSL Revival
6 days
herO vs Gerald
ByuN vs SHIN
Kung Fu Cup
6 days
Liquipedia Results

Completed

BSL 21 Points
SC4ALL: StarCraft II
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
Stellar Fest: Constellation Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
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.