Mindful software

I have spent considerable amounts of  time thinking about the concept of information and how to convey it in software.  Some years ago I came to the conclusion that I want to present information in context, e.g not present crude extracts from databases, but adapt it to the presentation context, with the user in mind.

Some useful contexts could be “location” or “social networks” – the context should be varied depending on the type of information context – e.g information about abstract concepts have no use of location information. The use of context should increase the likelihood of the information being conveyed to the user in a understandable manner.

When I observe users, I rarely see one user that uses only one tool to achieve her goal. Information gathering is usually done using a variety of sources – so a good system design principle could be to know where the system should stop – and how to present the information  in a such a manner that supplemental or related information can be retrieved from another system.

So , to me, presenting information in context is also about presenting the least amount of “friction” in the system. Here I consider any obstacles hindering information flow in and out of the system as “friction”. By minimizing the “friction” we make it easier to present information in context by connecting data between systems.

This has lead me to think that good system design should focus on how information is shared  between users via connected systems.  Turning the attention to how information is shared between users via connected systems, then we obtain a understanding what the data is (since we need to be able to share it).

Tags:

On the untimely demise of google wave

Alas, Google wave is no more. I knew it well.

Or.. rather. I knew the api’s well. All the cool technology behind it – I knew that.  The google wave team tackled some tough issues to get it up and running. Google wave included an implementaion of  Operational transforms for largescale realtime collaboration. The google wave api was also pretty nifty.

Now – when thinking about it , I remember email conversations about google wave – facebook conversations about google wave. Real life conversations about wave. Hackathons about wave. I never actually did anything useful in wave itself.  All the fun memories I have about google wave is basically learning about new technologies and meeting new people. There is nothing bad in hacking on interesting tech – during this process I learned about google app engine, cloud computing, python,  protocol design and some longhaired math – all these things are usefull to me in the long run.

It looks like that some of  the technologies of google wave will live on in other google products.  One of the main features – realtime collaboration in documents is now available in google docs.

Tags: ,

adventures with mingw , ruby,java, rhino and jspec

update 2010-10-05: jspec has been deprecated in favour of jasmine

update 2009-10-21: This post is a writeup of my early experiences with gemcutter and rubygems. The strange runtime error I did not understand was probably related to that I needed to update rubygems to 1.3.5. I now know how to use gemcutter from ruby1.8.6 using the oneclick installer .

I have been using jspec on macosx for a while and decided to give it a try on windows vista today. Installing jspec on macosx and linux can be done using the instructions here .

I want to run the automated jspec tests available via rhino at a client site. Sadly , I am forced to use windows there, so I have given some thought on how to make jspec run on windows.

First of all you need to install ruby. I used the automated 1.8.6 One-Click Installer available here . After installing i ran


gem update

the instructions in the README file for jspec currently states that I should install gemcutter and install jspec via that . I was not able to do that on windows ( my system decided to report an obscure runtime error that I did not understand). So i decided to do this instead:


gem sources -a http://gems.github.com
gem install visionmedia-jspec

I let gem install the required dependencies visionmedia-commander and visionmedia-bind. After this I had the jspec script available. Sadly this gave me version 2.7.2 (I noticed \ruby\lib\ruby\gems\1.8\gems\visionmedia-jspec-2.7.2 ) The listing on gemcutter told me that a version 2.11.10 is a avaiable , so I decided to dig deeper. Maybe I could make gemcutter work anyway?

After a little browsing on github.com I found the oneclick installer

I cloned this repo using git

using the following command:

git clone git://github.com/oneclick/rubyinstaller.git

and pressed


rake ruby19

This project creates a sandbox that compiles a working ruby environment using mingw.

After contemplating the insanity of what I was doing for a couple of minutes (remember : installing a working ruby on linux is a single shell command) I grabbed some coca cola and started browsing through the source code for ruby distro while the rubyinstall was compiling. I looked a bit at ruby.c and vm_exec.c and had grim flashbacks to my c days. Luckily the compile finished and I copied ruby19_mingw to my c:\ drive and set it up on my PATH variable. Then I could check which version I was using:


C:\>ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [i386-mingw32]

Now I was able to do:

gem install gemcutter
gem tumble
gem install jspec

(Note that there is information sent to the terminal during these steps)

Now for the interesting part(!) jspec was working , so I could do this:


jspec init SolitaireCipher --freeze

This created a directory where I can train doing the SolitaireCipher using javascript. I renamed lib/yourlib.core.js to lib/SolitaireCipher.js and spec/spec.core.js to spec/spec.SolitaireCipher.js and spec/spec.dom.html accordingly.

After 20 mins of fiddling I managed to get some running tests in a browser by opening spec.dom.html. Then I decided I want to automate the tests using mozilla rhino. After installing rhino , I could run automated tests like this


cd c:\projects\SolitaireCipher
jspec --rhino

This opens up a proces that listens to file changes in the lib and spec folders. All very well – untill I discovered that jspec currently uses ANSI codes to render colors to the terminal screens. ANSI codes are not supported on windows vista (something with ANSI.SYS being obsoleted), so if I want the nice colors then I need an alternative terminal than my command prompt in vista.

I found rxvt available from PortableGit on google code. This renders the colors just nicely – but has some other drawbacks. If I just use rxvt for rendering feedback from the jspec tests, then it seems to work though.

One thing to note is that rhino needs the java sdk to be installed and js.jar needs to be on your CLASSPATH. when starting jspec from rxvt on the msys from PortableGit, then CLASSPATH could be set like this (assuming rhino is installed in c:\tools ):


export CLASSPATH=/c/tools/rhino1_7R2/js.jar

I probably want to avoid using rxvt on PortableGit too much . There are some major flaws listed here .

Maybe I should look into doing a adobe air frontend for jspec?

Tags: ,

BDD is not about testing

When talking to people about BDD and my lame example using Paris Hilton, then I got the question “it was really interesting reading about Paris Hiliton .. but what is BDD really about?.

The central insight of BDD is that TDD is really computer aided specifications of the executable behaviour of your system. BDD tries to express this using a Domain Specific language.

Back in 2006 , Dave Astels described how to ascend from the focus on 1-1 testing of production code to use the test proces as a way to describe the way you want your system to behave.

In the video Dave makes the valid point that “The words you use shape how you think”. So we should go away from thinking about “testing” constantly to think about describing how you want your system to work.

So to me – BDD sounds like a kickstart to be productive in TDD – and do it well from the start. So if you are starting out on TDD , you should really start out doing BDD.

Dave walks through some examples using rspec in ruby. I am currently using jspec

Tags:

Paris Hilton and Behaviour Driven Development

Recently, I have been giving Behaviour Driven Development some thought.

Let’s take a an example of how to develop and test a music video search and storage system. A traditional way of developing this would require formulating a object oriented system architecture, thinking about streaming and metadata enabled search. The system architecture could consist of a well chosen database server, a streaming server and a metadata enabled search engine – combining these technologies with a modern UI and encapsulating theme in carefully designed object oriented structures. During all these important choices , and all during development we would make sure to write tests before we write a single line of code.

All these things put together would lead to a well thought out system architecture , but all the effort put into the system architecture can be in vain – if we don’t have a solid business understanding of what a video storage system should do. What will the users expect?

While browsing on facebook this other day I found the “The Paris Hilton & Jacques Derrida Appreciation Society” – this group explores the connections between the works of Paris Hilton and Jacques Derrida. When we deconstruct the “pretty blonde” facade of Paris Hilton, then you can actually find some deep insights. Take “Nothing in this world” for instance:

Take the phrase “when you are with somebody else, that’s me in your eye”. There is the obvious interpretation of the sentence . But thinking about that sentence also let’s you reflect on the real meaning . When you look at Paris Hilton in this video, what do you see? Do you see the pretty blonde or the millionaire , hard working young girl . In this video I am seeing the image of the pretty blonde – but I am also thinking about the millions of dollars she is earning portraying herself in this way. So in a sense – I am reading the original message out of context. I am admiring what Paris Hilton in some other way than she intended – the original meaning of the words seem to have disappeared – but my understanding of the sentence is more useful to me. I wish I could do what Paris Hilton does – but in a way that would make sense in my world .

The producers of the “Nothing in this world” video are not likely to convey information about the business empire of Paris Hilton in the metadata supplied for the video. So a system formulated as a “video storage system” would not let me exploit the information I found in the facebook group.

BDD introduces the use of a Domain Specific language to express the users expectations in a manner more directly focused on the behavioural aspects of the system. This lifts the clouds from the system aspects and focuses on intent.

A better way to formulate my expectations for the system would be:

Describe the music video storage system:
  I should be able to search for videos using metadata
  it should play videos  in my browser
  I should be able to query facebook for information about it

If I had those expectations formulated to me , then I would choose to implement this system as a mashup between youtube and facebook as a facebook application. This would be a radically different system architecture than the one describe above.

Furthermore , by leveraging one of the several BDD test frameworks available, then the expectations could be formulated in way that can be used as tests.

Tags:

what is information?

Listed as one of the of five deep questions in computing , this questions stands out to me as the one question we have to answer before we can answer questions like “what is computable” and “(how) can we build complex systems simply”.

To me the concept of “information” only makes sense if it can be extracted or related using wellknown techniques. In this sense “information” is put in the context of a “subject” and a “object” , e.g. the information identifies facts about the “object” in a manner that is understandable for the “subject”. When information allways should occur “in context”, then it should be clear that the information should be codified in a manner that is understandable by the “subject”.

This “codification process” is successfull when the information about the “object” is conveyed to the “subject” in a manner that is easily understood – so in my interpretation “information” can be expressed in many ways , and still be intended as the same information about the the same “object”.

In most concrete circumstances involving human communication “codification” will mean “telling” somebody “else”. E.g saying “I am hungry” .. or “do you mind passing me the water”. Information is revealed through use of language in a sentence and placed in the context of the situation where the sentence is spoken.

In most traditional computing software information is stored to examine facts about phenomena or physical items. The wealth of information in context has been lost in the process of gathering these facts. Take a traditional supply store. It is not very common for the desk clerk to capture the facial expression of the customers while entering the items bought in the cash register. So in this way, the information from the facial expression is available to the desk clerk but not the store manager.

In our current computing systems, then it is not easy to compute “the mood of the customers” – but if we understand the wealth of information lost in the “codification process” then we can exploit this for a better understand of the market siutation . But we will still not be able the compute the “mood of the customers”.

So – to me information can only be understood as “information in context”. I will try to design complex systems from this where it makes sense.

Cloud computing man kan bruge til noget

Jeg har tidligere kigget på brugen af vmware ifm test og udvikling. Jeg har fundet ud af det det kan være fordelagtigt at opbevare udviklingsmiljøer og databaseopsætninger på virtuelle maskiner – det hjælper typisk med at min hoved-udviklingsmaskine ikke bliver ‘møget’ til af diverse projekter jeg kigger på i løbet af ugen. Jeg har også kigget på Google App Engine for java - det er godt med nogle fasttømrede api’er der er klargjort til af fungere på en større gruppe af maskiner på en gang – så performance og skalerbarhed har været der fra starten ( Jeg hører også gode ting om Amazon EC2)

Det har dog bæret sådan at det bliver lidt bøvlet at vedligeholde diverse images rundt omkring – og Google App Engine for java stiller væsentlige begrænsninger på hvordan man kan skrive SQL – og det kan blive vanskeligt at få benyttet GIS operatorer på GAE (Bemærk at jeg slet ikke har prøvet microsofts nye Azure platform)

Bob McWhirter kører iøjeblikket et projekt for jboss , hvor han iøjeblikket eksperimenterer med puppet til at administrere virtuelle maskiner. Jboss håndterer udviklingen under projektet jboss cloud . Ideen er at man kan benytte “metaappliance” til at generere de øvrige “appliances”. Jboss understøttede clustering allerede fra version 4 – det nye i eksperimentet er nu maskin-håndteringen, hvor deployment-platformene inkluderer ec2, vmware, kvm .

Jeg håber at kunne bruge jboss-cloud projektet til at håndtere mine udviklingsservere på en mere fornuftig vis :)

et nogenlunde hurtigt virtualiseret kodemiljø

Jeg har tidligere skrevet om min oplevelser med at kode J2EE på linux. Siden da har jeg fået lidt flere erfaringer med brugen af vmware og har gjort mig flg. observationer:

  • Det er skidt at flytte datasæt “ind” i et vmware image. Så er det nemmere at lave filshares samt databaser på hostmaskinen .
  • Kontorprogrammer samt gængse applikationer er bedre placeret på hostmaskinen end i det vmware image der programmeres i.
  • wmare kræver ikke så meget RAM for at køre. Jo mindre RAM der tildeles det enkelte image – jo hurtigere går det med at åbne og lukke det.
  • Kode er placeret bedst i versionskontrol på en anden server. Ideelt set så kan det brugte image rulles tilbage til start efter endt brug.

Jeg kører nu med 256 mb tildelt mit windows image og har flyttet kontorprogrammer ud fra windows. Dvs at jeg nu kører alle andre programmer end de windows-specikke fra linux.
En af de umiddelbare fordele der er kommet ud af at samle min arbejdsfiler på et enkelt share er at mine backupfiler er faldet drastisk i størrelse.

vmware workstation 6.0.3 default fejler på linux kerne 2.6.24

Jeg har for nyligt opgraderet til Ubuntu 8.04 .

Efter at have opgraderet ubuntu, så oplevede jeg at vmware-config.pl ikke opgraderede min kernemoduler for vmware som vanligt. Dette skyldes øjensynligt at der er blevet flyttet rundt på nogle headere i kerne 2.6.24 som ubuntu 8.04 kører med.

Efter at have kigge lidt rundt på nettet fandt jeg følgende løsning , der involverer brugen af “any-any” patchet for vmware . Jeg har selv valgt denne løsning selvom at den ikke er officielt supporteret af vmware ( jeg har kun gjort dette ifbm med min hjemmeserver, der ikke kører kritiske ting).

Et pragmatisk miljø til at kode J2EE i

Efter at have kigget lidt på linux igen her i 2008, så har jeg fundet opdaget at det er forholdsvist nemt at begå sig med javaudvikling på serversiden i linux. Tilbage dengang da J2EE startede med at gribe om sig omkring år 1998- 2001 , så kan dem der var med den gang nok huske hvilket helvede det var at vedligeholde et udviklingsmiljø for java. Tingene har sandeligt ændret sig siden Sun frigav java som Open source!

I dag har jeg installeret et udviklingsmiljø på linux med:

  • suns java sdk
  • eclipse
  • tomcat 5.5
  • ant og junit
  • php

Det kunne jeg gøre forholdsvist nemt således:

sudo apt-get install sun-java6-jdk eclipse tomcat5.5 ant junit

jeg havde allerede installeret Oracle Express edition og havde bemærket at jdbc driverne lå i

/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/jdbc/lib/

Hvis jeg havde databasen på en anden maskine, så ville jeg have hentet jdbc driverne her

Da dette er min hjemme maskine , så vil jeg også gerne kunne køre php ifbm andre ting — så jeg vil gerne stadigvæk køre apache. Derfor ville jeg gerne have en måde at integrere php på apache2 og tomcat5.5. Jeg har tidligere gjort dette med mod-jk connectoren til projekter – og fandt heldigvis mod-jk og php5 hos ubuntu:

sudo apt-get install libapache2-mod-jk php5

Det viste sig at jeg skulle pille lidt ved jk.load opsætningen for mod-jk modulet for apache:

indhold af /etc/apache2/mods-enabled/jk.load:

LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel debug
JkLogStampFormat “[%a %b %d %H:%M:%S %Y]”
JkMount /java/* worker1


derefter skulle /etc/apache2/workers.properties indstilles:

workers.tomcat_home=/usr/share/tomcat5.5
workers.java_home=/usr/lib/jvm/java-1.6.0-sun
ps=/
worker.list=worker1
worker.worker1.port=8009
worker.worker1.host=localhost
worker.worker1.type=ajp13
worker.worker1.lbfactor=1

Dernæst skulle apache2 og tomcat5.5 genstartes:

sudo /etc/init.d/apache2 restart

sudo /etc/init.d/tomcat5.5 restart

Nu kan urls med /java/* i køre på tomcat og resten på apache. Voila .

Bemærk iøvrigt at du nok gerne vil omdøbe /java/ til dit helt eget seje applikationsnavn i /usr/share/tomcat5.5/webapps/ . Du kan læse mere om hvordan du bruger servlets og jsp her : http://www.coreservlets.com/Apache-Tomcat-Tutorial/