Losing weight by eating right
Losing weight is one of my new year resolutions. I started on a “reduced gluten” diet around 10th of January. My main motivation for this particular diet was in solidarity with my wife. She’s suspecting that gluten intolerance has an adverse effect on her health and wanted to verify this by elimination. Not sure what I expected, but the benefits I’ve had so far have exceeded them.
I love using Spray and its routing DSL for REST APIs but I’ve found a lot of the examples are just showing off its syntax. I’ve been missing examples of how you can use it to wire together a real application. Therefore I put together an example that goes a bit beyond the routing syntax to document my current understanding of best practices in that regard.
Delighting your users with SBJson 4
I was asked to speak about SBJson at Cocoa Kucha 2 on the 16th of January 2014 and used the opportunity to try to explain why I think SBJson is still relevant—even after Apple added native JSON support to iOS 5 in 2011. This post summarises the main points of my talk.
Learning Clojure by Solving Euler Problems
I’m always interested in new technologies and languages. We’re using Scala at work, and I really quite like the language. I really do like static (inferred) types. But on the other hand, as an AI graduate Lisp holds a certain allure and is a language I’ve wanted to learn for a long time but somehow never really gotten around to. One (for me) silly roadblock has been the stupid names of functions like
car rather than
rest. Clojure actually fixes this deficiency in Lisp, so I decided to give it a go.
The Brautasets stayed in London again this year. We do not like to travel at the best of times, and doing eight-hour journeys at Christmas with a two-year-old is not our idea of fun. I’ve had Christmas off though and we stocked the larder in advance. In other words: good food and quality family time was had. I’ve also had a little time to think of resolutions for 2014.
Consolidating and de-duplicating iPhoto libraries
This explains how I consolidated & de-duped about 45,000 pictures and movies from four iPhoto libraries on two different machines and various directories full of images on USB drives into one 33,000 file library.
Spray Routing Error Handling
I’ve recently taken a lot of inspiration from a blog post titled Akka and Spray over at the Eigengo blog. It covers a lot of ground and comes highly recommended if you are learning Scala, Akka & Spray. The only thing I didn’t like was how it handled marshalling of errors, and I intend to show a better way here.
Scala, Slick & PostgreSQL Unit Tests
When I first started writing DAO tests in Scala/Slick with PostgreSQL I would use a trait to create a new database for each individual test. I kept track of them in a list and dropped them in an
afterAll() method. This worked well, except I found it too slow for more than a trivial number of tests. This post shows my current much faster approach.
Re-designing for readers
I enjoyed reading Matt Gemmell’s post on designing blogs for readers the other week. I decided to see how well my own blog “complies” to his advice.
Using ScalaTest with Akka
To test Actor code with ScalaTest you have to mix in a lot of traits; sometimes it can be difficult to remember them all. Inspired by a course led by Heiko Seebergen I made this abstract class (it cannot be a trait because it takes constructor parameters) that you can drop into a project.