programming

This. Nothing else, just this.

Bookmarks Clearout, Part I

Few of my bookmarks I had long since forgotten about (warning: most of these are pretty old). I’ll assume these were for blogging, so here you are, in no particular order:

Here ends the bookmarks.

The Programming Antihero

I was fresh out of college, still wet behind the ears, and about to enter the beta phase of my first professional game project — a late-90s PC title. It had been an exciting rollercoaster ride, as projects often are. All the content was in and the game was looking good. There was one problem though: We were way over our memory budget.

Since most memory was taken up by models and textures, we worked with the artists to reduce the memory footprint of the game as much as possible. We scaled down images, decimated models, and compressed textures. Sometimes we did this with the support of the artists, and sometimes over their dead bodies.

We cut megabyte after megabyte, and after a few days of frantic activity, we reached a point where we felt there was nothing else we could do. Unless we cut some major content, there was no way we could free up any more memory. Exhausted, we evaluated our current memory usage. We were still 1.5 MB over the memory limit!

At this point one of the most experienced programmers in the team, one who had survived many years of development in the “good old days,” decided to take matters into his own hands. He called me into his office, and we set out upon what I imagined would be another exhausting session of freeing up memory.

via Gamasutra – Features – Dirty Coding Tricks.

You’ll have to scroll to the bottom of the article to read The Programming Antihero, but it’s totally worth it (as are all the other reads)!

Just. Plain. Awesome.

I sure as hell don’t think I’ll ever be in such a situation, but if I am – far out, that’d be an awesome way to do it.

Like whichever person I follow on Twitter who posted this, I could read these sorts of things forever.

The ‘X Character Finder’ Crapfest

So, Java, huh?

It’s not so bad, actually.

As a first language, Java is okay – especially when it is taught right (inside joke there).

Anyway, hot on the heels (somewhat cold, actually), of the Windows Shutdown Crapfest, comes the X Character Finder crapfest, courtesy of yours truly.

First, a little background to this – at Uni I’m doing a subject called programming and problem solving. It involves Java.

Our first assignment was to calculate some variable. Or something. Anyway – one of the things we had to do was find out if the user’s name had the ‘x’ character in it – in either upper or lower case.

This is what I managed to come up with – I’ve commented the code so you understand what it does. I’ve also used Pastie to embed the code, because this is the one time WordPress has failed me. Right, everything seems to be failing hard on me tonight, so I’ve just linked the Pastie… :(

If you don’t really get what’s going on, I wouldn’t worry. Here’s the english explanation: Get a username. Count the letters in that username. Look at the first character – if it’s an X or an x, then we have an x in the username. If it’s not an X or an x, then we look at the next character in the username, and perform the same “Is it an X or and x check” again. We keep doing this until we either find an X, or we’ve run out of characters in the username. If you just want to know why this is the X Character Finder crapfest, well, it’s just because I’m re-inventing the wheel here, man – there’s a heaps easier way to find if a particular word/string has a particular character in it, and that’s via use of methods.

The real code that I submitted looks like this. Thanks again to Pastie. :)

See? Much easier.

This was the X Character Finder Crapfest, brought to you by Benny Ling.

Comments below.

#349916 – Pastie

Zune Source Code FAIL

via #349916 – Pastie.

The offending function from the source code of Zune’s that caused the huge, epic Zune failure.

For those of you that don’t know how it managed to fail (myself included), see this Digg explanation for more:

Ouch.

For anyone who is wondering or just doesn’t want to figure it out, Dec. 31 qualified as being greater than day 365 (obviously, because it was day 366) but it got caught where the program says to look at (days > 365). The problem is that there was no code for what to do if the day *equals* 366, only if days is *greater* than 366. So, there was no way to break out of the (days > 365) loop until today (day 367) when the program would reset days to 1, thereby breaking the loop.

Whoops. It’s amazing what one bad “if” statement can do.

Heh. Amateur mistake, I know…

Abstruse Goose » Computer Programming 101

Computer Programming 101

…for some reason, Press This couldn’t “see” this image on the webpage. I had to upload it to my server.

Abstruse Goose » Computer Programming 101.

Open source programming languages for kids

The past couple of years have seen an explosion of open source programming languages and utilities that are geared toward children. Many of these efforts are based around the idea that, since the days of BASIC, programming environments have become far too complex for untrained minds to wrap themselves around. Some toolkits aim to create entirely new ways of envisioning and creating projects that appeal to younger minds, such as games and animations, while others aim to recreate the “basic”-ness of BASIC in a modern language and environment.

via Linux.com :: Open source programming languages for kids.

Drag and drop programming? Things where you can actually “see” what your programming goes and what it does?

Yeah, I’m all for that.

The Digg comments for this article are serious gold – gems like “Bah, just start ‘em on C++, tough learning curve but if they succeed they’ll be one of the best damned programmers ever, and if they don’t – well, I hear McDonalds is hiring…”

I Digg that. Pun intended.

If programming languages were religions…

Java would be Fundamentalist Christianity – it’s theoretically based on C, but it voids so many of the old laws that it doesn’t feel like the original at all. Instead, it adds its own set of rigid rules, which its followers believe to be far superior to the original. Not only are they certain that it’s the best language in the world, but they’re willing to burn those who disagree at the stake.

via Aegisub: If programming languages were religions….

Epic lulz.

Check it out – there’s C, Java, PHP, C++, C#, Lisp, Haskell, Erlang, Perl, Lua, Ruby, Python, COBOL, APL, LOLCODE, and Visual Basic.

Interesting read, nonetheless!