Saturday, December 22, 2007

NTFS Symbolic Link

I almost hate to say it, but the more I use Vista for my day-to-day work the more I hate it less. Yes, that was a lot of small hates.

Vista now supports symbolic/hard links like POSIX systems do (*nix, bsd, etc). This is amazing, as I use them like crazy on my Ubuntu and Leopard machines.

It's as easy as:

C:\>mklink /d bar c:\windows

More info: http://en.wikipedia.org/wiki/NTFS_symbolic_link

I stumbled upon this while trying to set up the Zune software and iTunes (on Leopard) to pull from the same music library ... on yet another machine. On Leopard, I simply put a symlink to where my music library is mapped, so it looked something like this:

$/Users/jimmy>ln -s /Volumes/jimmy/Music/iTunes Music/iTunes

This requires I have my shared library mounted to that volume already, so I created a little automator script to mount smb://jimmy-zeus/jimmy to /Volumes/jimmy.

In Vista, this is simply one step. You can make the symlink directly to a SMB file-share! (Please someone correct me if you can do this in *nix ... I'll promise to feel like an idiot =P).

C:\Users\jimmysch>mklink /D iTunes \\jimmy-zeus\jimmy\Music\iTunes\iTunes Music

Pretty freakin' cool!

[Update] Ok, maybe SMB file-share symlinks aren't so cool; as explorer.exe doesn't understand them and will hang the UI if the server doesn't respond right away when navigating to a folder with ANY SMB SYMLINK'd FOLDERS! And if you don't have access to the server ... you must wait for the 60 second timeout to get control of the window again. Ugh. Use wisely ...

Thursday, December 20, 2007

For those of use who *have* to use Internet Explorer

http://ie7pro.com/ This IE7 add-on adds some familiar features from Firefox, like better tab management, text field spell checker, crash recovery, and inline search! It adds a bunch of other features, but it makes using IE much more *familiar*. =)

Sunday, December 16, 2007

Countdown to Lang.NET 2008

Are you a compiler/language implementer? Intrigued by the DLR, Volta, or other Microsoft language technology? Want to find out how others are implementing languages in browsers, *nix platforms, or Java? Yes? Great, sounds like you'll love Lang.NET! January 28-30. Microsoft Redmond Campus. Lang.NET focuses on the things you care about; designing, implementing, and building tools around languages. We'll have talks from developers doing all sorts of language-related work, and most won't be from Microsoft employees. This is the second Lang.NET Microsoft is sponsoring, after a great turnout at the first Lang.NET in the summer of 2006. http://langnetsymposium.com has more verb-age on exactly what Lang.NET is. The speakers and agenda are still being worked out, but I'll let you know when they are available on the website (later this week). All the information is available on the website. Registration is still open, so please register today! (aka. send an email to langnet_at_microsoft_dot_com). Registration is closed!

Upgrading Assistment to Rails 2.0

image linked from b.lesseverything.com
Today I spent some time upgraded Assistment (http://assistment.org) to Rails 2.0. I made the mistake of upgrading Rails before changing anything, and then fixing the errors one by one ... oy. So, I'll quickly go over what I had to do to get stuff working again.
Fix deprecation warnings in 1.2.6
If you haven't upgraded yet, make sure you're on Rails 1.2.6 and get rid of your deprecated API calls: http://www.rubyonrails.org/deprecation. To easily find your deprecated usages grab the rake task from this site: http://www.slashdotdash.net/articles/2007/12/03/rails-2-upgrade-notes. And of course, make sure your tests pass and your app actually runs before moving on!
Keep in mind some pretty useful parts of Rails have been pulled out into plugins, which you can find at http://svn.rubyonrails.org/rails/plugins/. I had to install acts_as_list, acts_as_tree, classic_pagination (though, we really need to move to will_paginate!), and in_place_editing. I also had to spend time updating my forms to use the block-notation rather that start/end form tags. That was annoying. One plugin I had trouble with was acts_as_paranoid. It calls construct_count_options_from_legacy_args, which is deprecated, but I have not found an update to the plugin. To fix it, I had to add that method to the plugin. I left the deprecation notice in there to remind me to fix it =) Also, if you used strip_tags in your model (shush, I had my reason: I used it since I stored HTML in the database and I wanted a nice way to clean it), you have to include ActionView::Helpers::SanitizeHelper in your model; just including ActionView::Helpers::TextHelper won't cut it.
Upgrading Rails
gem update rails
should do the trick for upgrading you. I had some problems upgrading on Leopard, so I had to gem remove rails and the active*/action* gems before running "gem install rails". Even that failed the first 2 times with 404 errors for finding certain gems, but the 3rd time it worked.
rake rails:update
Run that in your project to upgrade your configs, javascripts, and scripts. I took the extra step and generated a new rails project and merged any new config changes into Assistment. This was mainly environment.rb, and the extremely useful addition of a initializers directory for application config.
Running Two point Oh!
(Note: to use ruby-debug you don't need to manually set it up in environment.rb. Simply run ./script/server --debugger to enable debugging with the "debugger" method. Yep, that simple.) Run your app/tests and your on Rails 2.0! If anyone has any additional issues, google is your friend.