Archive for November, 2005

Posted on November 17, 2005 at 5:38 pm

Getting ODBC working on OS X is pretty easy, but you’ll have to find the damn drivers first. First grab the newest iODBC SDK from the Software Availability page, and then grab the the Universal Data Access Drivers from the OpenLink download page. Install the SDK first, and then the drivers.

Once you’ve installed both of those packages you will have a new iODBC Administrator program in your Applications/Utilities/ directory. Open it up and add a System DSN just as you would on a Windows machine.

Posted on November 10, 2005 at 2:44 pm

I bought a copy of Better Than Ezra’s latest CD on iTunes this morning. It’s a great album and is much closer in style to their first album Closer, than to their last couple. I’ve always loved Better Than Ezra and I still remember singing along at the top of my lungs to Rosalia when they played at the Salem Amphitheater. Good music makes me happy.

Posted on November 7, 2005 at 3:56 pm

I cobbled together a “what I’m listening toâ€? page in about 20 minutes over lunch. It shows the 10 most recent songs I’ve listened to in iTunes. It’s “mostlyâ€? live data. It refreshes every 15 minutes or so.

Posted on November 3, 2005 at 4:28 pm

Want to churn through Microsoft Exchange logs for some statistics? Here’s a few short programs you can use.

Count of inbound SMTP messages:

puts File.open('20051103.log').grep(/^([^\t]+\t){8}1019/).size

Count of outbound SMTP messages:

puts File.open('20051103.log').grep(/^([^\t]+\t){8}1031/).size

Count of locally delivered messages:

puts File.open('20051103.log').grep(/^([^\t]+\t){8}1023/).size

Count of inbound SMTP messages from a bunch of log files:

counts = Array.new
Dir.glob('*.log')  do |f|
  counts < < File.open(f).grep(/^([^\t]+\t){8}1019/).size
end
puts counts.inject {|count,n| count + n}

Try my full Exchange log parser if you want something more robust. And don’t laugh. It was my very first Ruby program.

Posted on November 1, 2005 at 10:01 pm

So, I was playing with the in_place_editor helper in Ruby on Rails this evening. When I went to look for documentation on how to re-style the editor I couldn’t find anything about it on the web. Armed with documentation on the scriptaculous inplaceeditor function, the actual scriptaculous.js file, and a little help from the Firefox web developer plugin I was able to figure it out pretty quickly. Here’s so everyone doesn’t have to figure it out on their own. I also created a new page on the official RubyOnRails wiki:
HowToStyleInPlaceEditorWithCss

The form itself is given a class of inplaceeditor-form and the other elements don’t have any classes. Because of this you need to use an exact attribute value selector, which you don’t see very often, on the input text field. Here are the css elements and what they do:
This will style the entire in_place_editor form:

.inplaceeditor-form input { }

The text input field:

.inplaceeditor-form input[type=text] { }

The textarea input field (if you use a :rows value greater than 1):

.inplaceeditor-form textarea { }

The cancel link:

.inplaceeditor-form a { }