Skip to main content

Posts

Showing posts from August, 2012

Automated Dependency Injection

In the tradition of modular and object oriented programming, we have long learned to design software by hierarchical decomposition - divide and conquer engineering, where each module/object has a clear function/responsibility. Complex functionality is achieved by delegating some sub-functionality to other modules/objects. In the above example, module A achieves its functionality with the help of B, C and so one. When these functions become stateful, abstract data types or objects, "wiring" up this dependency tree to enable the access to the right instances of data at each level can become non-trivial in large projects. The dependencies can be hidden and encapsulated hierarchically such that if an application needs an "A", creating "A" in turn triggers the creation of the appropriate "B", "C", "D" and "E", hiding all the complexity of the decomposition from the user of "A". However this static setu

Kugelbot - or what to do with a Raspberry Pi

With the Raspberry Pi board now up and running on the network, I needed something "reasonable" for it to do. Maybe an homage to the famous Trojan room coffe pot camera - 20 years later, at a fraction of the cost? Hosting a download mirror for Raspberry Pi boot images on a Raspberry Pi? A probe for network performance monitoring? A twitter robot which recites The Iliad 140 characters at a time? Finally, I settled for a robot which reposted a summary and link to all my public Google+ postings to my otherwise unused Twitter account . In addition to Python 2.7 already included in the boot image, the following ingredients were used: tweepy (Twitter api library, recommended by Twitter ) google-api-python-client (Google+ api library, provided by Google) daemon (small library to run python script as a daemon, easy_install daemon) In order to read public posts via the Google+ API , no authentication is required, but a developer key is needed for quota tracking, which

Raspberry Pi - unbagging and first impressions

Looking for low-cost linux hardware , I had come across the Raspberry Pi project a few months ago and been hopefully intrigued by its goals to promote " computer literacy " (whatever that means). Now that you can actually get them more easily, I ordered myself one from Farnell and surprisingly it arrived in a few days. I am glad to see that the popularity of the Raspberry Pi device is creating an active community, where detailed help and instructions are easily available - not an obvious thing for other niche and esoteric hardware. I was going to set it up as a network server and access it from my PowerBook via ssh, X11 and/or VNC. Getting a bootable SD card was very easy, also in part thanks to such detailed instructions , but requires access to another computer with SD-card reader and Internet access. Using a spare micro-USB cellphone-charger and an ethernet cable to connect directly to the home router was all that is needed to complete the setup. After that, it got a