• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 01:12
CET 07:12
KST 15:12
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
StarCraft Evolution League (SC Evo Biweekly) RSL Offline Finals Info - Dec 13 and 14! RSL Offline FInals Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BW General Discussion Which season is the best in ASL? Data analysis on 70 million replays BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET [Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread ZeroSpace Megathread Nintendo Switch Thread The Perfect Game Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
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
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1584 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
Replay Cast
00:00
WardiTV Mondays #62
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 178
SortOf 72
trigger 59
-ZergGirl 1
StarCraft: Brood War
Stork 793
Tasteless 205
Shine 139
NaDa 43
Bale 30
Icarus 10
ZergMaN 8
Dota 2
NeuroSwarm149
febbydoto31
League of Legends
JimRising 634
Other Games
summit1g11463
WinterStarcraft516
C9.Mang0350
ViBE139
Mew2King82
Organizations
Other Games
gamesdonequick855
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH113
• practicex 41
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Azhi_Dahaki13
• Diggity5
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo1400
Upcoming Events
The PondCast
3h 48m
OSC
9h 48m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
17h 48m
Korean StarCraft League
1d 20h
CranKy Ducklings
2 days
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
2 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
2 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
3 days
[ Show More ]
WardiTV 2025
3 days
OSC
3 days
BSL 21
3 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
4 days
StarCraft2.fi
4 days
Monday Night Weeklies
4 days
Replay Cast
4 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
5 days
StarCraft2.fi
6 days
Tenacious Turtle Tussle
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
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 © 2025 TLnet. All Rights Reserved.