• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 21:18
CET 02:18
KST 10:18
  • 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
[ASL22] Finals Preview: Sweet Victory!12[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5
Community News
Weekly Cups (October 19-25): Clem triples first in 5.0.175Evil Geniuses - shutting down20ISSL (IntoTheTV x SOOP SC2 League): Premier6Weekly Cups (October 12-18): 5.0.17 era begins1[$1250] International ShieldBattery League94
StarCraft 2
General
Behind the Blue - Team Liquid History Book No more SC2 streamers on team liquid? SC2 Power Rank: epic29 Weekly Cups (October 19-25): Clem triples first in 5.0.17 How do you feel about the mass reverts in the 5.0.17 PTR?
Tourneys
Stellar Fest TWO the Moon (Dec 16-20) Sparkling Tuna Cup - Weekly Open Tournament RSL goes to London! 2026 Offline Finals Nov 21-22 ISSL (IntoTheTV x SOOP SC2 League): Premier RSL 2026 Offline Finals LCQ Sign-Ups
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[D] the control group Simple Questions/Answers [G] How to playtest arcade maps [A] Nemrods 1/4 players
External Content
Mutation # 549 Endless Sparkles The PondCast: SC2 News & Results Mutation # 548 Shining Bright Mutation # 547 Temple Of Terror
Brood War
General
Rollback Netcode in Brood War BW General Discussion SCHNAIL now supports Remastered Ziemie's Starcraft 1 Prequel Campaign Bot on ladder
Tourneys
[$1250] International ShieldBattery League [BSL23] RO24 Group D - Sunday 21:00 CET [Megathread] Daily Proleagues [IPSL] IPSL Winter 26-27 Ro24 is HERE!
Strategy
50,000-Word Terran Builds Memo 2026-10-22 Cliff Jump Revisited (1 in a 1000 strategy) Simple Questions, Simple Answers
Other Games
General Games
Deus Ex 3!? Stormgate/Frost Giant Megathread Nintendo Switch Thread Mobile Legends: Bang Bang Armies of Exigo - YesYes?
Dota 2
Dota 2 Champions League Season 3 Begins April 25!
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread Trading/Investing Thread
Fan Clubs
Reynor Fan Club The Flash Fan Club Serral Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
Why I built Repalyzer (1.1.…
BlueStar
Innovate or Game Over?
TrAiDoS
ShieldBattery on Mac
Kraekkling
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Can Bots Beat Pros?? Starcr…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7830 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
Poland17867 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
Poland17867 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
Poland17867 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
Poland17867 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
Poland17867 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
Next event in 12h 43m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ViBE151
RuFF_SC2 100
Codebar 35
StarCraft: Brood War
White-Ra 174
Dota 2
NeuroSwarm201
LuMiX2
Other Games
summit1g5715
FrodaN4385
JimRising 603
PiGStarcraft299
C9.Mang0288
XaKoH 246
syndereN246
JuggernautJason34
Organizations
Other Games
gamesdonequick1015
CranKy Ducklings19
[ Show 13 non-featured ]
StarCraft 2
• davetesta54
• musti20045 28
• CranKy Ducklings SOOP24
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21290
Upcoming Events
OSC
12h 43m
Yamato Cup
13h 43m
IPSL
15h 43m
Artosis vs RiceHat
Kyrie vs Sony
Map Test Tournament
21h 43m
WardiTV Weekly
1d 10h
Ultimate Battle
1d 10h
Rush vs BeSt
Replay Cast
1d 21h
Rogue vs Classic
Patches Events
2 days
PiGosaur Cup
2 days
Kung Fu Cup
3 days
[ Show More ]
The PondCast
4 days
KCM Race Survival
4 days
IntoTheTV X SOOP
6 days
WardiTV Invitational
6 days
IPSL
6 days
WorsT vs nOmaD
Dewalt vs andersOn
Liquipedia Results

Completed

Proleague 2026-10-30
Blizzard Classic Cup 2026
HCC Season 3

Ongoing

Acropolis #5
KCM Race Survival 2026 Season 4
International ShieldBattery League
BSL Season 23
IPSL Winter 2026-27
PGL Masters Bucharest 2026
Stake Ranked Episode 5
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026

Upcoming

1xBet Invitational
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
BLAST Bounty Winter 2027
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 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.