Blog

  1. FixedDataTable React.js tutorial

    Thursday, Jan 29 2015

    Recently, Facebook has released FixedDataTable , a library to build data tables with React. I tried it out to see how it stacks up against the alternatives. For reference, I have used DataTables, one of the most popular JavaScript table libraries. Setting up the table Creating the table is simple. You just compose and render the Table React component. You pass the data to the table through a rowGetter prop.

    Read More

  2. Uploading a directory to Amazon S3

    Wednesday, Jul 30 2014

    If you want to translate a directory structure on a disk to Amazon S3, you need to use the file path as the object key for the file. For instance, if you want to obtain the path /bar/foo/baz.jpg, you need to store ‘baz.jpg’ with an object key of ‘bar/foo/baz.jpg’. In the administration console, it is possible to create “folders”. There is no such thing in the API. Amazon has decided to introduce this concept in their interface.

    Read More

  3. Automated deployment

    Thursday, Jan 24 2013

    Recently, I’ve had to work on an application where, for reasons that are best glossed over, a lot of the business logic resides in the Apache configuration. This requires continuously updating a fairly complicated set of mod_rewrite configuration. The configuration needs to be installed on the test server and Apache itself restarted in order to test again. This is not terribly time-consuming, but repeating the over and over can become wearisome and above all, tempt you to modify the Apache config in place instead of keeping all changes under version control.

    Read More

  4. Computing’s layer cake

    Monday, Jan 21 2013

    There is the ISA, an abstraction built on top of the physics of the materials out of which electronic calculators are built. From the standpoint of the application developer, the ISA, this incredibly powerful abstraction, is a meaningless mechanism. Its concepts, its meaning and its purpose are the fruits of further abstraction. So, in a computer at least, abstraction is a relative concept. One could fend off accusations of abstract thinking in more general matters by pointing out this fact.

    Read More

  5. Scraping ISO country codes with Nokogiri

    Wednesday, May 9 2012

    The ISO country codes are used in many business settings to identify the countries of the world: for instance, to indicate the destination of a shipment. ISO makes the two-letter codes available for free, but the three-letter and the numeric codes are jealously guarded and even if you pay you will not receive them in a very friendly format (only PDF and Microsoft Access are available). Wikipedia has got a table containing all the ISO country codes you will ever need, so I have decided to write a little script to extract the ISO country codes from the web page.

    Read More

  6. Simple Java builds with SBT

    Wednesday, May 2 2012

    SBT is a build and dependency management tool written in Scala. When I need to quickly setup a project with some dependencies, I often use SBT, because setting up a simple build is very easy and takes much less typing than with Maven. There are also a couple of other advantages with SBT, namely: sbt automatically recognises your application’s main class and can launch the application just by typing sbt run (no need for a plugin like the Maven exec plugin just to run the application).

    Read More

  7. Client side web applications

    Wednesday, Apr 25 2012

    What happens inside the browser is real The more I develop using Backbone.js the more I realise that client-side heavy JavaScript applications using requires a conceptual shift. We are used to think that the canonical state of the application resides on the server; in a JavaScript application, the canonical state resides in the browser. You need to sync it with the server, but what the user sees and interacts is entirely inside the browser.

    Read More

  8. The cost of writing

    Tuesday, Feb 28 2012

    After a manuscript contains certain number of words, the effort to add more to increases. A 200 page book takes much more than twice the effort of a 100 pages book. Anyone can write a mediocre short story, but you cannot write a some exercise. On the other hand, a book that is twice as long easily delivers less than twice the value to the reader. You can fix higher margins on shorter books.

    Read More

  9. Jfokus 2012

    Tuesday, Feb 21 2012

    Here are my notes after attending the Jfokus in Stockholm this year. Tradition Java EE programmers seem to feel most at home in the JEE/patterns paradigms. Injection, repositories, DAOs are everyday fare. The Java worldview has been abundantly shaped by this ‘software engineering’ worldview. Hacking or intellectual sophistication of the mathematical kind come second. Attendee profile Striped shirts, higher education. Serious engineering. Big company culture. Mostly male, as always. Why aren’t there more women in software engineering?

    Read More

  10. Fixtures vs Factories

    Sunday, Feb 5 2012

    Many web frameworks integrate fixtures: a mechanism to define sample data to be loaded in the database for testing. The format of choice is often YAML, and the frameworks supplies classes for setting up and removing this data. But all too often you load data into the database when all you really need is to access sample objects in your test code. Inserting data into the database for each run slows down tests considerably.

    Read More

  11. The refactoring dilemma

    Friday, Jan 27 2012

    It is an accepted principle that you should leave working code alone. But sometimes you need to modify its behaviour. Now admit that the existing code is fairly opaque, that there are no tests and that the application has never been used nor tested extensively. In any case, you will need to change. You could either introduce your change with minimal modifications refactor the existing code into something more understandable before introducing your change The second option seems riskier at first thought.

    Read More

  12. Up and down the stack

    Friday, Jan 20 2012

    I am starting to become more and more convinced that to spot issues with a piece of software, you need to go take a wider view of what consitutes ‘the application’. In a typical Java server side application, ‘the application’ does not include only the code running on the JVM. For instance, looking at a database query log can be very instructive. It is amazing how much the number of generated queries can be reduced in some cases by some simple changes.

    Read More

  13. How to sell tech books in a physical bookstore

    Monday, Jan 16 2012

    I am leaning towards the opinion that it is pointless to keep a tech book assortment in a physical bookstore, as the target audience is going to buy their books online and tech books run out of date so quickly that they probably are an inventory headache. There is a large general bookstore called Selexyz in Rotterdam. By all appearances, the least likely place where to look for an interesting tech book assortment.

    Read More

  14. Mapping a composite key in JPA with @EmbeddedId

    Wednesday, Jan 11 2012

    Why @Embedded objects? JPA sits in the uncomfortable middle between managing relations stored in the database and providing object-oriented programming facilities. The general rule is that you annotate your classes with @Entity and each class will correspond to a separate table, with while each field of the class will correspond to a column in that table. The @Embedded and @Embeddable annotation exists to allow you to define two separate classes without using two separate tables in the database.

    Read More

  15. Packet Analysis with Wireshark

    Monday, Jan 2 2012

    Some months ago I wanted to remind myself of how the Web works. In addition to Computer Networking I went through the second edition of Practical Packet Analysis, by Chris Sanders. Notwithstanding the general-sounding title, Practical Packet Analysis is very much about Wireshark, which is a GUI tool to analyse network traffic, released under the GPL version 2. On a Fedora Linux machine, running Wireshark is very easy, you just start it up and it does its magic; no configuration required except adding yourself to the wireshark group.

    Read More

  16. Some Perl idioms

    Friday, Dec 9 2011

    Recently I have worked with Perl again for some system monitoring scripts. Some people at Lunatech, where I work, are real Perl mavens. Here are some quick reminders Constants use constant CONSTANT_NAME => "constant value"; creates a compile time constant. It is mainly useful for clarifying intent, although if the right side is a more complex expression, for instance a calculation, there might be some performance benefit. Learn more about constants in the official Perl docs.

    Read More

  17. Classpath trouble

    Thursday, Nov 17 2011

    Java programmers are haunted by inferiority complexes. Before the functional programming wave, a much ink had been spilled debating the benefits of dynamic languages such as Python and Ruby. While the discussion focused mostly on syntax and the pros and cons of dynamic typing, it recently struck me that the major reason something like Python feels so much more easy to experiment with than Java is that the interpreter manages to import most installed third-party libraries automatically.

    Read More

  18. What Rails got Right

    Monday, Sep 26 2011

    While getting updated on Rails 3.1 with the latest Manning book on the subject and the thought struck me that where Rails has been the most succesful has been creating a new vocabulary. A DSL for CRUD Web applications More than just providing an MVC structure, Rails has created a DSL for Web programming, which expresses most of the common CRUD operations in a few concise lines. The con is that there is a learning curve, but in exchange you get to think in terms of these operations really fast, and begin to type code very fluidly.

    Read More

  19. Designers needed

    Wednesday, Sep 21 2011

    Designers needed Sketching. Thinking out navigation paths. Planning surprises and moments of delight. We don’t need designers meaning ‘people who draw pretty pictures.’ We need people who know that some problems can’t be solved by yet more code and are ready to interview clients, draw on A3 paper, and sit down with the end users to know how they really work and figure out what’s really going to make a difference.

    Read More

  20. EuroSciPy 2011

    Wednesday, Sep 21 2011

    Last month I have attended the Euroscipy conference at the École Normale in Paris. The conference is about scientific computing with Python, in particular the numpy/scipy/matplotlib stack. Performance Scientific computation is very CPU intensive; an interesting change from applications where memory and storage are the main bottlenecks. In the performance talk by Gael Varoquaux, we got to see the demonstration of a computation runnning noticeably slower when iterating through a matrix along one direction than the other.

    Read More