A CSV Parser – moving from Scala Parser Combinators to Parboiled2

CSVs are an ubiquitous format for all sorts of tabular data. I assume that every major programming language ecosystem has a handful of libraries handling both parsing and writing them. In Scala you can quickly turn to StackOverflow to find a 30 lines long CSV parser based on the Scala Parser Combinators library. In this short blog post I will show a Parboiled2-based a version of this parser and compare the performance of the two.

Continue reading A CSV Parser – moving from Scala Parser Combinators to Parboiled2

Handling services that require explicit shutdown in Scala

While working on our projects at SoftwareMill we have recently started depending on a few services that require explicit closing. Until now they were closed in a shutdown hook we manually registered. That has started to become error-prone, so I have decided to introduce a simple mechanism for registering those services during their initialization in MacWire-based modules and having a single centralized shutdown handler closing them. In this post I briefly go through the experimental shutdownables API.

Continue reading Handling services that require explicit shutdown in Scala

Adventures with Python: Warsaw’s bike parkings

Python has always been a language I wanted to improve in. Mostly because of its data tools. Also being an active bicycle commuter I to grab data from a crowd-sourced Warsaw’s bicycle parking location aggregator. Once scrapped the dataset is straightforward: lat-lng coordinates, number of racks at a given location, its address and some additional data.

Continue reading Adventures with Python: Warsaw’s bike parkings

Externalizing configuration for Tomcat deployments of Rails apps

One of the requirements of a Rails-based project I’m currently involved with is to deliver a JVM WAR (Web ARchive) and deploy it on Apache Tomcat. For various reasons the WAR file is built locally and the configuration needs to be externalised and stored in Tomcat’s directory structure (its ‘conf/’ directory). In this blog post I’ll use the example of database.yml and show you how to use a quick hack to use the file from Tomcat’s ‘conf/’ directory. Continue reading Externalizing configuration for Tomcat deployments of Rails apps

Capistrano and multi-module projects

We at SoftwareMill believe in using the best language to do the job – be it Scala, Java, Ruby, JavaScript or anything else. For one of our products (JBison – an app monitoring tool) we use a mix of Java service logic code and Ruby as great solution for providing a web interface using Rails. Recently we’ve decided it’s time to improve our deployment process and we’ve chosen Capistrano as our tool. In this blog post I want to share with you the issues we came across due to the multi-module, multi-language nature of our project and how we solved them. Continue reading Capistrano and multi-module projects

RubyGems 1.3.1 for Ubuntu 8.10

Some time ago Rails 2.2 was released. Since than the framework requires rubygems 1.3.1 to run. Unfortunately Ubuntu 8.10 only has rubygems 1.2.0 in its repositories. A quick google search didn’t yield a good solution for this. Everyone is suggesting to install the vanilla rubygems-1.3.1.tgz, but I feel more comfortable having rubygems managed by Ubuntu’s package manager.  So I created the package myself.

Continue reading RubyGems 1.3.1 for Ubuntu 8.10