RailsConf 2008 David Heinemeier Hansson’s Keynote Video


RailsConf 2008 David Heinemeier Hansson Keynote on Vimeo.

Part of dhh’s message was to spread the message…so I assume I should be fine to publishing these extracts from David’s keynote. I was sitting at the back of the room and took some videos snapshot. I didn’t film all the talk as I didn’t have a tripod, but this will give you a nice overview of the what was going on during the talk…Rails is pretty big, there where lots of people there…and David was going beyond technology and telling the attendance that all Rails developers should seize the opportunity Rails create to improve themselves and not only from a technical point of view. Check it out.

Warning: I didn’t edit the video and didn’t have a tripod so it’s quite ruff and shaky. Also oreilly is going to publish an high quality official one.

Update: video was gone…seems to be back now.

RailsConf tutorial and source code open sourced

Thanks to everyone that attended the Powering AIR with Rails talk. That was really cool. I didn’t realize how hard it is to give such talks, but hey…party time now. It’s fun to give a presentation the first day at a conference, we can now enjoy the rest of the conference.

You can find the slides and the source code at:

http://github.com/danielwanja/railsconf2008

We presented the following 10 AIR applications:

01_AIRBrowser 
  mx:HTML
  dougmccune CoverFlowContainer

02_HelloBlog
  ActionScript/Javascript Brige
  Drag Drop API

03_WebSnippet
  javascript injection using HTMLComponent
  File
  Sprite/drawing API
  Window API
  Bitmap manipulation
  
04_HTMLFileBrowser
  File System Access
  AIRAliases.js

05_OfflineCampfire
  Windowing API
  flash.desktop.NativeApplication
  DockIcon
  SharedObject

06_S3Browser
  flash.filesystem.File.upload
  HTTPService + REST (list, create, delete)  
  attachment_fu (S3)
  
07_SQLExample
  sql lite from AIR
  
08_PhotoBooth
  flash.media.Camera
  flash.media.Video
  flash.net.URLLoader
  attachment_fu (file)

09_TwitterSpider
  Charting API
  DataGrid/Filtering
  
10_TwitterFriends
  com.adobe.flex.extras.controls.springgraph
  twitter4r

Enjoy,

Daniel and Tony!

RailsConf 2008 is started.

RailsConf this year has a pre-conference tutorials days which was optional and it’s starting now. However attendance seems already pretty big and there was a quite long queue to the registrations desks. I am now at Denny’s for my breakfast and will skip the first tutorial and meet with Tony to apply the finishing touch to our talk. We have a lot of code to present, I hope we can cover all the details in the 3.5 hours we have. We will publish the slides and the source code of the 10 apps we are going to present, so if you didn’t make it to RailsConf or our talk you still can get a glimpse at what we are presenting. The slides will have code extracts, but during the talk we will not use them as we will run and show the apps, so there is still good value if you attend the talk :-). See you there!

Enjoy, Daniel.

Catching StackOverflowError and a Bug in Regex Implementation in Java

Shortly after we launched SunWikis almost a year ago, we started having an issue with StackOverflowError, which was occurring when the content of certain wiki pages was being parsed and URLs where being extracted. I documented the issue in CONF-9392.

The problem is not really a bug in Confluence (even though using an overly-complex regular expressions doesn’t help the case), but it’s a problem in JDK. After a brief search at bugs.sun.com I found the root cause of our StackOverflowError documented as bug 6337993.

Originally I tried to mitigate the situation by increasing the memory reserved for the stack data via the -Xss JVM parameter. This helped a little bit, but wasn’t good enough in most cases.

Last week I decided to go against everything I’ve been taught, and wrote a patch for Confluence that wraps the part of code that results in the StackOverflowError into a try/catch block. I know that any throwables that extend from Error should not be caught by a client code because they usually indicate a failure that only JVM should try to recover from, but IMO in the case of StackOverflowError, the situation is a bit different. That is mainly because before throwing the StackOverflowError, JVM pops the stack, so by the time the code execution gets to the catch block, JVM has already recovered from the error.

I don’t claim this to be a solution to the problem, it’s just a workaround that works better than increasing the stack size in this particular case. The fact that Confluence doesn’t find all the URLs in wiki pages (used mainly to list outgoing links in the page info view) is just a small sacrifice, compared to inability to save or copy the page.

As for the solution, it seems that reimplementing Java’s regular expressions library would be the most suitable one. I tried to run a code that fails in Java in JRuby, which uses a port of Oniguruma regex engine for Java and things worked flawlessly and as I read it also gives JRuby a performance boost over java.util.regex.

#111 Advanced Search Form

If you need to create an advanced search with a lot of fields, it may not be ideal to use a GET request as I showed in episode 37. In this episode I will show you how to handle this by creating a Search resource.

#111 Advanced Search Form

If you need to create an advanced search with a lot of fields, it may not be ideal to use a GET request as I showed in episode 37. In this episode I will show you how to handle this by creating a Search resource.

Powering AIR Applications with Rails – RailsConf tutorial preview.

Last night I gave a 2 1/2 hour tutorial preview at Derailed (Denver’s Ruby On Rails User Group) of the talk Tony and myself will be giving at RailsConf next week. This allowed me to understand if we have enough material and what needs to be changed for the different sections we are going to present. I guess we have too much material as I wasn’t able to present some of the apps I have created for the presentation. Attendance was pretty low, about 15 people, but the feedback was excellent and it seems they have appreciated the talk. For the talk we will be showing how to code many of the features and ways in which using AIR can enhance your Rails application. Lot’s of code in the second part. We will cover the different APIs AIR provides such a File system access, Native Drag&Drop, Native Windowing, Dock Notification, Sending binary files to S3 via attachment_fu, taking photos from your webcam and sending them directly to your Rails app (attachment_fu again!), how to manipulate the HTML DOM, and of course a couple of twitter related apps, one using twitter4r and the other spidering twitter.com (I hope I am not the guy who is bringing it down)…and much more. If you intend to attend drop us a line. See you there!

Daniel.

#110 Gem Dependencies

In Rails 2.1 we now have the ability to set gem dependencies. Now it’s easier than ever to specify which ruby gems our rails app relies on.

#110 Gem Dependencies

In Rails 2.1 we now have the ability to set gem dependencies. Now it’s easier than ever to specify which ruby gems our rails app relies on.

#109 Tracking Attribute Changes

Rails 2.1 keeps track of the changes you make to a model’s attributes. It also allows you to see what the previous value was. But watch out for the gotcha! See this episode for details.

#109 Tracking Attribute Changes

Rails 2.1 keeps track of the changes you make to a model’s attributes. It also allows you to see what the previous value was. But watch out for the gotcha! See this episode for details.

Biznik – Ruby on Rails Podcast

The founders of Biznik talk about business networking, their BizJam Conference, and Rails.

Sponsor

Biznik – Ruby on Rails Podcast

The founders of Biznik talk about business networking, their BizJam Conference, and Rails.

Sponsor

#108 named_scope

The named_scope method in Rails 2.1 makes performing finds on models very elegant and convenient. See how in this episode.

#108 named_scope

The named_scope method in Rails 2.1 makes performing finds on models very elegant and convenient. See how in this episode.

#107 Migrations in Rails 2.1

Migrations now have a timestamp as their version number in Rails 2.1. In this episode I will explain this change as well as show you some other cool additions.

#107 Migrations in Rails 2.1

Migrations now have a timestamp as their version number in Rails 2.1. In this episode I will explain this change as well as show you some other cool additions.

Who Needs an API?

GitHub is a pretty fun site to work on, I’m not gonna lie. On more than one occasion, we thought it would be pretty cool to setup a service allowing public projects to receive donations.

Sounds like an Itch

Pledgie being the venerable service it is, I decided one night it couldn’t possibly be that hard to integrate it with GitHub. It’s a pretty standard Rails site with some simple forms to make the magic happen (eg. setup a donation page).

They don’t have an API (yet), but in this day and age, you really don’t need one if you procure the proper tools.

Enter Mechanize. You can do all I’m about to describe with just Net::HTTP, but seriously, who wants to do that?

Start Scratching

Step 0: Drive girlfriend to airport, buy a case of Anchor Steam, and turn off the Xbox.

Step 1: Sign up for a Pledgie account, cause GitHub’s a regular user after all.

Step 2: Write the interface on GitHub to accept the user’s Paypal address.

Step 3: Figure out the form fields I should be filling out to login and create a new pledge on Pledgie.

Step 4: Write the Mechanize code:

def pledgify(email)
  agent = WWW::Mechanize.new
  page  = agent.get('http://pledgie.org/accounts/login')
  form  = page.forms[1]
  form['account[login]']    = GitHub::PledgieUser
  form['account[password]'] = GitHub::PledgiePass
  page  = agent.submit(form)

  link  = page.links.text(/Create A Campaign/)
  page  = agent.click(link)
  form  = page.forms[1]
  form['campaign[title]']        = "FooBarz" 
  form['campaign[paypal]']       = email
  form['campaign[description]']  = "The best project evar!" 
  form['campaign[end_date(1i)]'] = 10.years.from_now.year.to_s
  page = agent.submit(form, form.buttons.last)
  update_attribute(:pledgie, page.uri.to_s[/\d+/])
end

Step 5: Take the pledgie attribute we just grabbed and put a cool badge in their repository’s detail box.

Step 6: Watch the millions pour in for GitHub’s hard-working open source committers.

The obvious caveat here is that it relies on Pledgie not drastically changing the structure of its HTML, but it’s incredibly satisfying to throw something together like this in such a short amount of time.

PS. If you’re on GitHub and wondering how you missed the original announcement, the post is here: http://github.com/blog/57-getting-paid-the-open-source-way

#106 Time Zones in Rails 2.1

In the past, time zones have been very difficult to work with, but no longer! Rails 2.1 brings with it great time zone support as you can see in this episode.

#106 Time Zones in Rails 2.1

In the past, time zones have been very difficult to work with, but no longer! Rails 2.1 brings with it great time zone support as you can see in this episode.