Skip to content
Jul 6 10

July, 7th

by andy

Never forget

Days are long, but years are short.

May 11 10

After Week One with a Kindle

by andy

So finally I’ve got myself an eBook-Reader. As I already own some Amazon eBooks the Amazon.com Kindle International Edition (which is almost the same as the Kindle 2) was the obvious choice. As I wasn’t too sure that I’m into eBooks I got one from ebay.at for around 130 Euro. How was the first week?

read more…

Apr 29 10

Provenance on Rails

by andy

First of all, what is provenance? The common description is that provenance describes how an object came into its current state. Think of it as versioning on crack: in addition to performed changes it also detects how and by whom those changes were performed.

..but do I need it?

Well that depends:

  • do you have any objects in whose alteration history you’re interested in? Think about any financial or business object.
  • social network app? think automatic activity feeds..
  • do you have any analysis workflow that produces a single output from multiple input data points? Provenance can retroactively create the relationships between the input and output datums.
  • do you want to monitor a given object’s access patterns temporary? Think debugging.

Actually, the longer you think the more use cases appear.

After the break I’ll talk about my master thesis (that dealt with provenance), the corresponding RoR prototype and future plans w.r.t. provenance within Ruby on Rails.

read more…

Apr 1 10

Howto use cmake with C/C++ projects

by andy

Writing code ain’t the end of a C/C++ software developer’s task, it’s merely the start of endless compile and debug sessions. Compiling is the build system’s job: Visual Studio users might just click on the “Build” button, UNIX users mostly depend upon Makefiles. The conventional way of creating Makefiles involves GNU’s autotools. They check the computer system’s installed resources (mostly installed libraries and compilers) and generate system-dependant Makfiles. Being fed up with autotools wrt. readability and performance I searched alternatives and found cmake. The conversation from autotools to cmake did shred away thousands of lines of build code while improving the build performance tremendously. In addition creating distribution-dependent packages gets a lot easier.

Alas I did not find too many introductions so I thought that I’ll write a bit about my experience with cmake. As I continue to find out more stuff about cmake the post will be updated with new findings.

Read after the fold for an introduction into cmake. We’ll create a build system capable of creating debian or redhat (RPM) packages. It will include advanced stuff as automatically creating and installing documentation, subversion-derived version numbers and creating optional features.

read more…

Mar 3 10

Nikon D40 NEF/RAW images with Linux

by andy

Caveat: I’m not too much into photography so everything I posted here might be wrong. It’s just my opinion as an end-user.

I’ve bought myself a Nikon D40 some time ago and finally had enough spare time to shoot some images and post-process them. My environment of choice is Ubuntu Linux so the obvious image management/edit tools were gimp and f-spot.

An first attempt did show some strange behaviour: f-spot did display NEF/RAW images quite different than gimp. It seems as if the (gimp) NEF import step did something to the white-balance and gamma so that imported images did look worse. The worst thing is: while f-spot does display beautiful images it is not able to export them to a more sharable format as JPEG.

GIMP is using ufraw to convert the NEF images, after playing with its parameters I’ve discovered that using a downloaded color profile for the D40 and some custom Gamma and Continuity values does provice a near approximation of the f-spot results. The used values are:

Gamma 0.4
Continuity 0.01-0.04
ICC got it here
White-Balance use camera

A drawback of using ufraw is it’s slow processing speed. Interestingly using ufraw-batch on the command line does not exhibit this problem, so just use:

ufraw-batch --gamma 0.4 --contuinity 0.02 --wb=camera *.NEF

While not being a problem at all, this is something that should work out-of-the-box, ie. the user should not be irritated by photos being displayed differently between applications.

Mar 3 10

Generating PDFs from Ruby on Rails

by andy

The problem

Ruby on Rails provides various helpers for generating dynamic web content but sometimes you need documents that users can easily store and share between them. The ubiquitous file format for this is Adobe PDF nowadays.

The common solution fro this problem is Prawn [github, introduction]. Alas it requires a custom DSL for document description, no existing Rails views or partials can be reused. An alternative is princeXML which transforms HTML/CSS into pdf through an external binary. This would allow reuse of existing templates and knowledge (think CSS designers) but has the downside of its price tag of $3800.

The solution

Enters wicked_pdf: it utilizes wkhtmltopdf to create a PDF document from a Rails HTML template. HTML rendering is done through the well-known webkit-engine. This allows developers to do PDFs in the right way™: define the document’s structure through a simple HTML document and theme them through CSS. You’ll get the automatic benefit of themability: exchange the CSS and you have another format. There are also lots of CSS artists out there that can supply you with different designs.

read more…