Thursday, July 16, 2009

I Have Seen The FutureRuby, And It Is Amazing - Part 1

It was with tremendous excitement that my brother Damen and I had arrived in Toronto for FutureRuby. Not only were we getting to attend the reprise of what had been by all accounts the "Best. Conference. Ever.", but we were going to be speaking about Project Flying Robot.

There had been many interesting interactions with various security personnel on the journey, thanks to the many small homemade electronic devices that make up our tiny squadron. All of them were extremely friendly and professional as they carefully unpacked, swabbed, scanned, then repacked our cases full of joysticks, Arduinos, electric motors, batteries, and many wires. MANY wires.

By the hour that we arrived, we were too late to attend failCAMP (failed to make it?), but there would be many opportunities to interact with our fellow comrades in Ruby. @peteforde and @meghatron of Unspace had designed the conference with the kind of architectural integrity only a geek could conceive. It was not until the final sessions that the master plan became clear, but I will get to that.

As a result, the next morning we had no post-fail hangovers to slow us down with our last minute assembly and attempts at troubleshooting, combined with walking all over Toronto. Once the evening came, we were eager to connect with our fellows, and happy to climb the stairs to Unspace's cool digs. Pinball machine FTW! And Greg Borenstein's robotic drummer pounding the skins on Pete Forde's drum kit, controlled by Archaeopteryx. It was an excellent party, and they had to kick us out at midnight with the reminder of the talks in the early AM, not to mention the festivities yet to come.

Opening up the first day of the actual conference with the first talk was Nathaniel Talbott with a rabble-rousing speech on "How Capitalism Saves Ruby From Corporatism, or, Owning The Means of Production". This was an immediate shot across the bow of the status quo, and gave us all a clue that the 'collectivist' theme was not just a cool design style for the schwag, but also a serious theme for the conference content.

Next on was Ilya Grigorik with "Lean and Mean Tokyo Cabinet Recipes". If you do not know about it, Tokyo Cabinet is an open source key-value database, that also has server and full-text capabilities. Ilya gave a very hardcore presentation that went all the way into many of the cool things that can be done with TC right now. This was a departure against the traditional SQL way of doing things, and tied in with the revolutionary theme. You HAVE been getting up to speed on one or more non-SQL databases already, haven't you?

The next session was one I was particularly eager to hear. Austin Che spoke about "Programming Life". As in, "Hello World in a petri dish" kind of programming. I had missed the actual workshop, where some lucky people were successful as growing their own glowing bacteria. However, the excellent talk from Austin took us on a wild ride through the current state-of-the-art in biohacking. Let me put it another way: we already have the rough biotech equivalents of both Github, with the Open Bioinformatics Foundation, and Sparkfun with Auston's own Gingko Bioworks. Other sites like biobricks.org and openwetware.org are also there for anyone who wants to get started with this fascinating technology at home.

Following this was Anita Kuno with "Version Control: Blood Brain & Bones" reminding us that the human mechanism needs to be correctly maintained, and developed for correct performance. She had a bunch of specific eating techniques and foods to share, and almost immediately, it seemed that we were more conscious of what nutritional input we were routing into our individual biocomputers.

Next up was one of the best presentations of the entire conference. Foy Savas gave a talk named "polyglots Unite!" which spoke about multi-language programming, and using a takeoff on Rack named Crack to providing a kind of Rack-adapter for other web-backends other than Ruby. It is a neat concept, and I look forward to seeing where it goes. The presentation itself was absolutely fantastic. The timing, the clarity... in a word, he "killed". One of the best speakers of the conference.

Only something pretty different and amazing could follow up that, and Misha Glouberman's "Terrible Noises for Beautiful People" satisfied. It was a laptops closed participatory session that had our entire group singing, clapping, and sushing together. Not only that, but we actually played Conway's game of life using musical interaction with the entire group as the cellular automata. You can't do THAT at home! Absolutely brilliant.

Next were my brother Damen Evans and I with our "Flying Robot" presentation. Despite a few small technical glitches (hardware!) we pulled it off, and the crowd was enthusiastic. We had a great time, and congrats to the winners of the 2 Blimpduino kits @_krispy_ and @maplealmond. There is some cool video here, and lots of great photos like here, and here. Thank you to everyone who participated, we had a great time doing it!

Once we had demonstrated Ruby air superiority over the skies within the Metropolitan Hotel, it was all mobile all the time for the remains of the day. First, a 3-way talk from the guys at Phonegap, followed with a demo by Adam Blum from Rhomobile. I had seen Adam's basic pitch before at LARubyConf, one nice change was that they no longer seem to be trying to charge a per-user license. Per-user license, what's that?? I haven't seem one of those since last century, I think.

Finally, the sessions for the first day were complete. We all put on our finery, and took over Pravda, a Russian-mobster-styled vodka bar that pulled out all the stops, with many people staggering out of the vodka-freezer with smiles on their faces. My personal favorite moment was when we gave a spontaneous group loud "ahhh-clapping-shushing" in response to the wonderful announcement that Shopify was going to pay to keep the bar open longer. There was large quantities of amazing food as well. That @meghatron really knows how to throw a party!

After a pleasant stroll through the streets of Toronto, powered by Russian jet-fuel, we collapsed, to get a few comfortable, if short, hours of rest before FutureRuby Day 2.

Sunday, July 05, 2009

Getting Ready For Takeoff At FutureRuby

I just realized it has been an entire month since my last post. Sorry! In case you were wondering, the always overambitious plans for Project Flying Robot have taken up more time than expected. And parts. Especially parts.

Lucky for us, the benefit of a hard deadline approaches: FutureRuby is coming up next week. My brother Damen Evans and I are going to be showing off our latest works in Unmanned Aerial Vehicles (UAV) based on Ruby Arduino Development (RAD). I don't want to let on too much, so as to eliminate the surprise element, but this should be our biggest spectacle yet.

So if you're going to be in Canada next week, we look forward to seeing you. If not, I'm sure there will be plenty of video to watch in either amazement or amusement, depending on how well we can pull this off...

Wednesday, June 03, 2009

Project Flying Robot: Supporting The Blimpduino

As Maker Faire approached, my brother Damen and I were very busy working on something cool: support for the now-shipping Blimpduino kit!

Thanks to the tireless efforts of Chris Anderson and Jordi Muñoz, the long awaited Blimpduino kit is now shipping at Makershed. As readers of this blog know, we have drawn a lot of inspiration from the Blimpduino. Now, we actually have 2 of them, and you can get your own. For less than $100, plus a few other items, and flying_robot software of course, you have everything you need for a complete experimenters kit for Unmanned Aerial Vehicles at home.

There are a few mods you need to make to your Blimpduino, if you want to be cool like us, and control/reprogram it using a linked pair of XBee modems. We will post complete directions soon on how to mod your blimpduino into a flying_robot using Ruby Arduino Development.

In the meantime, you can look at the almost completed flying_robot for Blimpduino code here.

Sunday, May 17, 2009

Fear And Loathing At RailsConf 2009

We were around Barstow on the edge of the desert, when the drugs began to take hold... wait, that was someone else's story. OK, restart.

We were around Barstow on the edge of the desert when the excitement began to take hold... we were on our way to RailsConf 2009! No screaming bats, just loud pumping techno music to power the PT Cruiser. My designer, who was not old enough to be pouring beer on his chest, nor interested in facilitating the tanning process, said "What the hell are you yelling about?". I aimed the Cruiser toward the horizon without slowing down, "I need an In-n-Out milkshake."

Las Vegas... what a place. Putting RailsConf there is the sort of idea that makes sense on paper, but could turn a previously mild-mannered group of Ruby programmers into a mob of raging lunatics. Come to think of it, a group of Ruby programmers IS a mob of raging lunatics. Case in point? Video slot machines... the worst odds in vegas, but the best graphics. How will a group of perpetually partially attentive people be able to resist the siren call of millions of sensory distractions each designed to exert psychological pressure to LOOK AT ME? Seems like an interesting Milgram-like experiment.

The back of the PT Cruiser was full of musical gear for the RailsConf music jam. With a small but effective PA and a few spare guitars, this session should be the best one yet. Could we play Vegas? Without offending the locals, or running afoul of some Musician's Union enforcers, that is.

I had meant to keep meticulous notes, and post a flurry of blog entries as I have done as RailsConf's past. But the dull fog of Vegas combined with the mad dog sentiments already awakened in the Rails community at GoGaRuCo, left me with the sure knowledge that no matter how hard I might try to offend the insiders, no one would even notice with the continuous drunken flame wars that RailsConf Vegas would become quickly known for throughout the Twitterverse.

The madness had taken hold long before we hit Vegas, and adding alcohol and neon fueled hyperstimulation only had the effect of pushing us into a raging frenzy. "Tim Ferris? How DARE he tell ME to exercise. Bob Martin? How dare he accuse me of not testing? Everyone else? How dare they dare to dare, or else how dare they not dare to dare! Forgeddaboutit!"

Just then my already tenuous sanity began teetering, and I started yelling that the White Rabbit and I had been pair programming together for years. The wild-eyed activist within me leaped into action, and I practically elbowed people out of my way to get to the mic, to ask Uncle Bob the burning question on my mind: "What happened to the social revolution you started with Kent Beck and Ward Cunningham?"

From the look in his eyes, I know the question haunted him, just as it still haunts me. If this is the utopia, why are we all fighting so much? "I saw the best minds of my generation destroyed by madness, starving hysterical naked..." and still Twittering away trying to validate justify, explain, strengthen, while simultaneously eroding it, tearing it away.

I had to escape, find a place to hide and collect my shattered illusions. Fortunately, the safety zone of CabooseConf greeted me. The comfort and sanity of watching my programming buddies hacking together an LLVM implementation for AVR was like slipping under a warm, soft blanket, after the frenzy that had started while I was sitting in the Reptile Room, watching some giant lizards get ready to feast on fresh ideas.

Days had passed, but in the strange netherworld between Vegas's clockless existence, and the constant Twitter flow of new input, I had lost all sense of temporality. It was a surprise that we had already come to the final keynote aka Q&A session. It was an odd demonstration of our shared exhaustion and sensory overload, that pretty much no one wanted to ask any questions.

"Time to get out of here!" I said to my designer. We piled the PT Cruiser full of our gear, plying the staff with dollar bills like we were mythical high-rollers. I drove like the wind, but it was not quickly enough. Leaving behind a cloud of gritty, baked dust, we fled from a man-made 24-hour spectacle that even Dante could have never imagined, even if he had taken all the drugs available to an Italian in the 14th century at the same time.

With apologies to, and in memory of HST, we need his free spirit now more than ever

Wednesday, April 29, 2009

Heroku Has Launched

Well, just a very short time after I started using Heroku, they went commercial. Yes, after their very successful beta period, where apparently 24,999 web sites other than mine were already hosting, Heroku is now offering a paid version of their service. I had a sneak peak at the pricing a few days ahead of time, but I was not able to talk. And despite my intentions of blogging this right away, the other demands on my time have kept me occupied till just now.

Heroku is mimicking the successful "freemium" pricing plan of other services, but brings it into the Ruby web application hosting space, within some pretty generous limitations. Yes, exactly. Heroku still allows you to get started with their service at no charge at all. Wow. I do not know of any free web hosting service that does not at minimum plaster your site with hideous ads. Let alone quality Ruby hosting. Let alone Ruby powered cloud computing.

As your traffic needs increase, or database storage needs, they have a variety of pricing tiers. Thanks to a slick AJAXified pricing tool, the complexity of so many pricing options is somewhat mitigated. Plus it's fun to play with.

The evolution of most startups seems to track really well with Heroku's overall business strategy: as a customer becomes larger and more successful, their increased traffic and database needs will cause them to start paying Heroku. If your venture does not really go anywhere, it is not really taking up much in the way of resources anyhow. This aligns Heroku nicely with the needs of their customers, instead of pitting them against them trying to extract revenues too early in the growth curve.

Despite a few growing pains, they have had pretty decent uptime on my app so far. Even with my new app Thumbfight getting a few sudden traffic bursts, as well as having a major reliance on Twitter for back-end processing (more about Thumbfight in an upcoming post).

Heroku is a work in progress, but so is most everything else on the entire Internet. Heroku provides an amazingly easy and insanely cheap way to jumpstart your Ruby-based web application hosting and deployment, while still getting some real expertise. As long as you can work within their current technical limitations, for a Ruby-powered startup, I think Heroku is a great way to go.

Saturday, April 18, 2009

Project Flying Robot: Getting RAD With The ATMega328

I have been wanting to upgrade the hardware used in our Dorkboards for flying_robot, from the ATMega168, to the newer better faster ATMega328. More memory, and a faster UART for serial communications with the XBee modems in the same pinout = easy win. Thanks to a quick shipping turnaround from @adafruit I got them in before the weekend, so I could play a little bit today.

The first step was to upgrade my hard-working Arduino Diecimila to a 328. I now have it working great with Ruby Arduino Development (RAD), but since RAD was really setup for Arduino 12, I had to make a couple changes. Here is what I did:

1. D/l and install Arduino 15 (brave, I know, since that is the latest release, and many people run one version down from the latest)
2. Change my hardware.yml entry
mcu: atmega328p

3. Change my software.yml entry
arduino_root: /Applications/arduino-0015

4. Lastly, since the ATMega328 bootloader runs at a faster rate, I had to tweak the RAD code itself to support it. The file "/vendors/rad/generators/makefile/makefile.erb" is the template used to create the makefile that compiles and uploads the code to the Arduino. Line 77 in that file controls the baud rate, which needs to be set like this for the '328:
UPLOAD_RATE = 57600


Once I had done this, I was easily and quickly able to recompile/re-upload the latest flying_robot code to my test board. Yeah! Hopefully tomorrow I can upgrade Rogue 1 and try a flight at the new, higher communication speed.

Tuesday, April 14, 2009

Heroku, Why Haven't I Been Using You Till Now?

Last night, I finally got around to deploying something on Heroku, an interesting service founded by my formerly LA-based Ruby programming chums Adam Wiggins, James Lindenbaum, and Orion Henry. I had played with their previous incarnation of the service, now known as "Heroku Garden" but only recently have I gotten to know a little bit more about the incredible offering they have evolved into.

Basically, the Heroku crew have addressed the question "how can I deploy my Ruby on Rails, Sinatra, or other Rack-based web application into a dynamic cloud of servers with ridiculous ease?" They have done this with an ingenious architecture that takes advantage of Amazon's EC2 to provide their internal infrastructure. This allows Heroku to concentrate on their most important core value proposition, of a simple way to take your Ruby code and just push it into the cloud.

Notice I said "push". Heroku requires that you use git for source control of your application. You are using git for everything now, right? If not, git with it! Sorry, could not resist that. Anyhow, by simply adding a remote master to your existing git repo that points to Heroku, along with a few Ruby gems that they provide, you can deploy your app just by pushing your current branch to the Heroku master.

Doing this, causes your app to get packaged up into "slug". Once you have an active slug, it will be be deployed to a "dyno" within the Heruku grid, which is what a virtual node within their architecture is called. As your app requires more resources, the slug can be deployed to more dynos within "less than 2 seconds for most apps". That is way faster than starting up a new Amazon EC2 instance yourself, and having this extra layer has a number of other interesting benefits as well.

Heroku has a quick start guide, which pretty much runs down what you need to do. I had found a slightly more simplified quickstart here. I already had an existing Sinatra-based app that I wanted to test on Heroku, so here were my steps:

1. Install heroku gem
sudo gem install heroku

2. Setup Heroku account info, and upload public key
heroku keys:add 

This will prompt you for your Heroku account info. If you have not created one yet, better jump over to http://heroku.com/signup and create one

3. Create Heroku app from my existing app
I just changed so my current directory was the app I wanted to add to Heroku, then entered:
heroku create myappname

This creates the new app on Heroku, and creates a remote branch so you can deploy just by pushing the code.

4. Deploy my code
git push heroku master

That's it! If you have a really simple app, with no database access, you are done. What, you are deploying a Ruby on Rails app and need a database setup? OK, then...

5. Run database migrations
heroku rake db:migrate


NOW, you are fully deployed and running on Heroku. Unless you are not. I still had a minor problem with my app. I was writing my log file into "logs/production.log" but Heroku does not normally allow write access to disk. The two exceptions to this are the "tmp" directory and "log" directory (notice singular). They do provide an easy way to view your most recent log entries, by typing
heroku logs
which is how I figured out my problem with the log directory.

So, here is my total time required to deploy this app on Heroku:
- Reading quickstart = 3 minutes
- Installing gem and entering account info = 2 minutes
- Making my app a Heroku app = 1 minute
- Deploying my app for the first time to Heroku = 2 minutes
- Figuring out what I had done wrong from the Heroku documentation = 10 minutes
TOTAL = 18 minutes

Here were my bonus steps:
- Reading Heroku docs on using a custom domain with Heroku = 1 minute
- Realize I need to rename my app using Heroku command line = 1 minute
- Rename my app using Heroku command line = 1 minute
- Setting my DNS settings to point to Heroku = 5 minutes
- Telling Heroku about my custom domain = 1 minute
TOTAL = 9 minutes

So there you have it... a fully deployed app, living in the Heroku grid and consequently the Amazon EC2 cloud, in less than 30 minutes, having never used their tools before, including troubleshooting a minor configuration problem. That may seem unfair... and it is. That is exactly the kind of unfair I like on my side!

Much credit should go to the Heroku team for creating something extremely cool and functional. Important details are still not available, like pricing etc., but at least for now Heroku, is a great way to easily get your app up into the cloud within literally minutes.

What is the future for Heroku? Funded by Y Combinator, they have been quietly working away, and now with Sinatra team leads Blake Mizerany and Ryan Tomayko onboard as well, I think we will be hearing a lot from this exciting little company.