February 28, 2008

IBM recently demonstrated a program that shows alerts in a Data Center using gaming technology. A user can walk around a virtual data center and see alerts if something goes wrong on a real world machine. I’ve also been talking to some customers about using gaming technology for training. Generally the way this goes is that they want to train salespeople on a new product and they have an avatar that stands next to the product and talks about it.
I applaud the effort that went into this project and I think there’s a lot of value in bringing gaming technology to these types of enterprise problems. However, why are these visualizations constrained to the item in the physical world they represent (except of course for the avatars that are people with cat heads)? Why not visualize the data in ways you can’t physically– represent computers as clouds and have the scene be sunny when all is well, overcast when your threshold is getting close, and thundering/lightning when a server is down? Instead of learning about a new car engine as you would in the real world by popping the hood and looking over the visible parts of the engine, why not pop out the engine and be able to rotate it, fly through the cylinders as the pistons fire– things you can’t do in the real world?
No Comments » |
Virtual Worlds |
Permalink
Posted by blaine
February 21, 2008
Congratulations are in order for our colleagues down in Atlanta with their launch of Rails-powered RecycleBank kiosks. The kiosks are running a custom Rails application that works with a web service backend. This was a really great idea by RecycleBank.
Lead developer Seth Chisamore has the full story, including a video segment, over at his blog
Nice work, guys!
No Comments » |
rails | Tagged: atlanta, launch, rails |
Permalink
Posted by cgansen
January 15, 2008
memcached is a great tool for building and running large sites. The SME Toolkit, a partnership between IBM and the International Finance Corporation (and a Ruby on Rails application) uses memcached extensively to reduce the load on the database and make the application really fly. In addition to caching HTML fragments in memory, we also use the Robot Coop’s simple CachedModel plugin to ease some of the repetitive queries for some key models.
One of the limitations of the MemCacheStore mechanism is that it doesn’t support regular-expression expiration of cache fragments. With the setup of the Toolkit site, various partners publish updates to their sites (for example: new content, updated categories, granting permission to view premium content). One instance of the application powers many brands, and the whole instance shares one memcached process. When a partner publishes an update to their site, we need to expire the cache fragments for their site, and their site only. With a simple disk-based cache, this would be simple; pass a regular expression to the expire_fragment method and be done with it. With memcached, it’s not so simple.
To work around this limitation, we exploit the ability of memcached to hold any piece of data. To keep track of each brand’s cache data, we maintain a hash of all fragment names for a brand, and save that in memcached as well. The code for this is remarkably simple:
module ActionController
module Caching
module Fragments
def write_fragment_with_memcache(name, content, options = nil)
return unless ret = write_fragment_without_memcache(name, content, options)
# Append the item's key to the array of items for this site
if fragment_cache_store.is_a? ActionController::Caching::Fragments::MemCacheStore
site = @site_brand.id #@site_brand is set by the application controller
doc = CACHE.get "fragments_for_site_#{site}"
doc = [] unless Array === doc
doc << fragment_cache_key(name)
CACHE.set("fragments_for_site_#{site}", doc)
end
ret
end
alias_method_chain :write_fragment, :memcache
end
end
end
Then in our sweeper for the site model, we simply iterate over the entire hash of fragments for the site and delete each one.
def expire_fragments(record)
doc = CACHE.get "fragments_for_site_#{record.id.to_s}"
if Array === doc
doc.each do |page|
CACHE.delete page
end
CACHE.delete "fragments_for_site_#{record.id.to_s}"
end
end
No Comments » |
rails, scaling | Tagged: rails, memcache, code |
Permalink
Posted by cgansen
January 11, 2008

My colleague Kevin started out working on our World Community Grid project as a developer. Over the last year, however, he’s gotten really deep into the topic of Grid computing, particularly with Volunteer Grids. He co-authored a poster that was presented at the SuperComputer 2007 conference. It explains some of the difficulties surrounding getting results returned quickly to researchers on volunteer computing grids (volunteer computing grids are very good at getting a lot of work done (high throughput), but it takes 3-4 weeks to submit a job and get the completed results back to the researcher (slow turnaround).
I was also impressed that Kevin was able to fit so much information on a single powerpoint slide. I had to set it to like 13% to fit on the screen.
No Comments » |
Grid Computing |
Permalink
Posted by blaine
November 27, 2007
It is very rare something works right out of the box. So naturally I encountered a few issues along the way in getting our JRuby application running. One, quite easy to figure out although still inconvenient, and the other I think I lost some hair over but eventually hacked it to make it work.
IDs’ are interpreted as strings
The first issue, and seems like this is only related to DB2, is the fact that I was unable to do:
@user = User.find(params[:id])
As then I would get this pretty message:
NativeException: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -401, SQLSTATE: 42818, SQLERRMC: =: SELECT * FROM users WHERE (users.user_id = '1')
Forgive the user_id instead of just id, this is a legacy application. This was easily fixed in the model by adding:
self.primary_key = :user_id
It doesn’t look like DB2 likes the quotes around the 1. So the first thing that came to my mind, make it an integer. Hence the following worked wonderfully.
@user = User.find(params[:id].to_i)
So until this is fixed, actually, I really should not use the word fixed. Now that I think about it, one would think it is natural to pass in an integer to an integer field. Ok, so until this is updated to match the functionality of other databases, I think I’ll have to live with a bunch of “to_i”’s laying around everywhere.
Read the rest of this entry »
4 Comments |
java, rails |
Permalink
Posted by tomek37
November 27, 2007
I feel like any developer I speak with that has been enlightened by RubyOnRails has some variation of experience with several other languages and frameworks. But like me, many if not all whom I’ve spoken with, are now RubyOnRails enthusiasts.
I’ll be the first to admit I really enjoy working with RubyOnRails. It makes my life easier. So what better way to introduce RubyOnRails benefits into a Java web application than JRubyOnRails.
One of the applications I am currently working with is called Reading Companion. It is a web application that uses IBM’s voice recognition technology to help children and adults learn how to read. Read more about the program on IBM’s website.
To maintain and prepare the application for its continuing growth, we continue to develop enhancements. To aid in speeding up the turnaround in deploying the enhancements, Blaine came up with the idea to integrate JRubyOnRails into the application and start developing future enhancements using it.
This proposition offered several challenges that needed to be solved. In this blog, I’ll describe the questions we had and the approaches we took to design the solution.
Read the rest of this entry »
No Comments » |
java, rails | Tagged: DB2, JRuby, JRubyOnRails, WebSphere |
Permalink
Posted by tomek37
November 20, 2007
The DB2 guys are really behind Rails and this makes sense since the Rails domain doesn’t overlap with the Database tier. The story for how Rails works with Websphere customers is a bit murkier since Rails and Websphere do overlap in the domain of application frameworks (Ruby vs Java). I think JRuby is a good answer for how a developer can get the benefits of developing in Rails while keeping their investment in Websphere. At RailsConf Europe I went to several of the JRuby sessions and met Charles Nutter who works for Sun and is doing great work on JRuby and getting things to run under Sun’s App servers, but I’m not aware of anyone doing this on Websphere yet.
Until now. I’m really excited that I had the chance to make some major enhancements to a Java application and decided to try out developing these in Rails and deploying out to Websphere. One of my colleagues, Tom, was the one who sweated the the details and got it working. I’ve asked him to write a post and he’s getting that ready now.

No Comments » |
java, rails |
Permalink
Posted by blaine
November 14, 2007
As a developer of the new TraduceloAhora.org website (profiled here), I found myself facing a few common tasks in the Ruby on Rails framework that I’ve faced developing web applications in other frameworks. One of the best features of Ruby on Rails is the abundance of 3rd-party plugins that live outside the core framework. These plugins are often well constructed, accessible, and allow us to not reinvent the wheel which saves development time and effort.
Three of the plugins we used on the TraduceloAhora.org effort were:
- Gloc - Provides a powerful, yet simple internationalization mechanism.
- active_record_base_without_table - Enables form input that doesn’t correspond to any ActiveRecord model to utilize the convenient ActiveRecord validation methods.
- acts_as_rateable - Gives Rails models in your application a “rating” association.
Read the rest of this entry »
No Comments » |
rails |
Permalink
Posted by matthewq
November 13, 2007
I meet a friend for lunch every few weeks and he usually starts out the conversation with, “Have you cured Cancer yet?”
I have to answer no, but over 330,000 people and their 800,000 computers are working on it.

An IBM team from Chicago, Austin, Seattle and Armonk launched a volunteer distributed computing project called World Community Grid back in November 2004 and it steadily keeps growing in all aspects– users, participating computers and research projects.
On November 1st, a new research project called Help Conquer Cancer was launched. This is a project that has the potential to significantly advance the understanding of how cancers grow which will enabled researches to find new ways to treat or prevent cancer.
The website was written in Java (I didn’t know about Rails back in 2004), runs on Websphere and DB2 (7 actually, we need to upgrade). IBM partners with Research institutions such as Scripps, NYU and the Ontario Cancer Institute who create the scientific models, generally in C, C++ or Fortran and the IBM team then “gridifies” the research application before deploying to the network. We use and actively contribute to the BOINC open source distributed computing project.
There are several other research projects that are actively running and some that have completed.
No Comments » |
Grid Computing, java |
Permalink
Posted by blaine