I don’t know exactly what causes this (I’ve only had a Mac a week!), but upon installing Leopard today and installing a couple of updates, the system felt a little sluggish and so I took a look at my Console, and it was brimming with messages like this:
10/28/07 1:06:33 AM com.apple.launchd[1] (com.apple.dyld)
Throttling respawn: Will start in 59 seconds
10/28/07 1:07:33 AM com.apple.launchd[1] (com.apple.dyld)
Throttling respawn: Will start in 59 seconds
10/28/07 1:08:34 AM com.apple.launchd[1] (com.apple.dyld)
Throttling respawn: Will start in 59 seconds
10/28/07 1:09:35 AM com.apple.launchd[1] (com.apple.dyld)
Throttling respawn: Will start in 59 seconds
10/28/07 1:10:39 AM com.apple.launchd[1] (com.apple.dyld)
Throttling respawn: Will start in 56 seconds
The fix for this is pretty simple, which I found here. But in brief, all you have to do is type this in a Terminal:
sudo update_prebinding -force -root /
Then reboot, and that should fix it :-)
Pro-gress ;-)
Posted by Cliff
I finally have my Mac! Through a series of unfortunate events, my PC finally gave up the ghost, and with a little help from my Mum (thanks Mum!) I have a shiny new MacBook Pro. And it’s awesome. Ruby development is super fast, and actually so is everything else. It’s got a 1.8Ghz dual core Intel processor and 2GB of RAM, and I can’t make it break a sweat. I’ve already started reading the Apple documentation, and its yummy, so at some point in the future I hope I’ll be releasing some kick ass OS X software. Woo!
Dates and times in fixtures
Posted by Cliff
Just a micro tip. If you’re inserting dates and/or times into your database via fixtures whether for testing or to load initial data, it’s not enough just to specify the date. This won’t work:
some_fixture: id: 1 created_at: <%= 2.days.ago %>
You need to coorce the data into the appropriate format like so:
some_fixture: id: 1 created_at: <%= 2.days.ago.to_s :db %>
Mac Mini?
Posted by Cliff
I think I’ve decided what to do. Since my PC is quite literally on its last legs, and I can’t afford the Mac I want yet, and I need to keep Windows at hand, and I don’t want to upgrade to Vista, and I don’t really wan’t to buy a new PC just to run Windows XP for the forseeable future.. I think I’m going to buy a Mac Mini and replace this eye piercing CRT with a shiny new TFT monitor from eBuyer. A little under 650 smackeroonies for the Mac and a little under 200 for the monitor and I can run both OS X and WinXP on it with the aid of BootCamp. Can’t be bad.
Ruby on Windows
Posted by Cliff
I’ve been sitting for the past ten minutes decided whether to clear most of my Cubase projects off of my spare drive and install Debian on it. I should probably have a Linux installation around anyway, but I rarely find myself using it as a desktop nearly enough to justify the space. So why is today any different? I’ve been using Ruby on Rails for a while now, and so far I’ve somehow managed to supress my frustration with the speed of the Ruby interpreter. But I’m slowly getting to the point where I need to do something about it. On my Linux based dedicated server, it takes a mere second or three to boot up a Mongrel instance, while here on Windows it can take up to ten. Even running a simple “Hello, World!” takes a few seconds to execute in my Microsoft hell (more on that later.. suffice to say I will not be upgrading to Vista..).
So what can I do about it? Well first off I can move to another platform. Ruby is pretty swift under both Linux and OS X, but I can’t afford a decent Mac yet. Moving to Linux is a viable option, but brings with it another set of complications. For example, I use Flash, and Fireworks, and Photoshop. Nearly everything I use is either cross platform or available for multiple targets and I’ve exerted considerable effort in my ten years as a software engineer to make that happen. Sure I can use Gimp for image manipulation, but it’s not Photoshop. And the majority of the files I’m sent by designers are Photoshop files. Sure Gimp opens them now, but does it support the latest PSD format? I have no idea. What if Adobe update the format again? How quickly will Gimp provide support for it? Will I have to change my workflow again? I can work around most things. For example I just got used to using E for my Ruby on Rails work, and I really like it, but I’ve changed IDE before and I can change it again, no biggie. And a Linux version of E is planned for the future, so there’s every chance it would become part of my workflow again. But not all of my concerns are as simple as which editor I use to write my code. Most of my questions can probably be answered simply and quickly, but they will be nagging concerns in the stability of the way I work for the forseeable future.
Spyware hell
Posted by Cliff
That was not fun. I just wasted a whole day or so trying to remove some evil spyware called “Vundo”. In short, it’s a nasty little piece of crap that pops up advertisements whenever it feels like it. It’s almost impossible to remove in Windows too, because it’s actually smart enough to resist almost every possible method of removal. Don’t take that as a complement, I’m just amazed that some moron somewhere has so little of a life that they have the time and energy to waste on something as pointless as this. In fact, it amazes me in general that morons who write spyware and virii don’t turn their skills to something productive, instead of joining the ranks of the scum and vermin of the internet.
So what did I do to remove it? After trying every single tool I could get my hands on to fix it, including (but not limited to) “VundoFix”, “Vundoh”, “Spyware Blaster”, “Spybot - Search and Destroy”, “Process Explorer”, “Advanced Process Manager”, “KillBox”, “ComboFix”, “Dellater”, “l2mfix”, “SmitFraudFix”, “Avenger”, “Brute Force Uninstaller”, and “HiJackThis” - none of which could actually remove the offending worthless piece of crap - I downloaded the Knoppix 5.1 Live CD, mounted my NTFS partition as read/write, deleted the offending DLL’s myself, then used HiJackThis to remove the offending registry entries.
What a pointless waste of time, and a tribute to Linux. Saved me again.
Cybersitters suck..
Posted by Cliff
That’s all I have to say. There should be a law against it. Assholes.
Edit: I should have done something about this sooner, but I received an email a little while ago from a nice lady who pointed out that Cyber Sitters is a child minding agency in Australia and that my comments were coming up in web searches! Let me point out that while my original statement stands in the context of people who buy up ‘interesting’ internet domain names with the sole purpose of selling them on at extortionate prices, it does not apply to said agency. So to anyone who finds this post in error, my apologies ;-)
Edit: I should also point out that while I said ‘Cybersitters’, what I actually meant was ‘Cybersquatters’. Slipious tonguious. Oops.
Embedding SWF content with Ruby on Rails
Posted by Cliff
A question regarding the embedding of SWF content came up on the Ruby on Rails mailing list. In this instance, the problem was related to the tags used to embed a SWF in Internet Explorer and Mozilla browsers. Internet Explorer requires an <object> tag, while Mozilla (and most other) browsers require an <embed> tag.
Further to that, the ridiculous EOLAS patent requires changes in the way that objects are embedded in web browsers. One of the effects of this is that Internet Explorer users must now click a plugin in order to activate it (which is a problem for SWF files, especially if they are used in navigation, since two clicks are required to navigate).
There is a workaround, however, in the form of the extremely lightweight SWFObject javascript library. It is very easy to use, and actually I prefer this method of embedding SWF files since:
- There is no need to deal with
<embed>or<object>tags at all. It’s all handled for you behind the scenes. - Cross browser embedding is implied; the exact same code embeds a SWF in any browser automagically.
- Passing parameters to a SWF is trivial.
- Supplying alternative content for browsers without the Flash Player is trivial.
- Embedding with SWFObject bypasses issues caused by the ridiculous EOLAS patent.
Because of these issues, SWFObject has quickly become the de-facto standard for embedding SWF files.
I was in the process of replying to the mailing list, but I figured it would be more useful to write up a blog post for everyone. So here is a short tutorial on embedding SWF content in Ruby on Rails using the SWFObject library.
- Download the zip file from the SWFObject homepage ( direct link here)
- Extract the contents of the zip file anywhere on your machine, and copy
swfobject.jsto#{RAILS_ROOT}/public/javascripts - Include
swfobject.jsin the head of your layout file using:
<%= javascript_include_tag 'swfobject' %>
- Copy your SWF file(s) to
#{RAILS_ROOT}/public/swf - Include the following code in the body of the template file in which you wish to embed the SWF content:
You need to upgrade your Flash Player This is replaced by the Flash content. Place your alternate content here and users without the Flash plugin or with Javascript turned off will see this. Content here allows you to leave outnoscripttags.
And that’s all there is to it. More information is available on the SWFObject homepage :-)
UPDATE: Meekish kindly posted a comment pointing out a plugin for Ruby on Rails that provides a flashobject_tag to use directly in your views. More info
here. Thanks Meekish!





