The Pradipta 416
So the funniest thing happened the other day (and as usual I’ve only just found the convenience to blog it). I was sitting working, minding my own business when I received yet another formulated mass post from a recruitment agent. Only this one was a little different..
I have a couple of Ruby on Rails position, wanted to know if you are interested?
Max Archie
Technical Recruiter
Prodigus Source
Cell: 219-669-9216
Phone: 312-235-2365
Max@prodigussource.com
Seems pretty normal on the face of it. Just a typical impersonal email recruiters send out to hundreds of “potential candidates” (read: anonymous list of farmed email addresses). However this agent forgot to use BCC instead of CC, and so 416 selected individuals all over the world were kindly supplied with each others email addresses.
So what did a group of complete strangers from all cultures and walks of life decide to do with this new found information? Well, for a while we laughed. And then we went a bit mad. And now you’ll find the Pradipta 416 all over the ‘net. Including, but not limited to, Twitter, FaceBook and a Google discussion group.
I love it. A community was born.
Screen resolution bookmarklets
I’ve been using various methods to test screen resolutions in Safari, but this is probably my favourite:

Just drag these links to your bookmarks bar (creating a folder to put them in if you so desire) and click them to resize Safari to the desired resolution. Simple huh?
These viewport sizes are “safe” resolutions (taking into account task bars, toolbars, status bars, menus and such) based on the most common set of browsers and operating systems, including Safari, Camino, Firefox, Omniweb, Opera, and Internet Explorer 5, 6 and 7.
Update: classic example of eating one’s own words. My colleague Daniel just sent me a mail to let me know that he’d installed my bookmarklets and discovered that my own site failed on a 1024×768 screen. D’oh! In my defense, it’s not my template, and I hadn’t actually tested it. *sheepish grin* Thanks Daniel! :-P
RA D IO HEA_D
I meant to post this waay before now.. Read it and weep..
It was freaking awesome by the way, sorry you couldn’t be there :-P
Strict typing is good mkay
I’m currently in the final stages of a refactor and I thought I’d just share this little tidbit on why strict typing is a good thing in AS3, especially when working in an agile environment where things can change quickly as requirements unfold and mutate.
Let’s say you’re working with data via AMF, and you have a Project value object with the properties ‘id’, ‘name’ and ’status’.
public class Project { public var id:Number; public var name:String; public var status:String; }
In no time at all the rest of your code will be littered with references to these properties, and obviously if any of these properties changes during refactoring will be instantly picked up by the compiler. No biggie refactoring those. But there are instances where changes can slip under the radar.
For example (examples are always good), take a look at this snippet:
private function on_result(event:ResultEvent):void { this.status = event.result.status; }
See the subtlety? In this instance, event.result is an
Object, which is dynamically typed. Therefore accessing erroneous properties will not be picked up by the compiler, and this ultimately leads to subtle, frustrating bugs and loss of hair.
To avoid this, ensure you type cast dynamic objects to their appropriate types before accessing properties thusly:
private function on_result(event:ResultEvent):void { this.status = (event.result as Project).status; }
Now if the status property is renamed during refactoring, the compiler will instantly pick it up and the world will seem a little brighter.
Building the MySQL gem on Leopard with the macports MySQL
I’ve been running with the Rails MySQL adapter for a while now after failing to build the native MySQL gem under Leopard. The problem, I thought, was that I’m using the Macports MySQL, and it turns out I was right. If you attempt to build the MySQL gem and you get an error like this:
Building native extensions. This could take a while...
ERROR: While executing gem ...
(Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... no
Gem files will remain installed in
/opt/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to
/opt/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.outThen you’ll need to add a couple of things to your Gem command line to get it building:
If you’re just installing or updating the gem, try this:
sudo gem install mysql -- \ --with-mysql=/opt/local/lib/mysql5 \ --with-mysql-lib=/opt/local/lib/mysql5/mysql \ --with-mysql-include=/opt/local/include/mysql5/mysql
If you’re updating all your gems (this one caught me out), then try this:
sudo gem update -- \ --with-mysql=/opt/local/lib/mysql5 \ --with-mysql-lib=/opt/local/lib/mysql5/mysql \ --with-mysql-include=/opt/local/include/mysql5/mysql







