• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:24
CEST 15:24
KST 22:24
  • 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
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
ZeroSpace Early Access is Now Live!17Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)84Reynor: GSL Loss Wasn't About Preparation Format16[IPSL] Spring 2026 Grand Finals - This Weekend!18
StarCraft 2
General
August World Ranking Watchlist: Serral back to #1? How would you feel about frequent/monthly balance patches for SC2? Balance hotfix patch 5.0.16b (July 16) Clem: "I don't have that much hope in Blizzard" Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters
Tourneys
RSL Revival: Season 6 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026 GSL CK #5 Race War HomeStory Cup 29
Strategy
[G] Having the right mentality to improve
Custom Maps
[M] (2) Industrial Park New Map Maker - Looking for Advice - Love or Hate
External Content
Mutation # 535 Assembly of Vengeance The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together
Brood War
General
Animated Gateway BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion HORROR STARCRAFT MOVIE How Famous was FlaSh before his Debut?
Tourneys
[Megathread] Daily Proleagues [IPSL] Spring 2026 Grand Finals - This Weekend! Escore Tournament - Season 3 Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers PvT advise for noobs Fighting Spirit mining rates Creating a full chart of Zerg builds
Other Games
General Games
Path of Exile ZeroSpace Early Access is Now Live! General RTS Discussion Thread ZeroSpace at Steam NextFest - Last free demo Nintendo Switch Thread
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Artificial Intelligence Thread How to buy a book - shipping from Korea to Europe The Games Industry And ATVI
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread Series you have seen recently... Movie Discussion! [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023 McBoner: A hockey love story
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
Hello guys!
LIN1s
Role of Gaming on Mental Hea…
TrAiDoS
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
An Exploration of th…
waywardstrategy
ramps on octagon
StaticNine
Customize Sidebar...

Website Feedback

Closed Threads



Active: 9573 users

The Big Programming Thread - Page 461

Forum Index > General Forum
Post a Reply
Prev 1 459 460 461 462 463 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.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
March 30 2014 18:45 GMT
#9201
Just a guess, but is that your problem?

http://www.cplusplus.com/reference/iterator/reverse_iterator/base/

The base iterator is an iterator of the same type as the one used to construct the reverse_iterator, but pointing to the element next to the one the reverse_iterator is currently pointing to (a reverse_iterator has always an offset of -1 with respect to its base iterator).
If you have a good reason to disagree with the above, please tell me. Thank you.
Amnesty
Profile Joined April 2003
United States2054 Posts
March 30 2014 19:00 GMT
#9202
yes that was the problem.
I guess i should have looked it up, thought i was just a straight mapping.
I used base() before and don't remember dealing with that either.
Thank you.

The sky just is, and goes on and on; and we play all our BW games beneath it.
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
Last Edited: 2014-03-31 04:16:04
March 31 2014 04:12 GMT
#9203
wrong thread
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
scudst0rm
Profile Joined May 2010
Canada1149 Posts
March 31 2014 06:39 GMT
#9204
On March 31 2014 13:12 icystorage wrote:
wrong thread


Though you were in the Big Progaming Thread, right?
You're like a one ranger army comin' at me...
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
March 31 2014 06:46 GMT
#9205
nope lol. had some topic but i thought it was more fit in the 'ask and answer stupid questions' thread
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
Manit0u
Profile Blog Joined August 2004
Poland17798 Posts
Last Edited: 2014-03-31 18:43:31
March 31 2014 18:43 GMT
#9206
On March 30 2014 21:04 spinesheath wrote:
Also if this is C/C++, you should prefer:

if (null == instance)

In any case, there's no real norm to that. Just do it consistently.


I prefer to see which variable is being assessed in the if statement before seeing what is it put against.

For me it was always:

if ( instance == NULL )
{
return;
}
Time is precious. Waste it wisely.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
March 31 2014 18:52 GMT
#9207
As I said, I find the C/C++ version harder to read too, but it provides that little extra safety against typos. In languages like C# where you don't have the stupid implicit pointer to bool cast, you don't need it.
If you have a good reason to disagree with the above, please tell me. Thank you.
Manit0u
Profile Blog Joined August 2004
Poland17798 Posts
March 31 2014 19:38 GMT
#9208
Well, the best way to write it and avoid any confusion would be this:


if ( !instance )
{
return;
}


Personally, I only use NULL pointer only in ANSI C when releasing memory after malloc. Just a habit I acquired which lets me identify methods that are there only to invoke release on a glance.
Time is precious. Waste it wisely.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
March 31 2014 19:59 GMT
#9209
On April 01 2014 04:38 Manit0u wrote:
Well, the best way to write it and avoid any confusion would be this:


if ( !instance )
{
return;
}


Personally, I only use NULL pointer only in ANSI C when releasing memory after malloc. Just a habit I acquired which lets me identify methods that are there only to invoke release on a glance.

You're using the still stupid implicit pointer to bool conversion there. And you have to know that there is an implicit conversion when you read/write that or else you're just banking on something that "seems to work", which is a really dangerous place to be in with C/C++.
If you have a good reason to disagree with the above, please tell me. Thank you.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
March 31 2014 20:10 GMT
#9210
it doesn't get more unequivocal than doing an equal to with a nullptr in c++ at least.
don't even have to see the type of instance to deduce what's going on.
conspired against by a confederacy of dunces.
Cyx.
Profile Joined November 2010
Canada806 Posts
March 31 2014 21:18 GMT
#9211
On April 01 2014 03:52 spinesheath wrote:
As I said, I find the C/C++ version harder to read too, but it provides that little extra safety against typos. In languages like C# where you don't have the stupid implicit pointer to bool cast, you don't need it.

Or you could compile with warnings as errors, then you get the best of both worlds - compiler error when you typo, and you don't have to make your code awkward to read ^^
bangsholt
Profile Joined June 2011
Denmark138 Posts
March 31 2014 22:03 GMT
#9212
On April 01 2014 06:18 Cyx. wrote:
Show nested quote +
On April 01 2014 03:52 spinesheath wrote:
As I said, I find the C/C++ version harder to read too, but it provides that little extra safety against typos. In languages like C# where you don't have the stupid implicit pointer to bool cast, you don't need it.

Or you could compile with warnings as errors, then you get the best of both worlds - compiler error when you typo, and you don't have to make your code awkward to read ^^

Except that you now end up having to #pragma you way out of warnings, which are dangerous as well as they are now ignored on a whole line

And potentially silly ones - as an example, I work with embedded as part of my job, and there's a simple macro that's nice to use


#define _BV(bit) (1 << (bit))


Combined with #define you now use code like this


#define SHIELD_UP 0
#define SHIELD_DOWN 1
#define SHIELD_MOVING 2
#define SHIELD_ERROR

if(ui8Input & _BV(SHIELD_UP))
{
/* do something */
}
else if(ui8Input & _BV(SHIELD_DOWN))
{
/* do something else */
}


And so on - by the way, spot the compiler warning in the above

Yep - it's this line

ui8Input & _BV(SHIELD_UP)


The warning is simply that the shift does not have any effect - but if you remove it, you may hide a bug that's surprisingly hard to notice, because the macro and define are both super simple - which is why I dislike "treat warnings as errors"

Of course you shouldn't have any warnings - but it's just as dangerous to #pragma them out or annoying to set warnings as error
nunez
Profile Blog Joined February 2011
Norway4003 Posts
April 01 2014 06:49 GMT
#9213
bagsholt works for protoss.
conspired against by a confederacy of dunces.
Manit0u
Profile Blog Joined August 2004
Poland17798 Posts
April 01 2014 07:21 GMT
#9214
Holy crap, I almost got a heart attack...

I got a small gig regarding the creation of a simple file format converting program for a company. Took me several days but I managed to do it (had to be in C# in which I didn't do anything before that). I let them know I'm ready to show and test the app with users to spot and get rid of any quirks that might still be there. In preparation I've decided to clean up some stuff on my machine, I had 2 folders with the same name, one in my workspace area and one outside of it. Without thinking much I delete the one that's outside the workspace... You guessed it, that was the finished app and in the workspace was the "backup" that was basically at the start of it, non-functional and useless. Had to sit there to 5 a. m. re-creating the app, doing stuff quick and dirty (gone are all the methods testing for file validity, value testing stuff etc.) but it works as intended if you do everything as you're supposed to.

Testing starts today, I don't have time to fix it any further until then. Crossing my fingers...
Time is precious. Waste it wisely.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
April 01 2014 07:26 GMT
#9215
holy crap justified.
good luck.
conspired against by a confederacy of dunces.
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
April 01 2014 07:36 GMT
#9216
im actually pissed reading that lol. im like "WHY WOULD YOU DELETE STUFF IN A CRITICAL MOMENT?!"
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
Manit0u
Profile Blog Joined August 2004
Poland17798 Posts
April 01 2014 08:41 GMT
#9217
On April 01 2014 16:36 icystorage wrote:
im actually pissed reading that lol. im like "WHY WOULD YOU DELETE STUFF IN A CRITICAL MOMENT?!"


I was working crazy hours and my brain didn't process stuff as intended...
Time is precious. Waste it wisely.
MichaelEU
Profile Joined February 2011
Netherlands816 Posts
April 01 2014 09:10 GMT
#9218
On April 01 2014 17:41 Manit0u wrote:
Show nested quote +
On April 01 2014 16:36 icystorage wrote:
im actually pissed reading that lol. im like "WHY WOULD YOU DELETE STUFF IN A CRITICAL MOMENT?!"


I was working crazy hours and my brain didn't process stuff as intended...


What happened to version control?
世界を革命する力を!― znf: "Michael-oniichan ( *^▽^*)ノ✩キラ✩"
Rollin
Profile Joined March 2011
Australia1552 Posts
April 01 2014 10:33 GMT
#9219
On April 01 2014 18:10 MichaelEU wrote:
Show nested quote +
On April 01 2014 17:41 Manit0u wrote:
On April 01 2014 16:36 icystorage wrote:
im actually pissed reading that lol. im like "WHY WOULD YOU DELETE STUFF IN A CRITICAL MOMENT?!"


I was working crazy hours and my brain didn't process stuff as intended...


What happened to version control?

"What's that?"
Throw off those chains of reason, and your prison disappears. | Check your posting frequency timeline: http://www.teamliquid.net/mytlnet/post_activity_img.php
Manit0u
Profile Blog Joined August 2004
Poland17798 Posts
April 01 2014 10:48 GMT
#9220
On April 01 2014 18:10 MichaelEU wrote:
Show nested quote +
On April 01 2014 17:41 Manit0u wrote:
On April 01 2014 16:36 icystorage wrote:
im actually pissed reading that lol. im like "WHY WOULD YOU DELETE STUFF IN A CRITICAL MOMENT?!"


I was working crazy hours and my brain didn't process stuff as intended...


What happened to version control?


There wasn't any. Didn't want to bother with doing it for such a small project that I was working alone with. Came back to bite me in the ass in the end.
Time is precious. Waste it wisely.
Prev 1 459 460 461 462 463 1032 Next
Please log in or register to reply.
Live Events Refresh
Kung Fu Cup
11:00
2026 Week 16
IntoTheiNu 1448
WardiTV655
RotterdaM540
Ryung 387
TKL 192
Rex128
SteadfastSC126
EnkiAlexander 24
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 540
Ryung 387
TKL 192
Rex 128
SteadfastSC 126
BRAT_OK 17
trigger 3
StarCraft: Brood War
Calm 4412
Rain 2911
Jaedong 1476
Horang2 1097
firebathero 731
BeSt 546
EffOrt 483
Light 368
Soulkey 336
Rush 246
[ Show more ]
Snow 242
Stork 239
Soma 230
ZerO 227
hero 213
ggaemo 203
Zeus 148
Last 142
Dewaltoss 135
Hyun 113
Leta 112
Mong 87
Killer 80
Pusan 78
sorry 60
[sc1f]eonzerg 48
NaDa 46
ToSsGirL 40
Movie 29
JulyZerg 27
JYJ 26
Nal_rA 25
Aegong 21
GoRush 21
Hm[arnc] 19
Sexy 19
yabsab 18
Sacsri 17
Yoon 13
IntoTheRainbow 12
ajuk12(nOOB) 12
Noble 10
Terrorterran 8
zelot 8
Rock 6
Dota 2
qojqva906
XcaliburYe272
syndereN13
League of Legends
KnowMe30
Counter-Strike
fl0m2752
Other Games
FrodaN3730
B2W.Neo717
hiko587
Lowko532
Mlord361
uThermal281
Liquid`LucifroN188
Pyrionflax159
ArmadaUGS110
ToD45
Trikslyr34
CosmosSc2 27
ZerO(Twitch)14
Organizations
StarCraft: Brood War
lovetv 14
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 15 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2365
• WagamamaTV316
League of Legends
• Nemesis1131
• Stunt600
• TFBlade525
Upcoming Events
OSC
10h 37m
CrankTV Team League
21h 37m
Replay Cast
1d 10h
CrankTV Team League
1d 21h
Korean StarCraft League
2 days
Afreeca Starleague
2 days
RSL Revival
2 days
Serral vs SHIN
herO vs Solar
Online Event
3 days
Replay Cast
3 days
RSL Revival
3 days
Clem vs ByuN
Rogue vs Lambo
[ Show More ]
OSC
3 days
WardiTV Weekly
4 days
Sparkling Tuna Cup
5 days
PiGosaur Cup
6 days
The PondCast
6 days
Kung Fu Cup
6 days
Liquipedia Results

Completed

Proleague 2026-07-21
HSC XXIX
Eternal Conflict S2 E3

Ongoing

CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026

Upcoming

Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
ASL Season 22: Qualifier #1
ASL Season 22: Qualifier #2
CSLAN 4
ASL Season 22
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
ESL Pro League Season 24
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 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.