Excluding items from Time Machine
Leopard’s new backup system has made it virtually inexcusable for users to not have automated backup systems in place for their Mac. It can not get any easier to do this: plug in a USB/Firewire drive and slide the switch to On in Time Machine.
I’ve been using this since Leopard came out and I love having the extra piece of mind. One part of this nagged at me a little bit, which was that my virtual machines were being backed up each time they were modified. As you can imagine, this eats up a lot of disk space. The data that I am interested in having backed up from the virtual machine already gets synced up via Parallel’s Shared Folders, so it gets picked up by Time Machine.
Finding out how to exclude my VMs turned out to be a little more complicated than I would have expected. For whatever reason, I missed the options button on the Time Machine preferences window. Click options and then add in folders which will be excluded from the Time Machine backup. I store all of my VMs in one folder, so I just added it to the list. Disk usage has gone down considerably, now that Time Machine isnt copying over multi-gig files every hour.
My daughter is a stud…
A few weeks ago the Boise valley had a tremendous amount of snow… enough so that the school districts called a snow day. I had to pick up Sierra (my daughter) and we came home to play in the snow. She was really excited to do a little sledding on the tiny hill in our subdivision, but didnt have snow gear. We stopped on the way home to pick up some boots and snow pants (pink camo, of course).
Anyways, she got pretty bored with the standard sledding routine of sitting in the sled and going down the hill, so pretty soon, she was standing on the sled as she went down the hill. To be honest, I was really surprised at her natural talent. She’s usually kind of klutzy, but she did not fall over. Once she got to the bottom of the hill, she came up and did it again.
That got me thinking… maybe she and I should take a snowboard class together. I’d only been a few times, but really had fun and she looked like she was having a blast riding a sled down the hill.
Well, earlier today, we went. All I can say is, Sierra is a stud… Originally, I’d booked a one-hour class for us, but she was insisting on extending the lesson for another hour. She was on her board for two hours, and by the end of it, she was linking turns together and making it down the beginner chairlift.
A little lunch in the lodge, and she was ready to call it a day. She slept pretty much the whole way home.
Curious error with :memory_store
For the longest time I had been stumbling on errors when trying to log in to my Rails site in development mode. Production worked flawlessly, but for whatever reason, development did not. Isnt that a different thing?
Anyways, the problem was that any of the custom methods I had on my model classes were raising NoMethodError when I was trying to invoke them. The strange part was that everything worked well in script/console, and also worked in the application when I changed the method to return a hard instance, rather than one from session. After some time, I remembered that I had set
config.action_controller.session_store = :memory_store
in config/environments/development.rb. For whatever reason, :memory_store did not like storing ActiveRecord derived objects. Removing this line and sticking with :active_record_store defined in environment.rb corrected the problem.
It’s probably best to mimic the production environment as close as possible anyway.
Adding :include to all find methods
A project that I have been working on has been making heavy use of joined ActiveRecord models with the belongs_to method. By default, the find method performs a lazy load of the related objects. However, if you use the joined data quite often, it can be very beneficial to include the data in as part of your find clause. For example:
def index Model.find(:all, :include => :other_model) end
It’s quite possible that the :include option can be sprinkled in many places throughout your code. So, in the interesting of DRYing up this code, I set out to figure out a way to include the :include option on all my finds. I think I found a very elegant solution, that takes advantage of Ruby’s alias capabilities, which let you map a method to a method of a different name. Without any further ado, here’s the code:
class Model < ActiveRecord::Base class << self alias find_without_includes find def find_with_includes(*args) options = { :include => :other_model } if args.last.is_a? Hash options.update(args.pop) end self.find_without_includes(*args.push(options)) end alias find find_with_includes end # rest of your model class end
Aliasing is proving to be a very valuable tool to allow for extending functionality. I look forward to exploring this further.
TFS and xUnit Frameworks
ScottGu posted some tantalizing screenshots of the System.Web.MVC project properties that allow you to pick the target unit testing framework that you would like to use for your project. Choices in the screenshot are MSUnit, NUnit, MBUnit and XUnit. It’s quite nice to see Microsoft embrace community efforts in this project. My feeling is that the recent hiring of several prominent open source advocates by Microsoft is what is starting to change this mentality. This screenshot has been causing some favorable reactions in the blogsphere (Phil, Jeremy).
My prediction is that community supported unit testing frameworks will be integrated into the VSTS/TFS suite by the end of this year. Here’s hoping that ScottGu and Brian Harry can make this happen.
My Paperless Office Dream, 3 Months Later
A little over three months ago, I shared with my readers my purchase of the Fujitsu ScanSnap S510M. By the time I got through my initial stack of paper, I ended up scanning and shredding almost three feet of paper. Now, I pretty much open my mail over the trash can. If its something I want to keep, I run it through the ScanSnap and shred it after it’s completed. The amount of paper clutter in my life has been cut down tremendously.
Since that time, I’ve customized my workflow slightly to make it easier to keep everything backed up. Initially, I was using DevonThink as my storage. However, I migrated away from that in favor of individualo files after upgrading to Leopard. The improved Spotlight capabilities in Leopard really make finding things a breeze. Additionally, backing up a 500mb DevonThink database can take quite some time as well as considerable amounts of space. Incremental backups are not possible with the DT databases, since the database is always in a changed state. However, by storing files individually, I am able to do incremental backups (via Leopard’s Time Machine for on-site backup and Mozy for off-site backup) which takes less space and bandwidth. Lastly, the OCR engine in the bundled software (Abby FineReader) is surprisingly good and makes a nice sized PDF which is considerably smaller than what was created by DevonThink’s engine.
I’ve heard of and have considered using an application like YEP for cataloging and tagging the PDF documents, but at this point I have not pulled the trigger on that.
Lastly, I wanted to address a question that I’ve received from a few people about the paper feed problems that seemed to plague the S500M. The S510M is a new model that apparently does not suffer from the same problem. That said, as a disclaimer, I’ve only had mine for three months, but so far everything is continuing to function flawlessly.


