Archive for the ‘clojure’ Category

Dutch Clojure Days 2016 – tickets, call for proposals and sponsors

Friday, December 18th, 2015

We’re taking ticket registrations for Dutch Clojure Days 2016. This will be a free one-day event on Saturday the 19th of March, 2016 in Amsterdam. Tickets are free but space is limited so please register if you’re planning on attending.

We’re also looking for speakers and sponsors. If you have anything clojure-related you want to present or if you’re willing to help us pay the facilities etc please visit the registration page for more details.

Event Sourcing at Studyflow Slides

Thursday, February 12th, 2015

I’ve uploaded the slides for the “Event Sourcing At Studyflow” talk I gave yesterday at the Amsterdam Clojure Meetup.

Event Sourcing at Studyflow talk

Monday, February 9th, 2015

This Wednesday, 11 February 2015, I will be giving a talk at the Amsterdam Clojure Meetup about our experiences at Studyflow implementing Event Sourcing with Clojure / ClojureScript. Daniel Marjenburgh will also be presenting “VisualReview: Web application layout testing with clj-webdriver”. This looks like it’s going to be an interesting evening.

If you want to attend, note that we are not at the regular old location @ Backbase any more. See the event web page for details.

Studyflow (NL/Amsterdam) is looking for Clojure talent.

Wednesday, May 21st, 2014

At Studyflow we’re looking for a Clojure programmer who wants to join the team.

We’ll be at the Amsterdam Clojure Meetup if you want to talk to us. Or contact us via the links above.

New article: Configuring Emacs

Thursday, October 24th, 2013

I just published my Emacs configuration as an article. Contains interesting stuff on Emacs, OrgMode, Clojure and other things.

See the incredible emacs config.

Saturday, November 3rd, 2012

Because people asked: my current emacs configuration is at

Note that it will not work as is, as it depends on my local file tree and specific installs from marmalade. So it’s mostly useful as a raw bucket of references to interesting stuff. Oh, and it includes my personal color theme, which may be an interesting example of emacs 24’s new color-theme functionalities.

October Amsterdam Clojure this saturday

Thursday, October 25th, 2012

This saturday, all day. I’ll be giving an updated version of my “functional clojure: sequences” talk in the morning.

Clojure-refactoring gets a little love, a new release and a new maintainer.

Monday, October 24th, 2011

clojure-refactoring, the Emacs/SLIME based toolkit for doing refactoring wasn’t getting enough love and attention, so I fixed a few things. Tom Crayford unfortunately doesn’t have the time to work on it any further so I’m taking over as the maintainer. Inspect the code at the new “official” repository.

For now, I’m focused on fixing parsing issues first, then installing ease (I’m thinking about packaging everything Emacs-related on marmalade but that depends on what’s the easiest way to get stuff integrated for the user on the Emacs and Clojure sides). I’ve already removed the dependencies on out-dated libraries. Basically, everything I need to make the current functionality reliable enough for production use. Next up is support for clojure 1.3, probably, if that needs any work (I’m running 1.2 in production everywhere for now).

For the further future, I’d like this code to be useful for other editors/APIs/tools, so the SLIME/swank/Emacs specific stuff probably has to be separated out at some point. Some more refactorings will also be useful.

For now, version 0.6.1 is on clojars. Get it while it’s hot.

Announcement: clj-authsub – AuthSub client in clojure

Saturday, October 8th, 2011

AuthSub is the authorization API Google uses for many of its products, meaning you can use it to ask a user to provide access to their private youtube listings, calendar entries etc without forcing them to hand over their password. The protocol is actually pretty simple and implementing it using clj-http was straight forward, except for one thing: clj-http always puts the connection port number in the Host header (which by the way is completely valid according to the HTTP/1.1 spec), but some google applications (notably, youtube) do not like that, giving a crypic HTTP status 401 “AuthSub token has the wrong scope” error. Figuring out the problem took a couple of hours given that that idiosyncrasy is not documented anywhere and I had to figure it out from some comments in the Python client for AuthSub.

With that issue out of the way, I’ve released clj-authsub version 0.1.0. It’s minimal and currently doesn’t support signed/secure tokens, but it works.

Relatively sane conversion of PDFs to web-ready JPGs using ImageMagick.

Thursday, September 15th, 2011

Some people when confronted with a problem, think “I know,
I’ll use ImageMagick.” Now they have two problems.

For one of the sites I’m maintaining a lot of content is generated directly from (more or less print-ready) PDFs. The only free tool I’ve been able to find that can convert PDFs to decent quality JPGs or PNGs is ImageMagick.

But even when you’ve got ImageMagick’s convert and mogrify commands installed, conversion of PDFs still requires some careful tuning, that is: careful selection of arguments to convert. Also; a sacrificial chicken and lots of patience. Anyway, here’s what I ended up with. Most of this is also available in my clj-imajine clojure library.

Color space.

Many web browsers do not support any color space other than RGB/sRGB. If your PDFs are in the CMYK color space (usual for print) or any other color space, the resulting JPGs will look “weird” in many applications and web browsers; some viewers just show a blank image and others completely mess up the colors. To make sure the end result is in sRGB, use the option “-colorspace sRGB“.

Color depth.

For much the same reasons, you want to enforce that the output color depth is 8 bits for JPGs. To do that, use the option “-depth 8“.

Crop boxes.

PDFs are pretty complex documents and one potential pitfall is that there are at least 3 different indicators of the “boundaries” of the PDF. I’ve run into a few where the “right” boundaries were provided by the “cropbox” instead of the “media box”. This post by Joseph Scott provided the solution: use “-define pdf:use-cropbox=true“.

The final line becomes:

convert -define pdf:use-cropbox=true -colorspace sRGB -depth 8 pages.pdf pages.jpg

Note that if your PDF contains more than one page, this will generate a JPG for each one, named pages1.jpg, pages2.jpg etc… To select a single page you can use convert -define pdf:use-cropbox=true -colorspace sRGB -depth 8 pages.pdf[X] pages.jpg where X is the page number minus 1. You can find the page numbers in a PDF using ImageMagick’s identify command like this: identify -density 2 -format "%p," pages.pdf

*) paraphrased from Jamie Zawinski’s remark on regular expressions.