Building RMagick on OS X

I’d always heard that building RMagick was supposed to be just this side of Hell. However, some intrepid soul (I’m sorry, I lost the original post), listed several steps for building RMagick. I put these steps together into a single bash script that downloaded everything that I needed and built RMagick with only a few complaints and what seems to be a working final product. Just beware that the script is nothing fancy, i.e., it is hard-coded to what I believe are the current versions of the RMagick dependencies.

Follow the link for the script.

Continue reading →

RubyOSA presentation to Northern Virginia Ruby Users Group

This evening’s NoVaRUG was a good time. Rodney Degracia spoke first about RubyCLR, which provides a dynamically generated bridge between a Ruby VM and the RubyCLR. If I ever need to get at .NET internals again, now I know how I’m going to do it. In fact, I dropped an e-mail to a colleague in the office about it — except that his assembly is executed from Python. A quick Google turned up “Python for .NET” as an option.

Then it was my turn to talk to RubyOSA and RB-AppScript. Admittedly, after using both, I’m strongly biased toward RubyOSA. I have the distinct feeling that, after my presentation, the audience felt the same way.

Well, the Mac users in the audience.

Out of twenty or so people in the room, it turned out that I was really presenting to perhaps five or six Mac users. I suppose that RailsConf is in no way representative of your average Right Coast Ruby developer. However, oddly, nearly everyone stayed for my presentation. I even fielded several good questions. All in all, I had a blast.

When Xandy asked for topics for next time, I asked if someone would present on RSpec. His next words were, “Thanks for volunteering, Evan.”

Time to learn RSpec…

Slides available here: OS X Scripting with Ruby

Three words: “Ruby on iPhone”

Yes, that’s right, ladies and gents. Thanks the hackery of a great many individuals (no, I am not among them), just this evening, I ran the following on my iPhone:

ruby -e “10.times { puts ‘foo’ }”

You can guess what happened.

Here’s how you do it, in short order, with minimal agony: Use the unofficial Installer.app developed by some folks at NullRiver. That’s it! From there, install the “Community Sources”, install “Ruby”, the BSD extensions, and “Mobile Terminal” and then go rubify yourself.

Ironically, this is not officially a product of theirs — more than likely because it is unwise to declare third party software for the iPhone as an official product at this tenuous time.

I wonder how long it will be before some intrepid Ruby coder works out a way to get to UIKit easily from Ruby and gens up some rdoc for it. I wonder if SWIG would help here?

Just for giggles, I tried:

ruby -e ’start=Time.now;a=1;b=1;1000000.times {a=a+b};puts a;puts “time: #{Time.now - start}”‘”

On my 2.16 Ghz Core Duo Macbook Pro, this took 0.280763 seconds. On the iPhone, this took 10.060393 seconds.

Looks like a speed difference of a factor of 50 for this simple computation.

Update: Um, ok, maybe it’s closer to 36 than 50.

Return values in RubyOSA

While holding the Ruby Hoedown BoF about RubyOSA and AppScript, I mentioned how I’ve never gotten a return value out of RubyOSA — which is why I used AppScript when I needed a return value.

Shoot me now.

A quick google of “rubyosa applescript return value” yielded this post to ruby-talk-google. Woops…

It’s this simple:

require 'rubygems'
require 'rbosa'
skype = OSA.app('Skype')
OSA.wait_reply = true
call = skype.send2 "call echo123"

And call is non-nil.

Admittedly, I’m somewhat at a loss as to why wait_reply is defaulted to nil…

Update 8/11/04 1609: Laurent tells me that, if the Applescript definition is correct, RubyOSA should correctly provide return values. Chalk that up as yet another bug in the Skype Applescript API. I’ll report it soon (it’s going into iGTD now…).

– Thanks, Laurent!

What were the iPhone developers smoking?

Ordinarily, I would not blog “gadget” here. However, as a would-be iPhone developer and a new user, I have some bones to pick. I call this my “What the hell were the iPhone designers smoking?” list.

  • For whatever reason, Apple didn’t include a mass e-mail deletion utility. While most folks are not likely to be on 10 or more listservs about Ruby and Ruby on Rails, several are likely to have a PEBKAC moment and download their entire collection of e-mail to their iPhone. What oh what to do? I suppose it’s just time to sit in a corner, cry, get angry, accept your situation, and then begin the arduous and tedious task of deleting e-mails one by one…(Update: Alternatively, host your e-mail on IMAP and manage bulk mail activities from a dekstop mail client)
  • Why can’t I save images from Safari and E-mail to my “Photo” list (for use as wallpaper or just to add to my collection)? Many of those crazy enough to pick up an iPhone on launch day will have something like a Flickr account. Sure, there’s a workaround:
    1. Save image to hard drive
    2. Add to iPhoto (You’re on a PC, you say? Oops…)
    3. Put photo in album
    4. Sync album to iPhone
    5. Create wallpaper from new photo on iPhone
    Meh.
  • If we’re limited to “web applications” for 3rd party software, why oh why can’t the iPhone save pages in memory to its generous 4/8GBs of storage? If I have an application that is one HTML file with associated CSS and JavaScript and data being saved to a cookie, this just makes common sense. I already love OneTrip but everytime you load it over EDGE a kitten cries…
  • The Calendar is nice but To-Do lists, anyone? I suppose that none of the iPhone devs are GTDers…..
  • No copy/paste? Three letters: WTF?
  • Turn by turn Google Map instructions but no GPS — not even “poor man’s GPS” triangulating your location based on nearby cell towers? E911 already does it….
  • Did I mention that interacting with the screen while Safari is loading a complex web page (try http://iphoneapplicationlist.com/) will cause Safari to “crash” and dump you back to the iPhone home screen.
  • Is this why Leopard was delayed in favor of the iPhone? Too much scope, too few resources?

    Don’t misunderstand, I love my iPhone. However, I still see it as a v0.95 product — just one that, so far, has bugs/quirks that I can work around.

More RailsConf 2007 Material

Here are recordings for the following sessions:

Also, here are Andrea O.K. Wright’s slides from her respond_to code walkthrough presentation. This was one of the most technical and in-depth code walkthroughs other than the “Rails Way” walktrhough. Enjoy!

Initial Release of JustCall for OS X

After goofing around at home for a few days, I finally get back on the coding wagon, fixed a few more bugs, and packaged up JustCall v0.5.1 for release. It’s avaialble here. Feel free to play with it. It’s simple but that’s the point!

In later days, I’ll be adding call answering to it. Basically, this will pop up a panel with two very large buttons to accept or deny a call. After that, if anyone other than my wife regularly uses it, I’ll see about adding some new features. Otherwise, it’s back to writing additional tools to help me manage my media server or otherwise simplify some minor productivity annoyances that I have with various OS X apps.

RailsConf 2007 Sessions (part 1)

Thanks to Matthew Cowley (madcowly on irc.freenode.net) for cleaning up the audio on these recordings, I now have three RailsConf07 sessions to share. For all of the below presentations, I asked for and received permission from the presenters to record and share these sessions.

Links below.

Enjoy!

Session audio recordings hopefully on the way…

… but, in the meantimne, enjoy the “JQuery” and “Automated Scaffold” BoF audio recordings.

Donwload - [JQuery BoF]

Donwload - [Automated Scaffold BoF (Streamlined, ActiveScaffold, Hobo, AutoAdmin)]

As for the sessions, I ran into a minor snag with my audio recordings. While the MBP mic picked up the audio adequately, it also did a fantastic job of capturing my typing during several of the sessions. Another RailsConf attendee, one with a radio background, is attempting to clean the audio up. With luck, I’ll have some sessions posted soon.

RailsConf 2007 Day 1

After a day of tutorials covering Streamlined and Script.aculo.us, the first official day of RailsConf kicked off today to Chad Fowler and a yukalele. Yes, a yukalele.

Minute musical machinations aside, it’s been a helluva first day.

The most amazing thing about RailsConf is the sheer breadth of the community. I have been introduced to more technologies in a day than I can easily recount off of the top of my head. To name a few, there’s GeoKit - a Rails plugin for location-based apps that uses Google for geocoding, Telegraph - a Rails plugin that provides a DSL for easily generating voice user interfaces through Asterisk from Rails, UJS - Rails plugin for generating accessible JavaScript for Rails, Merb - a performance plugin for Mongrel that considerably improves Mongrel’s ability to handle uploads, RAAKT, LiquidLayout, ActiveWarehouse, and RVideo — just to name a few.

So far, the most impressive I have seen, by far, has been Telegraph. Jon Palley’s demo simply knocked my socks off. Jon essentially built JAHJAH in about 10 lines of code. If you’re too lazy to follow the link, his simple web app took 2 phone numbers as inputs and connected both numbers via a VOIP call initiated from his Asterisk PBX. I’m dead serious: 10 lines (give or take a few). Telegraph looks to be that powerful. It provides functionality for statusing and managing call states including call recording. Walking out of the sesion, my brain was abuzz with the possibilities. Feel like building your own WebEx or web-enabled conference calling system? Honestly, it looks pretty darn simple from the demo.

Granted that another conference attendee told me that developing for Asterisk can be it’s own pain.

And, so far, I’ve totally neglected to mention the bevvy of improvements that DHH announced for Rails 2.0 today in his keynote: a “new” (it’s been in the wings for a fair bit although I haven’t played with it) REST-centric approach to controllers allowing them to render any number of different types of views with support for rhtml, builder, and XML (although still generting XML that is tightly bound to your DB schema) out of the box, declarative breakpoints in Rails that will drop you instantly into IRB at the breakpoint, and a new and DRYer DB migration syntax, to name a few.

It’s been a full day and my list of technologies to research and review is only partially covered above.

And there are two more days yet. :D