- 
      
ActiveRecord database :default "gotcha"
Note to self:
When a table column has a default value, such as for the
type_categorycolumn/attribute like so:t.string :type_category, :limit => 20, :nil => false, :default => 'tv'a new instance of your ActiveRecord model will try and set the defaults from the database. Meaning:
Anime.new => #<Anime id: nil, type_category: "tv"...Courtesy of this in ActiveRecord::Base:
def attributes_from_column_definition self.class.columns.inject({}) do |attributes, column| attributes[column.name] = column.default unless column.name == self.class.primary_key attributes end endSo, don't get confused when your model validations (
validates_presence_of :type_category) don't seem to work when testing:it "should require a type_category" do @foo.attributes = valid_foo_attributes.except(:type_category) @foo.should have(1).error_on(:type_category) # doesn't work since @foo.type_category = 'tv' endExplicitly set it to nil or a blank value.
Sounds silly, but it's a true story.
 - 
      
What's new in Firefox 3: Download Resume
This is not exactly a new change to Firefox 3's nightly builds since the bugs have been setting in my browser tab bar for about a week but I figured I'd write about them anyway since it's quite a nice improvement.
What's new? Download Resume - now you can pause and resume your downloads in the Firefox Download Manager. Implemented by a Summer of Code student, this brings Firefox's Download Manager up to speed with Safari (which has a really nice download resume feature that leaves
.downloadfiles that you can just double-click to resume the download).
You'll notice the insane speeds (986GB/s) I'm getting too in that last screenshot. Nope it's not a feature, it's a bug. And a known one that's probably fixed if you have a recent nightly.
For Firefox 1.5 or 2 users, don't despair, extensions like DownThemAll! allow you to resume downloads. If you use an external download manager, you'd probably be more interested in FlashGot.
 - 
      
Moar wiurd SSIDs
Following my previous post on SSIDs, I saw this today when I fired up my MacBook on the bus:

Some of the ones I liked from the comments are:
- broken
 - youneedbettersecurity
 - INTERNETS THROUGH THE AIR
 
Have you seen any amusing SSIDs today?
 - 
      
"Open in Tabs" fixed in Firefox 3, at last
The last time I blogged about Firefox's "Open in Tabs" behavior was 3 years ago in September 2004. Open in Tabs is quite a cool bookmark feature where you can open a folder of bookmarks.
Unfortunately, some of us felt that there it had a flawed implementation. Here's how you can see it for yourself:
Here, try this in a new Firefox window. Open up 4 tabs. Make sure that there’s nothing in these tabs that you want to remember to come back to later, especially the last 2. Now try using "Open in Tabs" on a bookmark folder with just 2 bookmarks. What just happened? Firefox has closed the last 2 tabs and loaded the first 2 tabs with the first 2 bookmarks. Well, actually this is not so bad for the first 2 tabs, because you can use the "Back" button to go back to your page should you want to, but the tabs that were closed are lost.
It was then rather unfortunate that this bug was closed as WONTFIX. I was thus surprised to see a patch for a similar bug land in the Firefox 3 trunk about a week ago (I haven't had time to blog about it until now!)
This change in Firefox 3 means that "Open in Tabs" is no longer a destructive proposition - a "use existing tabs and append" strategy is employed.
Here's how it looks like graphically (which I expect would be easier to understand compared to aforementioned "use existing tabs and append" strategy). Let's start with 4 tabs, with the Google, Ruby on Rails, Facebook and jQuery websites loaded:

I have a bookmark folder with 2 bookmarks (to the Firebug and Prototype websites) in them:

If I click on "Open in Tabs" in Firefox 3, I end up with this:

Notice how the Back button is enabled on the Firebug tab (allowing us to go back to the Google webpage), and the Prototype bookmark is loaded in a new tab after the Firebug one.
Small little tweak you may say, but it's all these small usability tweaks (like the recent Password Manager improvement) that promise to make Firefox 3 a much better browser.
 - 
      
Dugg? No problem with WordPress
An old post I wrote on a spoof MMORPG named "Outside" was Dugg not too long ago and I was quite pleased to find that my server and the blogging software (WordPress) that I use was handling the load extremely well. Quite obviously I was getting more hits in a day than entire months:

My setup is a Virtual Private Server (VPS) with 256MB RAM hosted at SliceHost and this blog is served off Nginx and PHP FastCGI processes to handle PHP scripts. The wonderful (because it just works and is really easy to setup) WP-Cache WordPress plugin keeps a cache of pages that's swept at logical times (i.e. whenever there are any updates or comments).
I may be a Rails/merb fanboy, but this awesome piece of blog software that can stand up to the Digg Effect with ease is great. WordPress
FTW! 
subscribe via RSS