Since the FreeBSD torrent tracker has been taken offline, and it appears that it won’t be coming back, you may be able to use a magnet link, so here they are. Each magnet link announces to three public trackers, to try and increase the size of the swarm.
If you try to install (or update) the sqlite3 ruby gem on FreeBSD, you might get the following error:
sudo gem update sqlite3
Updating installed gems
Fetching: sqlite3-1.3.5.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/sqlite3-1.3.5 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out
Nothing to update
The gem doesn’t include the correct locations to check for the sqlite3 headers, so we’ll have to tell it where to look ourself:
After an intermittent failure of my previous ADSL router, I thought long and hard about whether I could justify spending many hundreds of pounds on a nice Cisco 1800, I decided to go cheap and buy a bottom-of-the-range Netgear. After all, I’d had Netgear routers in the past, with few problems. So I bought the Netgear DGN1000.
The best thing about this router is that it has a power button. This is useful because you’ll be using it a lot.
The biggest problem with this router is that it randomly stops routing data between the WAN and the wireless network. Or sometimes it does route data, but at around 1Kb/s. Sometimes this failure to route data happens after several hours, sometimes it can happen within minutes. The only resolution is to reboot the router.
So apart from the constant failures, it’s fine. Except the automatic firmware update doesn’t work (it fails to recognise that there’s a newer firmware available), and WPS doesn’t appear to work at all.
This is the first piece of IT hardware I’ve ever felt like driving over in my car.
On this occasion I’ll return it as faulty instead.
The BEA released a briefing about the loss of Air France flight 447 today. The flight involved a descent of 3 minutes 30 seconds, during which the aircraft was stalled. All 228 on board lost their lives. The briefing specifically says
the engines were operating and always responded to crew commands.
Earlier in the day, the Daily Mail published an article with the headline “Terrifying final moments of doomed Air France flight revealed: Passengers endured three-minute plunge before crash”, and the sub-headlines include “…engines began to fail…” and “…engines stalled…”, so it’s downright incorrect.
Don’t worry though, because they’ve corrected it. The headline now says “FOUR MINUTE plunge”. Rounding up is better than rounding down, after all, and the use of capitals emphasises the difference. The sub-headlines mentioning engine failure are still there though. I wonder if it will ever be corrected.
The Daily Mail try to have a laugh at the expense of The Independent in this article.
The article points out that on The Independent’s site you can alter the URL as long as you retain the article number. Of course, The Independent “were embarrassed”. Ho ho, we’re The Daily Mail, other newspapers aren’t as good as us and all that…
I wonder if the journalist who wrote the article (it’s not even credited to Daily Mail Reporter) thought to try it on the Mail’s website.
As long as you retain the original URL up to the final “/”, and the “.html” at the end, you can put almost anything in between them (no spaces, no apostrophes) and you’ll be redirected to the original article.
So you’ve decided to rename a model in Rails. What could be simpler than renaming and editing a bunch of files? You make your edits in development, run migrations and so on.
There’s a potential issue you might hit though. Suppose you have model Foo, which you want to modify (e.g. add a column). So you create a migration with: add_column :foo, :quantity, :integer
…and you run your migration.
Then you decide you want to rename the model to Bar. So you use rename_table in your migration, and rename and edit the appropriate files. All works beautifully.
Now you come to deploy, and it all goes wrong when you migrate the database, saying it can’t find the model. The reason? Well your first migration now refers to a model that doesn’t exist, because the new model file is in place.
The messy solution is to perform the migration yourself, by renaming the database table directly in the database.
The clean solution is to avoid making changes like this in the first place. I guess it’s an example of where “deploy often” can reap benefits.
When renaming a model in Rails (2.3), there are a range of files you may need to change:
Create a migration to rename the database table:
(rename_table :oldname, :newname)
Rename the model.
Edit any associations in other models.
Rename the controller (if required)
Modify any links in views.
Rename the model in controllers and views.
Rename and modify any tests.
Moral of the story – name your models correctly from the start. Keep them as generic as possible. This post came about because I initially had a model for appointments for training sessions, so the model TrainingSession was created. Then I needed to store appointments which were for a different type of session, but I kept the model name the same, as it was only seen internally, and used a named scope. Now I need to store appointments of any type, so having code referring to TrainingSession will still work, but it makes it counterintuitive to refer to generic appointments as TrainingSession.generic. Instead, Appointment.generic and Appointment.training are so much more logical.
I’ve long been a fan of BBC’s Grumpy Old Men. Almost everything that is complained about is something you can sympathise with. However, tonight, for the first time I noticed that they class Grumpy Old Men as being from 35 to 54 years old. Given that I’ve only got two years until I fall into this bracket, I’m not sure whether I should be offended by this, or actually feel a little bit proud.