Archive for Musings

Book Reviews

I’ve read a few books this year, thanks to Kindle for iPhone & Mac as well as a few actual printed books either found or borrowed from work’s extensive library (one of my favourite parts of our Stockholm office).

These are my highlights.

Paradigms of AI Programming

After re-discovering Lisp style programming with Clojure, this book came high on my to-read list and I was not disappointed.

The book covers a wide range of classic AI problems, and walks through solutions in Common Lisp. This makes the book partly about solving AI problems, and partly an advanced book on Lisp programming.

I loved it for both aspects.

Be warned however, Peter Norvig is a master of his tools and reading along you can be seduced into how obvious each next step is. It is worth trying to implement some of these algorithms yourself, or even try solving Sudoku.

This book won’t make you an expert on the latest AI techniques, but it will add to the class of problems you can solve, and make you a better programmer.

Into the Plex

A great insight into the history and workings of Google. There are lots of examples of how Google goes about solving problems and lots of behind the scenes information.

One section I found interesting was on staff allocation:

Around 2005, Google determined a simple formula to distribute its engineering talent: 70-20-10. Seventy percent of its engineers would work in either search or ads. Twenty percent would focus on key products such as applications. The remaining 10 percent would work on wild cards, which often emerged from the 20 percent time where people could choose their own projects.

Animal Spirits

After finishing Robert Schiller’s course on finance via iTunes University, I picked up his book Animal Spirits.

This is an approachable book that doesn’t assume too much finance background, and covers how behavioural finance fits into a macro economic framework. Or rather, how human emotions messes up existing approaches to making decisions for the broad economy.

If you’re interested in how government should be setting policy, or how human psychology impacts economics, this is well worth a read.

Toyota Production System

The Toyota Way

I started by reading Toyota Production System, as the Toyota Way was already loaned out. This turned out to be fortuitous.

The Toyota Production System is written by Taiichi Ohno, who was responsible for putting in place most of the practices that define their production system. The book is translated from the Japanese, and reads like the writings of a Zen master. Everything is very clear and concise with no superfluous words or explanations.

I found it enlightening. However, it is worth pausing often throughout the book to ponder the implications of what has been said, and was it assumes. This is a book to read to understand the fundamentals and the attitude required to implement a similar approach to your business.

The Toyota Way is an easier read, and based on the time Jeffrey Liker has spent studying Toyota. He had access to a range of plants in the US and interviewed many of the key Toyota people. His book is written as a series of stories that act as a set of case studies for how the Toyota Way was applied to a range of engineering challenges.

I particularly loved the chapters explaining how Toyota created the Lexus brand and the Prius.

To get a good understanding of how Toyota works, it is worth reading both books. I feel like it is clearer on how Kanban fits into a wider corporate picture, after having previously read David Anderson’s book.

The Time Traveller’s Wife

This was left by a previous occupant of the apartment we rented for the summer in Paris. It was a great holiday read.

Suspend disbelief for a while, and just let the story flow. The characters are well thought out and carry the story well.

Stockholm Tourist Sights

This is my current list of things to do and see if you happen to be visiting Stockholm for a weekend or a bit longer. The list is based on things we’ve seen, or that friends have found.

To get up-to-date tips, contact me directly or via Twitter (@gmwils).

Fjäderholmarna, Stockholm Archipeligo

Sights

  • Vasa Museum — an old ship that has been preserved due to failure to launch. Interesting museum on maritime history. There are sometimes queues to get in, so may be worth a morning visit.
  • Nordic Museum — provides a history of the nordic region, and is just near the Vasa Museum.
  • Skansen — an open air museum / zoo / cultural centre. This whole park is quite large, so it is worth spending a full day, as there is lots to do. A good chance to see reindeer and moose in Stockholm.
  • Fotographiska — a photography museum / gallery on Södermalm. Three floors of photography, with a nice café with a view of Stockholm on the top floor.
  • Modern Art Museum — meant to be quite good, but still on my todo list.
  • Gamla Stan - well worth half a day wandering around, see the palace, explore the streets. Almost everything is over priced, but then it is the main tourist district. It also has some of the better restaurants in town.
  • Södermalm — itself is one of the nicer areas of Stockholm. The shore of the island on the south is a popular place for hanging out. There are lots of nice restaurants near Slussen on the northern side too. The cliffs above Slussen provide a good vantage point to see Galma Stan (old town) and the city in general.
  • Östermalm — a nice area in between the city centre and Djurgården island (where the Vasa & Skansen are). Lots of nice cafés to pass the day in.
  • Boat trips — there are ferries that shuttle between the various islands and make a nice way to get from Skeppholmen to Djurgården.
  • Stockholm Archipelago — this city is all about islands, and there are a number of boat cruises that leave for the wider Archipelago. We visited Fjäderholmarna, which is small and close and made for a nice place to wander around. The article has some info on boats, they also depart from near Östermalm.

Restaurants

  • Rival Hotel — the restaurant here is worth a visit, a short walk from Mariatorget station
  • Gondolen — quite a cool location for a restaurant, suspended underneath a bridge near Slussen station. We went for drinks at their bar, which gives a good view of Stockholm. If you want a seat at the restaurant, it is worth booking ahead.
  • Vete-Katten — Downtown is mostly shops, however if you’re wandering around and looking for somewhere for lunch, Vete-Katten has a great range of traditional Swedish cakes.
  • Den Gyldene Freden — modern take on tradition Swedish food. We found the service to be friendly.
  • Sturehof — interesting restaurant in Östermalm.
  • Pelikan — Swedish home style food.
  • Oliver Twist (House of Ale) — cozy pub in the midst of Södermalm with a good range of local beers and hearty pub food. Bookings recommended, although we’ve been lucky before.
  • Djuret — means “the animal” in Swedish, and they only serve one animal at a time. Interesting concept, and has been recommended to me.

For suggestions of coffee places on Södermalm, check out this article.

Transport

To get around, it is worth getting tickets for the underground train line (Tunnelbana, abbreviated to large signs with a T). It runs pretty much everywhere and will make it easier to see the city.

To transfer from the airport, taxi works out cost effective if there are more than one person travelling. Otherwise, the train system is fast and easy to navigate.

Swedish News

For news in English about what is happening in Sweden, try The Local.

For Swedish, DN.se and for Swedish restaurant reviews try På Stan (with Google translate to help).

Language Basics

Almost everyone here speaks perfect English as their second language, so knowing some Swedish isn’t important. That said, some pleasantries always helps.

These few phrases will get you far:

  • Hej (pron. “Hey!) — hello, or goodbye, general greeting.
  • Hej då (pron. “Hey door”) — goodbye.
  • Tack — thanks, and please. Pointing at something and saying tack, or saying tack after receiving something is common. You’ll hear this word a lot.
  • Tack så mycket (pron. “Tack so mickey”) — thank you very much, often used at the end of transactions.

Chinese vocabulary for Social Media

Jeremy Webb, over at the Asia Digital Map blog, has a great list of Chinese terms for the social media web:

Location-based service: 定位服务 dìngwèi fúwù

Augmented reality: 现实增强 xiànshí zēngqiáng

Desktop client: 桌面客户端 zhuōmiàn kèhùduān

Mobile phone client: 手机客户端 shǒujī kèhùduān

App (iPhone etc.): 应用程序 yīngyòng chéngxù

As I’ve been using iVocabulary to study vocabulary, I added all the terms into the ProVoc (dng) format.

If you have a Mac, the file is available here (zip).

Learning Clojure with Google App Engine and Emacs

This is an overview to my attempts at getting Clojure with Emacs. Inspired by this post, I set out to learn three things simultaneously: emacs, clojure and Google App Engine.

For comparison, my current web prototyping combination is TextMate, Rails, and Heroku. Prior to that it was a mix of python, php or perl, with vim.

There are already number of articles on getting GAE and Clojure to work. Consider this me making notes for myself because I keep forgetting the Emacs shortcuts!

Emacs

I settled on Aquamacs to start out with emacs on the Mac. It seems to be more forgiving if I use normal Mac keyboard shortcuts while I learn emacs keys. Also makes it easy to switch between it and TextMate.

The other feature I love is full screen mode: ⌘-Shift-Return

To get command line access, you need to go to Tools->Install Command Line Tools. This gives you an “aquamacs” shortcut in the shell. I aliased it to “aq”.

For some help on learning emacs, consider:

You may also want to setup Clojure to run with Emacs. This article assumes you are using lein.

Google App Engine (GAE)

The GAE distribution is available here: GAE Download.

I setup my shell to include a $GAE_BASE directory for where I unpacked it, and added $GAE_BASE/bin to my path.

Creating a Clojure Project

The first post I read assumed that you were starting with a manual layout of your project. I’m going to use lein, a build manager for clojure, similar to rake for ruby. Behind the scenes lein uses Java’s maven as a package management system (similar to gems).

To make things a bit more interesting, I plan to write a very basic CMS to explore the various APIs. I’m keeping everything on the githubs.

The steps to getting setup look something like:

% lein new gaecms
% mkdir -p war/WEB-INF

Then make some changes to your project.clj file:

(defproject gae-cms "1.0.0-SNAPSHOT"
  :description "A basic CMS built on Google App Engine (GAE)"
  :dependencies [[org.clojure/clojure "1.2.0"]
		 [org.clojure/clojure-contrib "1.2.0"]
		 [compojure "0.4.1"]
		 [ring/ring-servlet "0.2.1"]
		 [appengine "0.4-SNAPSHOT"]
		 ]
  :dev-dependencies [[leiningen/lein-swank "1.2.0-SNAPSHOT"]]
  :compile-path "war/WEB-INF/classes"
  :library-path "war/WEB-INF/lib"
  )

To save some typing, you can clone: git://github.com/gmwils/gaecms.git

To run the interpreter locally, try the following:

% lein deps
% lein swank

To test out that the interpreted mode is working, open up src/gae_cms/core.clj in AQ.
Then connect to the server:

M-x slime-connect

From within the editor, you can now run either of the following:

C-x C-e    % evaluate current line
C-c C-k    % compile the current file

You also have an interactive clojure shell for typing commands into. Try adding the following into your source code and then pressing C-x C-e to evaluate:

(System/getProperty "java.class.path")

You should see your current CLASSPATH printed out.

Setup for GAE

In $HOME/war/WEB-INF/web.xml map the URLs that you want your custom servlet to handle. In this case, send everything into the servlet:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
   xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
   version="2.5">
  <display-name>CMS on GAE</display-name>

  <servlet>
    <servlet-name>cms</servlet-name>
    <servlet-class>gae-cms.core</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>cms</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
</web-app>

In $HOME/war/WEB-INF/appengine-web.xml add the following to setup Google App Engine to refer to your servlet above.

<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <application>cms-clj</application>  <!-- GAE app id for your app -->
  <version>v0-1</version>  <!-- Arbritrary Version Id -->
</appengine-web-app>

Next, update src/gaecms/core.clj with:

(ns gaecms.core
  (:gen-class :extends javax.servlet.http.HttpServlet)
  (:use
   compojure.core
   [ring.util.servlet :only [defservice]]
   )

  (:require [compojure.route :as route]))

(defroutes cms-public
  (GET "/" [] "<html><title>GAE CMS</title><body><h1>Hello World!</h1></body>")
  )

(defroutes cms
  cms-public
  (route/not-found "Page not found")) ; 404 error page

(defservice cms)

To test this locally, try:

% lein deps
% lein compile
% $GAESDK/bin/dev_appserver.sh war

Deploying to Google

First go to the GAE console and create an application. The following should then work:

% lein deps
% lein compile
% $GAESDK/bin/appcfg.sh update war

I’m still playing with getting it working with Google App Engine. The above is enough to get hello world working.

For more details, I suggest you follow the Compojure on GAE blog. Specifically, the article on Deploying to App Engine is a good overview.

Next steps include getting interactive development working with GAE, and actually handling dynamic content.

A/B Testing Overview

A/B Testing is how sites like Amazon, Yahoo, Google, Facebook and others became the best in the world. They used data to drive decisions about content, layout, wording and other aspects of their sites.

Smashing magazine covers the details of A/B testing in this post.

At its core, A/B testing is exactly what it sounds like: you have two versions of an element (A and B) and a metric that defines success. To determine which version is better, you subject both versions to experimentation simultaneously. In the end, you measure which version was more successful and select that version for real-world use.

37signals tested the headline on its pricing page. It found that “30-Day Free Trial on All Accounts” generated 30% more sign-ups than the original “Start a Highrise Account.”

Dustin found that “You should follow me on Twitter here” worked 173% better than his control text, “I’m on Twitter.”

Along with its other A/B tests, CareLogger increased its conversion rate by 34% simply by changing the color of the sign-up button from green to red!

The article covers the results from others of testing, as well as details on how to get started for your own site.

What I find interesting is that the tools that used to require significant investment in time and development are increasingly available as easy to use, free solutions.