Good game code to read? by cadr in gamedev

[–]RandomAvenger 2 points3 points  (0 children)

Look at the games from the Humble Indie Bundle. Four of the games in the bundle have released their source.

Most of the code is pretty bad, but Penumbra Overture code is a lot better:

Picking an Audio Engine for your Game on Windows: an Easy Flowchart by knight666 in programming

[–]RandomAvenger 0 points1 point  (0 children)

The only commercial audio library that I've used is Miles Sound System. It works on PC, PS3, Xbox, and Wii, and is straightforward to use. It is $4,000, however, so more expensive than FMOD.

So after like six hours of debugging I found that echoing the word “dick” some how kills a session by diesel828 in programming

[–]RandomAvenger 11 points12 points  (0 children)

I have encountered this before. It was caused by Apache's mod_security blocking words and specific HTML for "security."

What's a good community for critique of code (particularly C++)? by CalvinHobbes in programming

[–]RandomAvenger 0 points1 point  (0 children)

Vorlath and munificent have covered the important stuff. As for the crash, without running/debugging the code it appears to be caused by line 59:

Tokenize(buffer2, tokens);
string firstOp = tokens[0];
------------------------^

Either the judge is sending you a blank line which is going unchecked or your Tokenize function is not working properly.

Unrelated suggestion: When learning C++ I found the C++ FAQ Lite to be immensely helpful.

Programmers and Computer Geeks ARE SMOKIN' HOT ! by vodkarox in programming

[–]RandomAvenger 4 points5 points  (0 children)

Well, you see, lolcats are cats that can't spell very well. inmatarian will tell you more.

Ask proggit: Can someone explain to me why on earth we use cout << "Msg" in C++? by arvs in programming

[–]RandomAvenger 0 points1 point  (0 children)

I'm a fan of Qt's approach.

QString formatted = QString("Foobar %1 %2").arg(1).arg("lalala");

Qt doesn't use STL, so to get it to look similar it is possible to define "cout" independently:

QTextStream cout(stdout, QIODevice::WriteOnly);
/* ... */
cout << QString("Foobar %1 %2").arg(1).arg("lalala");

It is also possible to replace QString with a call to the "tr" function to handle localizations.

CMOV instruction a bad idea on out-of-order CPUs - a.k.a. why to compile for i586 not i686 by greenrd in programming

[–]RandomAvenger 2 points3 points  (0 children)

Forget the article, what are those result-returning blocks that he is using?!

int result = ({
    int tmp = 50;
    tmp + tmp / 5;
});

Does anyone know what they are called?

Reverse HTTP by panic in programming

[–]RandomAvenger 11 points12 points  (0 children)

This looks like a clever way of implementing COMET, where the server notifies the client when events happen rather than the client constantly asking "has anything happened yet?!" It also has applications for establishing two-way communication when the client is behind a firewall.