Richard Dallaway Hello! I'm Richard, and I write things down here.

26 Aug 2011

imap-idle 2.4-M3-0.91

A release of a library to let your Lift app listen for incoming email.

04 Aug 2011

Review of "Functional Programming for Java Developers"

This is the book for you if you code in Java, you've heard of functional and want to know what the fuss is about.

04 Aug 2011

Slides from "Adding machine learning to a web app"

Slides from BathCamp AI showing one of the simplest thing you can do to get started with machine learning in a web app.

22 Jul 2011

JSESSIONID and the like, plus the Privacy and Electronic Communications

Notes on guidance on cookie use.

29 May 2011

Functional Brighton: "What functional programming means to me"

The Functional Brighton meetup for May was a set of short demos and talks on the subject of “What functional programming means to us”.  Kit kicked off the evening with an F# show-and-tell of a 3D flocking simulator (complete wth 3D glasses); Eric spoke about why he uses Haskell; Andy showed us some Scheme code and made it progressively more functional; and Tom jumped up with a code tour of a Haskell project of his.  A good evening with plenty of Q&A.

03 Apr 2011

Option(null) is None

@wfaler asked:

Doing a presentation soonish on “Why #Scala” - have a truckload of arguments, but what are your arguments for Scala over Java? Give me ammo!

Ok, I’ll bite.  Here’s one of those every-day things I stop and notice from time-to-time. It’s not new, it’s not huge, it’s just one of the things that makes a difference when you’re trying to ship stuff.

The Google Java APIs for accessing Google contacts has you write code like this:

16 Mar 2011

A review of "25 Recipes for Getting Started with R"

cover

25 Recipes for Getting Started with R, by Paul Teetor. Published O’Reilly Media, Jan 2011.

Summary

Need to “do stats”?  This text is a great way to get a hands-on tour of how to use R, to find out if you want to learn more.

Review

From time to time I need to plot some data, compute correlations… that kind of thing.  Doing anything like that in a spreadsheet is a pain for me, so I’m on the lookout for a stats framework or tool I can live with.  R (http://www.r-project.org/) could be that tool. 

07 Mar 2011

Using Sendgrid with Lift

If you want to send email from your Lift app using SendGrid you need to do two things: set an authenticator and enable the javax.mail authentication flag. That second part isn’t obvious.

Step by step…

Assuming your Lift props file contains the following:

In Boot you need to set the authenticator:

  And you’re done. The regular Mailer class will now use SendGrid.

22 Jan 2011

London Scala User Group: How the Guardian (mostly) moved from Java to Scala

LSUG Guardian Event 2011

Graham Tackley spoke at a packed LSUG about how guardian.co.uk implemented their first Scala project, the content API.  It’s well worth watching the video to see the timeline of how the team switched their brains from Java to Scala (what the team initially liked, what they liked after a year, grokking flatMap, tools, and more).  

The result after the transition: more fun, better code, more productive and happier developers.  Regarding the cost of switching, the comment from the team during the Q&A was: there’s a learning curve to Scala, but providing you have someone to lead the way, the switch doesn’t materially effect delivery in the first three months, and post three months the team becomes more productive.

14 Jan 2011

SBT builds with Hudson

We build our Lift applications with Hudson Jenkins, and we’re in the process of converting some projects from Maven to SBT.  This is mostly straight-forward but there are a couple of non-obvious things you might need to know.

Running SBT

There’s the start of a Hudson SBT plugin, but at the moment we’re running SBT from Hudson by simply shelling out to execute the SBT command.

To do this, install SBT somewhere (.hudson/tools/sbt for us) and then create a new free-style Hudson job and add a build step of “Execute Shell”.  We have:

31 Dec 2010

A Review of "CouchDB: The Definitive Guide"

cover

CouchDB: The Definitive Guide, first edition, by J. Chris Anderson, Jan Lehnardt and Noah Slater.

Published by O’Reilly Media, and available online under a Creative Commons license.

Summary

This first edition is inevitably out-of-date compared to 1.0 of CouchDB, has room for improvement, but is nevertheless a useful introduction to CouchDB and thinking about things in the CouchDB-way.  A pleasure to read.

Review

The sense I get of NoSQL products, such as CouchDB, is that they are good for certain kinds of problem and have potentially great performance characteristics.  I’m nowhere near pushing the capabilities of relational databases, but I was interested in understanding how problems are approached from a NoSQL perspective.  After all, how can I tell if I have a problem suitable for a NoSQL database if the only way of thinking I have is SQL?

02 Dec 2010

Running SBT (or any shell command) from Eclipse

4ff9dbd6dbe3b-35137865-0-0_Install

Mostly when I’m writing code I’m in the Scala IDE for Eclipse, with a separate terminal window containing SBT running ~test-quick or jetty-run. But flipping back and forth between terminal and Eclipse is non-optimal, so I went digging for Eclipse + SBT integrations.

There are a few mentioned on the SBT site, but I realized all I needed was a shell prompt as a view in Eclipse and I’d be happy.  And of course it exists already as “Target Management Terminal”, part of the Galileo update site.