Sunday, December 28, 2008

Shout out to

When discussing film content with Kim, particularly the film Fool's Gold (a horribly-made film, I wasted my time on), we noticed how ratings could not be trusted. Kim and I now have a account (thanks Kim!) and we can watch movies instantly, she was looking for something for us to watch and came across the film, Fool's Gold. She asked me if I had ever seen it and I told her I had, but that it was horrible. Along with the film's lack of any artistic strand, it has a scene where two girls in bikinis remove their tops. Although this scene is short, you can still catch detail of what is going on. This film was given the rating of PG-13 by the Motion Picture Association. I think Kim made a good point when she said this film is not for 14 year-old kids (or older depending on your moral standards).

As it is obvious from this film, and many others, the Motion Picture Association is not doing a very good job rating films. The need for more information is crucial for the public to be aware of a film's content. Fortunately, for those who know about it, there are web sites that can give us more information than a simple PG-13 stamp by some organization. and, both freely give information on a film's contents. gives ratings (0 - 10) for three separate categories, and brief descriptions of why that film got the rating that it did.

I tip my hat and give a shout out to those interested in conserving morals and giving us another way to stay away from the things we don't want to see.

Friday, December 12, 2008

Array Shuffle AS3

When working on shuffling arrays for games we are working on, I wanted to write something that would be efficient and quick. I had previously written a method using the Array push and splice methods and was short, but when testing that against my new function, found that the push, splice methods use a lot of memory and are about half as slow as my final solution. (Please test this if you aren't convinced) The final solution is posted here using the prototype extension (I am still not sure whether or not the prototype usage is being deprecated):

Array.prototype.shuffle = function(){
    for(var i = 0; i < this.length; i++){
        var a = this[i];
        var b = Math.floor(Math.random() * this.length);
        this[i] = this[b];
        this[b] = a;

This can be modified into a regular function by changing it to pass an array by argument and then modifying the passed in array object. If you have questions, just let me know.

Wednesday, December 3, 2008

FireFox 3 Workaround - e.location.getItemLocation( is undefined

While trying to get my Firefox add-ons and themes to update, install, or uninstall, I kept getting an error from Firefox saying the (after downloading the add-on) that the install file was not available - or something like this. It will show e.location.getItemLocation( is undefined in the error console under Tools->Error Console. I tried to do research a fix and found little documentation on this specific error, so I followed mozilla web links and this is how I came to resolve the problem.

I installed a backup utility to backup my settings, bookmarks, etc. (MozBackup - This will make sure we don't loose anything important in the process.

Then I used the utility to backup my profile named 'default' (This is the profile Firefox builds by default)

IMPORTANT: Close all instances of firefox (this means any processes as well)

Once, everything was backed up, I went to Start->Run (on the Windows XP Taskbar)
and entered 'firefox.exe -P'. This will only work if you installed firefox with an installer, if you downloaded a zip file of firefox, you will have to enter the full path to the firefox.exe (i.e. C:/)

This will open a simple program showing your default Firefox profile with the option to create, remove, etc. Create a new profile with whatever name you choose and close the program)

IMPORTANT: Again, check to make sure all instances of firefox are closed/stopped (this means any processes as well)

You will now have to manually copy over the files you want from your old profile to your new one. You will go to start->Run (just like last time, from your windows taskbar)

Enter '%APPDATA%' (no single quotes), this will open a directory with all your application data for programs on your computer, choose Mozilla->Firefox->profiles.

You should now see atleast 2 directories with unqiue id's followed by the profile name (i.e. 0843D.default or 0842D.newProfileName) Since there is a list and descriptions of these files, the best way is to follow the instructions mozilla gives for migrating data. The link I used is,

NOTE: When I transfered data, I checked firefox to make sure it wasn't having issues as it went. You may not want to copy everything over, I assumed my problem was caused by a bummed add-on and just manually reinstalled my add-ons, and only the ones I really needed.

If you are still having problems, you are welcome to see my sources and ask me questions. Thanks and good luck.

NOTE: Since this tutorial is written after fixing the problem, and I can't recreate the problem, please let me know if something isn't clear.

Migrating Data:
Manually Profile Backup -
Using MozBackup Utility -

Friday, November 28, 2008


With 10 months behind us, I recently asked Kim to marry me. Fortunately for me, she said yes. ;) See her (or our) blog for more detailed information. She is so wonderful!

Friday, October 24, 2008

Flash AS3 String Prototype Extension

I was working on a problem where two strings looked identical but weren't.

Because there were many variations of the string, it was possible that some converting (and integration with stage objects:textfields) may have changed the white space characters to something different. I was able to get character codes for what existed and what I wanted to replace it with, so I wrote a simple prototype extension for the String class class replaceCodes(code1, code2), and it would change the string to reflect the replacement.

The solution/function:
String.prototype.replaceCodes = function(code:uint, code2:uint):String {
    return    this.split(String.fromCharCode(code)).join(String.fromCharCode(code2));

Hope this helps someone.

Tuesday, October 21, 2008

Solution to loading CakePHP styles in XAMPP

After much trial and error setting up CakePHP on Xampp (or WampServer 2.0) I finally found the problem.

The Issue: After setting up the Cakephp structure in my htdocs/ folder in Xampp, I loaded the project through http://localhost/. The page would load but none of the styling set out by the cake css sheet was rendering. The book Beginning CakePHP, mentions you need to alter the site (in my case Xampp's) httpd.conf file. It suggests you change to

<Directory /dir/to/cake>
Options Indexes FollowSymLinks
AllowOverride All

This is fine but I wasn't sure if this reference is relative or not. After testing it with a quoted path, relative, and an absolute path. I decided it was something else.

The Solution: With more research I discovered something the book forgot to mention. This was to change another line in the httpd.conf file. There is a line for a module that needs to be uncommented (remove the # in front of it) - that line is this:

LoadModule rewrite_module modules/

This waisted about an hour of my life and I am hoping this post will save someone else that hour. Happy programming.