Archive for July, 2007

Installing Ubuntu 7.04 in Parallels 3

I finally found a mostly successful tutorial on how to install Ubuntu 7.04 in Parallels. A straight forward install won’t work. You need to do a few tricks to get it to install. The most important thing, I found, was to set the memory at no more then 512megs. I tried with both 1024MB and 768MB and met with failure each time. As soon as I used 512MB, the tricks in the tutorial all worked. The other trick I used was to use a typical install instead of a custom one when first starting Parallels.

I also found another tutorial that shows you how to change the screen resolution once Ubuntu has been installed.

Rails Tip: Using select_tag with a collection

In Agile Web Development with Rails, they have the following code snippet for working with a selection list and a collection.

<%=
  @users = User.find(:all, :order => "name").map {
    |u| [u.name, u.id]
  }
  form.select(:name, @users)
%>

This may work when using form_for, but I could not get a similar variant to work with form_tag. Instead, I had to do the following:

<%=
  @users = User.find(:all)
  select_tag(:id,
    options_from_collection_for_select(@users, :id, :name))
%>

If you don’t include the options_from_collection_for_select method, you get some very odd HTML output.

<select id="id" name="id">
  John Smith1John Doe2Jane Doe3Jane Smith4
</select>

There may be a simpler way of doing this, but after several hours of searching, this is what I found worked for me.

Great Ruby on Rails API Site

If you are doing any kind of Ruby on Rails programming, then you must check out gotAPI.com. The site not only has the API for Rails, but it also has it for CSS, HTML, JavaScript DOM, and other technologies and languages. It is a great resource for any one creating web applications.

Cool Mac Tip - Locking your computer using keyboard

One thing that OS X misses, in my opinion, is the ability to lock the computer when you walk away. I finally found an excellent tip on how to set this up using the screensaver and QuickSilver.

Parallels Desktop creates Max/PC ads

The guys at Parallels have put together four excellent Apple “I’m a Mac and I’m a PC” like ads showing off the ability to run Windows and OS X side by side.

jEdit - set buffer format

I found a neat little trick in jEdit today. Another developer on my team sent me some Java code in the form of a single method. I copied this into my favorite editor on Windows, jEdit. The problem was that it thought it was just text. I noticed in the lower right hand corner is a section that shows the editing mode along with a bit more info.

jEdit_buffer_snippet

If you double click on this, it will pop-up a dialogue box with the buffer options. Here I simply selected Java. The result was my copied code displayed with proper Java syntax highlighting.