13 February 2008

Auto-Complete Text Fields in Rails 2

[Note: this entry updated to include required routing, as I failed to mention that the first time.]

In Rails 2, the PrototypeHelper and ScriptaculousHelper code was removed to plugins. This means that doing auto-complete for various fields was no longer part of the base Rails. I didn't find any great, straight-forward docs on how to do this for Rails 2.x, so am sharing what I've done to hopefully help others. Further, the README for this tells you how to do it for standard string fields on a given object, but I needed to do it for an associated object field, so I'll cover that here as well. As you can guess, this only pertains to Rails 2.x...

First you'll need to install the auto_complete plugin:

script/plugin install auto_complete

This plugin will give you the text_field_with_auto_complete view helper method amongst others. It also provides a controller hook ( auto_complete_for) to implement the auto-complete action/method in your controller for you, if that works for the field you need. As per the auto_complete README, it looks like:
class BlogController < ApplicationController
auto_complete_for :post, :title
end

auto_complete_for, as used above, would implement a auto_complete_for_post_title method in your controller class. The parameters are the object and field/method of that object. The method it implements will dig through all the Post records in your database and do a LIKE comparison on the title column, comparing the title to the contents of the post[title] form field. With the results, it will generate the HTML for an unordered list (ul), and return that to the view.

This is pretty slick: you can essentially get auto-complete with a view method name change in your HTML (from calling text_field, to text_filed_with_auto_complete), and a single line added to your controller. Now, what happens if the field you want to auto-complete on doesn't directly correlate to a field on your model object? For example, in my case, I wanted to auto-complete on a field from a belongs_to association, so I couldn't use the pre-built auto-completion method that does a direct SQL query on the field.

This is actually easy to solve. You can just implement the auto_complete_for_object_field method yourlself. And, while you're at it, you might as well leverage some of the other helpful methods in the auto_complete plugin. Or, if you need custom view/HTML output, you can just render as you need within that method. When you do this, do not call the controller hook, simply implement the method yourself. Here's mine for example:
def auto_complete_for_doctor_organization
re = Regexp.new("^#{params[:doctor][:organization]}", "i")
find_options = { :order => "name ASC" }
@organizations = Organization.find(:all, find_options).collect(&:name).select { |org| org.match re }

render :inline => "<%= content_tag(:ul, @organizations.map { |org| content_tag(:li, h(org)) }) %>"
end

Finally, for completeness, here's the field's definition in my view template (Erb):
<label for="organization">Group/Practice/Hospital Affiliation</label>
<%= text_field_with_auto_complete :doctor, :organization, :autocomplete => "off" %>


The one counter-intuitive looking thing there is the :autocomplete => "off" bit. Uh, aren't we doing autocomplete? Well, this particular attribute tells the browser to not do it's auto form completion stuff (so that our code can do it instead). Oh, and of course you need to ensure you are including Prototype and Scriptaculous JavaScript libraries in your views, which you can achieve, rather bluntly, with:
<%= javascript_include_tag :all, :cache => true %>


Finally, you will need to add route(s) to your routing file. I use a sort of wild-card route to cover all my auto-completes:

map.auto_complete ':controller/:action',
:requirements => { :action => /auto_complete_for_\S+/ },
:conditions => { :method => :get }

This will resolve any routes that match an action starting with "auto_complete_for_".

With that, we have auto-completing text fields in Rails 2.x! Cool stuff.

10 February 2008

Facebook and Business

I was, and am still slightly a Facebook skeptic. I did not use it in college (it didn't exist "back then" ;-) And, it's just not something I use much, yet. But, I won't deny the incredible viral effects it has. And, I am actively working on Facebook applications (or integrations with existing sites).

I came across a great blog entry, Collision of the enterprise and web 2.0, which talks about how Facebook is being used for business more and more, and how the lines between your friends, and your "business associates is blurring. I couldn't agree more. Besides, I'm both friends with and business associates with many of the same people, a lot of them in fact.

One of the main things that has prevented more use of Facebook for me is simply the lack of "useful" applications. Zobies and movie quizzes are just not something I have time for, or rather, want to spend my time on. But, as productivity, business, and other such "useful" applications start to enter, it won't surprise me at all if I use Facebook a lot more. It is a good social and network property, and downright easy and nice for doing the social networking aspects. So, here's to seeing how Facebook's application space grows going forward.

08 February 2008

My Dock, Too Many Browsers, Fluid, etc.

As may be obvious to readers of this blog, I've been doing a fair bit of Facebook development work lately. As such, I need to have multiple Facebook (test) users to observe the social net aspects, etc. I thus have to have multiple browsers open so they can all be logged in at the same time. I am really hoping that a future version of Fluid will allow you to have a separate cookie store per Fluid app, so that I can just create Fluid apps for each FB user. But for now, I can't, so I have at least two, if not three, sometimes four different browsers open to do testing.

I also have been somewhat amused that my dock now consumes almost the entire width of my 24" monitor (1920x1200 resolution)!

Fullscreen
Uploaded with plasq's Skitch!

Oddly, this isn't bothering me a bit. I make good use of LaunchBar, but I'm still a Dock fan as well. See the Skitch page for a list of what some of those dock icons are.

And a geeky tip for Screensaver developers: drop your debug and/or release versions of your saver into the documents area of the dock as an easy way to install it (that's what the two swirly white document images are at the far right of my dock).

07 February 2008

Asynchronous Tasks in Rails

On the blog Play/Type, there's a great article on how to do asynchronous tasks in a Rails app. Furthermore, they've built a Rails plugin, Workling, that encapsulates asynch tasks and provides a wrapper around Starling, Spawn, and others, making these easy to use.

I came across this tonight as I was figuring out a solution for spawning off Facebook profile FBML updates in the background since these can do a fair bit of data gathering. It is also useful in controllers used in a Facebook app, because while you never want your apps' actions to take more than 8 seconds regardless, if they do for Facebook, Facebook will simply fail to load the page. Therefore, if you have an expensive operation that can occur asynchronously, but is initiated by a controller, this is another place to leverage something like Workling.

For my own needs, I didn't wind up using Workling, as Spawn was sufficient for my needs at this time. Before I go to production, I may switch to Workling simply to provide future growth in case this Facebook app takes off, etc. This will be one to watch for sure.

04 February 2008

Testing Facebook Applications With Test Facebook Users

Facebook's terms of service don't allow "fake" users, or user's who aren't associated with a human. This makes it harder to test Facebook applications which aren't published. However, they do provide a mechanism to mark an account as a test user account (see the Test Accounts wiki page). It falls under a bunch of different rules, some of which make things slightly challenging. For example, non-test user's cannot be friends with test users. This means in order to use a test user, you will have to create at least two of them, so they can be friends. Doesn't exactly parallel real life does it? :)

So, the next problem that crops up, is that you will want to register your developer app using a real account, but if real accounts and test accounts can't be friends, how do you share that app? This is not obvious, but you can extract how to do it from the questions at the bottom of that Test Accounts wiki page. Here's how I set it up (these are streamlined instructions as I had to futz around a bit before seeing how to work with the limitations):


  1. Create two new user accounts on Facebook. You'll obviously need a valid email to go with this. I run various domains so just setup users in that, but you could use a Yahoo account or whatever.

  2. Add the Developer application to each of the test user accounts. This is required in order for them to use your application which is still in development and not public.

  3. Have these users become friends now if you like (they can become friends later as well). Also, have them be friends of the user you have that registered your Facebook application.

  4. In your real user account that has the registered app, make the test users developers.

  5. In one of the test user accounts, add the application. I start with just one, as I often want to test the Invite mechanism for the application.

  6. Now mark the test accounts as test accounts using the URL provided on the Test Accounts wiki page.



Now you're set to have your test user's be what you use to test your application, allowing you to do invites, post messages to the mini-feed, and so on, and see how this works across friends. Hopefully Facebook will improve this in the future, as per various suggestions on the wiki page.

03 February 2008

Take the Red Book

The latest issue of Wired has an article by Clive Thompson titled, Take the Red Book. The article, available on Mr. Thompson's web site struck a chord with me. I have not been a big reader of SciFi, but I've noticed that over the last couple years, I've been reading less fiction, and amazingly (to myself), a lot of non-fiction. I think his article resonated because I realized that I have been a bit bored with some of the fiction as well. Further, his article got me to read Cory Doctorow's, After the Siege, which is a great short story. It is also not crazy out-there SciFi.

I've read William Gibson's two latest books, er, scratch that, I'm still in the middle of his latest, and honestly, I don't think I'll finish it. Granted, these are a departure for him, and are not SciFi, but IMHO, aren't that good. I liked some of his earlier work, and I know he's highly regarded, but a lot of it was just too far out there, too much tech. I've read Snow Crash, various Heinlein, Asimov, Douglas Adams, etc. And actually, while I haven't read all of his works, Bruce Sterling's Heavy Weather is an absolute favorite, that was right up my alley. And now, having read After the Siege, and based on the Take the Red Book article, I'm thinking I need to get back to some SciFi, and just try some different authors. Recommendations?

Delete an S3 Bucket Containing Thousands of Files

A backup bucket I had on Amazon S3 (via Jungle Disk) had gotten out of control and was costing me too much. I decided to kill it off completely and take a different approach. So, I wanted to delete the bucket. I thought, easy, I'll just use Interarchy, pick the bucket, hit delete and be done. Nope. Interarchy kept choking on some of the files. I tried a few times. Turned to Transmit, failed as well. So, instead, a few lines of Ruby, via the aws-s3 gem, and I was done, with one caveat.

Assuming you have the aws-s3 gem installed, I just used IRB to do it. First there was setting up the connection, and then finding the bucket in question:


require 'aws/s3'

AWS::S3::Base.establish_connection!(:access_key_id => 'put-yer-key-here', :secret_access_key => 'put-ye-ole-secret-key-here')

# Find the bucket the blunt way, by getting a list of the few I have, then picking the particular one (for me it was the second one in the array):

buckets = AWS::S3::Service.buckets
evil_bucket = buckets[1]


Then, you need to blow everything away. According to the docs, you should just be able to delete the bucket, passing the ":force => true" option, but that didn't work for me - it complained that the bucket didn't exist. So, instead I decided I'd delete everything in the bucket using the Bucket#delete_all call. That appeared to work, but it wasn't actually empty. Then I found that the library only pulls down 1000 files at a time (this is a standard S3 limitation in a listing call - although you'd think the library would realize this and loop until it was truly done), so it was only deleting 1000 files. So, the trick then was to do:


while !evil_bucket.empty?
puts "."
evil_bucket.delete_all
end
evil_bucket.delete


I have the puts in there, simply to observe progress (and it's also sort of fun to see how many files there really were). Obviously this is quick and dirty, but it wound up being far more effective, and nearly as simple as I had expected Interarchy to be. One note, if you do have a lot of files, this is not something that goes quick - it was taking about a minute per 1000 files (i.e. per delete_all call) on my system.

28 January 2008

Alpine Navigation DVD's: Alpine are idiots

We have a Honda Odyssey which has an Alpine navigation system in it that runs off DVD. They only update the DVD annually. Fine. But get this, they prioritize new cars, sitting on a dealer's lot over their existing customers who are actually using the darn thing every day! No joke.

I called and talked to them today about it, and that's what I was told. They told me that until that process is done, only dealers can order the DVD (it's been out since the fall of 2007), and only once all the dealers have done it will they make it something you can order on the web site.

How ridiculous is this in this day and age? It's a DVD, burn a few more, or heck, burn on demand! I fail to see how there is any logic, any value to their customers, etc.

27 January 2008

RubyCocoa Rocks

My infatuation with RubyCocoa continues. I've been working on a small app for the Building Web Apps folks. I'd originally been tasked with a feature that was to be done 100% within the web app. However, some of our requirements changed, and the workflow was not efficient enough. So, essentially what we moved forward on was a desktop Mac application that could interface with NetNewsWire, as well as the Building Web Apps site. The desktop app gives us a faster way to add data into the system - rapidly processing a ton of content and injecting what is desired into the web app, yet without getting slowed down by a web app interface. AJAX or Flex, or some other web UI tech wouldn't make it any faster in this particular situation.

Thus, I pursued building a Cocoa app, but this time using RubyCocoa. I've written Objective-C apps before, and spend the bulk of my time in Ruby, but this was my first opportunity to use RubyCocoa. The combination, much like JRuby, Jython and other hybrid systems, gives you "the best of both worlds." There are cons of course (slower, a few Cocoa things you can't do, debugging is harder, etc.), but for the most part, it's really nice.

For me, the infatuation stems from letting me use the aspects of each system that I am either more efficient with, or that are easier for a particular piece of functionality, all yielding a faster, and better end result. I can iterate on the app more quickly, and get a solution to BWA faster. And, one step further in the case of RubyCocoa: having the native OS integration abilities at hand.

What's been great is the ability to use Ruby's more effective (for me at least) string processing, XML processing, and networking features; create a native Mac application - using any cool Cocoa/native features; and support for AppleScript, which was critical for this particular application. This latter feature ruled out using something like Adobe Air.

This evening I setup the second use of AppleScript/Apple Events in this app: registering a custom URL protocol for the app. Applications like Pukka and Mailplane do this. What for? Well, in this case, it allows me to create a web browser bookmarklet, that can send data from the browser to our app. It also means that it works in basically any browser on the Mac (as opposed to AppleScript not working for Firefox). Further, it allows a simple "push a button" in the browser to send the data over to the app, as opposed to having to switch to the app, pick a menu item to pull the data, or horror of horrors, copy-paste.

How do you do this? This article is short and covers how to do it in Objective-C. It's just as easy in RubyCocoa: You need to add an entry into your Info.plist file to specify the name of your URL protocol as described in the article. Then, you need to register your app as a handler for that protocol:


NSAppleEventManager.sharedAppleEventManager.
setEventHandler_andSelector_forEventClass_andEventID_(
self, :getUrl_withReplyEvent, fourcharcode('GURL'), fourcharcode('GURL'))


The fourcharcode method is my way of translating four character codes for use in Ruby. I discussed this in more detail in my last post about RubyCocoa, but here's the actual method for your pleasure:


def fourcharcode(character_code)
character_code.unpack('N').first
end


Ok, so now that you've registered your app to handle its custom URL protocol, you will get an Apple Event sent to you with the URL whenever one is opened. This is handled (as per the parameter in the registration function above), by the getUrl_withReplyEvent method:


def getUrl_withReplyEvent(event, reply)
url = event.paramDescriptorForKeyword(fourcharcode('----')).stringValue
# url now contains the complete URL as a string
# do your processing of the URL/content...
end


That's it. Pretty cool eh? Handling events from NetNewsWire is almost identical (register for them, write a handler function).

And, one more great thing I could integrate: Sparkle. Sparkle is a superb Cocoa library that does automatic application updates. It checks the web for a newer version of your app, downloads it, and installs it. Integrating it is simple, and in fact, depending on your needs, you don't have to write a single line of code. The only code I wrote for it was actually a Rake task to build the appcast and upload it to the server. Slick.

All this could only be done as a native Mac app, which means Cocoa. But, as said above, doing it with RubyCocoa gives me access to all these abilities, yet, I can do all the more heavy string and XML processing I need to do using Ruby, which is much more effective for me. Also, the web services calls and code is a lot easier for me to do in Ruby than Cocoa.

Furthermore, this is plain fun! Unlike some, I feel desktop apps still have a place, but love webapps at the same time. With RubyCocoa I can build super cool Mac apps, but do so in a language I'm happier using, yet have the power of Cocoa available to me. For me, some of the best "applications" these days are such hybrids: a web app that does your primary data storage, and gives you access to the app from "anywhere" (i.e. anywhere you can get to a browser and net connection), but a desktop app to use most of the time for faster interaction, potentially better integration on your desktop system, and so on. It's the same reason I use Mailplane (desktop app for Gmail), or PackRat (desktop app for Backpack). I suspect it's the same reason we're seeing other solutions like Adobe Air, or Google Gears. Technology is so cool, isn't it?!

18 January 2008

Building My First RubyCocoa App - Some Notes

Today I started work on my first app built using RubyCocoa, which is now a first class citizen in MacOS X 10.5/Leopard. I had read the docs and tutorial found here. I proceeded, and ran into a few bumps along the way, so here are some notes maybe someone else will find useful...

The code for the example app RSSPhotoViewer, is not quite the same as that shown in the tutorial. Specifically:


  • The tutorial says you need to put "ib_action :method_name" after your methods that are Actions. The example code does not do that, and I found I didn't need to do it either.

  • The example code does not require osx/cocoa or include OSX, yet I had to do this in my Ruby source code in order for it to recognize the class names properly (or at least so I didn't have to prefix them with OSX).



I couldn't get Interface Builder to recognize my Ruby window controller class - i.e. it didn't show it's outlets and actions. I tried a variety of things here, but basically I finally had to go to the command line and run "rake" and let it do a command line build. I have no idea what that did differently, as I can't see any new files it generated, etc., but that resolved it - now IB can see all my outlets and actions.

My app wouldn't run, and I got a strange error in Xcode saying "The debugger is still running" etc. It appears that if your app crashes this will be the case. And, in this case, Console is your friend. Open up Console and you should see messages that will help you assess what's gone wrong.

And now for the win... dealing with Apple Events. My app wants to receive a particular apple event from NetNewsWire. NNW documents this protocol nicely, however, when registering as a handler for the event (using NSAppleEventManager.sharedAppleEventManager.setEventHandler_andSelector_forEventClass_andEventID_), you need to pass in the class and event ID that are not standard ones (they're defined by NNW/external blog protocol). Well, in Cocoa code, these are just a four character string, but as I found, a string that an unsigned long via string packing. So, it was a question of how I get these ID's in via Ruby. Luckily this turned out to be rather simple, as you can use String#unpack. And, in this case, you pass unpack "N" as the format, which is an unsigned long packed in network byte order.

Lastly, debugging. As mentioned above, Console and such are your friend. I haven't tried any shenanigans with ruby-debug or such from the command line, so that might work. But, Xcode can't debug into the Ruby code in your project (it can into the code in main.m just fine though). So, if you have weird crashes and such, check Console. Also, use NSLog, or pop alerts or what not. If someone knows a better way please do tell.

Regardless, I'm quite excited by RubyCocoa and have another couple apps that I may do with it. This app was a small one, and of course is not done in just a couple hours, but it's going to be a nice addition to the tool belt.

17 January 2008

Sending SMS (Text Message) to Your Phone Using Ruby and iChat

Tonight I took a bit more of a look into the various Scripting Bridge and RubyOSA features in MacOS X 10.5/Leopard. This originated with a quick bit of research on a script that would pull data from the current article being read in NetNewsWire, and send it off somewhere else. But then seeing a Tweet from a friend, and how he's using Twitter and such, I thought, why not just send SMS directly (more robust in his case). This led me to the fact that the latest iChat can send SMS's, and knowing that I could drive iChat via Ruby (instead of AppleScript), I investigated.

With no further ado, here's a simple script to send an SMS to a phone that's in your buddy list (i.e. you've had to sent an SMS to it from iChat previously):


require 'rubygems'
require 'rbosa'

ichat = OSA::app('iChat')
myphone = ichat.buddies.select {|buddy| buddy.name == "+18005551212"}.first
ichat.send2("from ruby!", myphone)

Obviously put in the correct phone number. You'll need to install the RubyOSA gem:

sudo gem install rubyosa

Anyway, I think this is pretty cool. One other thing I learned was that you can leverage a neat tool called rdoc-osa that will generate rdoc for a scriptable application! For example:

rdoc-osa --name iChat
open doc/index.html

This will generate the docs (placing them in a directory called "doc" in your current directory - you likely want to put it elsewhere if you plan to keep it around), and then the second command obviously will open those up in your browser. The docs are more of a way to get started, and you'll likely want to combine those (for the Ruby syntax/naming), with the docs from the app's scripting dictionary (pull that up by running Script Editor, and then opening the scripting dictionary of the app you're interested in).

I should note, you can also do this via the osx/cocoa Ruby library, if for example, you have a full fledged Cocoa app written in Ruby (another super cool thing introduced in/built into Leopard). But, I find using the RubyOSA stuff just slightly nicer if all you are doing is driving an app via scripting, and aren't doing Cocoa stuff.

11 January 2008

Things: the Ultimate Todo/GTD App?

I've finally struck gold when it comes to a todo list/GTD app! I've recently switched to a new Mac app called Things, and I couldn't be happier. Finally, a system that works the way I do, is fast, looks nice, and has everything I need. Things is produced by Cultured Code, who also happen to make the excellent Xyle Scope product.

For the longest time, I used Backpack to manage my todo lists, and I've worked in a semi GTD way. I originally chose Backpack as it was relatively simple, I was using it for other things, and it provided access to my lists anywhere I had access to the 'net. When I was working at Adobe, and had many computers, plus my home machines, this was valuable. But, I disdained having to always keep a browser tab open for it, and have it mixed in with other browser use. I started working on an Apollo app to have a dedicated system for it, but that was in the early days of Apollo when the HTML view was buggy and prevented this app from working effectively. Along came Packrat and solved it, making a dedicated Backpack app, as well as providing offline storage, and much faster access. Yea! I still use this combo today, and that will be the subject of an upcoming post. But, alas, I was not happy with my todo system.

Now that I'm using essentially a single machine, and I wanted further speed for this commonly used app, as well as a better overall functionality, I started looking. This was stimulated when I saw Anxiety, which was a nice HUD implementation of a display for your iCal todos, which I'd been thinking about using to sync to my phone. I switched and tried it a while. Not bad, but definitely some issues (Anxiety was a pure viewer (you can add items) - you can't re-order, it doesn't pay attention to priority, and so on). But I'm babbling, get on with it right?

I found out about Things, I believe via Twitter I think. I watched the screencast, which starts a bit slow, but is a good display of the app. What immediately attracted me was the "Today" view, and it's separation from Next, as well as the abilities to tag, to postpone (with a timered re-add/check for re-add), and the whole Someday system.

I had been organizing my stuff more manually into a "to do today" list, and everything else. It was actually somewhat tedious to manage in Backpack, until they added dragging between lists. But still, Things just does it naturally and really well. Simple buttons to move things back and forth between Today and Next, or you can drag. Also, it pays attention to due dates on tasks, and automatically moves them into Today if they are due today.

Also, I really like the Areas of Responsibility and the Projects. I use Areas heavily, and Projects much less, but they are both useful and distinct. In general I organize all my different "work" items into areas (by client or project, or various other ways), and my personal stuff is area-less, with some exceptions. The Areas show up as distinct lists, or as separate lists in the Next and Today views. I could tell you more, but just check out the web site and/or the screencast.

So, what about web/network storage, and access from multiple machines? Nope, Things doesn't have this (yet?). Hasn't bothered me a bit though. It is an extremely rare day that I don't use Packrat to for Backpack, and with my single computer setup now, I just have much less need. Things will supposedly have some Export options later, and it's data is stored in an easily accessible and readable XML file, so I could create a simple solution for read-only data if I wanted to at least have it on the web, but I just haven't had the need or desire. The app itself works so darn well, that this aspect has barely even been on my radar.

I've looked at a variety of other apps and solutions over the last couple years, but hands down, Things is the best.

09 January 2008

Cocoa Screen Saver Prefs and Bindings (or Not)

In my latest work on my Visionary Saver screen saver, I had tried switching all my preferences to use Cocoa Bindings, to make it super easy to manage the prefs. After doing this, and having it appear to work, I realized that it does not.

The problem is that screen savers are supposed to use the ScreenSaverDefaults class to manage their preferences. This is a special Defaults class that namespaces a screen savers defaults/preferences within the defaults system, given that a screen saver is a bundle, and works within System Preferences (as opposed to being its own application). The reason it doesn't work with bindings is that you can't tell the Bindings system about ScreenSaverDefaults (to my knowledge), in the same way as you can bind to the Shared Defaults Controller. ScreenSaverDefaults requires a module name, and so on. If there's a workaround, I'd love to hear it.

I thus had to go back to manually getting and setting the preferences for Visionary. This did simplify one thing, which is the preferences settings for an NSPopUpButton, where the content values come from an array, yet the selection and setting should go to preferences. Personally, NSPopUpButtons, for simple use, are a real pain. I'm not an Interface Builder expert, but it's odd that you can set up to 3 values into an NSPopUpButton in the UI, as generic text, but if you want more, you have to setup the whole NSArrayController and its content array, and so on, then bind that to the popup, etc, etc. It's not awful, but the documentation is pretty weak in terms of a straight forward use of something like this. I suspect many other folks don't have complicated data models behind the values for some of their popup buttons, and a cleaner way to do all this would be nice.

Anyway, it's all good now, or well, it's all fixed up, and there's a new version of Visionary Saver out.

28 December 2007

New Visionary Saver Version, and Updates

The Visionary Saver screen saver now has an official home, on my new (and barely going) business site (Cobalt Edge LLC). There is a new version (1.3) out, which mainly adds some additional visualizations. It is built for Leopard only, and will be this way going forward. My apologies to anyone running MacOS X versions prior to 10.5.

Installing Litespeed on Slicehost

I was trying to install Litespeed on a new slice at Slicehost. This is an Ubuntu 7.10 setup. It all seemed to work until I tried to start it up. It said it couldn't find the binary for lshttpd, but it was there. Doing some searching finally yielded this thread, where I realized I just needed to install the 32-bit compatible libraries (since Litespeed is 32-bit). So, a simple sudo aptitude install ia32-libs and a re-install of Litespeed did the trick.

22 December 2007

Use every tool you can

I just spent a chunk of time figuring out a problem with the way the content of one of the sites I work on flows. We have theme templates, and so on, but all of a sudden the sidebars of the site were no longer sidebars, but shown at the bottom of the page, and there were a few other oddities.

We couldn't figure out anything that had been recently changed that would affect this, so I basically had to start sifting through the HTML to try to see what it could be. I suspected a missing ending div tag or similar, that would thus pull the sidebars into the main content area's div.

To solve this, I started with the Web Developer plugin in Firefox, but that wasn't leading anywhere. I checked some things in CSS Edit. I then used Web Developer's View Source with my associated editor (TextMate) and pulled up the code. The code was messy as hell (no thanks Drupal and the theme we are using), and using code folding, re-indenting and various things was going to take forever.

Next up was Dreamweaver. Voila! This is probably the third time I've used Dreamweaver in my life, but I opened up the source for the page in it, and turned on it's ability to "Highlight Invalid Code". Immediately it showed two div tags that did not have closing tags. Just as I suspected! Now, how to figure out what code within that was eating the ending div (i.e. that itself did not have ending div's, because I could see that the matching ending div for these particular two divs was there (I'd edited the theme to put in comments showing the matching ending divs).

Now it was back to TextMate to manually look at the enclosed HTML. This was tedious for sure, but after some time, I found what looked like some missing closing div's. I identified which blog entry it was in, went to the site and looked at the content for that blog entry, and voila, wacky use of divs! This appeared to have been remnants from some kind of formatting the TinyMCE WYSYWYG editor had been doing. Thankfully we've bailed on TinyMCE and are now using FCKeditor which appears to work much better so far.

Anyway, wrapping up, I fixed up the two blog entries that had these weird div uses, and voila, that fixed the site layout! For me at least, I found a new useful tool, which is Dreamweaver, or specifically Dreamweaver's "Highlight Invalid Code" feature.

Monitoring

For some of the sites I work on, that are either personal projects, or small, where I'm not going to setup Nagios, Monit, or some other internal or serious solution, I've been looking for monitoring services. What I've found, and signed up for (all of these), and will compare over the next few weeks are:



Have others to recommend? Please do tell. Note, they basically have to be free, or super cheap (which for me right now translates to maybe a couple bucks a month if, and only if, they are providing something more than simple uptime watching and monitoring intervals 10 mins or less (less is great, most of the above range from 5-60 minutes depending).

20 December 2007

Amazon Kindle: First Use Thoughts

I received my Kindle the other day, and have had a chance to read with it for several hours now. So far, so great! I like it quite a bit. I'm going to keep this short, because the Kindle has been covered a lot elsewhere.

Things I like:


  • Trivial setup. The unit comes completely setup, tied to your account, and included all the books I'd already bought. All I had to do was turn the thing on and start using it. I did follow directions and plug it in to charge, which reached full within maybe 15 minutes. Also, the unit starts right into a quicky getting started, that I found to be just the right length and usefulness.

  • The "electronic ink" display is awesome. You can read this thing in any kind of light, no problems like you'd have with a laptop screen or many other devices. Very pleasant to read to as well, did not tire my eyes at all after several hours!

  • Easy to use UI. Basically, learn a couple buttons and the scroller and you're done.

  • Neato features like clippings, search, and bookmarks.

  • When the unit is in sleep mode, the display actually has an image on it, and it tells you how to wake it up (in case you forgot ;-)



What I don't like... I can really only think of two things to start off:

  • No PDF support. This is a pretty big deal. I knew this going in, but had read you could convert documents. You can, but have to use a Windows app, and it's unclear how well it works. I haven't tried it yet, but plan to. I was hoping to place some of the existing ebooks I have onto the Kindle this way. This is hands down my #1 complaint and the thing I truly hope Amazon can remedy. I understand the reasons, but I'd like to see them solve it, even if it's not ideal.

  • The price of subscribing to blogs. Usually it's cheap, such as $1/month, but really, blogs are free, and yes, obviously this is partially to cover Whispernet fees (which Amazon always says they cover in their docs, but obviously it's built into the price you're paying), and to cover management on your account, but seriously, it's a blog. How about you give us at least 10 for free, and then make them dirt cheap thereafter. Or at least don't tell us that you're covering the Whispernet fees.



All in all, I love this thing so far, and am really excited to see how I use it going forward. I very much like the idea that I can take this one thing when I travel, instead of having to either figure out what I might want to read ahead of time (I'm usually in the middle of a few books), or take multiple books with me. Also, nice to have even around the house, for just the ability to grab it and know I've got various reading material on it.

I will be most curious to see if I try blogs, newspapers, or magazines on it. Cost wise I probably won't, and I don't get a newspaper as it is (blogs, newspapers/news, I get all online). Magazines maybe, although most of the ones I read have a good visual component (various cycling mags, National Geographic Adventure and Outside, techy mags which typically don't translate to something like this very well, Wired, or whatever). Time will tell, but it's pretty cool so far.

26 November 2007

Ordered an Amazon Kindle

I bit the bullet and ordered up an Amazon Kindle ebook reading device. I'm a big reader and this thing has serious appeal. As Don MacAskill says, I am often into several books at a time, and don't know what mood I'll be in, so when traveling it's hard to trim down the list to something easy to travel with.

I am also very intrigued by its ability to send documents to it, in particular PDF. The PDF translation (to the MOBI format the Kindle needs) is apparently not perfect, but this is huge, as it'll allow me to take all the ebook versions of tech books I have and use with me. I always have these on my laptop, but there are times when I want to actually sit down and read some of them (as opposed to just do a quick lookup while coding).

It's pretty promising, and I promise to review it once I have it, which won't be for a few weeks (mid-December is my approx ship date).

17 November 2007

Killer New Cooking Tools

Well, really, I hope they aren't actually "killer", but I am talking about knives, and spinning blades...

I recently attended a knife skills class, and during the class got to try a slew of different types and brands of knives. I came away very impressed with Shun knives. Great feel, cut briliantly, and the food just falls off - no need for the hokey hollow ground divots, etc. Also, I was able to try the "Ken Onion" Shun knife in particular. This knife has a specially designed bolster/handle area, where your fingers can sit in the proper style. It also rocks really well while cutting. And technically, there is a whole range of Ken Onion knives know, it just seems that this one was the first and thus is what folks refer to as the Ken Onion.

A few weeks later I picked up a Ken Onion, a paring knife, and their cool new serrated "Ultimate utility knife" (I couldn't find this on Shun's site, so the link is to the online store of the place I bought it from). I also took in my Wusthof Grand Prix knifes to be sharpened. These have been great knives, but I actually think I will sell the two cook's knives and paring knife now that I have the Shuns. Eventually I will replace the others as well.

I returned a bit later to pick up my Wusthof's, and low and behold, the Shun rep was there for the day. I talked to him for maybe 10 minutes (I was actually in a hurry at the time). Luckily he clued me in that "diamond fingers" sharpeners, which work rally well on German/stainless steel, shouldn't be used on VG10 steel of Shun knives. I thus got Shun's sharpening steel, which handily has a properly angled bolster on it to help you be certain you are maintaining the proper angle on your edge.

Finally, somewhere in all this, I also picked up a Viking immersion/hand blender. I got a chance to use it for the first time tonight, and WOW, that thing rocks! Made itself worth it in one use. I was making potato leek soup, which needs to get pureed, and previously I had to do this by taking stuff out in batches and putting it in a food processor/blender - a total pain. With the immersion blender, obviously, you just pop the thing in the soup pot, and blend for seconds (it probably took me 20 seconds). This is going to be one nice addition to the kitchen tool chest.

Oh, one note on the Viking vs. others. The Viking is extra powerful and has two speed settings. The first speed setting is what most immersion blenders can dole out, the second is turbo. Also, it's blade guard/bottom area is a nice design that lets the food flow out much better than many of the others that have holes, but where those holes aren't open to the bottom. It also comes with a whisking attachment, and others are available (I got a mini-chopper one with mine due to a current promotion).

12 November 2007

Open Source, Linux-based, New Wireless Protocol Bike Computer

This is really amazing - an open source, Linux based, bike computer/cyclometer, that does GPS, heart rate, power metering, and all the usual other cyclometer stuff (speed, distance, etc.). The system is fully hackable, an intended to be hacked. They are also using Ant +Four, which is like Bluetooth for bikes. I blogged about this more, including the link to the video showing it, the company, etc, etc., on my Mountain Monkeys blog. Check it out, quite cool.

11 November 2007

What Leopard Changed for Me

I've been running Leopard for about two weeks or so now. It has not been the usual OS update where it has some nice eye candy improvements and some underpinning changes, but doesn't essentially affect the apps I run. Leopard has directly impacted the apps I run. There are also some that I've chosen not to switch to.

Documentation?!



But first, wow, the little printed booklet that comes with Leopard... wow, a) I actually read it, and b) the info in it was actually useful! Hath hell froze over?! Printed documentation of value?! Woah nelly! Even better, it was short, easy to read, and to the point, with almost zero fluff. Way to go Apple.

The app changes...



Not a lot, but a couple key ones. As I mentioned in a previous post, I am no longer using Path Finder, because regular Finder has some great improvements, picks up some of the key features I used Path Finder for, and it eliminates needing an additional app, that didn't integrate as seamlessly as you'd hope.

Update (12 Nov 2007): A new version of Path Finder has been released that integrates MUCH better with Leopard, including supporting Quick View, and having an "Open in Finder" replacement that works completely. I'll have to see if I go back again to using Path Finder...

Second is iChat. The jury is still out on this one to be honest, but the fact that you can now login to multiple accounts on a single network (Jabber for me), all the video and screen sharing enhancements, and again, one less app to install and keep up to date, has led me to stop using Adium for now. We'll see. I've tried before, and iChat was not up to par, but this time it's looking like a replacement.

Other bits... Stacks are pretty cool, especially when you add overlays to keep them straight. Quick View rocks. Safari is definitely better, and thankfully the one feature Safari cannot seem to implement, for who knows what reason, is still solved by Saft. This is the feature of it remembering all the tabs you had open when you close the browser, and re-opening it with that. Saft also adds a great feature, which is to allow you to edit Text Area's with your favorite editor. This is key for me (I use(d) a similar plugin with Firefox).

What hasn't changed...



Time Machine. Yep, I am not a convert. Admittedly I haven't looked at every option, etc., but I'm a Super Duper! fan. Why? First I don't really need multiple revisions of files - any files I do need that for are already in a version control system. Second, one of the key features of Super Duper (or similar) backups, is that I have a complete clone of my drive, that I can boot off of. This has saved me a few times. What happens if your hard drive goes bad or something happens to your system. Fine, you restore from backup. But, what if you are in a time bind and you really need access to your files? Well, you can just boot off your backup, work there for a short bit, and then perform your restore/redo when time permits. No biggy. Yes, you lose whatever was changed between the time you did you clone backup and the current time, but for me that is often very little (due to what really matters being in version control, or being backed up by Jungle Disk every 15 minutes).

I still don't use Apple Mail. In fact, these days I don't use a desktop mail program, or rather, one that I POP or IMAP mail with. I use Mailplane, and all my email accounts are Gmail accounts (I have a half dozen or more at this point). Works extremely well for me.

XD

The blog post, Dock Stack Overlays on the XD blog is really cool. It shows you how to put an overlay icon on your dock stacks, so that you always know which stack is which. This is incredibly useful if you use stacks (or more than one stack anyway). Great stuff.


10 November 2007

New Tools

I've been using a few new tools lately, and also got rid of one I've used a long time. First up, now that I'm running Leopard on my Macs, I've found I just don't need or want Path Finder. Path Finder has been great, I've used it for a few years now. But, with the new features in Finder, and the niggling issues I've had with Path Finder, it was finally time to end my use. The Finder's new sidebar, stacks, quick look, and the fact that you can show the directory path at the bottom of Finder windows (this was a big-little feature in Path Finder for me), brought me back to using it.

Update (12 Nov 2007): A new version of Path Finder has been released that integrates MUCH better with Leopard, including supporting Quick View, and having an "Open in Finder" replacement that works completely. I'll have to see if I go back again to using Path Finder...

Some new tools, both web and Mac that I've been using a fair bit lately include:

Mind Meister


I haven't used mind mapping tools much in the past. I've tried various ones several times, but they either were too cumbersome, too slow, or just didn't seem useful. I found out about MindMeister from someone on Twitter, and have a couple mind maps running on it now. I'm also collaborating on one of them with others. MM is fairly preferment, quite easy to use, nice to look at, and the collaboration bit is super nice. I'd like to see them add a way to insert a URL/link, where that link could be clicked on, but that's about the only issue I have so far. Interesting to note, if you get the Premium account (a measly $4/month!), they have offline editing. They are using Google Gears for this. Another intriguing bit is that they have an API. I haven't looked into this yet, or haven't thought about how I'd use it, but I always like to see services that have this as an option.

Mars Edit 2


The 2.0 version, now produced by Red Sweater Software is quite nice. In days of old, I'd preferred ecto, but this new version is simple, effective, fast, and quite nicely, has great Flickr integration. I've been using Flickr quite a bit, especially with my other blog, and often put multiple photos in a post. Mars Edit makes this trivial.

Navicat


Navicat is a GUI database tool. I used to use CocoaMySQL, and YourSQL and such on Mac, but YourSQL doesn't seem to work these days, and CocoaMySQL seems out of date, and I think wasn't under development anymore(?). Navicat, while a commercial product, has been rock solid, and I've found to be quite useful. Admittedly, I use it a lot of simple browsing, simple queries and value changes, etc., but the dependability and quality of it have kept it in my tool chest (and got me to buy it). One other nice thing here is that while it has a real Mac UI, it is a tool also available on Linux and Windows.

Acorn


Acorn is a slick, simple new image editor by Gus Mueller of Flying Meat Software (likely better known for VoodooPad). It's extremely fast to load up, and I'm finding it's my top pick to do things like saving images in another format (if they aren't in my Lightroom library - otherwise I use Lightroom), make minor tweaks, crops, etc. The speed is one of the best things - it launches super fast, and is very fast to use, so it's an excellent tool for quick work. Interesting note: you can write plugins in Python or Objective-C.

Pack Rat


I use 37 Signals Backpack extensively. It's my GTD system, and I keep tons of notes and information I need in it. Backpack's web interface is somewhat slow, especially if you switch between various pages a lot (and don't want to keep said pages in lots of browser tabs). I have a half completed AIR app to be my Backpack client, but Pack Rat seems to be the ticket now. It has synchronization, offline editing, and so on. I am sold, and have essentially not used my browser for Backpack since.

Panic Sans font


Last, but certainly not least, is the Panic Sans font. This is a fixed width font, great for coding. I've been using the Bitstream Vera Sans Mono font for quite some time, but Duncan's recent post about this discovered a few new ones. Panic Sans is actually a font found inside the Coda app's package. It's very similar to Bitstream Vera Sans Mono, but slightly nicer. Duncan's post has good info in that particular post, but also see some of his followup posts on the subject.

What's new in your tool chest?

07 November 2007

lselect: great Finder toolbar addition

lselect is a really handy Finder toolbar addition. It lets you select files, in Finder, using globs, just as you would on the command line. On the lselect page, if you download the "lselect-toolbar-app.zip", expand that somewhere (e.g. where they suggest on the web page), then drag it up to your Finder's toolbar to add it. Now, wherever you are in Finder, if you click this new toolbar button, it'll show you a dialog that lets you type in a glob pattern, and will then select all the files in your current location based on that glob. Pretty slick.

05 November 2007

WBC Champ Makes More Coffee Than Espresso - What's Happening?!

In Jimseven's (aka James Hoffman) latest blog entry, he says that he makes very little espresso these days in comparison to how much Chemex or press coffee he makes. This caught my attention as he's mentioned the Chemex a lot. I of course take note, given that this guy (jimseven is James Hoffman) is the 2007 World Barista Champion. Not that baristas don't make "regular coffee", but the WBC is all about espresso, and so on.

I like experimenting, and am tempted to get a Chemex just to see, but it seems almost every time I drink "coffee", it is rarely enjoyable (of course most espresso from cafes here in the US at least sucks as well). The other thing that is a big discussion in the coffee world these days is the Clover machine, which is basically sort of like an espresso machine, but for coffee, in that it makes one cup of coffee at a time, with grounds made separately, measured precisely, and so on. Some of the higher end coffee houses are getting them (Ritual in SF had one when I was there a few weeks ago, so I got to see it in person ;-) They are also a machine you can put on the net, and you can have it track all the coffees you make, as well as program it with various settings so you can just say, make a #3, which you know is all the settings you use with a particular coffee, etc. I think the machines cost several thousand bucks, so they aren't likely a home machine (and they may require a water connection). Of course Mark Prince of CoffeeGeek doesn't really like Clover coffee, for many of the same reasons I tend to not like coffee in general, which is that he claims it has almost no "body".

That's like coffee in general for me, in that espresso is this complete mouth experience, in that it has real density to it, and does all sorts of things to your tongue, much in the same way wines do, etc. Maybe I've just had too few good cups of "coffee", but coffee usually just winds up tasting like flavored brown water to me, as opposed to a liquid in its own category.

Note, I mean no offense at any of this, as one thing I love about the coffee world is the range of different preparations and opinions on what is great, etc. So, any of you espresso lovers out there, should I bother trying a Chemex?

31 October 2007

First CSA a Hit So Far

I only learned about CSA's (Community Supported Agriculture) this year. They are beyond plentiful in Eugene, with I think something like 40-60 providers. We signed up for a fall CSA with Groundwork Organics. What this is, is a weekly delivery of locally, and with our choice, organically grown produce. In the spring we will likely sign up for multiple of them, with potentially one doing dairy and/or meat as well. Anyway, it's been really great so far. They provide a bunch of things that we wouldn't usually buy, or in some cases, have never even heard of!

We've had I think 3 deliveries now. Each week we've gotten 1-2 pounds of lettuce/greens (lots of spinach, field greens), a bunch or three of carrots, and then things like parsnips, beets, dill, Italian parsley, watercress, squash, potatos, onions, arugala, garlic, leeks, and more. The apples we got last week are the most flavorful apples I've had in a long time (they were "Liberty" apples I believe).

The delivery we got today included leeks, red potatos, and dill, with a recipe to go along with it (they always include recipes). It also included "Delicata squash" (roughly 8-10" long, white with green veins, and tubular, maybe 4" in diameter), with a recipe, and we'll try that out. I don't think we've bought salad greens at the market for a month due to this, which is great.

We've tried several things we have either never had, or needed to go find recipes to figure out what to do with it, etc. (the roasted parsnips were yummy). We used a bunch of the salad greens, carrots, etc. tonight, and I roasted up 4 heads of garlic as well.

I can't wait to see what the next one brings us, as well as what we sign up for in the spring (when the real CSA season occurs).

25 September 2007

New Espresso Machine Update


VivaceFirstPours-3
Originally uploaded by Christopher Bailey
So things have been continuing to improve in terms of my shots out of the new espresso machine. I've been getting more consistent and higher overall level of shots these days. A few things I'm finding important (some of this is obvious, well documented, etc., some slightly different, etc.)...

  • The grind is super important. I haven't been making hardcore truly micro adjustments yet (I haven't sat down and pulled zillions of shots in a row to experiment at that level yet), but I am making smaller adjustments and dialing things each day, etc.

  • The freshness of the beans makes a huge difference! This may seem obvious, but I'm finding that I now won't even bother with anything that isn't dated, and current

  • The roast of the beans is critical as well. Anything "over roasted" (extra dark and oily), is just pointless for me. I've yet to pull a good cup with one of those, and I have no interest in them it seems, since they seem to lose the caramel and subtle flavors, and enhance the roast/smoky flavor. As I've known, but now proved further, I too am in the "Northern Italian" camp for bean choice.

  • I've had great success using a grounds distribution technique I saw at Wandering Goat: I use the side of the palm of my hand to distribute the grounds, and mostly just back and forth, but ensuring that I get a really even distribution, and proper amount of grinds.

  • Better on my tamp pressure, and more consistent. Don't tamp the crap out of it, do indeed stick to the ~30lbs force, which is not as much as it seems.



Right now I'm awaiting arrival of my bottomless/crotchless portafilter, as well as a custom handmade tamper from Thor Tampers.

The best shot I've made to date is from Zoka Paladino beans, later in their life (probably about 10 days I think). Great taste, and then brilliant aftertaste, with the effect on your tongue the same as a wine with heavy tannins (sort of drys it out), and superb chocolate flavors coming out. This is pretty cool because usually Zoka is more on the smoky side for me, so this was a real transition. The shot in this picture used Vivace Dolce.

24 September 2007

Installing Ruby MySQL Gem with MacPorts MySQL

Blogging this more for my own record, but maybe others will find it useful... Tonight I was having a hard time getting the MySQL Ruby Gem installed on a new MacBook Pro. I have installed Ruby, Rails, RubyGems, MySQL, etc. via MacPorts (or via the Ruby that was installed via MacPorts). Anyway, this is the command that finally got it to work:

sudo gem install mysql -- --with-mysql-include=/opt/local/include/mysql5 --with-mysql-lib=/opt/local/lib/mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config


Update: as I mention in my comment below (updating here in case folks don't read the comments), when doing this on Leopard/MacOS X 10.5, I needed to change it to:

sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-include=/opt/local/include/mysql5 --with-mysql-lib=/opt/local/lib/mysql5 --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config

12 September 2007

My New Espresso Setup


My new espresso setup
Originally uploaded by Christopher Bailey
Today I finally got to getting the new espresso machine all setup, in its final (for now?) resting place, and started to pull some shots. So far, average, but I'm just starting to learn to dial in the grinder, tamping, shot duration; and I'm not using a coffee I've liked that much (but it was free with the purchase, and I figured I might as well start out with something I didn't mind wasting a lot of shots of :) Anyway, all the pictures are here:

http://flickr.com/photos/chrisrbailey/sets/72157601979329896/

Initial impressions... First, I was pissed for a short while, because the machine didn't work out of the box! It didn't heat up properly. I called tech support, and they pointed me to instructions on how to reset the Hi Limit on the temperature. Did that to no avail. Then, as I simply looked around the insides of the machine, I saw a friggin wire was not connected! It was just off the terminal (used those nice plastic enclosed flat connectors), so it was real obvious where it went. Plugged that in, and voila, everything good now. Phew. Bad start though.

Getting past that, holy shite... The first thing you notice is the weight! Super heavy: 61 pounds! The other thing that simply rocks is the sheer amount of metal, the entire thing is stainless steel, or brushed steel (the internals of the drip tray are brushed metal, seems like everything else is stainless). It is incredibly beautiful at the same time as being totally kick ass industrial.

Next, nice big steam wand, dedicated hot water wand (very convenient for warming cups), burly lever action, heavy portafilter with E61 grouphead, and simple to use (mechanically - putting aside the art and science of pulling a perfect shot). On to the actual espresso...

So, first I ran a bunch of pre-ground Illy through that I had from buying the an Illy cup collection (No Water, No Coffee). That simply gave me a feel for pulling a shot, but the results sucked (minimal, crappy crema). After a half dozen of those, I fired up the new Macap MC4 doserless grinder. I filled it up with Malabar Gold, as that came for free with the machine, and while this may seem odd to some, it was a roast I hadn't liked much in the past. I figured I might as well waste a bunch of something I didn't care much for, while I started tuning the grinder, etc. Instantly I was at least getting crema, and better shot times (I was pulling doubles for all these, so approx 25 seconds).

After a couple, I started futzing with the grind setting, dialing it finer, to slow the shots down a bit, and thicken things up. I'm still playing, but I can at least pull something I find reasonable to drink. I will by no means claim to be pulling stellar shots at this point. It's at least thicker flavor and such than my super-auto, but it's definitely not honey yet.

I haven't even touched steaming yet, and probably won't for some time

Finally, I'm reading David Schomer's book (from what I understand, THE reference). I'm not too far in yet, but so far it's an easy, and seemingly good read, and I assume I'll learn a ton.

All in all, the journey has started. Interestingly, I recently found out that the "Best Coffee School" is right here in Eugene. That's the actual name of the place, and apparently people from all over the world come to get schooled here. They offer courses that range from basics, up to the longest course which trains you to run your own cafe and on the last/graduation day, the class runs their cafe.

06 September 2007

First Day of Being an Indi

Yesterday was my first day of being an "Indi", as in an independent contractor/web worker/having my own company, etc.  I'm working on some contracts, started the process on forming an LLC, etc.  I decided to use MyCorporation.com for the LLC formation, to lessen the amount I need to do.  They called me this morning to say everything was in order, and they're submitting my forms, etc.  I also bought the .com and .net domain names for the new company (name forthcoming, once I ensure the LLC goes through).  


I now need to get the logo worked on, bank account, and AMEX card, finish evaluating hosting providers and so on.  I plan to be building a few web apps of my own, with hopes that I can grow that into what makes my living, but will also be working part time for a company to start off (and have a guaranteed source of income).  I'm loving this already...

03 September 2007

Early September Sunsets


EarlySeptSunsets-13
Originally uploaded by Christopher Bailey
We very frequently get amazing sunsets here at our house in Eugene. Tonight's was another great one, and while I decided late to get my camera out, still got a few decent images.

Here's the collection of five that I got tonight.

New Espresso Machine and Grinder

I'm finally stepping up to very serious espresso machine (and likely selling my super-auto).  I just purchased an Expobar Brewtus II machine.  My understanding is that this is the creme de la creme of machines, unless you can shell out over $4000 for a La Marzocco GS/3, which is the ultimate home machine (and would actually kick the ass of many of the machines used in cafes and so on).  


For a grinder, I finally decided on a Macap MC4C83R Doserless.  The big learning point was about going doserless, which is the way to go for a home machine, because you don't pull shots constantly, and thus extra grounds would get left in a doser, going stale quickly.  I looked at various grinders and discussed a lot with cafe folks I trusted, friends who'd researched it, a few key blogs, CoffeeGeek, Chris Coffee (or specifically Chris, from Chris Coffee), etc.  The doserless Rocky is the usual starting point, but various reasons led me away.  First, the finish/appearance.  Sure, that's not the most important point, but when you have a beautiful chrome machine, you don't want a black, plastic grinder sitting next to it.  Second, it's burrs won't last as long, and aren't as good as those of a Macap or Mazzer.  How about a Mazzer Mini?  Well, they have a doser, and the doserless one, the Mini E, or Mini Electric costs $700 - so you are basically paying more than $200 MORE to go doserless (when in fact, you'd think you'd go less for not having a doser (although it does have extra electronics I guess).  The Macaps rival the Mazzers in grind quality, so no hesitation there.

I also picked up a Bumper tamper, knock box, and tamper stand, and some cleaning supplies, etc.  All this stuff should arrive this week, so I'm pretty excited.  

01 September 2007

Eugene Restaurant Review: Marché

I had been told that Eugene had a lot of great restaurants. We've been here for a few months now, and I hadn't really felt that Eugene had lived up to that, in fact, I'd been fairly disappointed so far. Tonight changed that in a big way. My wife, parents, and I had dinner at Marché.  


Dinner was superb!  All of us thoroughly enjoyed it.  The atmosphere was great - clean, crisp, yet warm, and relatively casual.  We had reservations and were seated promptly at a nice corner table.  Our waitress was great, and was helpful with the wine choices.  She knew the wines on their list quite well, as well as knew California vs. Oregon characteristic differences and other points that helped.  

We started off with some great cocktails, and placed our order:
  • My mom: Heirloom tomato and goat cheese salad, side of chard to split with my dad, and the fresh, Chinook salmon.
  • My dad: Heirloom tomato and goat cheese salad, and the pork chops.
  • My wife: Trio of bruschetta for appetizer, and then she went for the heirloom tomato salad, side of onion rings, and side of beans with bleu cheese, for her entrée.
  • Myself: Breaded/fried oysters, and the duck.
First off, the heirloom tomato salad was absolutely outstanding, all of us couldn't stop raving.  The tomatoes were perfect, the goat cheese was outstanding, and at the proper temperature, and the light dressing was killer (so good we asked how they made it, and plan to try to reproduce it at home :)  I ate a chunk of my wife's salad, and again, just stellar.
The fried oysters were ok, and are something sort of unusual for me anyway.  I think slightly lacking in flavor, but honestly, with all the other awesome food we had, it was fine, and we ate them all.

As for the entree's, all of them were excellent.  My mom loved her salmon, and I tried the pork which was very good - very juicy and tender, so often restaurants dry out pork, but not at all in this case.  Also, the grilled peaches that went with it were a really great match, and a nice change from the the more typical apples.  

The duck I had was hands down the best duck I've had in as long as I can recall.  I don't order duck all that often, but had it recently in the Bay area, and it was pretty average on that occasion.  The duck came sliced, rare, with a extremely tasty crust around the edges, and in the most wonderful sauce!  Everyone was going nuts for the sauce, and in fact, we had them bring a little extra bowl for dipping the onion rings, as we found that a great combo :)  The sauce was the perfect amount too - by no means swimming in it, but also, enough to coat some of the potatoes and chard.

Speaking of chard, yes, we had a lot, given two of our entrees came with it, and we had two sides.  It was so darn good though that we ate nearly all of it, and took the remainder home.  Perfectly cooked, great seasoning, oh, just so good.  I wish I had more room, as I'd have finished it off.

Finally, we managed to save enough room to have some dessert.  My dad and I split the cheese plate, and my wife had the creme brulee.  First, thank you Marché for not putting berries in the creme brulee!  Very good.  The cheese plate had a small serving of the same goat cheese used on the heirloom tomato salad, and a Camembert I particularly liked.  Given the intent for this to be a dessert for one person, it was a good portion, but since we split it, I'd probably have liked to have one more cheese (not that our stomachs needed it!).  We also had some espresso.

The food was so good, I almost forgot we had wine.  Aside from a glass of malbec we sent back (and indeed, the waitress had told us it wasn't the best), the cab was good.  We had wound up going with just wine by the glass, as honestly, their wine prices are quite high - even by California standards.  They had a fair number of good wines, but with cocktails, and the prices of the wine, we just decided to skip it.  I guess that would be about my only knock.  Aside from that, outstanding.  Definitely the best meal I've had in Eugene, and Marché gets my vote as the best restaurant in town (that I've been to so far anyway). I would highly recommend it.


Update: I also posted this review here on Yelp. I'm finding Yelp more useful for restaurant reviews than say Eugene Weekly's food thing.

22 August 2007

I am 73% Optimus Prime

I AM
73%
OPTIMUS PRIME
Take the Transformers Quiz

15 August 2007

Green Buildings Story: My Adobe Building Photo Used

I was happy to receive email from Grist, which just did an article on 15 Green Buildings.  They used one of my photos of the Adobe Systems buildings in San Jose (see building #8 in the article).  Here's the full photo on Flickr.  I myself have become very interested in being "green" and have been increasing my own efforts.  Good job to Grist for observing the Creative Commons license, and glad I could help with such an article.

09 August 2007

New Visionary Saver screensaver on the horizon

I've put a bit more work into the Visionary Saver screensaver, and should have a new version out soon. I'm likely going to have delay on the multi-monitor stuff. Getting all the preferences right for that is somewhat of a UI mess (especially for those of us who deal with multiple multi-monitor setups for a single computer).

On another note, I've added the "ThisWorld" visualization. Gary's FlickrTicker will be fully supported as well.

Depending on what work I get done on it this weekend, or in the next evening or two, I plan to have a new version out early next week, or this weekend.

30 July 2007

New MacBook Pro Recommendations?

I'm planning to replace my dual G5 tower (personal machine) with a new MacBook Pro, 17". I need to get down to a store and see if I can look at this in person, but doing so in Eugene, may be hard. So, I'm soliciting advice on two issues:

  1. Should I get matte or glossy display? The glossy sure looks cool, but how susceptible is it to glare? I don't have a lot of glare in my work environment, so maybe that's moot and the glossy is better? What do folks think? Does it make a difference in color correction? I've found that Galbraith and such have tested with the matte displays, and that I really like having my monitors color corrected.
  2. Since I'm going with the 17", I'm debating whether to go with the higher resolution version. My primary work mode will be with a 24" (or larger) monitor hooked up, so I use the laptop screen either if I'm on the road, not at my regular desk, and as a secondary monitor at my desk (typically for IM windows and similar). Is the higher res a lot harder to read, or? What are the pros and cons?
In general, this will be my do-everything machine. Personal stuff, as well as development projects of my own, etc. Thus, everything from email and Quicken to heavy coding, Lightroom/photo work, etc.

03 July 2007

You don't always get what you pay for (IBM: $30m, 2 years; us: $3m, 1yr)

I just found out today, from the gentleman I did a consulting gig with a few years ago, that the company we did the architecture for (but who declined having us do the project), had IBM do it instead. That's not the interesting part (especially since during this time the company hired an ex-IBMer). The interesting part, as I was informed, is that IBM used our architecture (admittedly that's how it was explained, and we didn't get into details, but still), but took two years to do the project, and charged $30m!!! As I recall, we'd bid it at around a year, and I think around $2-3m! Either the project changed a lot, or that is just gross. I suspect IBM went in and did some massively overdone EJB implementation (this was a Java project, and I'd done a very basic prototype using Spring, Hibernate, and Velocity or JSP).

25 June 2007

GPS Data for Canon DSLR's?

Moose Peterson recently blogged about this really cool mini-GPS that mounts on the hot shoe of Nikon DSLR's. I'm wondering if there is anything like this for Canon's, in particular the Rebel XTi, or 30D, etc. I would also be ok if there was a solution that connected my Garmin 60CSx to my XTi to automatically store GPS data in the EXIF info.

20 June 2007

iPhoneDevCamp at Adobe San Francisco (free event)

Check out the iPhoneDevCamp, which is being held at Adobe's San Francisco office July 6-8. This is a free event, and features presentations, development projects, and demos.

15 June 2007

Fixes for Capistrano 2's Perforce

I'm starting to convert to Capistrano 2. We use Perforce, and I've found a simple typo/bug in Capistrano 1.99.1. The fix is simple:On line 57 of recipes/deploy/scm/perforce.rb, change the use of "revno" to "rev_no".


Now, the question is, where is the Capistrano bug DB, or where/how do I submit this to them?


I reported this to the mailing list, and Jamis has already checked in the fix in SVN. Capistrano lives in the Rails Trac.

Perforce Implementation for CruiseControl.rb

While I haven't had a chance to clean up the code, folks have asked for it, so I'm making my Perforce implementation for CruiseControl available. There are some important notes:

  • You need to set up your project manually, you can't do an "add" via CruiseControl.
  • Some work needs to be done on the text retrieval for checkin messages, and how that's displayed on the CC.rb results pages.
However, so far it's been working fairly well for me. Feel free to use this as you need. I have not yet submitted it to the CC.rb folks, as I hadn't had time to clean it up yet. So, if you dial it in better, please do submit it to them, or send me your changes, and I'll submit it, etc.

To install/use it:
  • Put the perforce.rb file into your cruisecontrol/app/models directory.
  • Manually setup your project:

    • Create a directory under the cruisecontrol/projects directory.
    • Place a cruise_config.rb file in it. It should contain something like the following in order to use Perforce:
    Project.configure do |project|
    # Use Perforce for source control
    project.source_control = Perforce.new(
    :port => 'your.perforce.server:1666',
    :clientspec => 'clientspec-for-cruisecontrol',
    :user => 'buildusername',
    :password => 'builduserpassword',
    :path => '//depot/path/to/your/rails/app/...')
    end
    • Sync your code once.
    • Fire up CruiseControl, and let the games begin.
Usual disclaimer: I take no responsibility for your systems, code, etc. Read the code, test it out, backup your systems, etc.

Update: I've now given this an official home on GitHub. See the cruisecontrolrb_perforce project there. Fork at will, and please do send me Pull requests if you enhance the code, or at least tell me about your version, and I'll put that in the README or on the wiki, etc.

06 June 2007

Our Servers


Rack And Stack
Originally uploaded by • g l u b •
Gary got a nice shot of some of the servers we've recently racked up.

04 June 2007

Visionary Saver Updates Coming...

I've been swamped at work, so haven't had much time to work on Visionary Saver. But, I should have an update in the next week or two. Some of the things I'm working on:

  • Multi-monitor support: allowing you to pick which visualization(s) you want on each monitor (or fully random)
  • Adding a new Flickr visualizer: FlickrTicker
  • More options for various visualizers
  • Looking into enabling use of the mouse while the screen saver is running
Thanks everyone for the support!

In the mean time, to get the existing version, click here.

02 June 2007

New Home AV Stuff

Today the installers wrapped up the bulk of the new home theater and whole-house audio additions, changes, upgrades, etc. The house had come with a Nuvo Concerto system for whole-house audio. But, we wanted really good iPod control, so we upgraded (for cost difference) to the new Grand Concerto system, that has these improved touch pads (instead of keypads), and does full metadata display for iPods, radio, XM radio, and so on. They are really nice and we're stoked to have XM now (before it was a dual AM/FM tuner, which we swapped out for a dual AM/FM + XM). The iPod dock part shows up next week, can't wait for that.

They also installed the new Samsung 50" plasma, wall mounted, and then racked up the equipment in the little AV closet in our bonus room. Nice setup, but I think we'll likely have to get more ventilation in the little closet, it gets pretty hot in there.

They still have a bunch of othe wiring to do in the house, as we're having some ethernet and other stuff re-jiggered, and they didn't finish programming the killer Universal Remote Control MX-3000. Of course, I'll want to get my hands on programming this as well. You can do all sorts of crazy stuff with it.

The funny part is we probably wouldn't have done half of this if the Nuvo system didn't already come with the house. But now that we have it, boy is it nice. Being able to have music all through the house (and different choices in different rooms), as well as on the deck (that's my favorite!) is just so nice. We watched a movie on the new plasma tonight and it was great, plus super sound in that room. There are better plasmas, but for the money this one is extremely nice. BTW, we have a Loewe 42" plasma for sale if anyone is interested (no, you don't even want to know what that cost, it's rather embarrassing in fact). Anyway, as you can tell, I'm pretty giddy about it all.

01 June 2007

Online/Offiline Web Apps: Why Does the Browser Matter?

For a few months now we've been seeing more offline web app support. This includes technologies like Apollo, some of the tricks people are using with Firefox (like ), http://www.blogger.com/img/gl.link.gif, and lately .http://www.blogger.com/img/gl.link.gif

What amazes me is how much people want to seem to stay within a web browser. They're trying so hard to cram a feature into a space that wasn't designed for it, not to mention is just a crappy solution. No doubt there are a few nice uses of offline support for a pure browser-based app, but why haven't more people started to realize how much better they can do by going beyond the browser? Why do you want the browsers UI to be your dominant surrounding UI? Why do you want to be constrained to the browser's window, and force your user's to have your app running in another http://www.blogger.com/img/gl.link.gifapp, that doesn't have it's own dock/task bar icon or ability to interact with the OS?

I also don't think it's an all or nothing situation. I value having a browser-based UI available to me, so that when I'm not using one of my computers, I can still view my data. I don't expect the experience to be as good, and it can lack features, but I can get to the data in a pinch. But, I would much rather have dedicated applications for the "web applications" I use a lot. Examples of this would be Backpack, project tracking systems (currently I use Scrumworks, which has a Java desktop client that works with their web app, and Basecamp), music players, weather watchers, GotAPI, Twitter, and many others.

There are some examples popping up. Twitter has Twitterific, and FineTune has their Apollo player. These are both excellent examples of how deficient the browser is for many web applications, and how much better you can do outside the browser.

I admit that Apollo is really what took my thinking on this to the next level. You no longer have the excuse that you don't know native code or native code toolkits and such. Building an Apollo app can be done the same as you'd build a web app, and even gives you the choice of Flex or HTML, or a combination (this gets very powerful). You can even simply pop an existing web app into an HTML view in an Apollo window, and thus have a dedicated application (doesn't give you much more but at least you aren't just a tab in your browser, and can display it on a different virtual desktop or size the window differently than your browser window, etc.).

To make this more positive, this is a call to all web developers to think hard about this. Even if you don't need offline support, or you don't need it right away, think about the user experience and how you might create that much better of an app by not being constrained to a browser. I won't have anything in the next week, but yes, I'll be eating my own dogfood, and having some apps out soon enough (watch this space).

23 May 2007

Initial Implementation of Perforce for CruiseControl.rb

I got the Perforce support for CruiseControl.rb working this evening. I haven't done extensive tests yet, but seems to be going ok. I need to polish up a few bits, and then I'll post it (as well as submit a patch to the CruiseControl.rb project).

Bug in Perforce's Marshaled Ruby Output?

I'm working through this with Perforce tech support right now, but wondering if anyone else has seen this (since they didn't seem to know if it off-hand and it seems pretty significant)...

If I use the "-R" flag with Perforce commands, to get the output as Marshaled Ruby, with some commands, I only get the first file or item back. Specifically I'm seeing this with "sync" and "changes" commands. For example:

p4 -R sync
p4 -R changes -m 10

I am consuming these with code similar to:

Marshal.load(`p4 -R sync`)

I'm using Ruby 1.8.6 from MacPorts, on a MacBook Pro running MacOS X 10.4.9, and Perforce client "P4/MACOSX104X86/2006.2/112639 (2006/12/14)".

Update: Turns out that the output is still individual lines, but where the lines are marshalled Ruby. So, you simply need to process each line, with something like:


CMD="p4 -R sync"
IO.popen(CMD, "rb") do |file|
while not file.eof
hash = Marshal.load(file)
synced_files << hash['data']
end
end

22 May 2007

Perforce for CruiseControl.rb

Tonight I'm doing a quick bit of hacking to see if I can implement Perforce support for CruiseControl.rb. It looks promising, but we'll see. Perforce and SVN are quite different beasts. One cool thing though, Perforce has a -R flag to all commands that say to return the output as marshalled Ruby (they also have this for Python). This is very handy when writing scripts.

Also, if someone has already done this (i.e. my Google searches for it were too feeble), please let me know!

19 May 2007

RailsConf Day 3

There were a couple good sessions at RailsConf today. In particular Ezra's talk on performance, and the demo show was great. After the sessions, headed into town for a good dinner. We hit the Portland Steak and Chophouse for a quite leisurely and good dinner. Fried oysters and drinks, great steaks, and a nice bottle of Stag's Leap. Then it was on to Pivotal Labs party at the Rock Bottom Brewery which was fun. Played many rounds of pool where Aaron from Revolution Health showed us how it was done. Thanks to Ian and the folks from Pivotal for the party.

p.s. Jeff - I'll get you the yo-yos one way or another...

New Version of Twittervision Screen Saver

I've put up a new version of Visionary Saver the Twittervision/Flickrvision, and now Twittervision 3D and Twitter Flash RailsConf visualizers. The options panel is a bit different now - it's just checkboxes. If you want to randomize between different visions, just check which ones you'd like to randomize for.

I'm still at RailsConf, but will be home this coming week and can then work on settings for which saver you want to run on which monitor of a multiple monitor setup, so stay tuned.

Download Visionary Saver

18 May 2007

RailsConf Day 2

Day 2 of RailsConf has drawn to a close for me. Back in my room, ready to pretty much collapse. It's been an extremely busy month leading up to today for me, and I'm now really looking forward to the next two days as a) the two presentations I/we did are done (both went fairly well today I think), b) the sale of my house in CA closed, and they finished up the flood repair on Wednesday, c) wrapping up a week of travel, and d) resting a bit from putting in some serious hours at work for the last several weeks. It all adds up to one tired guy (the house stuff felt like a second job! Some day I'll elaborate on that saga).

Tonight, Andrew S (Adobe), Peter Armstrong (buy his book, Flexible Rails), and my presentation partner in crime, Chris H (thanks for TwitterRailsConf), and I went to dinner at Pazzo, which is a great Italian restaurant. Most of us were about ready to fall asleep by the end (Peter, wake up!). MAXed back to the hotel, then CH and I hung in the bar for a while after. Heh, you should have seen the size of the "double" gin they gave me (and that was so they could charge me less as a martini, instead of the single rocks I asked for - whatever). This thing was probably a quad. I barely dented it, and am now blogging and winding down, then will crash.

RailsConf, and Presentation Day

Today is the big day for us: our two presentations at RailsConf. In the morning my co-worker, Chris Haupt, and I are presenting a session purely on Apollo. If you don't know much about Apollo, or want to find out more, join us for this. Then, in the afternoon, we'll jump into using Apollo with Rails, and our experiences in that regard. Both talks will include demos and code.

If you attended Peter Armstrong's BOF on Flex and Rails last night (which was great, good job Peter!), come see the Apollo talks to see how you can take that even further with what Apollo adds to Flex.

17 May 2007

RailsConf version of Apollo TwitterCamp App

My co-worker Chris Haupt has tweaked the TwitterCamp Apollo app, for displaying RailsConf tweets. Very nice. You can get it on the RailsConf wiki "Toys" page.

15 May 2007

Twittervision/Flickrvision - the Screen Saver

I think Twittervision, and Flickrvision are really cool. However, I thought, to be even better, why not have them as a screen saver?! So, last night I whipped up a MacOS X screen saver that shows these. You can choose one or the other, or have it randomly choose which one to use. This is literally a quick hack. I plan to add some other visualizations, such as Breathing Earth, and others (send me your suggestions).

Download Visionary Saver

10 May 2007

Bug in ActiveResource's HttpMock?

I'm using ActiveResource a fair bit now. It's working fairly well, even with our non-standard XML and so on. Testing it works ok with use of HttpMock (see this blog entry for a way to do it). But, I've found that HttpMock appears to have a bug in how it deals with headers, and comparing the request you're making and the known requests. If the order of the keys in the header hash differs, they will fail to compare equally, and thus fail to match. To resolve this, I've modified the HttpMock::Request#hash method. It used to look like this:

def hash
  "#{path}#{method}#{headers}".hash
end

I changed it simply to this:

def hash
  "#{path}#{method}#{headers.sort}".hash
end

I will figure out how to post a bug report on this, but wanted to post here first in case there's a different solution, or disagreement that this is a bug.


Update: I've filed a bug in Rails trac. You can find it here.


03 May 2007

Adobe Acquiring Scene7

Adobe is acquiring Scene7, who make superb technology for media delivery amongst other things. If you've ever browsed various Amazon merchants, Sears, Macy's, Land's End, and many other clothing and other such merchants online, who show their products in all the different colors and styles, etc., they're using Scene7 to do it. This is their dynamic imaging product. They also make eCatalogs, and various other things. Great stuff, check it out.