Working in ActionScript and JavaScript, one gets used to getting and setting known Object properties using the dot-accessor.
var h = {}
h.foo = "bar";
For the lazy and the brave, the same can be accomplished in Ruby.
class Hash
def method_missing(m, *args)
if args.size > 0
self[m] = args.first
elsif self.include?(m)
self[m]
elsif self.include?(m.to_s)
self[m.to_s]
end
end
end
The newly assigned key is a Symbol, a desirable default.
Posted on 28th July 2009 in hacking | No Comments »
I know several “conversationists”. I refer not to people who can make small-talk with anyone, anywhere about anything. The conversationists think of the Internet as being a vast infrastructure for conversations.
And truly, that’s how it all began. Literate, word-savvy graduate students interfacing with each other through text. Wielding the knives of satire and sarcasm while burning the ether with flame wars.
To a large extent, today’s bloggers and twitterers carry on this tradition, albeit with better business savvy and slightly larger egos. Many of them know the power of images and deploy them to great effect.

The Medium is the Message
Clearly, there is a huge difference in impact between reading a comment on some nameless text-only forum (or worse, a rendering of a forum in one of your favorite client) vs reading it in a controlled space. Despite the atavistic tradition of feed readers, blogs reinforce weight and authority through a hundred and one subtleties around choice of domain, layout, theme, content focus as well as through stats widgets, comment areas and ancillary businesses. Read the rest of this entry »
Posted on 8th July 2009 in ideas, insights | No Comments »
Google has tremendous amount of talent in terms of engineers and strategists. And in their 20% time they build pretty amazing stuff.
Over the years, speculation had built up on the Google desktop OS. (There is already a super-scalable server version, but that is not for general release I suppose).
Now it’s official. This is a great opportunity for those lucky OS engineers refactoring and building a clean, modern OS that matches today’s most common usage. Good luck.
I write this with mixed feeling because Google is working with several OEMs to build x86 and ARM versions. Unlike Linux, which piggybacked on existing computer infrastructure (and hence x86), Google will probably intervene aggressively to find the right price points and distribution channels. So, its the erstwhile rumored duopoly that Google is going after, not just an OS monopoly.
Let the marketing and turf wars begin.
Posted on 8th July 2009 in Uncategorized | No Comments »
AirDB solved a pressing need in abstracting SQLite operations and thinking in terms of object behavior. I was able to design and build it quickly thanks to ideas and various bits, pieces and whole chunks of work that has been done by various people.
Thanks to Jacob Wright for AIR ActiveRecord. His ideas and code on Inflection and Reflection have been useful and incorporated with due credit into AirDB.
Thanks to Christophe Coenrats for demonstrating how to use annotations and meta-data.
AirDB of course is adapted to solve particular problems of interest, including support for explicit, incremental migrations (useful for AIR apps that update themselves) and chainable associations, and is available for others to build upon or use.
Posted on 2nd July 2009 in thanks | No Comments »
Eric Mortenson’s report on the economic perseverance and adaptability in Klamath County talks about how Liskey Farms is creating new lines of business.
Klamath Falls sits on natural geothermal springs, and geothermal power was used to heat homes in the area, starting in 1900. Today, schools and colleges are offering courses and careers in renewable power generation using geothermal energy.
The economics of geothermal heating allows Liskey Farms to maintain and operate a greenhouse where “lima beans sprout and grow 3 inches in two days”.
The company leasing the greenhouse intentionally infests the lima beans to grow spider mites. Spider mites are known to feed on more than 180 different plant species in both greenhouse and outdoor environments and are considered a serious pest in agriculture. Strawberry fields, grape vineyards, almond orchards, apple orchards and mint fields are susceptible to spider mite attacks.
Several companies offer biological controls for spider mite infestations. At $25 per 1000 bugs in a bottle, farmers and growers can get predator mites which attack and feed on spider mites.

Spider Mites

Predator Mites

Predator 6-pack
Lima beans are grown in geothermally heated greenhouses to breed spider mites specifically to harvest their eggs and use them as feed for predator mites, which are then bottled and sold to orchards and vineyards to increase their yield. As Liskey simplifies it, in traditional terms:
“We’re the hayfield to the feedlot”
Just another example of ecological niches combined with economic requirements harnessing available resources to create new businesses.
What’s your niche?
Posted on 21st June 2009 in investigations | No Comments »
TextMate has increased my programming happiness.

A well-crafted, elegant and intelligent text editor, TextMate is a rare combination of graphical power, customizable keyboard shortcuts, sensible project management and extensible smarts.
Most importantly, it does all this with a speed and responsiveness that keeps you in the code flow.
Nothing is skimped, nothing is extraneous, nothing forced. You are free to develop your personal interaction style that works best for you. Here are the things that I appreciate the most:
- Syntax highlighting and automatic indenting for a range of languages, including multiple scopes such as when HTML combines Javascript and Ruby.
- Quickly go to a file by typing just a few characters. The pattern matching for the dynamic file selector is powerful and intuitive.
- Ultra-quick Find/Replace at multiple levels. The Project level find is collapsible at the file level.
- Multiple file tabs that are easy to switch and move around.
- Code navigation, bookmarking and text folding.
- Rich set of language and task bundles with code generation snippets, macros for common cases and more.
Thanks to Allan Odgaard.
Also, thanks to all those who contributed snippets and bundles to TextMate.
Posted on 19th June 2009 in thanks | No Comments »
Opera – the epitome of nice guys finishing last and maker of the eponymous browser – has launched Opera Unite, an attempt to “reinvent the Web”.
The notion of a web browser as a web server is not new, it simply fell by the wayside in the Internet Gold Rush. Netscape decided to essentially give away the browser and charge a huge premium for the server. Once Microsoft realized that browser market share was critical to control standards, formats and future evolution of the technology, the browser business model was deemed FREE. A dying Netscape spawned the open source Mozilla, and various companies nurtured it to develop Firefox. Not surprisingly, Google feels the need to replay the strategy with Chrome.
Yet Opera has not made much headway. Because, or in effect, they seem to make decisions that go against the grain. For example: Read the rest of this entry »
Posted on 16th June 2009 in investigations | No Comments »
I enjoyed exploring the Smithsonian last week while I was in Washington, D.C. The exhibits are impressive, and the curation is enlightening. Here is just one example.

1903 Wright Flyer
The National Air and Space Museum has the original Wright Flyer on display. Yes, that is the actual beech and iron frame, with controls and engine from 1903 that flew at Kitty Hawk. The fabric has been replaced, of course, but I am pretty sure that the replica fabric mimics the characteristics of the original as closely as possible. The exhibit is impressive in its regard for history and heritage.
But the care in curating and creating a narrative is what provides the larger context for the Wright Brothers’ accomplishment. It illuminates the inspiring story of two entrepreneurs who use their knowledge and skills to set off on a larger quest. Through artifacts, images, audio-visual displays and hands-on models, our attention is drawn to the process of innovation. A methodical, analytical and empirical approach with the result that:
The basic problems of mechanical flight, lift, propulsion, and control were solved in the Wright design
Even more interesting is how people react to the information and artifacts. Their urge to draw attention to certain aspects to marvel, discuss, and just share. Right then, right there with those present, or later in ruminations and retellings. Imprinting it with their own experiences and absorbing it into their perspectives.
And therein is an idea and possibly a new market.
Posted on 15th June 2009 in ideas, insights | No Comments »
A summary of the several improvements committed to AirDB in the last five weeks.
- Support for has-many and belongs-to associations
- Support for multiple associations for a given Modeler class.
- More smarts and existence checks for automatic schema migration
- Call-chaining for Associations e.g. post.author.comments.count
- Miscellaneous fixes, improvements and optimizations
Highlights of the major new additions since I wrote about the initial design.
The Migrator handles schema versioning, checking and automatic migrations.
public class Migrator implements IMigratable
{
public function Migrator(klass:Class, options:Object, directives:Array) {
// setup table structures, prototype fields, existing schema
DB.migrate(this);
}
// Supported migration directives
// create a table after processing the provided function block
public function createTable(block:Function):void { ..}
// specify a column, if it does not exist, it is created.
public function column(name:String, dataType:uint, options:Object = null):void {..}
// make a join table to handle many-many associations with specified class
public function joinTable(klass:Class):void { .. }
// map a foreign key for belongs-to association
public function belongsTo(klass:Class):void { .. }
}
The Associator handles associations which are specified via class meta-data. The improvements under the hood make it easier to make associations between Modeler object instances. For example
// Use the record ID of the target to specify associations
// Post has-many comments
post.comments.push(3);
// Chain the target for further calls
// Post belongs-to author and Author has-many comments
// Obtain field value of associated target
var nm:String = post.author.name;
// Make further associations on associated target
post.author.comments.push(new Comment({title: 'hello there'}));
Join queries and foreign-key lookups are now a breeze with AirDB.
Posted on 7th June 2009 in airdb, hacking | 1 Comment »
Its been exactly one month, since I decided to stop reading TechCrunch, quit using Google Reader, cut down on Hacker News and began cultivating new reading habits. Given, how long I have had those old habits, I am a bit surprised by how easy it was to change and how quickly I can perceive the improvements.
I now use a hand-crafted RSS folder and a personal news-bot to track interesting items. Recently, the Amazon AWS Import/Export service caught my attention.
AWS transfers your data directly onto and off of storage devices using Amazon’s high-speed internal network and bypassing the Internet. For significant data sets, AWS Import/Export is often faster than Internet transfer and more cost effective than upgrading your connectivity.
This is amazing! And shows exactly why Amazon continues to amaze.
- It is useful, understated, and solves a problem.
- It harnesses Amazon’s strengths physical shipping, receiving and handling.
- It clearly shows that Amazon understands clouds better than anyone else.
Twitter may have tantalizing plans for revenue, and Facebook may fantasize about being the once-in-a-century revolution in media, but Amazon is the Other Internet Company. They run a tight-ship, host a diversity of services and help other people make money. Most importantly, they do it transparently and without running secretive double-blind keyword auctions.
Amazing!
Posted on 21st May 2009 in insights | No Comments »