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.
On May 30 2011 20:09 Tili_us wrote: Hey guys, I love C++, but I can't ignore the handy stuff that C# gives.
Is there stuff like reflection c++? (maybe in the new version?)
Also, I've being working with Unity3D, and they use Coroutines using the yield command. Is this available in normal C# too ? (or even c++?)
C++ allows you to inspect the type of objects at runtime with typeid. However, this is all you can do with C++ without resorting to other machinery. In particular, you can't natively inspect methods and fields of a C++ class like you can with C# at runtime. See this stackoverflow Q&A for some of the available options if you need this sort of functionality.
C# supports yield in the context of iterator blocks which you can use to develop co-routine like behavior. In C++, there is no innate language support for coroutines but they can be built into a library without much problem. You can check out yet another stack overflow post for more information (in particular, links to boost.coroutine which you can use).
On May 31 2011 00:42 RoTaNiMoD wrote: C++ is where my heart's at, but that didn't stop me from applying for a PHP Developer position. Nor did it stop me from getting it! Woot!
First real job, what up bitchezzz.
How can you call working as a PHP dev as a real job?
On May 30 2011 20:09 Tili_us wrote: Hey guys, I love C++, but I can't ignore the handy stuff that C# gives.
Is there stuff like reflection c++? (maybe in the new version?)
Also, I've being working with Unity3D, and they use Coroutines using the yield command. Is this available in normal C# too ? (or even c++?)
C++ allows you to inspect the type of objects at runtime with typeid. However, this is all you can do with C++ without resorting to other machinery. In particular, you can't natively inspect methods and fields of a C++ class like you can with C# at runtime. See this stackoverflow Q&A for some of the available options if you need this sort of functionality.
C# supports yield in the context of iterator blocks which you can use to develop co-routine like behavior. In C++, there is no innate language support for coroutines but they can be built into a library without much problem. You can check out yet another stack overflow post for more information (in particular, links to boost.coroutine which you can use).
IMO C++ is kind of obsolete - at least on the windows platform. Basically it has no advantages over C# if youre gonna use the .net environment, just takes more developer time to do things.
On May 31 2011 00:42 RoTaNiMoD wrote: C++ is where my heart's at, but that didn't stop me from applying for a PHP Developer position. Nor did it stop me from getting it! Woot!
First real job, what up bitchezzz.
How can you call working as a PHP dev as a real job?
Hah! I kind of agree with you; I mean like I said, C++ is my bread and butter. My company's sweet though and their PHP codebase is mature and very object-oriented, so it's still pretty neat. Plus, to be honest, I was at a point where I probably would've taken an "HTML Developer" position -- money may have been a factor.
On May 30 2011 20:09 Tili_us wrote: Hey guys, I love C++, but I can't ignore the handy stuff that C# gives.
Is there stuff like reflection c++? (maybe in the new version?)
Also, I've being working with Unity3D, and they use Coroutines using the yield command. Is this available in normal C# too ? (or even c++?)
C++ allows you to inspect the type of objects at runtime with typeid. However, this is all you can do with C++ without resorting to other machinery. In particular, you can't natively inspect methods and fields of a C++ class like you can with C# at runtime. See this stackoverflow Q&A for some of the available options if you need this sort of functionality.
C# supports yield in the context of iterator blocks which you can use to develop co-routine like behavior. In C++, there is no innate language support for coroutines but they can be built into a library without much problem. You can check out yet another stack overflow post for more information (in particular, links to boost.coroutine which you can use).
IMO C++ is kind of obsolete - at least on the windows platform. Basically it has no advantages over C# if youre gonna use the .net environment, just takes more developer time to do things.
Actually, C++ on Windows is seeing a resurgence of importance that has been brewing since Visual Studio 2008 (e.g., see this zdnet piece on the recent stb re-org and visualc re-branding). There's a clearer distinction now by Microsoft to use C++ for full-fledged desktop apps and .NET for lob and mobile apps.
As for why you would use C++ over C#, there are a variety of reasons including legacy, performance, and interoperability. Many of these reasons are why the developer base has stuck with C++ over the last decade while Microsoft tried to push .NET as the way to do all development on Windows.
(And oddly enough, the resurgence of the importance of C++ isn't just on Windows. Apple is putting a lot of effort into LLVM and it's companion C/C++/Objective-C front-end, Clang, to facilitate native OS X development.)
I really like both languages to be honest. To do get some results as fast as possible I use C#. But I love C++ when I need to take control.
I honestly don't get all the hate C++ is getting versus C#. Every time this discussion starts is about the JIT compiler stuff for C# and how its faster than C++ (in some cases), etc ... But there is still too much happening behind the scenes with C# that bothers me as a C++ developer.
I for one, really don't like structs is C#, they are just silly. I know why they made them value types, to make sure nothing iffy happens. But why is it then that when you know what you are doing in C++ it's no problem at all to pass these structs by const ref. It's just silly to keep copying them each time you pass them to a function. I'm sure Sutter wrote about this ... "gratuitous pessimization" it was called.
Anyone know anything about Huffman coding? Like a general breakdown of it or anything. My friend is having a hard time with HW and maybe theres someone here I could refer them to
On June 01 2011 12:19 FinestHour wrote: Anyone know anything about Huffman coding? Like a general breakdown of it or anything. My friend is having a hard time with HW and maybe theres someone here I could refer them to
This looks helpful: and
Though if your friend knows of this website called "google" he's probably already come across them. There's a wealth of information out there that I can see. What's his problem with Huffman coding?
is anyone here has an experiece in xml and php? cause I've been trying to layout all the data of the xml file, been doing this 3 days straight now(18hrs/day) and no effin improvement and it's due is on friday 9AM +8 GMT or my wife and kids would be stoned
On June 01 2011 16:36 omG.[RaYnE] wrote: is anyone here has an experiece in xml and php? cause I've been trying to layout all the data of the xml file, been doing this 3 days straight now(18hrs/day) and no effin improvement and it's due is on friday 9AM +8 GMT or my wife and kids would be stoned
You should give information about: - How the input looks like - How the output should look like - The code you currently have (minus unrelated parts) - The current output
Then we might help you.
Usually parsing XML is as simple as using any of the many XML parsers out there...
On June 01 2011 16:36 omG.[RaYnE] wrote: is anyone here has an experiece in xml and php? cause I've been trying to layout all the data of the xml file, been doing this 3 days straight now(18hrs/day) and no effin improvement and it's due is on friday 9AM +8 GMT or my wife and kids would be stoned
I did try that too, I know it's a lot to ask but can you show me an example code showing all the data that are listed in the xml file? I would really appreciate it
On June 01 2011 17:02 omG.[RaYnE] wrote: I did try that too, I know it's a lot to ask but can you show me an example code showing all the data that are listed in the xml file? I would really appreciate it
Sorry, i don't do "gimme teh codez". If you can't get from the examples to a working solution, you should get another job. It's not even namespace stuff or anything complicated.
Another (untested) example:
$xml = new SimpleXMLElement('YourXmlFile.xml', null, true); foreach ($xml->xpath('//Sport') as $sport) { foreach ($sport->xpath('/Texts/Text') as $text) { echo $text['Language'] . ':' . $text->Value . "\n"; } }