• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 06:47
CEST 12:47
KST 19:47
  • 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] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244
Community News
StarCraft open world shooter announced at BlizzCon59Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism10Official StarCraft website teases new content ahead of BlizzCon?168Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3
StarCraft 2
General
StarCraft open world shooter announced at BlizzCon How do you feel about the StarCraft shooter announcement at BlizzCon 2026? Balance hotfix patch 5.0.16b (July 16) Team Liquid Map Contest #22: Results and Winners Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament RSL goes to London! 2026 Offline Finals Nov 21-22 KSL Week #92 IntoTheTV X SOOP SC2 League : Weekly & Monthly 2026 GSTL Announcement
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 542 The Ascended Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This
Brood War
General
Official StarCraft website teases new content ahead of BlizzCon? BGH Auto Balance -> http://bghmmr.eu/ Broodwar Prediction Market Practice Partners (Official) [D] Brainstorming a balance patch for Brood war
Tourneys
[ASL22] Ro16 Group B [ASL22] Ro16 Group A Escore Tournament - Season 3 Small VOD Thread 2.0
Strategy
Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation Game Theory for Starcraft
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 Community Thread
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Trading/Investing Thread UK Politics Mega-thread Russo-Ukrainian War Thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Diablo Animated Series on Netflix Movie Discussion!
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
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Virtual Romance, Real-Life C…
TrAiDoS
Regacy Esports:Our Goa…
regacyesports
Dreaming of BW patches (mod…
c3rberUs
LOCKPICKING NOOB
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7117 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
Sparkling Tuna Cup
10:00
Weekly #146
TBD vs Gerald
CranKy Ducklings84
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
MindelVK 30
Trap 29
Rex 21
StarCraft: Brood War
Britney 25501
Calm 8269
PianO 2804
Shuttle 2189
Jaedong 1695
Pusan 532
firebathero 409
Larva 358
Hyun 255
Stork 175
[ Show more ]
Sharp 112
Last 100
Mong 54
Killer 51
ZerO 48
Shinee 41
Aegong 37
HiyA 29
Mini 26
sSak 25
Shine 18
Hm[arnc] 16
NaDa 15
SilentControl 15
ajuk12(nOOB) 12
Rock 11
JulyZerg 10
Dota 2
XcaliburYe646
ODPixel416
Fuzer 160
Counter-Strike
edward86
x6flipin4
Other Games
summit1g16464
Pyrionflax213
KnowMe110
ZerO(Twitch)9
Organizations
Other Games
BasetradeTV222
StarCraft 2
IntoTheiNu 105
StarCraft: Brood War
UltimateBattle 18
lovetv 8
[ Show 13 non-featured ]
StarCraft 2
• StrangeGG 114
• CranKy Ducklings SOOP22
• Adnapsc2 5
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos1901
Other Games
• WagamamaTV85
Upcoming Events
WardiTV Invitational
13m
ByuN vs Percival
Cure vs Classic
Shopify Rebellion Sundays
4h 13m
Spirit vs Mixu
Clem vs TBD
RSL Revival
5h 13m
Serral vs Rogue
BlizzCon
7h 43m
IdrA vs MC
Replay Cast
13h 13m
Afreeca Starleague
23h 13m
Light vs JyJ
Soulkey vs hero
WardiTV Weekly
1d
Monday Night Weeklies
1d 5h
Afreeca Starleague
1d 23h
Snow vs Shinee
Shine vs EffOrt
GSL
2 days
[ Show More ]
PiGosaur Cup
2 days
The PondCast
2 days
Kung Fu Cup
3 days
Replay Cast
3 days
KCM Race Survival
3 days
IntoTheTV X SOOP
4 days
Replay Cast
4 days
IntoTheTV X SOOP
5 days
Replay Cast
5 days
GSL
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Acropolis #5 - TRS
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1

Ongoing

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

Upcoming

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
PGL Major Singapore 2026
Stake Ranked Episode 6
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
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.