A wave is coming

Last week I attended a  day of outstanding geek fun . At the Google wave hackathon I had the chance to sink my teeth into the Google wave API after seeing presentations on gwt and google wave  by Tommy Pedersen and a presentation on wave gadgets by  Joakim Recht.

After a couple of hours of presentations and brainstorming  we started hacking.  I teamed up with  skakanka to experiment with sending the contents of a wave to a Proof of concept Document storage system . But we ended up doing a simple Echo Bot (but hey! we illustrated how to extract content from a wavelet and send it somewhere).

I brought a mac and used the Google eclipse plugin for galileo for coding. It helped that I allready had a Google app engine account from some earlier experiments – but I spent some time learning the different key combinations on the mac – it was great fun though (and now I know how to use eclipse on  a mac!). Deploying on google app engine is as simple as pressing a button in eclipse (I also tried using som ant tasks in my earlier experiments).

We managed to have a google wave running sometime before lunch – so it is very easy to get a basic understanding what a wave bot is all about. (You could think of it as an ircbot on steroids ! )

The overall idea of building a google wave bot is to listen to incoming events defined in the protocol. Let’s say we want to perform something when somebody enters the wave or write something – then we can define the capabilities like this:




0.0.4





Then the robot should act on the defined events in a manner similar to this :


@Override
public void processEvents(RobotMessageBundle robotMessageBundle) {
Wavelet wavelet = robotMessageBundle.getWavelet();
String rootText = wavelet.getRootBlip().getDocument().getText();
for ( Event e: robotMessageBundle.getEvents()){
Blip b= e.getBlip();
String text= e.getBlip().getDocument().getText();
if (e.getType().equals(EventType.BLIP_SUBMITTED)){
e.getBlip().getDocument().append( makeEcho(text));
}
}
}

The Wave client api offers something like the DOM api for the xml being sent back and forth. During the hackathon I learnt that there is no way to ask for the contents of the entire wave from a single blip – so it will require some thinking to save the entire contents of the wave – but it should be doable.

Sometime during the afternoon things started to slow down on the wave test server. I noticed that some of the other guys doing a multiuser interactive drawing gadget for wave. It looked like they recorded a delta to send every time the mouse moved! This made me want to look a bit under “the hood”:

Sounds like the team are handling the multiuser issues using “operational transforms” . Maybe they could somehow ‘batch’ deltas from interactive gadgets ? I have yet to fully understand how “operational transforms” work  – but it sounds like an exciting challenge to make this work on a large scale!

openlayers 2.8 supports WFS-T

if you are in a organisation where you store data with geographical information associated with it , then you have the option of sharing your data using the following standards specified by OGC:

One way to leverage these standards is to use the geoserver project for data storage and the openlayers project web for showing and editing maps.update 2009-09-03: When integrating with the extjs framework , then it is worth using the geoext project.

An example snippet from geoserver shows the use of WFS-T for inserting geometric data with associated metadata for an alley in Tasmania. I’ll just bring it here:


xmlns:wfs="http://www.opengis.net/wfs"
xmlns:topp="http://www.openplans.org/topp"
xmlns:gml="http://www.opengis.net/gml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd http://www.openplans.org/topp http://localhost:8080/geoserver/wfs/DescribeFeatureType?typename=topp:tasmania_roads">







494475.71056415,5433016.8189323 494982.70115662,5435041.95096618





alley



Note that oracle has a well supported ways of extracting GML from spatial datatypes if you need to construct the wfs transactions yourself ( oracle locator )

At the first glance wfs can seem a bit complicated. Luckily openlayers has nice wrappings for it that is easily accessed from code as shown in one of their examples running here :


map = new OpenLayers.Map('map');
var wms = new OpenLayers.Layer.WMS(
"State",
"http://sigma.openplans.org/geoserver/wms",
{layers: 'topp:tasmania_state_boundaries'}
);
wfs = new OpenLayers.Layer.WFS(
"Cities",
"http://sigma.openplans.org/geoserver/wfs",
{typename: 'topp:tasmania_cities'},
{
typename: "tasmania_cities",
featureNS: "http://www.openplans.org/topp",
extractAttributes: false,
commitReport: function(str) {
OpenLayers.Console.log(str);
}
}
)
map.addLayers([wms, wfs]);
var panel = new OpenLayers.Control.Panel({
displayClass: "olControlEditingToolbar"
});

var draw = new OpenLayers.Control.DrawFeature(
wfs, OpenLayers.Handler.Point,
{
handlerOptions: {freehand: false, multi: true},
displayClass: "olControlDrawFeaturePoint"
}
)
var save = new OpenLayers.Control.Button({
trigger: OpenLayers.Function.bind(wfs.commit, wfs),
displayClass: "olControlSaveFeatures"
});
panel.addControls([
new OpenLayers.Control.Navigation(),
save, draw
]);
map.addControl(panel);
map.zoomToExtent(new OpenLayers.Bounds(140.64,-44.42,151.89,-38.80));
}

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.

Nerdapalooza 2009 – I wish I had been there

Looks like Schaffer the DarkLord has been kicking it in Orlando this month for the nerdapalooza 2009.

Dual core looked cool to:

I had the chance to visit Orlando this year for the ExtJS user conference 2009. Hey! Maybe the ExtJS crew can make some kind of deal with nerdapalooza for the next conference?

so Copenhagen is not the center of the world?

flueknepperi

“flueknepperi”:

danish slang for being overly obsessed with details

I was recently asked to start blogging in english instead of danish. This makes sense since I start making more online friends these days – I also hope to be able to contribute more back to the various communities I am a part of.

“What is the meaning of your blog title” you might think? To me being pedantic is not necessarily a bad thing. Try looking the word up in various dictionaries , and you’ll see that the word “pedant” mostly has negative connotations. From wiktionary : A person who is overly concerned with formal rules and trivial points of learning. That’s me – and a good focus for my blog. “trivial points of learning” are easy to write in a blog entry – and formal rules are interresting to me as a programmer.

So I’ll write a lot of small details and trivial things here;)