Tuesday, August 30, 2005

Flash and Web 2.0

Mike Chambers from Macromedia posted on his blog about what Web 2.0 is and how the Flash platform relates to it. Having spent the better part of the last six months building a substantial application with Flash which, as a by-product, has produced the ActionStep open-source component framework and using the MTASC compiler for building swfs from ActionScript, I will say that Flash is far better suited to building applications that feel like desktop apps, but that operate in a distributed manner. If Web 2.0 is "the Web as a platform" as Mike says, then Flash should be seriously evaluated for projects that are trying to build applications for that platform. If you want to just use HTML and AJAX, that's fine, but for us Flash is a must...and when you see our applications you will understand why.

Saturday, August 06, 2005

ActionStep and Rails

Some may have heard the crazy story about my integrating ActionStep and Rails at OSCON. ActionStep is an OSS component framework for Flash written in the ActionScript programming language. Rails is...well that goes without saying. I was slotted to speak on ActionStep on Thursday in the Emerging Tech track. I have to admit that although I have been doing Ruby programming for 4 years, I had never touched Rails. My job really has nothing to do with Web frameworks and such, and time slips by... Anyway, OSCON presented an opportunity to see Rails in action and I sat through David's great tutorial session. Rails is a really nice Ruby framework, and it struck me that it would be cool to come up with a templating language to build ActionStep-based UIs with Rails. Monday and Tuesday I iterated on a design with David, Dave Thomas, Glenn Vanderburg...all the fun Ruby folks, and came up with something linguistically nice. David asked me to add to my ActionStep/Rails syntax slides into my presentation as a 'teaser'. Here is an example of the templating format:

NSView :test do
  attributes :rect => {:x => 0, :y => 0, :width => 200, :height => 400}, 
             :backgroundColor => 0xdddd00
  publishes :selected_person_id => execute { names.selectedItem.label }
  NSButton :hello do
    attributes :title => "Test", 
               :rect => {:x => 10, :y => 10, :width => 20, :height => 20}
  end
  ASList :names do 
    attributes :items => @names, 
               :rect => {:x => 10, :y => 50, :width => 100, :height => 200}
  end
end

Having slides that showed this format was cool with me...but on Wednesday night all that changed. I went to hang with the FOSCON folks, and presented the teaser slides to them. People really liked the syntax and the implications of what having a Flash framework attached to Rails could mean. Then all hell broke loose. Well, actually not hell proper, but chaos harnessed in a very Ruby way by _why the lucky stiff. After his side splitting performance I went back to my hotel around 11pm and decided to just implement the syntax in Rails and ActionStep. I mean, how hard could it be to build a Rich Internet Application framework? I started at 11:30 with two Dr. Pepper and by 6:00am had stuff rendering from Rails to ActionStep. I crashed for an hour and a half, and then went to the David's keynote on Rails. His keynote gave me just the boost I needed to push it a little further and I spent the next hour getting data sent back from ActionStep to Rails. At my 11:30am session I was able to fully demonstrate Rails dynamically creating and serving an ActionStep-based UI. You could update the text templates, press refresh in your browser, and the UI would re-render with your changes. Round-tripping data...the works.

I would like to say that it was just a few lines of code, but that is not quite the case...its a few more than a few. I will be creating a Gem by the end of the month to allow people to play with things, and until that time I wrote up what the syntax looks like...you can see it here in more detail:

http://www.osflash.org/doku.php?id=actionstep_rails

To Open Source and all that it implies..um...ok, I need to sleep now.

PS. United Airlines sucks, I just needed to get that out.

Wednesday, May 04, 2005

ActionStep source is on SourceForge

Well, I went released (in CVS) what I have been busy working on for the last month. ActionStep source is now available on the project site under a BSD-style license. Whew. Porting OpenStep to ActionScript is quite a pain, and there is so very much to do. The goal was to mirror the API as much as possible (with necessary syntactic variations). In Objective-C you would create a button like this:

[[NSButton alloc] initWithFrame:NSMakeRect(10,10,50,20)]

In ActionStep you do this:

(new NSButton()).initWithFrame(new NSRect(10,10,50,20));

Other than that, the API is going to attempt to support as much as my/our little fingers can port. I have NSButton and NSTextView working, but will be making them better over the next few days. Scott Hyndman has joined in and is working on NSBox to get his feet wet. NSNotifications all work, target-action, the responder chain...good times!

When I can lay out a strategy for total domination of the UI world, I will post again, for now I need to sleep.

Friday, April 29, 2005

Ruby 1.8.2 in Tiger

Nice...the Apple team included Ruby 1.8.2 in Tiger. Tis a sweet thing indeed. If you want to build extensions for it though you need to install xCode Tools. And then, there is a minor problem with the shipped rbconfig.rb file. The wiki on the rails site here documents the change.

You can also use RubyGems to fix it too thanks to Chad Fowler who already built a Gem (fixrbconfig) to fix the problem. After you install RubyGems you just do this:


% sudo gem install fixrbconfig
Password:
Attempting local installation of 'fixrbconfig'
Local gem file not found: fixrbconfig*.gem
Attempting remote installation of 'fixrbconfig'
Updating Gem source index for: http://gems.rubyforge.org
Successfully installed fixrbconfig-1.0

Then run (from another terminal window):


% sudo fixrbconfig
====================
This program will replace your rbconfig.rb , located in /usr/lib/ruby/1.8/powerpc-darwin8.0/rbconfig.rb
Press enter continue or ctrl-c to abort.
Backing up original rbconfig.rb in /usr/lib/ruby/1.8/powerpc-darwin8.0/rbconfig.rb.bak
All Done! You should be able to compile C extensions now!

Its nice when package managers ship fixes to OSes on the same day the OS ships!

Now, full steam ahead with Ruby on Tiger!

[UPDATE] Lucas Carlson posted this very nice script to fix both the rbconfig.rb file and download and install readline support (which gives you command recall in IRB). Very nice indeed! If you have already applied the rbconfig fix, you can just snip out the lines starting with: curl ftp://ftp.gnu.org/gnu/readline...

Wednesday, March 09, 2005

Speaking at OSCON 2005

So, my talk on ActionStep was accepted for the 2005 OSCON conference which is being held in Portland from August 1-5. Its a high honor to be accepted at this event, and I thank the program committee for selecting my talk. I will not disappoint. As to what ActionStep is...heh...its coming! ActionStep is an open-source (thus OSCON) component framework for Macromedia's Flash player that InfoEther is paying to develop. There is a lot of open-source momentum building in the Flash community and ActionStep's goal is to be one piece of the puzzle. Another significant piece is the MTASC ActionScript compiler which is freaking incredible and makes ActionStep possible. I will be posting more about ActionStep soon, and will be switching my CVS to the SourceForge project soon as well. Oh, and don't worry, Ruby is still my best friend...this ActionScript language is a necessary evil!

Monday, February 28, 2005

Jef Raskin

Jef_foocamp_small Jef Raskin passed away yesterday. My heart goes out to his family and to those close to him. I only met Jef two times, but in both instances he was a vibrant and engaging person. At last years O'Reilly FOO Camp Jef brought his small model planes and to the delight of the children flew them around the parking lot. Five years ago when I was working on a prior software project (Roku) we were close to engaging Jef to help us build the user experience. That, unfortunately, fell through but I did get to visit Jef at his house on the coast of California. We spent the afternoon in a dialog about The Humane Interface and his vision for The Humane Environment (THE). His son seems to be carrying on his father's vision at The Raskin Center. The very computer that I type this on owes much of its existence to the creative mind of Jef Raskin and I will always remember him for both his accomplishments and his dreams.

Friday, February 18, 2005

New InfoEther site live

We just updated our site at infoether.com. Check it out if you get a chance. It's a database-driven flash-based site and the backend has some crazy cool stuff one of our folks developed. Its likely overkill for a corporate Web site, but hey, when you have a bunch of crazy cool developers working for you, why not!

Tuesday, October 19, 2004

RubyGems marches toward 1.0

We have a lot to celebrate today in the world of RubyGems...we passed the 5000 download mark of RubyGems and over 20000 gem libraries have been downloaded and installed. Chad Fowler has captured this nicely on his blog.

Its not too long before we reach the 1.0 milestone...but with over a hundred Ruby libraries already available and more coming every day, there is no time like the present to install RubyGems and experience an elegant solution to package management for an elegant dynamic language.

Viva Ruby!

Saturday, October 02, 2004

Alph code released into the wild

Well, here is the first public release of Alph:

Alph Project Site

Alph is a Ruby/Java/Flash (I know...I am insane) that bridges the Ruby and Flash runtimes (and Java too...but that is to solve the cross-platform projector problem that Macromedia will not solve.) With Alph and Ruby (>= 1.8.1) you can create Flash user interfaces (forms, etc) that are fully coded in, and controlled by Ruby. No Actionscript required, no Flash IDE required, just Ruby (and those dependent runtimes). Here is a simple ruby script:

This example demonstrates the List Box family of components (ComboBox, ListBox, Grid). See: http://www.ultrashock.com/tutorials/flashmx2004/ui-components06.php

$:.unshift '../lib'
require 'alph'
app = Alph::Application.new
frame = app.new_frame
frame.control.setBounds(100, 100, 640, 480)
flash = frame.flash
myComboBox = flash.new_component("mx.controls.ComboBox", 
  :editable=>false, :rowCount=>5,
  :_x=> 14, :_y=>26, :_width=>291, :_height=>22)
myComboBox.labels = ['Organic Snacks', 
 'Recycled Office Paper', 'Wind Energy', 
 'Solar Power']
myComboBox.change do |event|
  # The myComboBox.selectedItem method returns 
  # the label (not an object) because the data is not set.
  puts "You selected #{myComboBox.selectedItem}."
end
myList = flash.new_component("mx.controls.List", 
  :_x=> 14, :_y=>66, :_width=>291, :_height=>120)
# Data provider is an array of anonymous objects (label/data)
myList.dataProvider = [ 
  {:label=> "Organic cotton underwear", :data=> 7.25},
  {:label=> "Organic T-Shirt", :data=> 15},
  {:label=> "Recycled Office Paper", :data=> 6.99},
  {:label=> "Organic Cola", :data=> 1.25}
]
myList.change do |event|
  # The myList.selectedItem method returns an object with
  # a label and data property because the data _is_ set.
  item = myList.selectedItem
  puts "#{item.label} costs $#{item.data}"
end
myDataGrid = flash.new_component("mx.controls.DataGrid",
  :_x=> 14, :_y=>200, :_width=>291, :_height=>120)
# Column names align with column ids
myDataGrid.setColumnNames( ["Product", "Price", "Quantity"] )
# Data provider is an array of anonymous objects (keys = column ids)
myDataGrid.dataProvider = [
  {:Product=> "Underwear", :Price=> 7.25, :Quantity=> 3},
  {:Product=> "T-Shirt", :Price=> 15, :Quantity=> 1},
  {:Product=> "Paper", :Price=> 6.99, :Quantity=> 7},
  {:Product=> "Cola", :Price=> 1.25, :Quantity=> 24}
]
myDataGrid.change do |event|
  # The myDataGrid.selectedItem method returns the anonymous object
  item = myDataGrid.selectedItem
  puts "#{item.Product} costs $#{item.Price} (#{item.Quantity} left in stock)"
end
# You can rename column names by index
myDataGrid.getColumnAt(0).headerText = "Product Name";
myDataGrid.getColumnAt(1).headerText = "Price";
myDataGrid.getColumnAt(2).headerText = "Quantity Left";
flash.new_component("mx.controls.Button", :label=>" Close", 
  :_x=>380, :_y=>89, :_width=>120, :_height=>35, 
  :icon=>"icon_16x16_warning") do |closeButton|
  closeButton.click do 
    frame.control.close
    exit
  end
end
frame.control.show
app.wait_until_done

Pretty sweet eh?

Go download it, and let me know what you think.

Monday, March 15, 2004

RubyGems Alpha I Release

Well, tonight Chad Fowler and I released the first version of RubyGems (Alpha I). If you are a Rubyist you can download it from here. I wrote on RubyGems after I returned from RubyConf 2003 last fall, and since then we have had little time to work on it until this last weekend. Our intent is to now press on until we reach the 1.0 release. To get a good sense of the power of RubyGems see the User's Guide at RubyForge.org. My hope is that folks will start using and producing Gems and move Ruby's handling of libraries (creation, distribution, installation, uninstallation) to the next level.

Monday, March 08, 2004

Using Xcode to Edit Ruby Files

This is the first of a series of posts on using Xcode to edit Ruby files.

For those that are familiar with Xcode, this will likely not be very informational, but for those of us that are new to Apple's programming editor, perhaps it will be useful. Xcode ships with Apple's developer tools which can be downloaded here (free/subscription required). A little known fact is that Xcode syntax highlights Ruby source code, so if you aren't a VIM or Emacs disciple, perhaps Xcode is for you.

First things first. If you always want to edit your Ruby files using the Xcode editor, use the Finder to browse to a folder with a Ruby (.rb file) in it. Then single click on the file (to select it) and then chose the File/Get Info menu item. This will present a nice long information panel. In that panel there is an 'Open with:' section that has a drop down in it. Select that then choose 'other'. This will bring up a file browser. The Xcode .app file is located in /Developer/Applications. After you select 'Xcode' make sure and select the 'Always open with' checkbox in the lower left corner, then press the 'Add' button. The drop down should now say 'Xcode' and if you click on the 'Change All...' button the Finder will open all Ruby files with Xcode.

That's it. Now, whenever to double-click on a Ruby (.rb) file in the Finder, it will open the Xcode editor. Also, if you are at a command line and there is a Ruby script you want to edit, you can just type 'open myscript.rb' and it will open the default application for .rb files...which we have now made Xcode!

In my next post I will discuss setting up the editor using the Preferences in Xcode that make editing Ruby extra special (like showing line numbers, indenting, coloring, etc). I will conclude with post on using the project capability of Xcode to edit groups of Ruby files.

Saturday, February 21, 2004

At FOSDEM 2004

Well, I am here in sunny Brussels at FOSDEM 2004 going to evangelize the wonders of Ruby to our European brethren. I conducted on interview last month about Ruby and that can be found here. I will start with a tutorial on Ruby at 1400 today (Saturday) and then tomorrow at 1600 give a talk on Ruby. It seems like its going to be a nice size group, and look forward to interacting with the other speakers this evening. As things go, I will post my tutorial source and presentation here on this blog, but since these things are still evolving, they will have to wait a bit ;-)

Saturday, January 31, 2004

Adobe Sales Adventures (conclusion)

I will make this quick. Adobe failed to ship their Creative Suite that I tried to order from them three times. I went and purchased it at my local Apple store instead. For those that thought that the Web would remove the need for intermediaries because manufacturers could sell directly to their end-users forgot that most manufacturers don't really understand end-user sales.

Wednesday, January 21, 2004

Adobe Sales Adventures

Well, I don't want this blog to be a gripe space, but my recent experience with the crack sales team at Adobe has made me wonder how they ever sell anything. It all began at the end of last year when I ordered (via their Web store) the Adobe Creative Suite. I made the unfortunate choice of using a credit card that I had not used in a long time, and they bounced the Internet transaction because of concern that it was an 'out of the ordinary' purchase. So a week later I get the rejection notice via email. No worries, I just called them up (with a supplied number) and changed the credit card info. Simple right?

Wrong!

The guy on the phone was new (like 3 days) and kept having to go back to his supervisor to get help. I didn't mind this too much, I mean the guy was new, but it took like 50 minutes, several on-holds, and a hang-up (with my calling back and tracking this guy down) to place the order. One week later...no delivery...two weeks later...no delivery. Crap...I called back and was connected with someone who had been there quite a bit longer than the last sales rep. Cool. She told me that the last (50 minute) sale was never committed, thus the reason I did not receive it. I told her it was critical to get this done because we were using a 30 day trial license and it was expiring in like two days...so I need it ASAP. She took my credit card info, placed the order, and everything was just fine (and only 10 minutes had passed).

Then the conversation went something like this: she told me... "you can expect deliver in 5 to 7 days." Huh? "I just told you I need it in the next two days", I responded "Well", she said, "that is how long it will take.". Grrrr...calm... "Can we get an extension on our temporary key?" I asked. "We don't do that" was her reply, "you should have ordered it sooner". Grrr...less calm... "Why don't I just cancel that order and get it from another place where it can be over-nighted", I told her in as nice a voice as I could muster. She then said..."OK, we will credit you back the purchase in 4-6 weeks." Grrrr...much less calm. "Just leave the order as it is...don't touch it anymore...and thank you for your service". Click.

Now we await both the expiration of our temporary license (in 24 hours or so) and our Adobe Creative Suite package (in 5 to 7 days).

Thanks for the great "Customer Service" Adobe.

Tuesday, January 20, 2004

FOSDEM Talk on Ruby

I am going to be speaking at FOSDEM in February on Ruby. FOSDEM is the Free and Open source Software Developers' European Meeting and is being held in Brussels Belgium on February 21-22, 2004. It will be fun to share the excellence of Ruby with such and excellent group! I conducted an intereview earlier in the month and it can be found here.

Sunday, December 28, 2003

The Alph Project?

The Alph Project is a bridge between two language runtimes; the Ruby interpreter and the Macromedia Flash player. Flash was originally constructed to be an animation runtime and because of this it has attracted a more design-oriented rather then developer-oriented community. The Flash player is actually a stack-based virtual machine which now supports the ability to write graphical component-based applications in the ActionScript 2.0 language. Although Flash and ActionScript are powerful, the downside to developing in it is that each application you build is compiled into a binary (swf) movie, and the main development environment (Macromedia Flash) is a commercial (> $500) product. Although the Flash development tools are commercial, the player runtime is free and cross-platform.

Alph will create a free, open-source alternative for constructing dynamic Flash-based interfaces in pure Ruby and aims to be an unique, comprehensive user interface framework. Alph ships with a single binary (swf) file that when executed connects to the Ruby-based service (which could be in-machine or network/web-based). This single swf file contains all the Flash 2.0 components compiled in with a network protocol handler, method dispatcher, and event manager which allows Flash-based interfaces to be created at run-time by Ruby over a TCP/IP socket. Ruby programs will have access to the full version 2 GUI component model of Flash 2004 without the commercial costs of existing Flash tools, and those Flash interfaces will have the full power of Ruby (and its library of extensions) behind them.

I originally demonstrated an Alph interface during my RubyJDWP presentation at the Third Annual Ruby Conference in November. I am currently working (as free time allows) on getting this fully running, and will be posting the source to the Alph Project website when it gets in a state where it is possible for others to develop with. I expect the code to be online by the end of January. As I make progress, I will keep my blog up to date with interesting tidbits and things I'm learning along the way.

Friday, December 26, 2003

Creating Panther Disk Images from the Command Line

Well, its been a while since last post. I've been a bit busy as of late, but will make efforts to keep up the 'good work' of posting regularly. Anyway, I was working on my Alph project and needed a way to create OS X disk images from the command line that contained my source directories. The reason I needed to create a disk image (rather than a tar.gz file or something) was OS X holds data in the 'resource forks' of files. So, if you have directories that have OS X executables in them (not Unix executables, but OS X apps, etc) you need to maintain this data for it to be executable on another OS X machine.

I went round and round, but finally found that this simple command works great:

hdiutil create -fs HFS+ -volname DIR -srcfolder DIR DIR.dmg

Where DIR is the directory you want to create a disk image for. That's it! When the command returns you have a DIR.dmg file sitting in your current directory, and if you...

open DIR.dmg

...the finder will mount it, and you can view it there, or in the Terminal:

cd /Volumes/DIR

Note: You don't have to name the volume the directory name, you can name it anything you want...the same goes for the .dmg filename.

Sunday, November 16, 2003

RubyGems Lives!

Well, RubyConf 2003 is wrapped up and I am here at the Austin Airport with Chad Fowler and Jim Weirich. We had a great time...lots of great speakers, food and break-talks. On Friday we were there in a roundtable with Matz and someone brought up package management for Ruby (again!). Matz said if someone built a good one, he would include it in Ruby. So Chad, myself, Jim, David Black and Paul Brannan decided to just do it. We have two nights...let's build RubyGems!

We paired up and attacked the problem Friday night from 9 pm to 2 am, then a bit of discussion during the day on Saturday (and a bit of coding during the talks...shh), then Saturday night from 9 pm to 1 am and our results are up on RubyForge here.

We got an impressive start (code committed). We have Gem building, installation, uninstall, version support, dependency support, and apt-get like capability (for network installs). Of course, its really simple to use (thanks Ruby/Matz).

Here is a gemspec for Jabber4r:

require 'rubygems'
spec = Gem::Specification.new do |s|
  s.add_dependency('rexml', '> 2.7.0')
  s.name = 'jabber4r'
  s.version = "0.5.0"
  s.platform = Gem::Platform::RUBY
  s.summary = "Jabber4r is a pure-Ruby Jabber client library"
  s.requirements << 'Jabber server'
  s.files = Dir.glob("lib/**/*").delete_if {|item| item.include?("CVS")}
  s.require_path = 'lib'
  s.autorequire = 'jabber4r/jabber4r'
  s.author = "Richard Kilmer"
  s.email = "rich@infoether.com"
  s.rubyforge_project = "jabber4r"
  s.homepage = "http://jabber4r.rubyforge.org"
end
if $0==__FILE__
  Gem::Builder.new(spec).build
end

Pretty spiffy. You execute that with:

ruby jabber4r.gemspec
Successfully built RubyGem
  Name: jabber4r
  Version: 0.5.0
  File: jabber4r-0.5.0.gem

That generates the .gem file (with version) and you install like this:

sudo ruby jabber4r-0.5.0.gem
Successfully installed jabber4r version 0.5.0

Then to use it:

irb -r rubygems
> require_gem 'jabber4r'
true

Gems manage the $LOAD_PATH of Ruby which lets two different versions of a Gem be installed and two scripts could each use the one they want. The gem --remote-install will be available once a service goes up on RubyForge. For now, you can serve Gems off of your machine to anyone on your local network.

I will post more about RubyConf soon.

Thursday, November 13, 2003

Off to RubyConf 2003

I am off to the third International Ruby Conference. The first two were great, and I am sure this one will be as well. I am speaking on Sunday on my Ruby Java Debug Wire Protocol library which lets you debug Java programs from Ruby scripts across a network (or in machine). I will also be unveiling a little GUI framework I've been cooking up. Although Ruby has several bindings to graphics APIs, it does not have anything that truly differentiates it. I think this will be different ;-)

Monday, November 10, 2003

Semantic Web...show me da code.

Well, well. There is a flurry of activity in the Semantic Web world today. Clay Shirky (who I really like and admire) wrote this wonderful devastating piece about how the Semantic Web is doomed to fail. Tim Bray wrote a counter-piece here.

Interesting perspectives, but I think rather than getting into whether the Semantic Web will succeed or fail I propose another approach. I like to speak in code (computer source code that is). Let's just see if over the next year I can show something that leverages OWL, is so easy to use you don't realize you are using it, and has high value.

Oh, and I am not one of these guys that is hung up on the whole knowledge representation thing. I really like writing dynamic OO code which is why Ruby is my language is choice these days. I like building things that, while perhaps not mathematically provable, are very functional and solve real problems.

My Photo

November 2005

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      

Recent Posts

Photo Albums