The Big Programming Thread - Page 509
| Forum Index > General Forum |
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
Belgium2760 Posts
| ||
|
Ethenielle
Norway1006 Posts
| ||
|
nunez
Norway4003 Posts
| ||
|
windzor
Denmark1013 Posts
On August 07 2014 19:43 darkness wrote: 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. | ||
|
nunez
Norway4003 Posts
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. | ||
|
Arnstein
Norway3381 Posts
| ||
|
Soan
New Zealand194 Posts
![]() | ||
|
Arnstein
Norway3381 Posts
| ||
|
Oktyabr
Singapore2234 Posts
| ||
|
Shield
Bulgaria4824 Posts
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). ![]() 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
1220 Posts
int main(){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
Denmark1013 Posts
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. | ||
|
nunez
Norway4003 Posts
| ||
|
spinesheath
Germany8679 Posts
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. | ||
|
waffelz
Germany711 Posts
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 | ||
|
ShAsTa
Belgium2841 Posts
| ||
|
Nesserev
Belgium2760 Posts
| ||
|
waffelz
Germany711 Posts
On August 09 2014 02:55 Nesserev wrote:
(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. | ||
|
Nesserev
Belgium2760 Posts
| ||
|
waffelz
Germany711 Posts
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... | ||
| ||

![[image loading]](http://milicicvuk.com/blog/wp-content/uploads/2011/08/rdf_graph_example.png)
