• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 17:10
CEST 23:10
KST 06:10
  • 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] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244ByuL, and the Limitations of Standard Play3
Community News
Official StarCraft website teases new content ahead of BlizzCon?81Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3New 3v3 BGH Ladder (and more) on ShieldBattery!40Weekly Cups (August 17-23): Zerg dominate the week6
StarCraft 2
General
Nexon wins bid to develop StarCraft IP content, distribute Overwatch mobile game SC4ALL: II Winner Will Earn a Spot at HSC 30! Weekly Cups (August 24-30): Patches' balance mod takes over Balance hotfix patch 5.0.16b (July 16) September World Ranking: herO leads, Serral climbs
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament Stellar Fest TWO the Moon (Dec 16-20) IntoTheTV X SOOP SC2 League : Weekly & Monthly SC2 INu's Battles#20 [BO.9] 2026 GSTL Announcement
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This Mutation # 539 Thunder Dome
Brood War
General
Official StarCraft website teases new content ahead of BlizzCon? ASL22 General Discussion Gypsy to Korea [Personal Project Share] Terran Defense v0.60 BW General Discussion
Tourneys
Brood War in Budapest ! WORTEX 2026 BW Finals KCM Race Survival 2026 Season 3 [Megathread] Daily Proleagues BSL LAN Party - Kraków 29-30 August - OPEN SIGNUPS
Strategy
Odyssey Mineral Stack Saturation Replay Review Process - What do you do? Game Theory for Starcraft Fighting Spirit mining rates
Other Games
General Games
Nintendo Switch Thread Diablo IV EVE Corporation [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish 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 TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Artificial Intelligence Thread Canadian Politics Mega-thread UK Politics Mega-thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Movie Discussion! Anime Discussion Thread
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023 NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Dreaming of BW patches (mod…
c3rberUs
Regacy Esports: The Bh…
regacyesports
Violent Games and Crime Rate…
TrAiDoS
LOCKPICKING NOOB
LUCKY_NOOB
Cathedral Of CS And NY pizza a…
FuDDx
Customize Sidebar...

Website Feedback

Closed Threads



Active: 6914 users

The Big Programming Thread - Page 462

Forum Index > General Forum
Post a Reply
Prev 1 460 461 462 463 464 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.
MichaelEU
Profile Joined February 2011
Netherlands816 Posts
April 01 2014 10:51 GMT
#9221
On April 01 2014 19:48 Manit0u wrote:
Show nested quote +
On April 01 2014 18:10 MichaelEU wrote:
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.


I guess it made for a valuable lesson.

If I imagine taking more than an hour for anything I git init.
世界を革命する力を!― znf: "Michael-oniichan ( *^▽^*)ノ✩キラ✩"
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-04-01 14:21:46
April 01 2014 14:21 GMT
#9222
put some time aside to get gcc-4.9.0 up and running with -std=c++1y.
return type deduction with decltype(auto) seems very sweet.
conspired against by a confederacy of dunces.
Rollin
Profile Joined March 2011
Australia1552 Posts
April 01 2014 14:33 GMT
#9223
On April 01 2014 23:21 nunez wrote:
put some time aside to get gcc-4.9.0 up and running with -std=c++1y.
return type deduction with decltype(auto) seems very sweet.

I personally didn't understand the appeal with the somewhat strange syntax.
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
Poland17838 Posts
April 01 2014 14:45 GMT
#9224
Woohoo! The test was passed. Need to put failsafes back into the app though.

Much weight.
Such lift.
Wow.
Time is precious. Waste it wisely.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-04-01 14:57:55
April 01 2014 14:47 GMT
#9225
@rollin i think it's born out of necessity. they seem very hesitant to introduce new keywords. but i am not knowledgeable and easily confused, maybe i will get irked at a later point in time (just auto would be sweet). here's the rationale from the proposal:

Difference from decltype

Unfortunately, there is no way to get the effect of decltype with an auto return type; plain auto never deduces to a reference, and auto&& always deduces to a reference. This is a significant problem, as it means that forwarding functions can't use auto. We could consider using decltype semantics instead of the existing auto semantics, but that would mean giving different deduction semantics to auto depending on whether the declaration is of a variable or a function, and making auto functions different from lambdas.

Therefore, I propose to also allow decltype(auto) to get the decltype semantics without having to repeat the expression. For simplicity of specification and orthogonality I propose to allow it everywhere that plain auto is allowed, except for introducing a trailing-return-type. It occurs to me that the difference in meaning of decltype depending on the form of the expression (e.g. parenthesized or not) might be more surprising in this context, but I think it would be even more surprising if this worked differently from C++11 decltype.
src

@manitou $

i wonder if it would be possible to get type deduction for initializing of static variables too...
conspired against by a confederacy of dunces.
Manit0u
Profile Blog Joined August 2004
Poland17838 Posts
April 01 2014 16:09 GMT
#9226
Damn, it's so irksome when you're doing something based on strings (like assigning value of one string to the other) and then you discover that string can return "string", "" or 0, the latter resulting with fatal error because something was expecting a string and it got an int.

Also, a pop quiz for all of you (regarding my latest headaches):
What do you get when you try to invoke line[0] on an empty line?
Time is precious. Waste it wisely.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
April 01 2014 17:30 GMT
#9227
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 ^^

Warnings as errors is always on, that's not even up for discussion. Max warning level as well. So yeah, it's not really necessary to use the proper C/C++ style. But you can never have enough safety nets in those languages.

And I sure hope that macro stuff is actual C. Makes me shudder.
If you have a good reason to disagree with the above, please tell me. Thank you.
Fawkes
Profile Blog Joined May 2010
Canada1935 Posts
April 02 2014 17:50 GMT
#9228
I'm looking for recommended books and articles on learning C# and .NET from scratch, anybody have anything they would suggest?
Taeyeon ~ Jennie ~ Seulgi ~ Irene @Fawkes711
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
April 02 2014 18:17 GMT
#9229
Other than the MSDN overview?

Use WPF instead of WinForm.
There is no one like you in the universe.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
April 02 2014 18:58 GMT
#9230
I found C# fairly easy to pick up. Basically I just started a project and googled as questions came up. I had a decent amount of C++ experience, but still I don't think it should be too hard just from the internet (Stackoverflow + MSDN). General good OOP practices are what you should be most concerned about, the rest is easy with C#.

WPF has a fairly steep learning curve, but is well worth it.
If you have a good reason to disagree with the above, please tell me. Thank you.
Manit0u
Profile Blog Joined August 2004
Poland17838 Posts
Last Edited: 2014-04-02 19:14:31
April 02 2014 19:11 GMT
#9231
I'm using GTK# since I mostly work under Linux.

And as far as books go this one is fine: http://shop.oreilly.com/product/0636920024064.do

I'm constantly using docs found on MSDN, dotnetperls.com etc. but I've found a long time ago that nothing really beats a good book on the subject. Especially that books are easier to learn from and remember what you learn (the way our brain works with roadmaps and all, e-books and Internet articles simply don't give you that).
Time is precious. Waste it wisely.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
April 03 2014 16:47 GMT
#9232
My main problem with books is that you can't CTRL+F through them, and I don't really have the time nor need to go step-by-step through any textbook. Maybe if you have a lot more time on your hands then they would be useful, but online references have usually been good. A pdf version of the book would be better too, but I don't absolutely buy the idea that books are easier to learn from unless you're actually going through the book page by page.
There is no one like you in the universe.
Fawkes
Profile Blog Joined May 2010
Canada1935 Posts
Last Edited: 2014-04-03 21:53:39
April 03 2014 21:44 GMT
#9233
Guess I'll slowly work through MSDN and stuff.

Need help with a SQL query, trying to update 2 columns on rows in a table that match a certain criteria. Assuming I have a userid column that starts with '13%', and I want to change every userid that starts like that to '14%'...so something like

13Fawkes would be turned into 14Fawkes, is this possible?


mySQL

update 'tablename'
set 'user_id' = CONCAT('14', SUBSTRING('user_id', 3)), 'user_id_clone' = CONCAT('14', SUBSTRING('user_id', 3))
where 'user_id' LIKE '13%'


Would this work?
Taeyeon ~ Jennie ~ Seulgi ~ Irene @Fawkes711
LaNague
Profile Blog Joined April 2010
Germany9118 Posts
Last Edited: 2014-04-03 22:56:49
April 03 2014 22:54 GMT
#9234
Murach C# is a good introduction and has exercises, but not very hard ones.
There is also Essential C#, Manning C# in Depth and others for more indepth features.

I like C# a lot and often the problem is simply that you didnt know about a technique or a .net class that solves all issues you had




Also, what do you guys think is the most elegant way to pop a messagebox/new form, pause execution of the main program and meanwhile send and read data from a USB port, while in the mainform if possible a "cancel" button should still be active.
Once something specific is read on USB, messagebox goes away and the program continues.


Im not good with all this multithreading. TT
Manit0u
Profile Blog Joined August 2004
Poland17838 Posts
Last Edited: 2014-04-04 00:25:19
April 04 2014 00:22 GMT
#9235
On April 04 2014 01:47 Blisse wrote:
My main problem with books is that you can't CTRL+F through them, and I don't really have the time nor need to go step-by-step through any textbook. Maybe if you have a lot more time on your hands then they would be useful, but online references have usually been good. A pdf version of the book would be better too, but I don't absolutely buy the idea that books are easier to learn from unless you're actually going through the book page by page.


That's why you have numerous indexes in the book, you can search through them too, you just have to know how

Also, it's easier to learn from a book because it's a physical object that gives you more references to the information you seek. Stuff you don't normally notice, like how far it is from the beginning/end of the book judging by how much paper you feel under your fingers, where is it located on the page etc. That's how our brain memorizes stuff.

As an example: It is easier to learn about numerous characters in the book, their names, appearance, history etc. than it is to memorize a 30 digit number even though the amount of data is vastly greater in the first case. It's all because of this roadmaps with waypoints that your brain creates when reading an actual book. That's also why in the memory-enhancing classes they teach you to make stories when you have to memorize something so that instead of having to commit a long number to the memory you remember stuff like 5 elephants bought 3 apples but monkeys stole 2 of them and sold them for 4 pennies. Even though at first it seems that memorizing a story is harder since it's more data it's actually easier for your brain to process because that's how it's built.

You don't necessarily have to read through the entire textbook too. Just pick it up if you need something, go through the index and try to find it. If you ever need that info again you'll be surprised how fast you can find it again (usually even faster than searching on the net). The added benefit is that after you read it in the book there's a greater chance that it'll stay with you and you won't have to look for it again.
Time is precious. Waste it wisely.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-04-04 00:56:48
April 04 2014 00:53 GMT
#9236
I've been reading a bit of that "Clean Code" book. One of the suggestions is not to return null but to throw an exception or return a special case object. Is that how you guys do it as well? I've recently got annoyed at some bits of my code that are if (object == null).

But then, do you have to catch those exceptions? Can't they go silently like "return" in a void method? What about int/boolean methods though? "return" is insufficient there, but if you write "return -1", then whether you check for (object == null) or (object != -1) kind of has the same purpose.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
April 04 2014 04:17 GMT
#9237
On April 04 2014 09:53 darkness wrote:
I've been reading a bit of that "Clean Code" book. One of the suggestions is not to return null but to throw an exception or return a special case object. Is that how you guys do it as well? I've recently got annoyed at some bits of my code that are if (object == null).

But then, do you have to catch those exceptions? Can't they go silently like "return" in a void method? What about int/boolean methods though? "return" is insufficient there, but if you write "return -1", then whether you check for (object == null) or (object != -1) kind of has the same purpose.


Returning null can be appropriate in some cases, raising an exception in others, it depends on context. If you're code is going to break if the return value is null then it should throw an exception plain and simple. Things get a bit more complicated with accessor methods in some situations, recent example I ran into was an accessor method for a signed cookie. If it successfully unsigns the cookie then it will return the value, otherwise it will return nil (which could be caused by bad cookie value or no cookie at all). This creates a clean encapsulation for accessing the signed cookie values that is easy to test. An example of a situation where returning nil could be a problem: you have a object being assigned through a function, and then a method being invoked on that object. If the object returns nil the method call will cause an exception. Better to have it blow up at the source rather than somewhere down the chain.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
April 04 2014 04:26 GMT
#9238
On April 04 2014 06:44 Fawkes wrote:
Guess I'll slowly work through MSDN and stuff.

Need help with a SQL query, trying to update 2 columns on rows in a table that match a certain criteria. Assuming I have a userid column that starts with '13%', and I want to change every userid that starts like that to '14%'...so something like

13Fawkes would be turned into 14Fawkes, is this possible?


mySQL

update 'tablename'
set 'user_id' = CONCAT('14', SUBSTRING('user_id', 3)), 'user_id_clone' = CONCAT('14', SUBSTRING('user_id', 3))
where 'user_id' LIKE '13%'


Would this work?

Why do you have a user_id_clone column? Is it always a clone? (if it's not then your where clause will muck things up)
If you want to do regex replaces: https://github.com/mysqludf/lib_mysqludf_preg#readme

I don't have mysql installed on this box but it does look like that would work.

I am concerned as to why you would ever want to do this ever like seriously what is going on here.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
April 04 2014 04:32 GMT
#9239
On April 04 2014 09:22 Manit0u wrote:
Show nested quote +
On April 04 2014 01:47 Blisse wrote:
My main problem with books is that you can't CTRL+F through them, and I don't really have the time nor need to go step-by-step through any textbook. Maybe if you have a lot more time on your hands then they would be useful, but online references have usually been good. A pdf version of the book would be better too, but I don't absolutely buy the idea that books are easier to learn from unless you're actually going through the book page by page.


That's why you have numerous indexes in the book, you can search through them too, you just have to know how

Also, it's easier to learn from a book because it's a physical object that gives you more references to the information you seek. Stuff you don't normally notice, like how far it is from the beginning/end of the book judging by how much paper you feel under your fingers, where is it located on the page etc. That's how our brain memorizes stuff.

As an example: It is easier to learn about numerous characters in the book, their names, appearance, history etc. than it is to memorize a 30 digit number even though the amount of data is vastly greater in the first case. It's all because of this roadmaps with waypoints that your brain creates when reading an actual book. That's also why in the memory-enhancing classes they teach you to make stories when you have to memorize something so that instead of having to commit a long number to the memory you remember stuff like 5 elephants bought 3 apples but monkeys stole 2 of them and sold them for 4 pennies. Even though at first it seems that memorizing a story is harder since it's more data it's actually easier for your brain to process because that's how it's built.

You don't necessarily have to read through the entire textbook too. Just pick it up if you need something, go through the index and try to find it. If you ever need that info again you'll be surprised how fast you can find it again (usually even faster than searching on the net). The added benefit is that after you read it in the book there's a greater chance that it'll stay with you and you won't have to look for it again.


You can find memory hookes when reading on a computer just as well as with a physical book. Groupings of paragraphs on the page, line numbers, etc... All that being said memorization isn't very valuable when it comes to programming. You shouldn't have to rely on memorization techniques for your understanding of data structures and algorithms, and the things that are handy to have memorized can be looked up in a few seconds on a computer and eventually will be memorized if you use them enough. (And if you don't, then they weren't worth the effort to memorize.)
phar
Profile Joined August 2011
United States1080 Posts
April 04 2014 05:26 GMT
#9240
On April 04 2014 13:17 CatNzHat wrote:
Show nested quote +
On April 04 2014 09:53 darkness wrote:
I've been reading a bit of that "Clean Code" book. One of the suggestions is not to return null but to throw an exception or return a special case object. Is that how you guys do it as well? I've recently got annoyed at some bits of my code that are if (object == null).

But then, do you have to catch those exceptions? Can't they go silently like "return" in a void method? What about int/boolean methods though? "return" is insufficient there, but if you write "return -1", then whether you check for (object == null) or (object != -1) kind of has the same purpose.

recent example I ran into was an accessor method for a signed cookie. If it successfully unsigns the cookie then it will return the value, otherwise it will return nil (which could be caused by bad cookie value or no cookie at all). This creates a clean encapsulation for accessing the signed cookie values that is easy to test.


In cases like these you can consider using Optional<T> instead of @Nullable T.
Who after all is today speaking about the destruction of the Armenians?
Prev 1 460 461 462 463 464 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 12h 50m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Liquid`TLO 162
JuggernautJason136
CosmosSc2 50
StarCraft: Brood War
Hyuk 234
Horang2 165
White-Ra 155
HiyA 73
Yoon 42
Dota 2
syndereN373
Pyrionflax139
LuMiX1
League of Legends
Doublelift3816
JimRising 323
Heroes of the Storm
Khaldor261
Other Games
gofns23884
summit1g7782
fl0m1529
Grubby1278
Beastyqt899
B2W.Neo770
PiGStarcraft305
KnowMe194
XaKoH 180
Mew2King56
Trikslyr33
kaitlyn25
Nina14
Organizations
Other Games
gamesdonequick1899
EGCTV859
BasetradeTV97
angryscii26
[ Show 17 non-featured ]
StarCraft 2
• printf 76
• musti20045 1
• Kozan
• AfreecaTV YouTube
• intothetv
• IndyKCrew
• Migwel
StarCraft: Brood War
• blackmanpl 47
• Azhi_Dahaki30
• Pr0nogo 6
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21430
Other Games
• imaqtpie1149
• Shiphtur190
• tFFMrPink 17
Upcoming Events
Sparkling Tuna Cup
12h 50m
OSC
14h 50m
Shopify Rebellion Sundays
17h 50m
Mixu vs TBD
Spirit vs TBD
Clem vs TBD
Patches Events
18h 50m
OSC
1d 2h
Afreeca Starleague
1d 12h
Soma vs Shuttle
BeSt vs Rush
WardiTV Weekly
1d 13h
Monday Night Weeklies
1d 18h
Afreeca Starleague
2 days
Leta vs ggaemo
Jaedong vs Queen
GSL
2 days
[ Show More ]
PiGosaur Cup
3 days
Kung Fu Cup
3 days
Replay Cast
4 days
The PondCast
4 days
KCM Race Survival
4 days
Escore
5 days
IntoTheTV X SOOP
5 days
CranKy Ducklings
6 days
Liquipedia Results

Completed

Proleague 2026-09-02
PiG Sty Festival 8.0
Light Tournament 2026

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
Acropolis #5 - TRS
RSL Revival: Season 6
Calamity Invitational
Big Dog Cup 2026 Div 1
BLAST Open Fall 2026
Esports World Cup 2026
Esports World Cup 2026: LCQ
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Escore Tournament S3: King of Kings
Blizzard Classic Cup 2026
Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
SC4ALL II: Brood War
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
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
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.