• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 18:05
CEST 00:05
KST 07:05
  • 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] Ro4 Preview: On Course10Code S Season 1 - RO8 Preview7[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16
Community News
Maestros of The Game 2 announcement and schedule !10Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
Maestros of The Game 2 announcement and schedule ! 2026 GSL Season 2 Qualifiers SC2 INu's Battles#16 <BO.9> Master Swan Open (Global Bronze-Master 2) GSL Code S Season 1 (2026)
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Mutation # 525 Wheel of Misfortune The PondCast: SC2 News & Results Mutation # 524 Death and Taxes Mutation # 523 Firewall
Brood War
General
Flashes ASL S21 Ro8 Review ASL Tickets to Live Event Finals? [ASL21] Ro4 Preview: On Course Quality of life changes in BW that you will like ? Why there arent any 256x256 pro maps?
Tourneys
[ASL21] Semifinals A [Megathread] Daily Proleagues [BSL22] RO16 Group Stage - 02 - 10 May [ASL21] Ro8 Day 3
Strategy
[G] Hydra ZvZ: An Introduction Simple Questions, Simple Answers Fighting Spirit mining rates Muta micro map competition
Other Games
General Games
Warcraft III: The Frozen Throne Stormgate/Frost Giant Megathread PC Games Sales Thread Path of Exile Nintendo Switch Thread
Dota 2
The Story of Wings Gaming
League of Legends
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
YouTube Thread US Politics Mega-thread Russo-Ukrainian War Thread UK Politics Mega-thread European Politico-economics QA Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
How EEG Data Can Predict Gam…
TrAiDoS
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2628 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 1h 56m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SteadfastSC 126
JuggernautJason123
StarCraft: Brood War
Calm 2511
Artosis 208
ggaemo 106
Mong 26
Dota 2
XaKoH 559
monkeys_forever484
NeuroSwarm105
League of Legends
Doublelift6685
tarik_tv5924
JimRising 405
Counter-Strike
fl0m5315
Fnx 1326
Super Smash Bros
PPMD39
Other Games
Grubby4517
summit1g3464
Liquid`RaSZi1736
FrodaN1605
shahzam766
C9.Mang0262
ZombieGrub115
ArmadaUGS109
UpATreeSC44
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 17 non-featured ]
StarCraft 2
• Hupsaiya 53
• Kozan
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• Eskiya23 24
• Azhi_Dahaki17
• Pr0nogo 1
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota2493
League of Legends
• imaqtpie2091
• Shiphtur265
Upcoming Events
OSC
1h 56m
CranKy Ducklings
11h 56m
Afreeca Starleague
11h 56m
Light vs Flash
INu's Battles
12h 56m
ByuN vs herO
PiGosaur Cup
1d 1h
Replay Cast
1d 10h
Replay Cast
2 days
The PondCast
2 days
OSC
2 days
Replay Cast
3 days
[ Show More ]
RSL Revival
3 days
OSC
3 days
Korean StarCraft League
4 days
RSL Revival
4 days
BSL
4 days
GSL
5 days
Cure vs TBD
TBD vs Maru
BSL
5 days
Replay Cast
6 days
Liquipedia Results

Completed

CSL 2026 SPRING (S20)
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
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

Upcoming

Escore Tournament S2: W7
YSL S3
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
BLAST Bounty Summer 2026: Closed Qualifier
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 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.