Sudhindra Rao

Rails Concerns for Serializers

Serializers for Rails

ActiveModel Serializers pack a lot of punch when it comes to dealing with objects. They allow you to use configuration that takes care of generating the proper serialization for conventional rails objects. Once your code matures to where finding reuse is not difficult, you may run into a situation where you want to leverage shared functionality via mixins. I ran into such a situation and was not able to find quick, clear documentation. Hence this effort to write it down.


EPIC integration

Glooko - Diabetes Management Platform

I was very excited to find out about Glooko and start working there last year. Glooko has built a unified diabetes management platform, where we enable users to sync data from a variety of blood glucose meters, continuous glucose monitor(CGM) and insulin pumps, as well as popular fitness trackers. Once their data is uploaded, users can review their diabetes data in context with their insulin, food and fitness data, as well as other relevant clinical information to help with manage their blood glucose levels and keep them under control. Glooko platform also enables health care providers(doctors, nurses, caregivers, parents, etc.) to monitor a person with diabetes remotely and provide more timely, collaborative care.

At Glooko, we now have a data platform that is open to integrations. Our preferred way to integrate is via our RESTful APIs using JSON.


Isn't 40 mins too long for a build?

Yes, our CI build on @thatsMingle takes 40 mins. Yes, @thatsMingle is a ruby application. Yes, @thatsMingle runs on Java using JRuby.

With all these superlative technologies Mingle CI build still takes 40 mins. And this is an improvement. And we are happy with it.

Now that I have made some bizarre statements let me explain what they mean(before you start calling me crazy).


Pushing ElasticSearch logs to Papertrail

Do you have your elasticsearch logs going to your logs folder? Are you still struggling to get them to syslog so that they could be transported to a log-archive system like we did?

Here is our working solution(with rsyslog):


Mingle Loves GitHub

Mingle has a new look and feel, if you have not seen it already. In improving the experience we have also been looking at improving how Mingle integrates with the world.

One of features that was missing on the Mingle Cloud version was integration with code. Given the popularity and market penetration it made sense to integrate with GitHub. Also GitHub’s openness to promote open source software collaboration made it a clear first choice.


Mingle Wall Reader - Sync your physical card wall with Mingle

Some time ago we built a hardware integration to Mingle. We did not talk much about it at that time. Hence this post to revive the talk about hardware interface with Mingle. Also about other hardware projects that were done in ThoughtWorks around 100days of hardware.


Ephemeral ports in Unix

We learnt something while installing our app on a Linux box. We chose port numbers like 36601, 37601, 38601 for a number of clones of this app. When we restarted the app we found that we were not able to start one of the clones on its assigned port(say 36601).



If you have been following this blog, you may have been curious what I have been upto recently. Few weeks ago we(Pengchao Wang and I ) got selected to speak at the aws re:invent 2013 conference to speak about our tool eb_deployer.

Here is a little bit of insight on what it is about and why we wrote it.


Android Intensive - Refined

At our San Francisco office we have been working on building mobile development capabilities recently. Here is a little glimpse into what we did to make it work.

The plan was to build enough initial capability so that we could bring everyone at a collaborative workshop and take their skills to the next level. This program started by a facilitated learning around designing applications for the mobile. We focused on Android platform.


Android Intensive - collaborative learning experience

At our San Francisco office we have been working on building mobile development capabilities recently. Here is a little glimpse into what we did to make it work.

The plan was to build enough initial capability so that we could bring everyone at a collaborative workshop and take their skills to the next level. This program started by a facilitated learning around designing applications for the mobile. We focused on Android platform.


SiriMingle - Siri assistance for Mingle

Announcing SiriMingle - a tool to interact with Mingle using SiriProxy. Bringing the power of Siri voice control to modify cards, get status and ask questions about the project.

It can be downloaded from sirimingle and used with SiriProxy.

SiriProxy is a proxy written in ruby 1.9 to allow people to use the power of Siri to perform useful tasks. Setting up SiriProxy was not trivial before. Over time and on 12.04 it can be more easily done.


Installing Ubuntu on MacPro with OSX Lion - Dualboot

Installing Ubuntu on Macpro turned out to be little trickier than I would have liked it to be. For starters OSX Lion does not detect the Ubuntu ISO disc as bootable or something that bootcamp can load an OS from. There are tricks on the web that allow you to get around that.

I am listing a few quirks that I came across while getting all this to work.

The Challenge: Install Ubuntu on a MacPro that is running OSX Lion and make it so that it can dualboot to ubuntu.

Install REFit

Download and install REFit. This will allow your BIOS to work with bootloaders other than that of Apple. Once you have installed it restart you machine. If you are lucky you will see the REFIt menu on restart. Do not be disappointed if you do not see it at first. Restart again and you will surely see the REFIt menu this time. Once you have REFIt installed it is time to partition the HardDisk to make room for Ubuntu.


moved blog to octopress

I am in the process of moving the blog from my jekyll based site to octopress. You will see that some of things work like: You may notice :

  • Posts show up clearer and nicer - because of octopress font selection
  • you will see my addition of tag cloud to octopress - so tags will show
  • archives - a list of archives arranged as an index page

What does not yet work :

  • Tags are not aligned on the page
  • Disqus comments are missing - thanks to discuss your comments are safe. They just need to be linked correctly
  • RSS feed is missing
  • My color scheme is missing - so does not reflect the author’s personality ;)

Hope you will bear with me while I make things easier for me to post and bring a more pleasant reading experience for you.

Thank you !!!


why blog?

I have come across too many people who are either not willing to blog, or do not see the point. This blog post is for them.

(Recently, “Elena Yatzeck”: posted on this subject as well.)

I recently read a one-liner “I see I scorn, I do I regret, I blog to not forget”. (Usually I am turned off by one liners intending to pack everything including the reason for life in minimum words, but this one I like because it is funny enough.)

This above quote is enough motivation to keep me going on my blogging. In the day and age of #fb and #RT it is difficult to get people excited about the value of details and being able to express in elaboration. Blogs come to the rescue.

I experience this loss of details quite a bit. Recently on my “M$ platform based assignment”: I forgot to blog what we did to make our .NET application development painless. Now when I try to recollect some lessons I learnt I have to depend on my memory which is sloppy about details. I blog to ensure that I have less of these situations and that I can use my experience to my advantage - also maybe readers of my blog will benefit as well.

I would like to encourage more blogging so that I can benefit from your knowledge and learnings.

Here are a few reasons you should consider blogging:

  • Twitter is too short to explain anything in detail.
  • Facebook will not understand when you say a lot without being emotional about it.
  • Your long term memory is not that good - also it is not google searchable.
  • All the short messages are easily lost in your tweetdeck. Google search will yield the desired message but will not provide you the context it appeared in.
  • Blogs are on the web and searchable via google.
  • Blogs can be as elaborate as you like - can be tagged, followed, copied and pasted from, tweeted about, and can turn into articles for publication.
  • Blogs can also be collected and turned into books - for free.
  • Self promotion - “A good post by Jay Fields”:
  • Blogs are permanent records(mostly) and they can be used to jog your own memory - or reminisce.

How and where to blog?

  • “Wordpress”:
  • “Tumblr”:
  • “blogger”: - beware of their weird copyright requirements.
  • “github”: - “octopress”:
  • build your own blog engine and push it to “heroku”:

What are you waiting for? Go write something.


ubuntu power management

(Intended date of release 2012/02/13. Procrastination…. Finally released today.)

After upgrading to Ubuntu 11.10(Oneiric Oncelot) I had a unique problem with my machine that was not googleable. All I could see is a symptom where my CPU fans would start full speed and keep blowing for a while. While they were up all my CPUs would be at 100% utilization. On various occasions that this would happen I had to restart the machine as it became unresponsive. Often times this would happen at nights when the machine is not being used.

Recently when I was researching how to manage power settings with LUbuntu(which is harder than it sounds) I found that powernapd was something that Ubuntu running in background to manage power usage of the machine components. This sounds like a reasonable thing to run since Ubuntu now supports Netbooks, Notebooks and Desktops all at the same time. In my case since I am running Ubuntu on a desktop it did not need such strict power management. I decided to try and turn this daemon off. Now my CPU utilizations reflect the amount of processor power my currently running applications use and there is no fan whirring anymore.

ProTip: Tweak your Ubuntu - Lubuntu is minimalistic so use Ubuntu Gnome to tweak LUbuntu settings.


Mac remote with presentations

When preparing for a presentation recently I was looking at various presentation tools at my disposal.

Purchasing one of those mouse like remotes was an option. I already had a magic mouse that could do the job. I also had a mac remote with keys that indicated forward/reverse. But by default it cannot be used as a mouse like remote for forward/reverse.

I stumbled upon “iRedlite”: . Just the tool I was looking for to use the slick mac remote for my presentation.

As an added bonus iRedlite is programmable to achieve different functionality based on the context of the application. Also that application context can be changed using the remote.

Thank you “tin:b”: for such applications. They have many more - check them out.


Agile and Beyond 2012

I had the opportunity to speak at the “Agile and Beyond”: conference recently. I loved the crowd, excellent turnout of 650+ people mostly from the Detroit MI area. Everyone was enthusiastic about learning how Agile can change the way they do their daily jobs.

I had a chance to present my ideas on improving how you refactor builds to get better feedback and change the way you work. I was also excited because this time I did a complete powerpoint/keynote free “presentation”: I used “deck.js”: and the good markdown tweak called “keydown”: Need to make a few feature additions to keydown soon.(I said it first : A fun project would be make “impress.js”: markdown friendly, like keydown.)

Lots of great presentations - varying form lean, kanban to plain old agile. Excellent facility at the Ford Convention Center, also had some time to see Detroit and also “The Henry Ford Museum”:

Overall a great experience. Thank you agile and beyond team.

(Ford Convention Center image from “”: )


Bundler with vendorized gems

Bundler is a tool for managing installed libraries on a ruby project. It comes bundled with rails 3 but can be used standalone without rails. Bundler tries to fix issues with having to manage your gems(and their related dependencies and versions) in a clean way. In doing so it allows you to work on your application and not have to worry about dependencies sucking the life out of your releases.

Off late I have been working on an application that vendorizes its gems and packages them while shipping the application. Since this application is also been built in the traditional way(rails 2) I was looking to use bundler with it to do the vendorization. Turns out bundler supports such a use case.

For a packaged application bundler allows you to freeze the gems and unpack them in the location of your choosing. This path can then be added to your application to load all the frozen gems. The following command with the path set to the location you would like to unpack your gems allows you to use bundler to vendorize gems.

   bundle install --path vendor/bundle

You can then add these gems to your application as you would for vendorized gems.

h3. Bundler with rvm and gemsets

One of the popular opinions is to just use bundler and ditch gemsets. I tend to use both gemsets and bundler to my advantage. This helps especially when I am working on multiple applications and when I am not online all the time. I ensure that my bundle is upto date before I go offline and then can work on my apps when I am offline by switching gemsets. Sometimes I tend to have multiple gemsets built when I am working on changing or experimenting with gems.

That way I do not have conflicts when I am using one version of rake for a ruby 1.8.7 application while my other ruby 1.9.3 application uses the latest and greatest rake gem.

h3. Cleaning your gems before using bundler

Bundler allows you to install and update a set of gems based on the Gemfile. But it is not obvious how you would set up an application that has local gems installed to start using bundler. To start you need to delete all gems from the current gems. Having a clean workspace allows bundler to install gems from Gemfile without conflicts and can prevent a lot of confusion when multiple versions of a gem being installed side by side.

Here is a snippet that will allow you to clean your gemset.

   Delete all gems from gemset

   gem list | cut -d ' ' -f1 | xargs gem uninstall -aIx

In most cases this will work. But rake seems to be installed as part of the global gemset. So the above command will delete all gems till rake and then abort. To skip deleting rake change the above script as follows

   gem list | cut -d ' ' -f1 | ack -v 'rake' | xargs gem uninstall -aIx

(ack is further reading if you don’t already know what it does.)


grok grack

Recently I was trying to host git repository from an already existing (non-bare) repository. I was looking for a solution that does not force me to create a bare repository and does not require me to install apache or some such webserver on my machine.

I found a wonderful tool written by Scott Chacon called grack. grack is a git server on top of rack. Its elegance is in its design. It consists of few hundred lines of a rack middleware (awesome!) and a 6–8 line config file that allows you to host any repository over http. Setting it up on a local machine was really easy. Even hosting multiple repositories is trivial.

I discovered one quirk when my server was not accessible, was due to binding it specifically to Avoid this and bind to the hostname instead.

Many thanks to Scott Chacon, Github, Rack and Ruby for keeping it so simple.


Simple Dashboard with Tab Slideshow

I had almost forgotten about Tab Slideshow for Firefox but an appropriate application of it jogged my memory. We wanted to show a few build reports on the dashboard and also wanted them to be big and visible. Also the reports do not change as rapidly as the build and can afford to be little delayed (since mostly we are showing long running build results). So we just opened up those reports in a tab each and started ‘Tab Slideshow’. Worked like a charm. We now have the simplest dashboard.

Note: Tab Slideshow for Chrome does not seem to refresh the tabs where as the Firefox version does what is expected.


Airport Express as Remote Speakers for Airplay - Also with Linux

I have an airport express that I used to use as my wireless router when I travel. Very convenient and useful when hotels do not provide a wireless.(Yes I am looking at you Marriott.) Airport Express thanks to apple technology also supports airplay to play music over the air, and/or printer sharing via a USB connection.

I was hoping to connect my desktop and my laptop to my music system which is located in another room than these machines. Apparently airport express can connect with your existing wireless router as a client (yes they have thought of everything) allowing you to do exactly that. Here is a list of quirks you need to remember when you try to set it up as a wireless client.

  1. Prerequisites - Note down the channel number your current wireless router is transmitting on - anywhere between 1 to 11.
  2. Plug in the airport express and connect it to your mac using the ethernet cable.
  3. Start airport utility~~ which will try to detect any airport devices but will not find any.
  4. Hard reset by pressing the reset button with a paper clip for atleast 10 seconds. The light blinks rapidly when you are holding the pin and then in 30 seconds becomes steady - this means that airport express is restarting.
  5. Now rescan on the airport utility - it should find one device with name ‘Base station xxxxxx’ - with last 6 digits from the mac address. It should have a yellow icon next to it - indicating that it has not connected to the internet.
  6. Perform a Manual Setup - DO NOT hit continue.
  7. Change the channel number that is automatically set on the airport express to the one from your wireless router.
  8. In ‘Wireless’ connect the airport express as a client - select ‘Join an existing wireless network’ - select appropriate SSID of the wireless router.
  9. Browse through other tabs if you are interested in the details - else click ‘Update’.
  10. The airport express should restart and reappear on the Airport Utility. This usually takes over a minute. When it reappears it should appear with the new name you chose and with a green light next to it - indicating it was able to connect to your wireless router.
  11. If everything was successful and airport express liked the ‘Enable for Airplay’ selection you made - you will see a red light in the stereo socket light up. Connect your speakers to airport express and you should be able to airplay your music using iTunes.


  • You may encounter “AirPort Utility was unable to find your AirPort wireless device after restarting.” One of the reasons for this is that Airport express cannot connect to your router with WPA2 or any other security.(Look at Airport Express Amber Light for more details.)

  • To ensure security I disabled ‘SSID broadcast’ and enabled MAC filtering on my router. I added the MAC addresses of my Airport Express (Airport Admin Utility will show those addresses when it detects Airport Express.)

To allow your linux machine to connect and airplay to the airport express you need install pulseaudio’s drivers and support for remote audio protocol by running airtunes with Linux

sudo apt-get install pulseaudio-module-raop paprefs

(I am not making this up- The protocol is Remote Audio Output Protocol - raop)

Setup pulseaudio to enable remote speakers as described in PulseAudio settings.

Once it is installed you may need to restart your Linux machine. On restarting you should see your newly available remote speakers in your Sound Preferences. Now you should be able to stream from your Linux machine too.

And you are done.

Enjoy remote streaming.


Why I use Firefox over Chrome?

For development I choose to use tools which make the code transparent. Hence I prefer to use simple text editors over IDEs (although I like IntelliJ for Java code), or browsers that have good builtin support for debugging over closed/magical ones (hence Firefox/Chrome/Safari over IE).

Recently I switched to Chrome as my primary browser since it promised to have all the add-ons to make it comparable to Firefox. On the contrary, in fact it still lacks the power and the flexibility of Firefox for development. Here are a few reasons why Firefox is still better at supporting development:

_“GMxmlhttpRequest is same-origin only.” - User Scripts .

  • A number of add-ons on Firefox show useful information on the status bar - I use ”DCurrency“:, ”CruiseControl Monitor“:

  • ”Selenium IDE”: is available for Firefox - a big plus when I am trying to record andplay while I am trying to debug some apps.

  • In the minimal view my frequently used bookmarks always show in Firefox ~~Google Chrome shows them when I open a new tab only. Maybe a minor annoyance but I cannot reuse the current tab with a single click access to my bookmarks.

  • Minor annoyance~~ when I maximize the window on OSX Google Chrome expands only vertically. Firefox does not have this problem.

  • Even with proxy switchers Chrome depends/modifies system proxy settings (diabolical). When using on Windows changing the proxy on IE will affect Chrome and vice-versa.

“Chrome uses system’s proxy settings (IE proxy settings on Wndows) because it doesn’t have its own proxy settings yet (see, changing Chrome’s proxy settings using Switchy will also affect the system proxy settings.” - quote from Proxy Switchy! extension.

That means when I use Chrome as a browser with tools like Sahi, it will affect how other things work.

In conclusion, for now Firefox is the best browser for development.


Boost your BASH - and never again work with a plain shell

Over the past few months I have been using a community version of bashprofile, bashlogin, emacs settings and such. It started when Muness shared his bash_vcs (which was pimped command prompt) and I was hooked. I noticed a few projects that were sharing similar shell settings and enhancements. Forking from Toby’s dotfiles I started enhancing my experience on every machine I worked. This not only lead me to have a better understanding how different flavours of Unix work and also helped me automate a lot of my day to day activities.

Allow me to introduce the dotfiles project which comes with all those enhancements - stolen and tweaked from many sources - and with valuable help from Patrick Turley. Recent additions include bash_boost and what could be called the beginnings of a javavm (inspired by rvm for ruby.) Now with more brainpower behind dotfiles we hope to add more features fast. Next steps include adding support for zsh.

Give it a try, fork it or point us to more stuff we can steal to improve it for you.


Software KVM that works on linux, OSX and Windows

I was using Teleport for Mac as my KVM. But I could only control a mac mini and my laptop with it. I was looking for something that would work with Ubuntu and MacOSX switching the keyboard and mouse between them.

I found Synergy Plus that was exactly the software KVM for my purpose. (There is also an older project called Synergy, but Synergy Plus is the latest copy being managed on google code.)

Setting up my Ubuntu machine as the server and my OSX laptop as a client was facilitated by

Configure Synergy in six steps

Use synergy between OSX and linux

One issue I had was using a PC keyboard with OSX (since my Ubuntu server is the synergy server). I was not able to map the Super key to be theCommand key. Tried various options with keymapping on Ubuntu without much success. Resolutions welcome.


Ruby Kaigi 2010 - Report

Returned from Ruby Kaigi last weekend. The conference was held in Tsukuba International Convention Center and attended much of the enthusiastic ruby community (including Matz, Chad Fowler, Charles Nutter, Yehuda Katz et al). Had a blast presenting ‘Rocking the Enterprise with Ruby’.

Of all the sessions I could attend I liked Matz keynote focusing on the direction of Ruby 2.0. Especially the focus on mix-ins, issues with module mixins and list of ancestors. Class-boxes also looked a very interesting concept. Makes me want to use ruby 2.0 now. Based on the timeline discussed it is on track to be released sometime in 2011. (Ruby 2.0)

I also liked the treatment of metaprogramming handed out by Paolo ‘Nusco’ Perrotta. A delightful presenter who can draw great illustrations as well as explain the issues in ruby programming very well. His message ‘Look at source code from projects to learn what they are doing’. Also, he concluded that what works in Ruby works because of its design (metaprogramming, mixins) may not work in Java/C#. So when you come to ruby you may have to change the way you think.

Very enthusiastic response to lightning talks (in fact entries to lightning talks were closed even before the start of the conference). Youngest ruby programmer (Shota Fukumori @sora_h) who wants to change ruby internals with his gem ‘few’ and babushka by Ben Hoskings were my favourites.(Lightning Talks)

The conference was organised very well, with an unofficial and official party on Friday and Saturday. Thanks to everyone who worked to make this a success.

(RubyKaigi 2010 Staff (by Naoto Takai))


Ruby Kaigi 2010 - Rocking the Enterprise with Ruby

Uploading the beta version of the presentation for today’s ruby kaigi talk.

Rocking the Enterprise with Ruby (Keynote)

Rocking the Enterprise with Ruby (PowerPoint)

Be virtually there!


Streaming Media from Ubuntu to Bravia

Over this weekend I set out to connect my Ubuntu machine with my Sony Bravia TV.( With inspiration from Sachin Dharmapurikar and DLNA.)

Googling yielded a number of techniques to stream media from linux over the home network. Some that did suit Bravia and some that did not. The easiest one to work with was minidlna server. Snappy install and my Bravia recognised it like any other streaming website. I am running the minidlna server for my music and photos and all the content that is in DVD/mpeg2 format.(How to install on linux)

I do have some videos that came to me as avi and minidlna does not support transcoding. (There are some that describe how to do it with Windows but no out of the box solution with linux yet.) Google for PS3 Media servers I stumbled upon a PS3 Media Server for Linux - which is a java application that streams and transcodes nicely.

To get the video to be non-jittery and avoid ffmpeg/tsmuxer crashing I had to tone the transcoding down to Lowest Quality. Even with that the video is pleasing albeit a bit grainy in some cases. Documentation suggests allocating more memory or CPU might help.

To support all this I also installed a bunch of libraries described by many to help transcode,mux and display thumbnails.. The instructions are for mediatomb but these libraries work with other dlna servers.

Next stop Getting mediatomb to work on linux and bravia


Setting up wireless usb card on Ubuntu - Lucid Lynx

I have faced the same problems with Wireless Networking as mentioned by many on the web.

I tried Hardware Compatibility List for Linux and many links on that list. In an attempt to install custom drivers I would always end up with a network card that would detect wireless but never would communicate over wireless. After going through a number of cards and uninstalling and installing drivers I found one that worked really well without resorting to the ndiswrapper solution (dealing with anything windows just feels unclean). Finally I found a card that worked and also provided native linux drivers.The wireless usb card that worked was - D-Link DWA–125 with Ubuntu Lucid Lynx.It also helped that D-Link in fact published a linux driver for their wireless usb card.


ActiveResource is an oxymoron?

One of the projects I worked on recently consisted of a number of applications interacting with each other over REST. These applications were written with an intention to obtain loose-coupling between them.

While writing more controller actions I noticed something that we were doing repeatedly - anytime one particular model changed in the domain it caused a ripple effect of making us change all the consumers in the application suite. These models were all exposed across applications by using ActiveResource. ActiveResource forced us to change every one of the model/model manifestations in the application.

The main intent of the decoupling effort was to help us change these applications almost independently of each other. These applications were supposed to only depend on the exposed interfaces. What ActiveResource did was forced us to tightly-couple them and a single change caused a ripple effect.

So my question is ‘Is ActiveResource an oxymoron?’ - Especially considering the fact that Active means really simple but strong coupling. Active does apply nicely to a database record and eases development by getting out of the way. But in case of lightly or ideally decoupled applications does the Active make sense? - Probably not. So if you want to expose objects and their behaviours over the wire maybe ActiveResource is not such a good idea.


Preparing the Training Venue

The venue and the setting in which the training is conducted forms a very important part of how the training is received. When selecting the venue ensure a few things beforehand:

  • Venue is accessible - by suitable means of transportation - by walk would be the optimum
  • Venue has ample space - to be rearranged and suited for all kinds of training sessions.[#seating]
  • Venue has a high ceiling and is mostly soundproof - this ensures that there is enough air circulation and privacy when the training is in session.
  • Consider custom lighting arrangement to be used during facilitation. Most of our sessions did run with full lighting as well as the projector running all the time. Activities during training do need sufficient lighting.
  • Venue has the facility to provide for the meals for the day - coffee/breakfast, lunch, high tea - which is why hotels with restaurant service are preferable. This can help cater to trainees with special food requirements.
  • Venue has ample electricity outlets to support the training crew as well as the trainees. We did carry some of our own extension cords to ensure availability of power near the trainee tables.
  • Venue has decent internet connectivity - Now I have seen and heard about venues that mostly suck at providing decent internet connectivity for anything over 10 users. If that is the case with your venue arrange for some way to get to the internet. Most importantly arrange for some way of sharing the computers over a network - this helps in distributing material, assignments, solutions. We arranged for our own wireless router which allowed to share the internet as well as create a private network. Not to mention we did have plenty of USB keys available for quick transfer of large files.
  • Ensure that the venue has a person to be the point of contact when the training is in session. This will help resolve last minute issues/hiccups. Treat this person with respect - when you do this you are sure to get better service.
  • Have the venue arrange for a projector on site. Alternatively also carry your own projector in case the projector at the venue dies or you need to project multiple things at the same time.
  1. Transportation
  2. Space
  3. Food and drinks availability
  4. Electric outlets and Wireless Internet/Shared network
  5. Projectors

Preparing to be a trainer

Preparing to be a trainer is more of a mental activity than physical. To be one you would want to observe one and learn how they do it. I had the opportunity of being trained by a set of great trainers/speakers and also working them to understand how they prepared to be a trainer. Mostly it is about being aware of the responsibility. It takes time to get a feel for the amount of work that goes into being a trainer. To facilitate this we started by studying the course material that was already available (In a sense I was lucky that there was so much refined course material available that I did not need to invest any time in design the course. Designing a course is a major undertaking and can be done only after much experience [#feedback]).

Another thing you must do is actually be a co-trainer/teaching assistant at a training session to get a feel of the mechanics of it all.(What gets overlooked is the fact that managing time/schedule and training content is harder than it appears.) To prepare to be such a person one needs to know the complete training course. To be a developer trainer I went through the exercise of reading all the material and also solving and reasoning all the examples for the course. At times it also helps to have multiple solutions at hand. In collaboration with other trainers and trainees we have managed to have a repository of such sample solutions that we are prepared with to hand out to trainees.

Once you have a grip on the course content you need to plan and replay the plan of how the content will be presented. Pairing on course content tremendously helps. In case of vast curriculum it helps to divide responsibility between the pair to deliver certain topics based on experience, enthusiasm and freshness of the trainer. Making a plan of the day for every half hour slot helps get a feel of timeliness as well as helps focus on delivering the most important message of the session effectively. Rehearsing all this with a pair is greatly useful. We had the opportunity to rehearse this training with the smaller group to time ourselves as well as refine delivery of content. Understanding what messages are to be delivering during the session and what content is to be learnt after class/further exercise helps divide the content and reduce course load.

There is a lot of physical activity involved too. To enhance retention and recollection it may be a good idea to prepare homework/extra work problems. Some students really gain a lot from working on these in their spare time. A trick that also helps retention is ‘rinse and repeat’ - We provided handouts of the most important messages of the session and reviewed sessions at the end and few days later.

Preparing also needs to consider the amount of stationary required, hardware required, accessories such as timers, props and power availability at the venue.[#venue]

Training is a lot of hard work. Do not jump in if you don’t thing 12 hour days + dinner + a night out are not something you can take. Not to mention activities that require you to be available on a weekend.

  1. Prepare course content
  2. Plan out each day
  3. Rehearse
  4. Ensure retention by way of handouts or reviews
  5. Prepare the venue to suit the training

no such file to load —rubygems

While working on my mac and trying to use giternal I ran into ‘no such file to load —rubygems’. While I had been using ruby apps on the machine for a while, without any issues and with all the installed gems, this seemed weird.

I tried using the irb and check if

irb\> require ‘rubygems’

would work. But I got the same error. I was using the default mac version of the ruby installation that is installed at ‘/System/Library/Frameworks/Ruby.framework…..’ and did verify that rubygems was installed and that rubygems.rb was also present.

On further investigation I found that the default ruby that was run on the command line was 1.8.7 when I expected 1.8.6.

It appears that my path contained ‘/opt/local/bin’ before ‘/usr/bin’ which made the 1.8.7 version of ruby default and thus clobbered all by 1.8.6 settings and lost rubygems.

To fix this I moved ‘opt/local/bin’ to be after ‘/usr/bin’ in my $PATH and voila everything works again.

I have also been meaning to try RVM - maybe its time to give it a shot since my personal projects are on 1.8.7 and I have jruby as well as 1.8.6 installed on my mac.


Why should you be a trainer?

After being thoroughly impressed by the training that I received when I joined ThoughtWorks I was driven to become a trainer myself. I did that in 2008 (yes it’s already been that long) and am a different person professionally since then.

I am documenting my experiences for future reference as a mulitpost on Training. As I continue posting the topics on the list here will become active. Maybe as you read it will excite you to be a trainer too.

  • Preparation ** Preparing to be a trainer ** Preparing the Venue
  • Training to be a Trainer ** Science of Learning ** Cognition ** Psychology of a trainee/student/learner ** Training tools ** Imaginative use of training tools to suit trainee/trainer/class ** Studying the material ** Suiting the training material to your style and needs ** Dry runs
  • Delivering as a Trainer ** Preparing for the session ** Seating ** Be ready with the accessories for the session *** Prepare the material ** How to present yourself and still be yourself ** Finishing up the day ** Coaching/Mentoring/One-on-one training
  • Feedback - Desiging training ** Updating session content ** Updating training style ** Updating training schedule ** Updating training theme ** Adding new content ** Applying what you learnt as a trainer to your profession

CruiseControl Monitors - Graphs and Configuration

cc_monitor now has graphs with the success and failure showing as below

Not only that it is now configurable with a config file to set variables at startup. And now it is also armed with activerecord mgirations. So if you want to look at a working example of activerecord migrations outside of rails you can use this code.


CruiseControl Monitors - Gotchas and repost

When trying to use cc_monitor on my current project I hit the known snag of making it work with cruisecontrol.rb. For the umpteenth time I was not able to find any documentation on making it publish cc_tray compatible xml, which would make cc_monitor work with cc.rb.

After some googling and mucking around I downloaded latest cruisecontrol.rb and looked at its routes. I found a route “XmlServerReport.aspx” which does publish in ‘cctray’ format. I plugged it in to cc_monitor and it works like a charm.

So now I can announce that ccmonitor works with any java/ruby versions of cruisecontrol. If you would like to use ccmonitor with a continuous integration tool make sure it publishes a cc_tray compatible xml and you are all set.

Recently I successfully added ‘bacon’ to test my ramaze code for cc_monitor. The repository has been updated so check it out.

I was also suggested to check out cc_board which is a build monitor written in sinatra by David Vollbracht. Another app to make big visible charts for your team!


Flash on Linux

Last night when struggling to get Firefox to play with Ubuntu and Flash I found this forum.

The instructions that worked for me are as follows

  1. Remove all installations of flash (9, 10.. )
  2. Remove all installations of gnash
  3. Remove all installations of swfdec
  4. (Basically remove everything that conflicts with flash player - some of these things come bundled with Ubuntu)
  5. Remove any file in “/usr/lib/firefox/plugins” with the word flash in its name. eg. or in my case

  6. Once you have verified that all this has gone (You could use about:plugins url in your firefox to see all the plugins you have along with their associated file types) - reinstall the latest version of flash player from adobe website.

  7. You should have working.

Hope this helps someone who is trying to do the same.

“Now when someone asks - Do you have Flash working on Linux - you know what to say”


Learn Git

One big repository</a> and one big repository on learning it all about git.

Now you can’t say you do not know enough not to try it.

“May the Git be with you!”


Agile Conference 2009 - TDD with Iphone

On the last day I had just enough time to listen to Eric Smith and Eric Meyer from 8th light where they talked about TDD with IPhone. What was interesting was even while working with this difficult technology (Objective C is not hard but Xcode is nothing but cryptic - XIB files really?) they were able to build iPhone apps without giving up of basic principles of TDD.

They demonstrated their struggle before any tools were available for Unit testing with iPhone.

Couple of tools they mentioned were

Google Toolbox for the Mac


Something to make life less miserable when building better applications with iPhone.


Agile Conference 2009 - day 1

Very busy even though I started at 11:00am.

Met a number of ThoughtWorkers, ex-ThoughtWorkers (talking about Aslak, Liz, h, Foemmel, Glenn Bernsohn, Naresh Jain) and many people I did not know before.

ThoughtWorks booth is a hit - atleast 25 entries for the free ipod touch.

Met people from Moscow, Israel, Brazil, India, UK.

Met people from different Agile organizations. So wonderful to see so much activity in the agile space. Just proves that ThoughtWorks has been right all along and we can say “We told you so”.

Went to interesting session from Mary Poppendieck - impressed by her speaking skills. (Hope I can come close to those skills during my talk with Paulo</a>).

Hope to see many more at the Agile Open office at the ThoughtWorks Chicago office tomorrow.


Speaking at Agile Conf 2009 in Chicago

I will be speaking at Agile Conference 2009 in Chicago between August 24–28. You will find all the other speakers from ThoughtWorks on ThoughtWorks website.

My colleague and compadre from my TWU trainer stint Paulo Caroli and Sumeet Moghe will be there too.

See you there.

After Print: Want to attend my session … there is an app for that (Agile 2009 Conference Connection at the AppStore - written by ThoughtWorks)


top ten reasons why maven sucks

  1. maven corrupts - software, people.

  2. maven uses an archetype (appfuse) and expects that all your projects look like the apache projects - even those that are not webservers.

  3. maven has only four build stages - compile, test, install, package - if you have a requirement to automate performance testing you are out of luck

  4. maven requires you to have a standard directory structure that is 5 subdirectories deep - regardless of the fact that your project only has 10 java files.

  5. tasks that are not implemented in maven have to be implemented in ant and need to be integrated with maven - a big nightmare.

  6. maven encourages you to integrate via binaries - thus making continuous integration difficult

  7. every time maven builds it connects to the internet (to verify/update dependencies) - building your project without the internet is extremely hard.

  8. maven manages the projects and subprojects implicitly (since there is convention and then there are overrides) - it makes debugging your build impossible.

  9. maven manages the project dependencies in its own repository - called the .m2 repository - which is not part of your application folder - thus making it impossible to track and package development environments.

  10. maven always downloads the whole internet - to keep its dependencies up to date - even though you don’t want to.


iTunes settings

If you are using iTunes to play your music be careful when adding music to the library. iTunes tries to be smart and by default it makes a copy of the music you have as well as tries to organise it the way it likes. So if you do not like your music organised by artist/album and so on it will render your music unsearchable. (This is true for me since I do not organise my music by the artist album and such.)

To save the whole lot of mess it creates set the following in your iTunes preferences .

This way iTunes will make a list of songs but not process them the way it likes. You can have your own organisation of music and save a lot of trouble for yourself.


javascript testing with seacucumber

Seacucumber was a project that was a tool we used on a previous rails project. My friends Mike Ward and Peter Ryan opensourced it some time back. It was dormant for awhile since it worked great with prototype. Another thing was that it looked and behaved very similar to Dr. Nic’s javascript testing that you can download for rails. Recently I was on a project where we used jquery and we did not have anything to run javascript tests and break the build on failure.

So I revived seacucumber development and added jquery support to it. I had to modify jquery test runner to postback results as prototype does. So if you need a tool to automate your javascript testing you should use seacucumber. It has been moved to github.

Feel free to download it, fork it and use it. Let me know what you would like added to this tool.


MySQL Triggers

MySQL added triggers to its portfolio in version 5.0. I am thinking this was a lot of database gurus have been wanting for so long. A little primer on how to use MySQL trigger follows : Trigger 101 follows - so detune if you are a guru already.

Your database can perform a decent number of arithmetic and logical operations on your data. All this can be done by using the features of your database engine and without writing any code. One of the features I used in a recent write up is triggers. I have some tables - models with relationships. When these models change I want to effect some calculations and update relevant tables.This can all be done through triggers.

Lets take it up with an example

create table voters (name varchar (30), id integer, ward varchar (30),
gender integer);\
create table voter\_ward (ward varchar (30), male integer, female

— adding trigger to update voter count by gender automatically\
create trigger TOTAL AFTER UPDATE on voters for each row\
update voter\_ward set male = (select sum (voters.gender) \
from voters where ward = new.ward) where ward = new.ward;

update voter\_ward set female = (select sum (voters.gender) \
from voters where ward = new.ward) where ward = new.ward;\
delimiter ;

This will add a trigger to your voters table and update the voter_ward table with the genderwise count. As you can imagine you can add a lot of simple logic into these triggers to build simple and efficient update based on such events. Another thing that should be apparent is being cautious about using these triggers every chance you get to use it - They will bring the database performance down with these frequent queries.


accordion.js that is simple and works with prototype1.6

Released accordion.js on github. We were quite frustrated with the way accordion v2.0 behaved with prototype1.6. Upgrading that from prototype1.5 broke the accordion when using with images. Our simple version does not have anyeffects yet but work beautifully and is completely tested.

Try it out!


Moved my blog to github pages, and how I did it

I have moved my personal blog from blogspot to github pages. Dr. Nic and Mojombo helped me do it with Jekyll.


Moved my blog to github pages

My old blog on blogger will still be available with all the posts and comments -