• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 06:04
CET 12:04
KST 20:04
  • 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 (Oct 26 - Nov 1): MaxPax, herO, Solar win0Weekly Cups (October 19-25): Clem triples first in 5.0.175Evil Geniuses - shutting down23ISSL (IntoTheTV x SOOP SC2 League): Premier7Weekly Cups (October 12-18): 5.0.17 era begins1
StarCraft 2
General
[D] Hacker peak in sc2 ? No more SC2 streamers on team liquid? Liquibets sc2 season 30 Evil Geniuses - shutting down Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays ISSL (IntoTheTV x SOOP SC2 League): Premier Stellar Fest TWO the Moon (Dec 16-20) RSL goes to London! 2026 Offline Finals Nov 21-22
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
Starcraft 2 Advance [D] the control group Simple Questions/Answers [G] How to playtest arcade maps
External Content
Mutation # 550 Graveyard Shift The PondCast: SC2 News & Results Mutation # 549 Endless Sparkles Mutation # 548 Shining Bright
Brood War
General
Recent recommended BW games BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion Rollback Netcode in Brood War SC4ALL II Brood War Complete Invited Player Lineup
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [$1250] International ShieldBattery League KCM Race Survival 2026 Season 4
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
Stormgate/Frost Giant Megathread Deus Ex 3!? 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
Trading/Investing Thread Dating: How's your luck? US Politics Mega-thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
Fan Club Resource Thread Reynor Fan Club The Flash 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: 11266 users

The Big Programming Thread - Page 509

Forum Index > General Forum
Post a Reply
Prev 1 507 508 509 510 511 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.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
August 07 2014 12:24 GMT
#10161
--- Nuked ---
Ethenielle
Profile Blog Joined December 2005
Norway1006 Posts
August 07 2014 14:09 GMT
#10162
Rule 1: At any possible opportunity, bash language X for reason Y.
Theres a fine line between fishing and just standing on the shore like an idiot.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
August 07 2014 16:10 GMT
#10163
ethenielle's rule language isn't zero-based? what a terrible language!
conspired against by a confederacy of dunces.
windzor
Profile Joined October 2010
Denmark1013 Posts
August 07 2014 17:35 GMT
#10164
On August 07 2014 19:43 darkness wrote:
Show nested quote +
On August 07 2014 11:56 Abductedonut wrote:
On August 07 2014 10:02 darkness wrote:
While we're at the C++ topic, could you recommend a good book that would teach me C++11? I'm not a beginner in the world of programming but I'm not an expert either, so anything too advanced would just be bad. Basically, I don't want to learn old C++ stuff only to learn that C++11 or earlier version does it better. I have no experience in C++. I know what pointers are, and very basic stuff from C as well.


In general, learning a specific language unless you know you're going to be using for your work/projects is a terrible idea. It's a great idea if you have zero knowledge about programming and just want to figure out what it is, in which case languages that don't make you want to dip your face into boiling oil are a better option. Like Python!

You need to change your approach to have you view the field of computer science. It's like asking how to architect a house by learning how to use a hammer. Why do you want to learn programming? What are you going to do with it? Where do you see yourself with in down the road?

If you're seriously interested in computer science and not just programming, then you need to go much deeper than just C++. There's a whole world of mathematics, data structures, and algorithms that you should learn to give you a solid foundation. Then you need to dabble in fields to get some breadth - operating systems, video game programming, web programming, database design, artificial intelligence, machine learning, computer vision, etc... Once you have an idea as to what sub-field you actually care about, that's when you should pick and learn a language. If you're doing operating systems, learn C inside and out. If you're doing databases, learn SQL. If you're doing web, learn python, perl, javascript... etc.

If you don't care about computer science and just want to program, then figure out what you want to do with your programming and learn appropriate languages. Don't waste your time with C++. It has a very niche place in the programming world right now, it's huge, really ugly, and has a lot of unnecessarily confusing shit (i.e. why do templates have to solve the Halting Problem? I need a pointer, let me google the 87 types of smart/dynamic/static/shared/whateverthefuck type of pointer I need for 10 minutes because I'm scared of memory leaks...). Quite frankly the only non-legacy things I can think of that C++ is being used for today is probably video game programming.

TL:DR: Figure out what you want to do with programming before wasting your time with C++.



Hi, thanks but I already know what Computer Science is. I have a bachelor degree. I'm asking for books about C++ because I may actually need to learn it if I get hired. So once again, can anyone please recommend some C++11 book? I don't really want to learn old habits, so that's why I'm asking for C++11 right away.


The thing is. If you end up working in a company where you do C++ work, you wont be using C++11. Most compilers dont support it completely yet. I would guess the C++ companies will begin to use it abit in 3-4 years.

I work in a company with 5+ mio lines of C/C++ code. I would say learning how things were done in old times is just as useful. You study CS, so learning the small things of the language should be easy for you. How things are done and way is what you should focus on.
Yeah
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-08-07 18:04:39
August 07 2014 18:00 GMT
#10165
you work in a company so you know how it is in compaines.
the compiler doesn't completely support every c++11 feature, thus you can't use any of it.

hm...

here's the wiki page for c++11 so you can see for yourself how ridicolous that sounds.
here's microsoft overview of what is supported msdn.
conspired against by a confederacy of dunces.
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
August 07 2014 20:59 GMT
#10166
I might be a bit high, but I just love C++!
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
Soan
Profile Blog Joined August 2010
New Zealand194 Posts
August 08 2014 00:25 GMT
#10167
Me too! :D I fucking love pointers. When I first started using C# at my old part time job, having not used it before, I was disappointed I couldn't use them.
Arnstein
Profile Blog Joined May 2010
Norway3381 Posts
August 08 2014 06:23 GMT
#10168
I've never used C#. You can't use pointers there?
rsol in response to the dragoon voice being heard in SCII: dragoon ai reaches new lows: wanders into wrong game
Oktyabr
Profile Joined July 2011
Singapore2234 Posts
August 08 2014 08:59 GMT
#10169
Does anybody know of a resource or software that builds a semantic network with text as input like e.g if there is a line "Sarah is John's mother" then the output would be a directed graph with Sarah and John as nodes, and "mother" as the edge label.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-08-08 09:25:37
August 08 2014 09:17 GMT
#10170
On August 08 2014 17:59 Oktyabr wrote:
Does anybody know of a resource or software that builds a semantic network with text as input like e.g if there is a line "Sarah is John's mother" then the output would be a directed graph with Sarah and John as nodes, and "mother" as the edge label.


I think you may need something like RDF. E.g. graph

RDF consists of triplets (subject that is URI, predicate, object).

[image loading]

For example, one out of many triples from this graph:

URI: http://chucknorris.com/data_/chuck
Predicate: foaf:knows
Object: http://stevenseagal.com/data_/steven

Note that the object does not have to be a link. It could be a string. 'foaf' is just a vocabulary that describes a "friend of a friend". There are many other vocabularies: http://richard.cyganiak.de/blog/2011/02/top-100-most-popular-rdf-namespace-prefixes/

I know that w3 is able to validate RDF/XML, and then generate a graph. http://www.w3.org/RDF/Validator/
However, if you don't want to write RDF/XML by hand, you may use an RDF framework for your favourite programming language. E.g. RDF Jena if you use Java.

There is also OWL which is richer and stricter RDF.
HaRuHi
Profile Blog Joined November 2010
1220 Posts
Last Edited: 2014-08-08 10:04:06
August 08 2014 10:00 GMT
#10171
int main(){
int x=5,y=5;bool z=true;

cout<<x<<' '<<y<<endl;

z?++x,++y:--x,--y;

cout<<x<<' '<<y<<endl;

return 0;
}


Why is it, that if z is true, it only changes x, but if z is false, it changes x and y?
edit: wait, don't tell me, gotta try something, think i got it :D
edit: Answering my own questions:
+ Show Spoiler +
Ok, y is changed if z is true, the last expression though is not part of the false branch of the ? condition and is always executed!
windzor
Profile Joined October 2010
Denmark1013 Posts
Last Edited: 2014-08-08 13:16:51
August 08 2014 13:15 GMT
#10172
On August 08 2014 03:00 nunez wrote:
you work in a company so you know how it is in compaines.
the compiler doesn't completely support every c++11 feature, thus you can't use any of it.

hm...

here's the wiki page for c++11 so you can see for yourself how ridicolous that sounds.
here's microsoft overview of what is supported msdn.


Pretty easy. Not all companies use the newest compiler. I need to compile the same c++ code on AIX, Solaris, Windows, Linux, OS X. All using VS, GCC, soon clang, Sun compiler, AIX compiler, while retaining support with older systems. You need to use the lowest common denominator. Currently because we support from Mac OS X 10.7 our compiler version is GCC 4.2. Take a look at GCC support for c++11 https://gcc.gnu.org/projects/cxx0x.html

Upgrading our specs is not possible because we will have customers who will demand to use that version.

When you need to support customers, big brand customers, you often don't get a choice.

But i'm not saying you shouldn't learn c++11. Of course you should, it is the future. But legacy code is pretty easy to come by and rewritting stuff to c++11 is not the answer to the problem.
Yeah
nunez
Profile Blog Joined February 2011
Norway4003 Posts
August 08 2014 13:55 GMT
#10173
when you put it like that i have no quarrel with you.
conspired against by a confederacy of dunces.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
August 08 2014 17:04 GMT
#10174
On August 08 2014 15:23 Arnstein wrote:
I've never used C#. You can't use pointers there?

You can if you open up an unsafe block.
You sure as hell don't want to do that though. There is no need for pointers in C#, and quite certainly pointers are usually extremely overused in C++ as well.
If you have a good reason to disagree with the above, please tell me. Thank you.
waffelz
Profile Blog Joined June 2012
Germany711 Posts
Last Edited: 2014-08-08 17:16:10
August 08 2014 17:14 GMT
#10175
In case anyone here is experienced with python:

Time ago, my internetz was going down for no apparent reason. My ISP kept arguing that there is no disfunction regarding their services, until I wrote a small thing in python, that send a ping to various sites, replying with 0 if the siote was reachable and with 1 if the site was unreachable. If all sites where giving 1's, a txt-file would be opended, and the downtime would be saved, as well as the time the sites got up again. I let this run on my laptop for a month straight, and send my ISP the result. Shortly after, thesy apologized, fixed some stuff and I got stable internet again. Now I have a problem with packet loss, occasionally appearing and stacking up to 50+%. I would like to create something similar to my ping-solution, only that it monitored the packet loss. My internet-check relys on 'os.system("ping " +site)' which basicly opens cmd, types in "ping site" and getsd the answer. Now I think about using something like 'os.system("ping -n 100 " +site)'. Using "ping -n 100 site" in cmd would ping the given site 100 times and then give you the regular ping-protokoll including the packets lost. I am now wondering how I could get this line via python, to then save it in a txt-file if it is higher than a given value.

regards

EDIT: I am using python 3.x
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
ShAsTa
Profile Joined November 2002
Belgium2841 Posts
Last Edited: 2014-08-08 17:23:09
August 08 2014 17:22 GMT
#10176
Stackoverflow's C++ book guide
If we hit that bull's eye, the rest of the dominoes will fall like a house of cards. Checkmate.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-08-08 17:58:36
August 08 2014 17:55 GMT
#10177
--- Nuked ---
waffelz
Profile Blog Joined June 2012
Germany711 Posts
Last Edited: 2014-08-08 19:14:47
August 08 2014 19:04 GMT
#10178
On August 09 2014 02:55 Nesserev wrote:


import os

var = os.popen('ping -c 5 site').read()
# output of ping command is now stored in var

# do some string mumbo-jumbo to extract package loss percentage

(tested on linux, hence -c flag instead of -n)


Python tends to gentle disagree:

Traceback (most recent call last):
File "C:/Users/Jonas/Desktop/packet loss.py", line 3, in <module>
var = os.popen('ping -n 5 google.de').read()
File "D:\Python33\lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 18: character maps to <undefined>

wihtout the .read(), var = os._wrap_close object at 0x0000000002AEB048. I guess the problem is that the acutal response is multiple lines long, but only the last one gets saved, making this method as useless as my ping-method.

EDIT: Are you also using python 3.x? Because I remember that there where some changes to "os.popen" which led to me using os.sstem instead, despite all the tutorials I found where using os.popen, but where a previous version of python.
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-08-08 20:16:32
August 08 2014 20:12 GMT
#10179
--- Nuked ---
waffelz
Profile Blog Joined June 2012
Germany711 Posts
Last Edited: 2014-08-08 22:33:48
August 08 2014 21:52 GMT
#10180
jupp, umlauts where the problem. "ausgefhrt fr" should be "ausgeführt für". lets tinker around it -.-

EDIT: seriously? why is this shit still a problem up to this date? And why does every solution that I find have to be out of date. I swear to you, these are the moments that drive all those promising newcomers away from coding...
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
Prev 1 507 508 509 510 511 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 23h 56m
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Calm 4851
Rain 3142
Shuttle 802
Horang2 752
Bisu 696
firebathero 680
BeSt 415
Zeus 368
Rush 269
Mini 167
[ Show more ]
Britney 165
Mong 158
ProTech140
sOs 118
actioN 105
Soulkey 105
Dewaltoss 104
Pusan 88
Hyun 73
ZerO 72
Snow 64
Shinee 43
Noble 35
hero 33
Killer 33
Barracks 32
sorry 26
soO 25
Aegong 21
Sharp 20
Free 16
HiyA 12
Movie 11
Dota 2
ODPixel494
League of Legends
Reynor85
Counter-Strike
fl0m2988
olofmeister981
jkaem33
Other Games
B2W.Neo713
Lowko339
JimRising 290
Fuzer 225
syndereN187
crisheroes187
NeuroSwarm87
ViBE45
QueenE33
Railgan24
ZerO(Twitch)5
Organizations
Other Games
ComeBackTV 244
Counter-Strike
PGL111
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• iopq 6
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 1260
• lizZardDota2361
• WagamamaTV236
Upcoming Events
IntoTheTV X SOOP
23h 56m
Reynor vs Solar
ByuN vs SHIN
Clem vs MaxPax
herO vs Rogue
IPSL
1d 5h
WorsT vs nOmaD
Dewalt vs andersOn
AI Arena Tournament
1d 7h
IntoTheTV X SOOP
1d 23h
IPSL
2 days
Azhi_Dahaki vs ggnore13
Double vs WIZARD
Replay Cast
2 days
Replay Cast
3 days
Sparkling Tuna Cup
3 days
WardiTV Invitational
4 days
YoungYakov vs Lambo
SHIN vs TBD
Percival vs Shameless
Solar vs TBD
PiGosaur Cup
4 days
[ Show More ]
The PondCast
5 days
KCM Race Survival
5 days
WardiTV Invitational
6 days
Liquipedia Results

Completed

Proleague 2026-11-05
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
Calamity Cup Div. A Season 8
IEM Beijing 2026
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

Upcoming

Sector 951
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
Underdog Cup 2026 Div 2-3
PGL Bucharest 2027
BLAST Bounty Winter 2027
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 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.