Can’t move focus to control?

March 6th, 2008

So like me you spent 30 minutes trying to fix this Internet Explorer JavaScript error ?

Cant move focus to the control because its invisible , not enabled, or a type that does not accept the focus.

In that case don’t waste time trying to understand it, odds are you have conflicting ids in your document. Also, remember IE 7 and the previous versions are alone to think a name attribute should be treated like an id.

OOP Javascript

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

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

February 1st, 2008

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

Parallels 3 & Civilization 4 sitting in a tree

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.

I’m a dot com

December 5th, 2007

I nearly lost the rights to The Music Tank’s domain name. I tried to transfer the dot com from Domain Registry of Canada to Go Daddy but I got caught with a very bad timing and my subscription had ended before the transfer was completed.

Fortunately, DROC’s customer server service allowed me to renew the dot com and gave me a price discount for the trouble. Ironically, the lowered yearly fee for the domain is still more expensive than Go Daddy’s (without including the Diggnation code). However, I’m just happy I didn’t lose The Music Tank’s branding which I have already worked 9 years on (no matter how successful it has been).

While registering on Go Daddy, I also purchased Francois Faubert.com as my portfolio’s domain name. It’s so cheap that it would be crazy for someone working full time in the web design business not to do it.

I guess it means I’m old enough now to assume my real name and not necessarily exclusively live behind my accustomed “Fake” nickname.

Disnutskin

December 4th, 2007

A friend working for Cornerstone Promotion sent me this clip a few days back, check it out it’s disturbingly funny :

phpBB3 RC7 update raised error

November 15th, 2007

Thinking all would be easy, I decided to move The Music Tank’s forum data into its own database. Doing so, I noticed there was a new release candidate for phpBB3 and installed it at the same time.

While most of it is my fault because I overrode the templates and migrated the database manually, the update caused the following error to occur each time you submit a post :
The submitted form was invalid. Try submitting again.

On phpBB’s official support forums, there were mentions of about a gazillion manual changes to the board’s templates. I didn’t do them because I knew better and the side effects weren’t exactly the same as theirs.

Finally, all I had to do was to reset the “user_form_salt” from the “users” table to a valid hash value (ex: the one the Anonymous user has). It may not be the most secure thing to do though, for obvious reasons.

I <3 my host

November 8th, 2007

Not often in my web life have I been happy with my hosting provider. I think I’ve tried a different one every year since I began playing around HTML.

The more I dig into the services offered by my shared MediaTemple box, the more I’m happy to pay the 20$ a month.

For example, I’ve been looking for a free place for me to store my projects using svn for a while now. I had found Unfuddle, which seemed like a decent service for the kind of work I needed to version. However, I needed to be able to create more than one projects.

Then I remembered MediaTemple gave access to both ssh connections and svn commands, even on shared box. I set up two different projects in about an hour earlier today with great ease because I had some experience with the basic commands and from the documentation MediaTemple provides on their website.

Neat.

Stop reinventing the wheel

November 8th, 2007

For years, I’ve been using an early version of a PHP database access class written by a friend of mine (hey Max!). I’ve been tweaking it over and over again, spending way too much time on it.

Well I’m tired of reinventing the wheel. I just learned that since it’s fifth installment, PHP provides an integrated object easing access to all types of databases it calls PDO functions. All the features you need are in there, coded in C by NASA engineers and is likely better than anything I could come up with.

You really should read up on the PDO if you currently maintain a custom database access object. Also, as the documentation points out, this is not a full-blown database abstration layer (to run MySQL, Oracle or others transparently) it’s a data-access abstration layer (so make sure your queries are properly formed for the database you want to use).