Roads Less Taken

21 May 10

Setting up a Squeak+Seaside+CouchDB dev environment

This is a little log from my attempts to set up a fresh development environment for the eBlankett.org project. eBlankett is a web system that presents wizard like web forms to the user given a declarative high level definition of this wizard in JSON.

Trip to Pharo land

First I picked up Pharo-1.0 from the Pharo site and installed Seaside-3.0 using Metacello. That takes… quite a bit of time to run. :) But hey, Pharo is meant to be the development platform for Seaside so it seems a reasonable choice.

Next component needed for eBlankett is a library to access CouchDB, because eBlankett uses CouchDB to store the form definitions. In the Squeak world there are currently two options for that:

  1. The CouchDB project from Danie Roux that uses the Curl plugin.
  2. The SCouchDB project from Igor Stasenko that works directly on top of SocketStream, not even using a HTTP layer between.

Since eBlankett so far uses only the utmost trivial CouchDB operations it doesn’t really matter which one we use. At the start of the project we used the former but lately we switched to SCouchDB to get rid of the Curl dependency (sorry Daniel, Curl rocks but…). Igor is also working actively on SCouchDB and Igor is my friend, so that also made it a nice choice :)

SCouchDB has an installation snippet in a separate class in a separate MC package that looks like this:

        Installer mantis ensureFix: '7446: [BUG][FIX] SocketStream>>peek'.
        (Installer repository: 'http://www.squeaksource.com/SCouchDB')
                install: 'JSON';
                install: 'SCouchDB-Core';
                install: 'SCouchDB-Tests'.

Note though that Pharo does not have Installer so the bug fix line will not work. After scrutinizing the bug I realized that this bug is indeed NOT fixed in Pharo 1.0. But it was a trivial fix to make by hand.

Ok, a speed bump, but let’s push forward. Pharooners use Gofer instead of Installer - it is very similar, but only operates on Monticello repositories (and probably knows how to do lots of other cool stuff of course). Since the above script is trivial we can convert it to Gofer:

        (Gofer new squeaksource: 'SCouchDB';
                package: 'JSON';
                package: 'SCouchDB-Core';
                package: 'SCouchDB-Tests'.

Aha! A bug in Gofer is discovered, it doesn’t like MC snapshots with more than 2 periods in their names so it loaded the wrong snapshots. Since Igor used a developer initial like ‘Igor.Stasenko’ Gofer gets confused! So ok, open up the repo and load the latest snapshots manually.

Finally we want to install the eBlankett code which is hosted on an ftp repository with a password but Gofer of course deals with that nicely:

        (Gofer new url: 'ftp://krampe.se' username: 'secret' password: 'secret')
                package: 'Blankett';
                load

Time to fire it up and see if it works, we make sure we have a CouchDB running on localhost:5984 too, but I am on Ubuntu which already has that.

        WAKom startOn: 8080

…ok, so a while later I realize that Pharo 1.0 is also missing Date class>>readFrom:pattern: (actually a contribution of mine) … and at this point I decide to run back home to Squeak trunk and try all this again! From the start. Sorry Pharo, perhaps some other time. It would have been easy to add #readFrom:pattern: but I just ran out of gasoline.

Running home to trunk

After fumbling around a while due to missing instructions and misleading filenames (this should be on www.squeak.org darnit!) I come up with this procedure to get an image running that tracks trunk:

  1. Download Squeak-4.1.zip.
  2. Open preferences, search for Monticello. Set the default update URL to "/trunk". This was not easy to find out, although trivial once found. There is one more way to find this out, go to Help->Extending the system and read there. But that was NOT obvious for me to find.
  3. Load Updates. This gives us a "bleading edge" image instead of 4.1. Probably not needed, but hey… we like the edge.

Then we execute the following:

        (Installer ss project: 'MetacelloRepository')
                install: 'ConfigurationOfSeaside30'.
        (Smalltalk at: #ConfigurationOfSeaside30) load.

        (Installer repository: 'http://www.squeaksource.com/SCouchDB')
                install: 'JSON';
                install: 'SCouchDB-Core';
                install: 'SCouchDB-Tests'.

        (Gofer new url: 'ftp://krampe.se' username: 'blankett' password: 'ett')
                package: 'Blankett';
                load

…and finally open->Seaside Control Panel, add a Comanche adaptor, start it. Surf to localhost:8080/eBlankett and tada! We are up. Ehm, ok, so encoding ended up as iso-8859-1, but wait, no problem, just use the menu in the Seaside Control Panel, easily fixed to utf8.

Ok, so trunk it will be for now. Pharo is cool and Pharo is good, no doubt. But I will try to stay in trunk for this project.

/Goran

10 May 10

Moving to a new workplace!

It’s friday and I will soon have finished my first week at my new workplace! My previous employment was at MSC and I was there for 5 years in fact, a very nice consulting firm where I was a group manager for the last two years. But things change and it was time to move on.

At TPGObjektfabriken ("TPG object factory") I am just a regular "consultant", and that fits nicely with my life at the moment. It’s also interesting to join a firm where us "coders" are actually in a minority - one of my "tasks" is to help strengthen TPGObjektfabriken in that regard - and it will be great fun!

/Goran

07 May 10

Making a Skype interview...

I got the opportunity to make a Skype interview with Dan Ingalls, so I decided to try to record it. Had no idea it was not as easy as a "press record"-button. I am on Ubuntu, Karmic Koala. First of all I had serious trouble getting proper sound working with Skype, I ended up following the HOWTO in order to install Skype 2.1 beta - which uses PulseAudio ONLY. That took care of that issue, after a bit of fiddling in the "Preferences" dialog you get when right-clicking on your volume applet :)

So… I did roughly this:

Record both sides of the conversation using parec. This is a tool in PulseAudio, so the recording is done "outside" of Skype. In two different files! I used this shell script to record both sides at the same time (note that this produces RAW files):

        parec -r -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor \
                -n "Mon Rec" > mon-rec & \
        parec -r -d alsa_input.pci-0000_00_1b.0.analog-stereo \
                -n "Mic Rec" > mic-rec &

Note that I found the alsa-yaddayadda names in… eh, some dialog somewhere! Don’t recall. Anyway, read more on this part here.

I then converted the resulting two RAW audio files into WAV using sox, some kind of audio swiss army knife. I don’t have the exact one-liner handy, but I used the options found in the link above.

Finally I mixed the two files together… eh, ah, problems… They don’t synch! Now… I have absolutely no idea how that can be, but the files end up drifting out of synch, and this seems to be a known Skype thing according to Mighty Google.

So in the end I had to manually cut/edit the two files in order to get a proper question+ answer sequence as an interview. I played with Audacity, ReZound etc but ended up doing it in Sweep, it felt simpler and didn’t cause me any other trouble.

NOTE: On "other less worthy platforms" than Linux there seems to be other options. I also found some stuff for recording on Ubuntu, but AFAICT these solutions would not work with Skype 2.1.

Well, perhaps it helps someone else out there intending to do the same journey!

regards, Goran

10 Mar 10

First FOSS-Stockholm meeting

On the 24th of february the first FOSS-Stockholm meeting was held in Kista. And I dare say it turned out to be a success!

My company MSC sponsored the event together with Nohup so that there was enough sandwiches and drinks to keep the crowd happy. :)

I taped all of the talks and you will find these movies and more here and here are the original movies if you are interested.

/Goran

06 Nov 09

Breakfast seminar on the new "super databases" and CouchDB

Earlier this week I held a 90 minutes presentation for about 30 people about the new "super databases" and CouchDB in particular. It went fine and although it was a "high level sweep" over the field I think most attendees got what they expected. The slides are available here translated to english, although some of them may be less valuable without accompanying explanation.

The interest is mounting in this field, partly because developers and architects are looking for alternatives but also because there is indeed quite an explosion going on with new interesting databases popping up every week. My personal experience covers mainly TokyoTyrant and CouchDB but I intend to try out:

  • MongoDB, since it is quite close to an object databases and has come further on sharding etc.
  • One of the "Dynamo clones", not sure yet which one, Dynomite is not interesting since Microsoft has put the lid on it.
  • One of the "Bigtable clones", also not yet sure which one. :)

Finally, some good and fresh info from the NoSQL community can be found at the two summaries made from the recent meetup in the US. It’s funny that I too made the "Cambrian explosion" connection in my presentation, and so apparently did one of the keynotes there. I didn’t steal it - honestly :)

/Goran

Powered by RubLog