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

11 Nov 2010

Intro to the Simple Build Tool at LSUG

John at the London Scala User Group ran “LSug Workshop: Up-close and personal with SBT” yesterday at Skillsmatter.  It was a kind of mini-unconference, and I contributed an introduction to SBT.  The video above is the first half of a screen recording I made, and it continues into part 2 on Youtube.

I learnt a lot from the evening on how others use SBT, and from Maciej Matyjas talk on giter8 and plugins (including what looks like a wonderful plugin to Posterous). Phil Wills showed us how to create a SBT plugin, and that doesn’t look too scary now.

30 Oct 2010

Screencast on using Lifty

Lift development has moved on from the depressingly long Maven commands to start a new project.  I made the above screencast to show the simple build tool that I’m growing fond of, and an add-on for SBT called Lifty that makes it easy to create Lift projects.

It took me a couple of attempts to make the video, so of course many of the automatically downloaded libraries were locally cached.  It’ll take longer for you if you’re starting from scratch, but not as long as I’d expected. For some reason (possibly imaginary) the SBT downloads for Lift seemed much smaller, and consequently faster, than I’m used to with Maven. YMMV.

29 Oct 2010

Creating graphs in Lift

4ff9dbd4add81-31900974-0-bar_chart_example

The other day at the London Scala User Group I was asked about creating charts and graphs in Lift.  The two ways that sprung to mind were to use Flot and Google Charts, so I’ve posted example source code for creating a bar chart both ways.  I probably should have made them look the same, but hey, it’s just an example to hack with.

All the code that matters is in one file.

19 Oct 2010

Databinder Dispatch Discussions at #scalalol

You can find the video of this talk at: https://skillsmatter.com/skillscasts/1613-richard-dallaway-databinder-dispatch

13 Aug 2010

If you like web MVC you'll probably like the Play web framework

Play is a MVC, convention-based, stateless web framework for Java with growing support for Scala too.

It’s not for me as I can’t face going back to MVC and the kinds of presentation languages they use. Having said that, if you like MVC, and you’re not already using Grails or Rails or a similar framework, I strongly urge you to look at Play as there’s some nice technology in there. 

Everything I know about Play comes from Rustem Suniev’s talk for the London Scala User Group at Skilsmatter on Wednesday. The slides and video are already on-line and they contain a really nice live-coding demo of Play which gave me a good sense of what the framework is about.  Nice work—and pizza courtesy of autoquake.com (who are hiring).

13 Aug 2010

Scala Lift Off London, 7-8 Oct 2010

I have my ticket. How about you? It’s £150 at the moment.

What we’re looking at here is a two day unconference, meaning we get a chance to learn about things we’re interested in by figuring it out on the day, talking to people, rather than being lectured at.  I thoroughly enjoyed the Scala Lift Off last year in San Francisco, so I’m looking forward to the London one.  Especially as it close by, rather than 8,720km away.

21 Jun 2010

Creating a executable script from a Maven project

If you have a Maven project with a bunch of dependencies, and you’ve written a harness to launch your thing, it’s handy to be able to create a shell script to run your harness with all your dependencies on the classpath.  The Maven assembler plugin is what you need.

In your pom:

<build>  
  <plugins>    
  ...     
    <plugin>    
      <groupId>org.codehaus.mojo</groupId>    
      <artifactId>appassembler-maven-plugin</artifactId>    
      <configuration>
        <programs>         
          <program>            
            <mainClass>com.example.yourApp.YourClassWithMainMethod</mainClass>
            <name>my_cool_app</name>         
          </program>       
        </programs>     
      </configuration>    
    </plugin>   
  </plugins> 
</build>

Then run:

27 Apr 2010

In Praise of flatMap

In Scala the flatMap operation is astonishingly useful in everyday programming. The texts on Scala that I’ve read only hint at how useful it is: Beginning Scala probably does the best job, and even then you could miss it.  So I’ll give it a go…

Map is an operation you probably know pretty well.  It takes a function of type A ⇒ B, and applies it to everything in your collection of As so you end up with a collection of Bs:

25 Mar 2010

Shell aliases for Lift development

Last night I was asked about the aliases I used during my Lift talk. Here they are...

29 Nov 2009

London Java Community Unconference 1

Notes from the first LJC Unconference held at IBM's Southbank building.

09 Nov 2009

Great functional programming lectures

A few weeks back Miles emailed the BrightArray group with a link to Erik Meijer’s Functional Programming Fundamentals lectures. You can find them listed at channel9 tagged as C9 Lectures.

I’m not planning to use Haskell for real, but I wanted to pass the links on because I’m finding the lectures really helpful for thinking about software. Possibly for thinking in general.

Two practical points about the series: you don’t have to install Silverlight to watch them as there are links to other formats over on the right of the page. And the slides can be found over at Graham Hutton’s Programming in Haskell page.

22 Sep 2009

Setting the character encoding in Scala

The only way I found was to set a JAVA_OPTS file encoding.