Monday, July 23, 2007

First Facebook App (but not the last)

We have been working with Voxant over the last 6 months or so to move them over to a new infrastructure for their Web service TheNewsRoom. TheNewsRoom is a pretty cool service that allows you to find and embed 70+ news sources' news stories into your own Web site/blog and you get a cut of the ad revenue generated. They have LOTS of news sources too in video, text or image formats. The stories are streamed down in Flash.

TheNewsRoom has been resurrected in Ruby/Rails (of course) from is prior short and painful life in Java. Tom, Ryan and Dave have been working mostly on the Ruby/Rails stuff and I have been focusing on creating a very flexible media streaming framework in Flash/Actionscript for them. I would prefer the Ruby coding, but hacking Actionscript is where I am needed right now.

That is until about two weeks ago when Chad (our new CTO) and I decided that it would be cool to get TheNewsRoom to run inside of Facebook using their new app API. Chad and I did a quick weekend development effort and then showed the Voxant folks. They were quite thrilled to see their content streaming inside of a network of 30 million potential users (and growing). They gave me the go-ahead to develop the app in full and last Friday we launched it (and I got to build it in Ruby...and Rails...yeah!). After a weekend of waiting for the Facebook folks to approve the application its now in the directory. Since Facebook does not really have news outside of what your friends are up to, this is a pretty solid news app. Right now its focused on video news but we surface 13 different categories including Business, Entertainment, Health, Life and Leisure, Politics, Science and Tech, Sports, US, World, and a few others including "Odd" (which has some weird stories in it). When you watch a news story you can comment on it and your comment will post on your profile (so your friends will see it in their feed if they have TheNewsRoom installed). There is an additional category of just news items that you and your friends have commented on (News with Comments). Its simple to use and fun to watch and comment together on what's happening in the world. Give it a spin if you are on Facebook. If you are logged in, navigate to this URL: http://www.facebook.com/apps/application.php?id=2406724706. Let me know what you think.

Update: It seems like if you have a Facebook app that you want to link to, you can just use this URL pattern: http://apps.facebook.com/thenewsroom and it will take you either to the app or let you install it. So, go install TheNewsRoom app!

Thursday, February 16, 2006

Get indi baby!

Well, after a year of very hard work, we have finally entered a (limited, invitation-only) Beta for indi. What is indi? You can find out here: http://getindi.com. indi is our answer to folks who believe that you need to put all your stuff on their servers to gain anytime-anywhere access to it.

Technically indi combines a lot of the work I have done in Ruby such as FreeBASE (plug-in framework for the FreeRIDE IDE), Jabber4r and Alph (Ruby to Flash bridge) with the work I have been doing in Flash/ActionScript...specifically the ActionStep port of the OpenStep/Cocoa App Kit to Flash. This combination creates a cross-platform execution environment with Ruby as the data manager, and Flash for the UI.

indi runs on OS X and Windows right now, and as soon as Flash 8 is supported on Linux it will run there as well. indi is more like a platform than an application, and its going to allow us to give some really cool capabilities to our users and deliver on a vision we have of digital independence (reverse the two and you get in..di - indi).

Anyway, we have a busy schedule ahead to release our next Beta in about 4 weeks at O'Reilly's Emerging Technology Conference.

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.

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...

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 ;-)

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.

My Photo

May 2008

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 31

Recent Posts

Photo Albums