Archive for February, 2008

OOP Javascript

Sunday, February 10th, 2008

If you’re anything like me, hardcore object-oriented Javascript coding always come with unexpected errors and some of the strangest behavior you can’t really explain.

But that’s always the programmer’s fault, of course.  It turns out Javascript isn’t made to be used in a object-oriented way, but rather in a prototype-oriented fashion.

This lengthy post compares Java and Javascript and explains how a Javascript programmer
should implement object inheritance.

I found a few things strikingly useful in there, notably the delegation of the whole obj.prototype reference and the fact he never explicitly declares any class attributes as he does in Java (and how we were trained to do it).

Interesting tendency

Wednesday, February 6th, 2008

Did you notice how many commercials of websites played during the Super Bowl? How interesting.

Take the work out of your workout

Friday, February 1st, 2008

That’s what I call an ergonomic chair. Thanks Sofia!

Parallels 3 & Civilization 4 sitting in a tree

Friday, February 1st, 2008

The virtual past was a sad one

My experiences with virtual machines weren’t too positive until recently. I was mainly trying to run Ubuntu on my Mac for all my development needs. Linux being supported by enterprises the way it is, virtualization software vendors probably had little time allocated for tweaking their software between each new Ubuntu release and in the end it felt as though they’d never catch up.
Because Fusion broke my mouse and Virtual Box would fit the resolutions I wanted, I had to drop the whole idea of emulating Linux on my Mac. The only decent solution left was to install a webserver on MacOS (which is halfway done out of the box) and scrap the whole idea of developing websites on Linux.

No Linux, but what about Windows?

It quickly becomes obvious the main installation these software are going for is Windows XP inside MaxOS. Everything in that combination works much more smoothly in all virtualization software I’ve tried. There aren’t many performance issues either when you stick to small stuff.

But what do I do on Windows I can’t do on a Mac?

Well if I can’t be a Linux geek, I’ll at least be a able to play my PC games… right? Nope.

Up until recently, no software I knew of was able to emulate DirectX. This meant no 3D effects on your virtual installation.

Yesterday I randomly stumbled on information saying that Parallels 3 supported DirectX 9. There you go, I had to try it.

I should also mention that the latest version of Fusion is also supposed to run 3D stuff, from what I gathered in a few forums. Since I had never tried Parallels, the latter seemed more interesting to me.

Civilization 4 works…

The only game I actively play on my PC is Civilization 4 :Beyond The Sword. Parallels’ big test would be to run the game good enough in order for me to justify not dual booting my Mac.

After a few tries and some tweaking around I got Civilization 4 to work well enough on Parallels 3. Here are roughly the steps I’ve taken in order to make it work. I guess this would apply to most games too :

  • Enable Direct X Shaders
    In the virtual machine’s configuration window, find the checkbox that will enable DirectX in the video tab. 3D being experimental, it’s off by default.
  • Pump up the RAM
    From the memory tab of the virtual machine’s configuration window, I gave 1024megs of main memory and 64megs of video memory
  • Lower Civ details
    When you start the game you will get a message saying you are running Civ under the minimum requirements. The game then proceeds in lowering everything it can thing of.I like to turn wonder videos off too: often the game crashed on my old Pentium 4 when I had just build the Oracle ending a perfect game start!

…but it’s not perfect

Apart from the common issues related to running Civ under its requirements, the only noticeable bug I’ve encountered yet was that the city growth and building progress bars don’t appear.