• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 01:11
CEST 07:11
KST 14:11
  • 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
[ASL21] Ro8 Preview Pt2: Progenitors4Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists22
Community News
RSL Revival: Season 5 - Qualifiers and Main Event10Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced92026 GSL Tour plans announced15
StarCraft 2
General
Code S Season 1 (2026) - RO12 Results Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun Team Liquid Map Contest #22 - The Finalists Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool MaNa leaves Team Liquid
Tourneys
StarCraft Evolution League (SC Evo Biweekly) $1,400 SEL Season 3 Ladder Invitational RSL Revival: Season 5 - Qualifiers and Main Event GSL Code S Season 1 (2026) SC2 INu's Battles#15 <BO.9 2Matches>
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
[ASL21] Ro8 Preview Pt2: Progenitors Why there arent any 256x256 pro maps? BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ ASL21 General Discussion
Tourneys
[ASL21] Ro8 Day 3 [ASL21] Ro8 Day 2 [Megathread] Daily Proleagues Escore Tournament StarCraft Season 2
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
Dawn of War IV Stormgate/Frost Giant Megathread Nintendo Switch Thread Daigo vs Menard Best of 10 Diablo IV
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
Can Diabetes Be Reversed or Cured Permanently? US Politics Mega-thread European Politico-economics QA Mega-thread Russo-Ukrainian War Thread 3D technology/software discussion
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion!
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: 1767 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
Poland17743 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
Poland17743 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
Poland17743 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
Poland17743 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
Poland17743 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
Patches Events
00:00
The 5.4k Patch Clash #17
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech124
NeuroSwarm 103
StarCraft: Brood War
Sea 11786
GuemChi 5833
Leta 220
Mind 159
Zeus 61
Nal_rA 40
Noble 20
Icarus 10
ZergMaN 8
League of Legends
JimRising 734
Counter-Strike
m0e_tv783
Super Smash Bros
hungrybox1389
Other Games
summit1g9725
WinterStarcraft601
C9.Mang0579
monkeys_forever307
ViBE125
amsayoshi39
Organizations
Other Games
gamesdonequick678
StarCraft: Brood War
UltimateBattle 50
Dota 2
PGL Dota 2 - Main Stream48
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 12 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1246
• Lourlo1168
Upcoming Events
Replay Cast
3h 50m
Afreeca Starleague
4h 50m
Jaedong vs Light
Wardi Open
5h 50m
Monday Night Weeklies
10h 50m
Replay Cast
18h 50m
Sparkling Tuna Cup
1d 4h
Afreeca Starleague
1d 4h
Snow vs Flash
WardiTV Invitational
1d 5h
SHIN vs Nicoract
Solar vs Nice
GSL
2 days
Classic vs Cure
Maru vs Rogue
GSL
3 days
SHIN vs Zoun
ByuN vs herO
[ Show More ]
OSC
3 days
OSC
3 days
Replay Cast
3 days
Escore
4 days
The PondCast
4 days
WardiTV Invitational
4 days
Zoun vs Ryung
Lambo vs ShoWTimE
Replay Cast
4 days
CranKy Ducklings
5 days
RSL Revival
5 days
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
5 days
Krystianer vs TriGGeR
Cure vs Rogue
uThermal 2v2 Circuit
5 days
BSL
5 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
RSL Revival
6 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
6 days
BSL
6 days
Liquipedia Results

Completed

Proleague 2026-05-02
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

YSL S3
Escore Tournament S2: W6
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
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
Asian Champions League 2026
IEM Atlanta 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.