logo
  • Jobs
  • About Me
  • Contact
  • Home

Archive for February, 2008

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.

No Comments

My daughter is a stud…

sierra snowboarding thumbnail

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.

2 Comments

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.

No Comments

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.

No Comments

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.

No Comments

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.

No Comments
flag
Favorite Charity
wounded warrior project
Search
Social
  • mattberther on twitter
  • mattberther on linkedin
Syndication
Archives
  • January 2010
  • September 2009
  • July 2009
  • June 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • September 2008
  • August 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004
  • September 2004
  • August 2004
  • July 2004
  • June 2004
  • May 2004
  • April 2004
  • March 2004
  • February 2004
  • January 2004
  • December 2003
  • November 2003
  • October 2003
  • September 2003
  • August 2003
  • July 2003
  • June 2003
  • May 2003
  • April 2003
  • March 2003
mattberther.com © 2003 - 2010