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.
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.
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.
You can find the video of this talk at: https://skillsmatter.com/skillscasts/1613-richard-dallaway-databinder-dispatch
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).
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.
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:
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 A
s
so you end up with a collection of B
s:
Last night I was asked about the aliases I used during my Lift talk. Here they are...
Notes from the first LJC Unconference held at IBM's Southbank building.
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.
The only way I found was to set a JAVA_OPTS file encoding.