Subscribe: Dead Programmer Society
Added By: Feedage Forager Feedage Grade A rated
Language: English
app  application  code  database  flying robot  git  heroku  install  new  phonegap  project  rails  ruby  server  time 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Dead Programmer Society

Dead Programmer Society

To the day that the programmers start running the asylum. Carpe Codex!

Updated: 2018-03-06T07:32:03.301-08:00


The Blog Drought Is Ending


After taking so much time off of any serious blogging (there might have been a guest post or two somewhere), I'm finally starting to feel the urge again to write something longer than 140 characters. The last year has been an incredibly busy one with The Hybrid Group, KidsRuby, and so much other goodness.

So if any of you are still with me, I've returned. Hello!

Gabba: A Ruby Gem For Doing Server Side Google Analytics Tracking


Yo, Gabba! Gabba, hey? Gabba is a Ruby gem to do easy server-side Google Analytics tracking of page view and custom events. Gather around and I'll show you how it works.

Google Analytics is the gold standard of website traffic reporting. In addition to tracking page views, one of the interesting capabilities it has is to track custom events. These could be shopping cart checkouts or video plays from clicking on a button in a Flash player.

The way that Google Analytics is implemented is using the typical tracking image technique. An image is fetched from the server, and based on the infomation pased with this request, the information about the visit is tracked. One twist on this is that Google Analytics generates the tag for the "traxel" using a piece of asynchronous JavaScript. This means that clients without javascript are not able to use Google Analytics to track visitor metrics... or does it?

There is another lesser-known way to integrate that can generate the needed info entirely on the server. This is normally used to handle older mobile browsers that do not have JavaScript implementations. Since all you are doing is fetching a 1x1 pixel GIF image, all you really need is the magic URL.

This is in fact exactly what you would need to do if you want to track custom events, the only real difference being the specific parameters passed to Google Analytics.

There are a number of cases where you might want to track custom events for non-browser devices or other unique situations. Tracking when a purchase is completed, or when a video is played by Flash player or a phone call is initiated, are just a few things you might want to track entirely on the server, with no browser interaction at all.

I did a bit of searching, but did not find any Ruby library that did what I needed. You know what that means! Fire up the editor, I'm going in! And that is how the gabba gem was born.

It is very easy to use:

# track page views"UT-1234", "").page_view("something", "track/me")

# or track custom events"UT-1234", "").event("Videos", "Play", "ID", "123")

That is all there is to using it. Simple way to get server side Google Analytics tracking of page view and custom events. Fork gabba on github, or just "gem install gabba" and start tracking all your fun stuff.

10 Cool Things From RubyConf X


This last week was the fantastic RubyConf X. It has been ten years of RubyConf and in celebration of this notable occasion, the organizers located it in New Orleans and opened up the registration to a lot more people then most years past. This had the clearly foreseeable consequence of turning the conference into a really fun time!So here, in no particular order, are 10 cool things I saw or heard at the conference.1. RiteDuring Matz's keynote he introduced "Rite" which is a embedded version of Ruby designed to run on devices such as digital TVs, and other neat small gadgets. It will have a different implementation that the CRuby implementation, optimized for the smaller lower powered profile of the next generation gadgets. The project is sponsored by the Japanese government and is already being used in development by a major game company that could not be named but is will known. My palms started sweating the minute I heard about it, and I am already getting excited about the prospect of flying_robot 2.0 based on Rite.2. Evergreen w/CoffeeScriptCJ Kihlbom and Jonas Nicklas gave an excellent overview of client-side UI testing. They also demoed their own highly useful Evergreen testing framework which works together with Ruby and Jasmine looks like a very succinct and useful approach toward browser testing. Writing specs in CoffeeScript looks very tasty.3. Gentlemanly Git TricksScott Chacon's talks on git always leave me feeling knowing both more than I did, and less then I thought I did, at the same time. This session also had a hilarious and yet useful section on 'how to be a gentleman' including tips on whiskey, how to dress, how to tip, and how to treat a lady. Keeping it classy, Scott!4. "F-Bombs, Zeds, _whys and a Missing Brain Area"The keynote speeches from Dave Thomas, David Heinemeier Hansson and Matz could not have been more different on the surface, and yet had a similar theme: defy the limitations of the status quo, and seek out new ideas that are actually better. Dave's admonishment of the community to get over our gender bias, David's F-bombs, weed photos, and cry of "Freedom!", and Matz's love of diversity from _why to Zed, and adopting of David's amusing yet appropriate term "freedom-patching" in lieu of the less pleasant-sounding "monkeypatching" were all different ways of showing our desire as a community to seek out these truths. As long as we keep talking to each other, and also listening with an open mind.5. Ruby 1.9.2 is ReadySeveral people have been saying it, I am been using it from some testing, and Jim Wierich said it in the 'hallway track': Ruby 1.9.2 is ready for prime-time. If you are not transitioning your apps to 1.9.2 you should be. Performance, and cool tools like minitest are just two reasons to do it today.6. Beyond The CodePaul Campbell, Joe O'Brian, Keavy McMinn, Jon Dahl, Tom Preston-Werner and several other interesting developers spoke about more than just programming. Hacking business, art, music, and code, are all just aspects of hacking. RubyConf is a great place to find out not just about Ruby code, but the motivations and inspiration behind people we respect, and look to to improve ourselves.7. Lightning TalksThe number of people that are eager to signup for a lightning talk was huge at RubyConf, as always greatly exceeding the available time. Even trimming down each to 4 minutes, there was only time to get thru relatively few, and I was lucky to get to speak about the Ticketmaster gem.8. Kid Programmer Mini-ConfSarah Allen, Sarah Mei, Jim Meyer (who sadly could not make the conference at the last minute), Liah Hansen put together a parallel kids programming track, for the first time ever at RubyConf. The idea was brilliant, and I hope to bring my own son next year to participate.UPDATE: Sarah Mei informs me that Maxwell Salzberg is also an organizer of the kids track. My bad!9. Hallway TrackAs always, the conversations at RubyConf are amazing. The people who attend are doing amazing things, and the change to hang out for a f[...]

Happy Ada Lovelace Day 2010


(image) Once again, it is Lady Ada Lovelace day, and time for me to celebrate some women software developers that I know personally. This year I want to call out four women that I have especially noticed their knowledge and dedication. In no particular order...

First, a big shout out to Sarah Mei (@sarahmei). Sarah is a founder of RailsBridge, a non-profit organization dedicated to helping people learn about and make use of Ruby on Rails. She is also a conference speaker who has been going around hyping up the community about one of the subjects most near and dear to my heart: teaching kids programming.

Next, a special thanks to Sonia Ramirez, my colleague at our Los Angeles based software development consultancy The Hybrid Group. Sonia is a tireless and detail oriented software developer. She is always eager to learn, and brings a great sense of humor to all of her work with us.

Third, a special thanks to Andrea O.K. Wright. Andrea has been a very active member of the Ruby community, and has given a number of presentations, must recently an incredibly ambitious overview of NoSQL databases at RubyConf 2009.

And rounding out this small sampling of the XX chromosome-based programming talent, is a new acquaintance Sarah Allen (@ultrasaurus). Sarah is also involved with the RailsBridge project, and is a mobile software developer who has published several projects based on the Rhodes framework. She is also a conference speaker, and published the RubyConf mobile application that we all made use of at LARubyConf earlier this year.

These persons of the female gender are merely a small sampling of the awesomeness that exists within the Ruby community. They just happen to be ladies that I have either worked with, or benefited from their contributions directly.

Thank you all, and have a great Ada Lovelace Day. And get back to some coding!

Configuring Hybrid Ruby on Rails Applications On EY-Cloud


This last weekend, we completed migration of a slightly more complex Ruby on Rails application than the usual to Engine Yard's EY-Cloud. It took a few tries, and a tiny bit of research, before we completely understood what to do to get it up and running with all of the needed capabilities. Naturally this was due to gaps in my own knowledge, and I wanted to post about what I had learned, and how awesome EY-Cloud really is!If you do not know about it, EY-Cloud is Engine Yard's cloud platform that is based on Amazon's EC2. Readers of this blog know I am not afraid to get hardcore when it comes to EC2 server configurations, and with EY-Cloud I feel like I can now get the best of everything. But I am getting ahead of myself.Let me briefly describe the architecture of the application I was migrating. The main application is written in Ruby on Rails and uses MySQL as its data store. The app provides UI and an API for interactions with the application, mostly called by a custom iPhone app written using PhoneGap. The main app is secured using an SSL certificate. In addition, a separate API for a specific high-performance capability is written using Sinatra and DataMapper. This "special API" is also secured via SSL.OK, you got that? Perhaps not, so here is a diagram to illustrate what I am talking about:We call this kind of application a "hybrid" application, meaning that it is built using Ruby on Rails + "something else". For this app, the "something else" is Sinatra + DataMapper.The previous installation used the same basic setup, but was created manually using hand-configured EC2 instances. This required a lot more management to keep the application going, and especially to add or remove instances to the cluster. Backing up the entire configuration by creating custom AMI's was also very labor intensive.This was the scenario that led us to wish to migrate the app from raw EC2 to EY-Cloud. So if you are planning to set something like this up yourself, here are my notes to share my experience migrating a hybrid Ruby on Rails application to EY-Cloud.PrerequisitesYou need to have an account setup with Engine Yard for EY-Cloud. In addition, you should have installed the Elasticfox plugin for Firefox to easily administer the security groups. You can also do this via the command line, but it is a lot more effort.Configure Main Environment & ApplicationConfiguring your main application for EY-Cloud is a pretty simple process. It basically requires setting up private key access to the git repository and the application settings using the web based interface that Engine Yard provides. There is a complete article that describes this in detail here. The main steps are:Create main environmentCreate main application and configure access to its git repoConfig ssh key you will use to connect to instancesAdd ssl certificate, and config main app to use itConfig any needed gems and unix packages to be used by main appLaunch app server and separate database server in main environmentConfigure Secondary Environment & ApplicationNow you are ready to configure the environment and application for the other public accessible SSL protected service that is part of the application. This needs to be a secondary application because EY-Cloud currently only allows a single SSL cert per environment, and only allows you to associate it with one application. Hence needing a second environment configured. The main steps are:Create specialapi environmentCreate specialapi application and configure access to its git repoConfig ssh key you will use to connect to specialapi instancesAdd ssl certificate, and config specialapi app to use itConfig any needed gems and unix packages to be used by specialapi appLaunch specialapi app in specialapi environment. No database is necessary.Copy contents of database.yml from /data/mainapp/shared/config/database.yml on "main app" server to /data/specialapi/shared/config/database.yml on "specialapi" server. Yes, you will need[...]

I Was A Guest Blogger At LARubyConf 2010


(image) Longtime readers of this blog know that I can really get into writing about Ruby conferences, and I had a great time this last weekend at LARubyConf 2010. This time, I got to try some thing new: I was guest blogging the conference for TheBitSource, which has been providing some great coverage of other tech events like PyCon and SCALE.

Please check out my complete recap from the 2nd annual Los Angeles Ruby Conference LARubyConf 2010 here. And thanks!

Crossing The PhoneGap For Multiplatform Mobile Applications


I had first heard of the PhoneGap open source framework for multiplatform mobile development last year at the FutureRuby conference in Toronto. Honestly, I did not really concentrate on all they were saying at the time, and in the flurry of info including back-to-back mobile sessions with Rhomobile, I did not fully retain a clear picture of what they had to offer. My bad.It was not until late last year, while working on plans for a very cool mobile application, that I was reminded about PhoneGap by one of my colleagues. After a brief evaluation of their benefits vs. the other multiplatform options, we decided to use PhoneGap on this particular project. We have made some amazing progress with using PhoneGap for mobile development since then, and I thought I would share a few of the lessons learned.First of all, a quick explanation of how PhoneGap works. Jesse MacFadyen, one of the programmers at Nitobi, the primary developers of PhoneGap, has a good blog post where he breaks down how the PhoneGap framework works on iPhone. Here is my much condensed take on what he is saying.All of the mobile platforms supported by PhoneGap have some kind of web browser control. A PhoneGap application is a packaged up application which is a webpage or mini-website, that executes inside whatever web browser control is available on that platform. Add in a standard JavaScript API to a wrapper that accesses the device-specific functionality like GPS or the accelerometer, and you can hook up the JavaScript on your "page" to the hardware. But don't make the mistake of thinking you should just slap together some web pages formatted for mobile. Rather, you can and must think of it as an application that is written in the form of a single web page with a bunch of JavaScript. To access server data, you will need to write some AJAX code to access the remote resources, then update your UI accordingly. The good news is you can use familiar JavaScript libraries such as jQuery to do so. We chose jqTouch to get a very iPhone-like UI. The PhoneGap framework is under very active development. New code is being committed to their github repo frequently. As such, you really do need to have git installed, and some working knowledge of how to use it, to get things setup.In fact, the device specific functionality for each platform is contained within the main PhoneGap git repository as a series of git submodules such as phonegap-iphone, phonegap-android, etc. This makes it all but impossible to install the latest and greatest without git. Being a git user myself, this does not pose any problem, and if you are not gitmotized yet, this is an ideal time to become so.Here are the series of steps I followed to create my own PhoneGap project...PrerequisitesInstall iPhone SDK (yes, you must join the iPhone developer program)Install Android SDK ( has some good instructions. I am not using Eclipse, so I skipped all that)Install Apache Ant (sudo port install apache-ant)Install PhoneGapGet latest PhoneGap (git clone git:// submodules for iPhone & Android (cd phonegap && git submodule update)Build iPhone Lib and installBuild Android libsSetting Up A New Multiplatform PhoneGap ProjectCreate a new iPhone project using the phonegap-iphone template. The www directory in the new project will be becoming the shared part of your project, with all your UI and application logicCreate the Android project using the phonegap-android build script. Use the www directory from the iphone project as the www-dir param. You will be replacing this with a reference to the git submoduleCreate a new git repo in the www directory in the iPhone project, and commit all the files in the www directoryChange directories to the parent of where you want to put the directory for the shared git repo, then clone the repo located at /path/to/iphoneproj/www to /[...]

Sparkline Some Interest With Ruby on Rails


Recently, I added some sparkline graphs to a Ruby on Rails application. A sparkline is a very small graphic that displays a large amount of information, typically shown over time, and usually embedded in some other text. Invented by the father of modern infographics Edward Tufte, the sparkline has become a fixture of many online applications that want to visually display some stats in a simple, integrated way.When it come to adding sparklines into a Ruby on Rails application, there are a couple of different options. You can chart the data on the server, output being an image file. You can also chart the data on the client, with a couple of different JavaScript libraries as available options.I started my plan, intending to implement my charts on the client-side. The project that appears to have the most flexibility, speed, and options, is an amazing jQuery plugin called jQuery Sparkline. Unfortunately, the project to which I needed to add the sparklines is a bit older, and does not use jQuery. As a result, I was not able to use jQuery Sparkline for this current project.Another interesting JavaScript sparkline library is lethain's Sparkline, but it has not been updated in some time, and is not compatible with current Internet Explorer versions. There is also an interesting looking newer lib topfunky-sparkline-js but I have not tried it out yet. So that brings us to server-side sparkline generation. If you are using ImageMagick/RMagick then @topfunky once again provides, with the Ruby sparklines gem. This gem provides lots of options for doing all sorts of fancy sparklines.In my case, I am not using ImageMagick for anything else, so I did not want to install it just for this. What I really wanted was something much lighter-weight, and I was willing to accept a lot fewer options to get it. It turns out that madrobby has written a library for generating very simple sparklines in pure Ruby code, called spark_pr. The project uses _why's pure Ruby implementation of a PNG generator to do the low-level work. spark_pr has also spawned an interesting application of it from @technoweenie called Sparkplug, which is a Rack module that generates spaklines from CSV data on the fly, using Rack handlers and Rack caching.Once I had seen Sparkplug's minimal elegance, it seemed spark_pr was the option for me. I decided to incorporate spark_pr into my application. Given that the app was written with a dedicated approach to keeping a clean RESTful interface, and that the database already contained the time-series data, it was quite easy to incorporate. Here is what I had to do:Step 1: Put spark_pr.rb file into lib directory. I just grabbed the code from the repo, and dropped it into my project. You may decide to have a more sophisticated way to do it, such as using git submodules.Step 2: require "spark_pr" in your controllerStep 3: include Spark in your controllerStep 4: Add PNG format to controller action that was already returning my time-series data, and return the sparkline PNG data:Voila! Refresh that view and you should now be looking at your ultra-hipster-chic sparkline graph. It is surprising how much more information comprehension a person has, when they are seeing a visual representation of their data. Plus it looks cool.[...]

Thanks For A Great #code2009


(image) It has been an amazing year for both personal and professional code development.

Starting with the inspiration to begin Project Flying Robot, to the prestige of presenting at LARubyConf, FutureRuby, TWTRCON, IgniteLA, 140 The Twitter Conference, RubyConf, and Conferencia Rails, and lastly the year-end fun of starting out the ongoing #code2009 Twitter meme, so popular that it spawned a couple of mashups and got picked up by Hacker News and uber-language blog Lambda the Ultimate.

In between were numerous meetups, hackfests, code jams, code dojos, pull requests, and casual codeslinging with friends. And the Maker Faire!

To everyone who welcomed me, listened to me, helped me, or taught me something, I am indeed grateful. Thank you. Let's do this 2010 thing right!

Flying Robot: World Tour 2009 Continues


(image) As usual, no blog posts = a lot of other activity here at Flying Robot HQ. Among other personal stuff, my brother Damen Evans and I have been getting ready for the last public demos of @flyingrobot for 2009. And we are going out with style!

Later this week, we roll up to San Francisco to present at the prestigious RubyConf! Then, next week @flyingrobot and I will fly off to Madrid, Spain, to do our first European appearance at the awesome-looking Conferencia Rails.

Anyhow, if you have been waiting eagerly for more Flying Robot news and gadgets, be patient. We will be unveiling our mysterious cool new stuff in just a few days...

PostgreSQL on Ubuntu on EC2: Backing It All Up


This post continues what I started with "PostgreSQL on Ubuntu on EC2: The Installation Guide". Once you have your PostgreSQL database server instance running, you will need to backup two different things: your database data, and the instance itself. The database data will be backed up using Elastic Block Storage (EBS) snapshots. Once we have the instance running the backups correctly, we will then create an Amazon Machine Image (AMI) that will allow you to launch a new instance to replace the database server in case it goes down.Backing Up The DatabaseFirst, we need to connect to our database server instance via SSH using the ubuntu user. We will need to install some dependencies to get our backup script to run:sudo apt-get install build-essentialsudo apt-get install ruby1.8-devsudo apt-get install rubygemssudo gem update --systemYou will need to tweak RubyGems so that the update works correctly, as described here.Now you can install Gemcutter, which is the new ultra cool repository for gems:sudo gem install gemcuttersudo gem tumbleFinally we are ready to install the Amazon EC2 rubygem:sudo gem install amazon-ec2Now we can create our backup script. Save this code into the ~/ directory under the name backup_database.rb. You will need to substitute the Amazon ACCESS_KEY_ID and SECRET_ACCESS_KEY, as well and entering the correct EBS volume for the DATABASE_VOLUME constant:#!/usr/bin/env ruby require 'rubygems' require 'AWS' ACCESS_KEY_ID = 'YOUR_ACCESS_KEY' SECRET_ACCESS_KEY = 'YOUR_SECRET_ACCESS_KEY' DATABASE_VOLUME = 'vol-XXXXXXXX' puts "Starting database snapshot..." ec2 = => ACCESS_KEY_ID, :secret_access_key => SECRET_ACCESS_KEY) ec2.create_snapshot(:volume_id => DATABASE_VOLUME) puts "Database snapshot completed."Due to the finicky way that Ruby runs as part of a cron job, we are best off creating a shell script that then runs the Ruby backup script. Save this code into the ~/ directory under the name!/bin/sh cd /home/ubunturuby /home/ubuntu/backup_database.rbDon't forget to make the backup shell script executable:chmod +x /home/ubuntu/backup_db.shNow we just need to configure this script to run as part of a cron job, so that the backups take place automatically. The crontab command brings up the list of configured cron tasks for the current user:crontab -eThis example crontab entry runs the backup daily at midnight, but you may want it to run more frequently:0 0 * * * /home/ubuntu/backup_db.shAt this point, you should have a fully functional automated backup system. Verify after midnight that the script has run as you expect, by looking to see if a new snapshot has been created, using Elastifox or however you administrate your EC2 instances.Creating The AMICreating the AMI to backup the entire database instance is pretty easy. First, you need to upload the PEM files. Remember you are authenticating as the "ubuntu" user:scp -i id_rsa-gsg-keypair pk-YOUR.pem cert-YOUR.pem your SSH connection into the database server instance to copy the PEM files to the /mnt directory:sudo cp /home/ubuntu/*.pem /mnt Now create the bundle. Make sure you use your Amazon account number (without dashes) as the value for the -u parameter. This can take quite a while, so do not get impatient:sudo ec2-bundle-vol -d /mnt -k /mnt/pk-YOUR.pem -c /mnt/cert-YOUR.pem -r i386 -u YOURUSERACCOUNTNUMBERYou can now upload the bundle to your Amazon S3 account, in preparation for making available as an AMI. Use something versioned for the -b parameter which is the name of the bundle:sudo ec2-upload-bundle -b my-database-server-1.0-ami -m /mnt/image.manifest.xml -a YOUR_ACCESS_KEY -s YOUR_SECRET_ACCESS_KEYFinal step is going back to your local machine, and making the n[...]

Happy 200 Posts: My 10 Personal Favorites


(image) I was shocked to discover this morning that this is to be my 200th blog post. Wow! It has been a good run so far since I restarted the Dead Programmer Society in 2006, and I really appreciate the awesome feedback and support that I have received from the community.

To commemorate this personal event, here is a list of my top 10 favorite posts, in no particular order:

1. "I'd Rather Be A Jazz Programmer"
2. "Fear And Loathing At RailsConf 2009"
3. "Programming Zombies Will Crush You"
4. "The Twitter 1-2-3 Rule"
5. "Goldilocks and the Three Icons"
6. "Money In The Ghetto"
7. "I Speak For The Code"
8. "The Folly Of Accountabalism"
9. "The Planning Game Vs. The Crying Game"
10. "Architect Is Not An Honorary Title"

Once again, I thank everyone for your support, and I look forward to telling more tales from the Dead Programmer Society.

PostgreSQL on Ubuntu on EC2: The Installation Guide


For some time, I have had clients hosting a couple different applications on Amazon EC2 using Ubuntu. One of these apps uses PostgreSQL, and has been running without event for quite a while. Yesterday, I got to catch up for lost time, by spending the entire day wrestling with data recovery issues related to a failed apt-get upgrade on an important database server. Luckily, the awesome Eric Hammond was around on IRC, came to my rescue, and coached my thru my self-inflicted pain.If you are not interested in PostgreSQL, you probably just stop here. Nothing to see folks, move along. However, if you are looking for the well-lit path to getting PostgreSQL installed on Amazon EC2 will all the trimmings, read on.I went to find various web pages to use as source material, expecting since the last time I went through this, someone would have written a nice definitive guide to installing PostgreSQL on Ubuntu, running it on a dedicated instance on Amazon EC2, and using Elastic Block Storage (EBS). Naturally, you want to be using the XFS file system too. However, no such luck: just a big collection of pages of instructions on the various parts, without any nice simple path to getting things working together.Hence, this post tries to provide a set of instructions for getting things working, and avoiding a couple of problems that I have run into while running Postgres in production for the last couple years.Step 0 - You are signed up for Amazon EC2, no? If not, there are plenty of pages with instructions on how to do so.Step 1 - Choose your AMIThere are several AMI's available to you. I currently run Hardy 8.04 LTS x86 architecture in the USA, so I am using ami-5d59be34, but you may have other requirements. The Ubuntu EC2 starter guide has good info on your options.Step 2 - Launch your instanceI like to use Elasticfox, cause I am super lazy. The command line works well, also.What size instance? This AMI supports small and medium. PostgreSQL is pretty efficient these days, and especially using a dedicated instance and not running anything but the database server improves raw database performance considerably. You would probably be pretty surprised how well a small instance can perform, but choose medium if you think you will have more significant needs.One key pattern I use for my EC2 hosted apps, is creating security groups in EC2 to separate my database servers from the public internet. I never use the default security group, but instead create a group for each tier of my application like "database", "web", "transcoder" and then allow specific groups to communicate with each other.Step 3 - Create the EBS VolumeYou can do this via Elasticfox, or via command line. Either way, make sure you do two key things: make sure you create the EBS volume in the same availabilty zone as your database server instance, and also make sure you create a volume with enough space. Here is how you would use the command line tools to create a 10GB volume in the 'us-east-1a' zone:ec2-create-volume -z us-east-1a -s 10One the volume is ready, attach it to the database instance. For example, this attaches an EBS volume named 'vol-VVVV1111' to the instance 'i-IIII1111' on device /dev/sdh:ec2-attach-volume -d /dev/sdh -i i-IIII1111 vol-VVVV1111Step 4 - Connect to the database instanceYou need to SSH in to configure you new instance. Remember, you cannot connect as 'root' user in Ubuntu, you need to connect using the 'ubuntu' user. This page has good details about using sudo and SSH on the official Ubuntu EC2 AMIs.OK, so now you are connected via SSH to your server. Of course, start with the usual update/upgrade:sudo apt-get update && sudo apt-get upgrade -yStep 5 - Install XFSWe will need to install the XFS file system. Actually, you[...]

The FutureRuby Revolution Will Not Be On AOL - Part 2


FutureRuby Day 2 began in a seemingly calm and reflective way. Coffees were sipped, and hangovers nursed. As the self-inflicted wounds from the Pravda-Vodka-Kalashnikov faded, Pete Forde, our leader and spiritual adviser, began a short sermon.His message was simple: Vegas is a horrible place to hold RailsConf. And we should live in a manner that follows the "Four Agreements". Seriously, yes, he said both of these things.Pete told us of the source of his sudden enlightenment: Portland's Jupiter Hotel. Instead of a Gideon bible, they have copy of Four Agreements in each room. Pete, being a curious guy, started to read the book. To save us time, he summarized it in nice Twitter-sized chunks.1. Use your words for good... do not gossip2. Do not take anything personally3. Do not make assumptions4. Always try your bestWith our spiritual bootstrapping complete, we proceeded to have a consciousness-expanding session from Collin Miller presentation called "Transc/Ending Encoding". This was NOT about video encoding.Collin Miller - "Transc/Ending Encoding"If the 60's revolt gave the counterculture heroes like Leary and Hoffman, it gave us tech heroes like Englebart and Kay.When writing software, we edit text files. We use textual encoding is a way to flatten down information to a simpler structure. But what does editing text lack? There are other options to make programs without text.There is this high priesthood of text, however, programming does not need to be difficult to be useful. The future is the ONLY frontier... so where are we as programmer-monks going?Martin Fowler has his concept of "illustrative programming". As another example, a spreadsheet is non-textual programming.Charles Simonyi's Intentional Programming in a different approach. It allows users to change names easily, or even program in two different natural languages. It does this by maintaining a constant set of references to everything in program. By doing this, different users can edit the same source database, without using the same editing style.Another example is Subtext ( In Subtext, everything is just a reference. It is like "googling the code". Subtext uses decision tables, and a syntax tree editor.It was a very interesting talk, and it seems like many people were inspired to think differently about code. I was having Smalltalk flashbacks, and my brother Damen Evans was reminiscing about how cool HyperCard used to be.Dr. Nic - "Living with 1000 Open Source Projects"Next up was "Dr. Nic" aka Dr. Nic Williams who is actually a PhD in CS, so not just granting himself an honorarium. His talk was called "Living with 1000 Open Source Projects". I have heard Dr. Nic speak before, and he is a very intelligent and funny speaker.There are two types of open source project founders:Type A. Nurture and converse "Do you care?"Type B. People who were previously type A"Who ever looked at their old code and thought 'that's better than what I write now'?"If you look after your old projects, you will end up with 500/hr. week of projects"Open source projects don't scale, but neither does raising pets and children"The question is which OSS projects to maintain? The pet projects you NEED every dayGoal: ZERO maintenanceHow to reduce bad karma from "abandoning" your project:- publish project status- facilitate group therapy- forward emails to mailing listPut a badge on project home page that says last time someone contributed to the projectAim for community to be self-sufficientGithub makes things easier with centralized patches. The github gem is great for laziness."Easy to give away commit rights, if you think 'this is not MY project, I just look after it'"Aim: ZERO process costAim for Zero- don't use[...]

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 and 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[...]

Getting Ready For Takeoff At FutureRuby


(image) 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...

Project Flying Robot: Supporting The Blimpduino


(image) 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.

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

Heroku Has Launched


(image) 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.

Project Flying Robot: Getting RAD With The ATMega328


(image) 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:

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.

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 gemsudo gem install heroku2. Setup Heroku account info, and upload public keyheroku keys:add This will prompt you for your Heroku account info. If you have not created one yet, better jump over to and create one3. Create Heroku app from my existing appI just changed so my current directory was the app I wanted to add to Heroku, then entered:heroku create myappnameThis creates the new app on Heroku, and creates a remote branch so you can deploy just by pushing the code.4. Deploy my codegit push heroku masterThat'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 migrationsheroku rake db:migrateNOW, 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 [...]

LARubyConf 2009 - Jim Weirich - "The Grand Unified Thoery of Software Development


As the 2009 Los Angeles Ruby Conference (LARubyConf) drew to a close, our keynote speaker Jim Weirich took the podium. I have seen Jim speak several times, and he is both intelligent, as well as down to earth, which is a rare combination indeed.The subject of his keynote would be anything but down to earth. In fact, it would have to be one of the most ambitious talks I have ever seen at a Ruby conference. Only Jim could have pulled it off as he did, with both humor and insight.One thing Jim does is have to conduct Tech Interviews. One question he always asks is "What do you look for in a good design?" Most people's answer: "UMMMMMM..."Then Jim seemingly shifted themes abruptly, to physics. Specifically, subatomic particles.It is known that particles that are charged the same repulse each other. Furthermore, every time you change electric field, there is a changing magnetic field at 90 degree angle.James Clerk MaxwellMaxwell discovered 4 equations that describe relation between electrical and magnetic fields. By describing these two entirely separate forces, combines into single force. Maxwell's work probably greatest contribution to science.Then, along came Ernest Rutherford's famous electron experiment. The one where electrons were supposed to evenly deflect onto a screen, but instead occasionally would deflect wildly. As a result, we now know that matter was mostly open space.There are four known forces- electromagnetic- gravity- strong nuclear- weak nuclearThe search for the "Unified Field Theory" in physics is a search for a single explanation that accommodates all four forces.This is very much like the search for a single explanation for software design.Some Commonly Accepted Software Design Principles- SOLID- Law of Demeter- DRY- Small Methods- Design by Contract Lots of ideas about how to write software, but no grand unified theory."The Grand Unified Theory of Software Development" Composite/Structured Design- Glenford J Meyers - 1978 Coupling & Cohesion - from best to worst- no coupling- data coupling - local data, simple- stamp coupling - local data, structured- control coupling- external coupling - global data, simple- common coupling - global data, structured- content coupling - when you reach inside of modules and mess with them from outside control coupling- method has flag parameter- flag control which algorithm to use Symptoms- word OR in description Example:Array.instance_methods(true) andArray.instance_methods(false) Which one lists only private methods?Another example, Rails does this:Customer.find(:all) vs. Customer.find(:first)Myers' classification were OK, however failed to extend well to objects and dynamic languagesMeilir Page-Jones's book "What Every Programmer Should Know About Object-Oriented Design" has 3 sections, two of which are not too useful, but the third is very interesting. It talks about the idea of Connascence in software design.Connascence - when two things are born and grow up togetherTwo pieces of code share Connascence when a change in one module requires a corresponding change in the other. CoN - Connascence of Name- when code linked by name- can also apply to databases- class name is NOT, but parameters are Locality Matters- if you have things grouped together, there is stronger connascence.- as dist increase, you reduce connect between them Connescence of Position- when the order of the params mattersLow/high degree of CoP When you encounter CoP it is better to transform it to CoNDegree MattersCoP i[...]

LARubyConf 2009 - Blake Mizerany - "Sinatra: the Ultimate Rack Citizen"


I was very happy when the next presenter at the Los Angeles Ruby Conference 2009 (LARubyConf) was Blake Mizerany, creator of the very cool Ruby micro-framework Sinatra. As long-time readers of this blog know, I am very into Sinatra. There has been an incredible amount of work going into Sinatra lately, so I was very interested to catch up on what the team has been up to.What is Sinatra? A Ruby Domain Specific Language (DSL) Mapping REST to simple actionsWhy?- small- fast- great rack and ruby citizen- strong focus on HTTP- HTTP caching helpers built in before it was cool- content negotiation- no boilerplate- dead simple config when the default are not enough- smart configuration- DOCS- extending is easy- rack is the only dependency- very low WTF to LOC ratio (jeremy mcnally's rubyfringe talk)when?- a few controllers models and views- starting any web application- you need reusable apps and/or middleware and/or resources- you need speedwho?- heroku- github- taps- integrity sinatra in your gems- a mini-github for offline repo browsing- a local plugin and play wiki- memcached utilization graphs- config reusable github hook Example: NotTwitter As classic Sinatraset :username, { fail "yo"} get '/' do ...endChange require 'sinatra'to require 'sinatra/base' But I want to deploy to Passenger or Heroku! No problem../bin/install-not-twitter Copy example to cwd Copy .gems file .ru is a standard Rack config file. .gems is a Heruku configuaration file that will handle any needed Ruby gems installations git init && git add . git commit heroku craete git push heku aster heroku 3 Awesome Features in Sinatra pass - I cannot handle this request, try the next route forward - sinatra as middle ware... done my job, let the next app take over... pop in front of rails metal use - Sinatra loves rack so much, we made sure not to hide it Resourceshttp://sinatrarb.com you are doing everything with Rails, you are probably using too much for the job. Sinatra is simple, fast, and extensible. I am using it in two production applications right now, along with Rails. Sinatra handles parts of the application better than how Rails does, so that is how I roll.Especially with the ever increasing momentum behind Rack, Sinatra is a good bet for getting things done. Combined with Rails Metal, and you really have it all.[...]

LARubyConf 2009 - Danny Blitz - "Herding Tigers: Software Development and the Art of War"


I had no idea what I was about to experience at Los Angeles Ruby Conference 2009 (LARubyConf) when Danny Blitz took the podium as the next presenter. I had seen him hanging out with his distinctive pompadour, tattoos, and leather jacket. He is a big guy, and hard to miss. But he had been pretty quiet till then, which was about to change radically.Herding Cats is a term commonly used when describing the management of software teams. But when Danny Blitz says cats, he means big cats aka tigers. So who is this guy? He has done TONS of stuff, from DOD to Dell, to the DARPA autonomous vehicle challenge. Very cool stuff.Get Agility?"A good plan violently executed now is better than a perfect plan executed next week" - PattonQ. Why is software so difficult?A. We don't want to face the truthQ. Why don't we want to face the truth?A. We're afraidQ. What are we afraid of?A. We're afraid we do not know anything about end resultQ. How can we deal with this?A. Admit the truthA tiger team is a small self improving team.What can you expect from a tiger team?Their first project was scheduled to take 5 weeks - took 5 daysTIGERS ARE A TEAM!QA is part of tiger teamTigers show leadershipTigers self-improveAlmost no meetings on a tiger teamQA and test automation are the tip of the spearQA should be there from very beginningShared psychology and intelligenceWinning, boldness, excellenceNot afraid of the darkWho is on team?- all staff needed to deliver product- leader, 4 devs, 1 automation engineer, 1 Q, product staff m,ember- in addition, architecture, system admins, any other support staffwhy warfare?- business is battleThere are two kinds of warfare: attrition and maneuverAttrition warefare- traditional, tactical- clashing head-onManeuver warfare- internet space- rapid modern violent- unexpected movementsSpeed- it is a competitive weapon- undeniable advantage in businessSpeed mitigates risk- not a guarantee- damage is contained by quickly compensatingSpeed improves the teamSpeed adds to job satisfactionSpeed allows agile to function properly- max iteration length (usually 30 days)Speed builds credibility- shows a lot of work in short orderCows and tigers- cow is bigger, but who wins?Disease: using agile terms to describe non-agile projectCorporate animal kingdom- Tiger cautious, calculating, looks to win- Cow herding not known to be original afraid of risk- Bear big, usually mellow awesome battle skills live and let live attitude- Leopard truly wild will attack at any time- Elephant huge and tough invincible best to avoid battle- Hyena scavenger steals food evil"Tiger teams are like Hell's Programmers" - Danny Blitz Leadership this is what makes or breaks faith love hope success belongs to the team failure belongs to the leader buck stops here fearlessness listener and learner protector outside influences internally too team members themselves US marine management techniques- manage by end state and intent- reward failure- demand to be questoned- glorify the lower levels of organization Politeness and professionalism- that or poison Agile is not a methodology, it is a mindset, it is inevitableDanny says he is working on the book called "Herding Tigers". He has also started a blog at All I can say is, he is a very dynamic and exciting speaker. Everyone was captivated, myself included. I'm still not sure how I took these notes.Rock on, Danny![...]

LARubyConf 2009 - Jeremy Evans - "Sequel"


The next session at the 2009 Los Angeles Ruby Conference (LARubyConf) was Jeremy Evans presenting Sequel, which is a very powerful database toolkit for Ruby.Ruby originally had adapters for each database. The problem was that each was very database specific. This was a problem due to both SQL differences, as well as API differences. no behavior1997 - ruby-postgres was first created. 2000 - DBI2004 - Active RecordAlthough AR made things easier, it had strong opinions. These opinions did not always map perfectly to any particular database.2007 - SequelCompletely DB independent API.Example is concatanating strings, which requires a completely different syntax in each flavor of SQL database.ConciseOptional BehaviorOpinions?Ruby should be like clay in a child's hands - MatzSequel advantages:- Simple - as possible but no simpler - Flexible - opinions, not dogma- Powerful- Lightweight - 1/2 memory usage as active record- Well maintained- Easy to Contribute- Easy to Understand- More FunShow me the *** code!require 'seq'DB = Sequal.sqlite('larun')DB[:attendees].count# => 1DB[:attendees].first# => {:name ='', :address =>}TransactionsDB.trans do DB[:entry],insert(:account_id => 1) ...endSQL LoggersDB.loggers 'value).deleteDB[:table] # this is a dataset... like query cursorSequel is a functional API, where object methods return copies of - while columns.filter.orderThis means you can easily chain function calls, like jQuery. Awesome!Sequel represents its internal objects using SQL's own internal representationsSequel has 'core' and 'model'class Attendee < Sequel::Model many_to_one one_to_many endHooks & Validations - got 'emSequel it built entirely out of plugins. That sounds interesting, but experience with DataMapper has shown me that too many plugins may not be a good thing. However, I do not have any direct experience with Sequel yet, so this may be a non-issue.13 - # of database adapters that Sequel supports todayDatabase graphingEverything was going so well up to this point. However, Jeremy then tried to do his demo on Windows, just to show that if you are one of the poor souls using Windows, it can still work for you. He failed to account for the quirkiness of conference display adapters, and what that can do to a machine. Oh well, no demo.That said, I was really impressed by what I heard about Sequel. I think I will have to try it out on something, just to see how it does.[...]