Programming

Largest palindromic long long int that is also the product of two integers

Just to practice my C skills I’ve begun doing the Project Euler exercises in that language. Project 4 asks what is the largest palindromic number that can be expressed as the product of two 3-digit numbers. The answer is 906609 = 993 x 913. Just for fun I modified my program to compute the largest […]

Default welcome page with Tomcat and Spring MVC

In my professional development, I felt that I had always neglected the field of web aplication development. To correct this I’ve started a little side project with Spring MVC, a web application to help a Toastmasters club’s Vice-President Education with their duties. Between the official documentation and the Spring in Action book, I found the […]

Source code filtering with Maven

Today I searched for a Maven plugin that would filter some of my source files before compiling them. An equivalent to the resources plugin with filtering turned on, but for Java sources, that would replace occurences of, say, ${token.name} with somevalue wherever that string occurs in the source files. I could not find such a […]

Don’t unit test JavaBeans

Should unit tests cover JavaBeans just to get a higher code coverage? These days I am working on a payment processing application that exposes its main interface as a SOAP web service. The API requires the client to build a wrapper object that packages the information needed for processing, for instance, a credit-card debit authorization: […]

Spring for structure, property files for parameters

Spring is a great framework for externalizing the object graph of your application. Typically you write an XML config file that defines a number of Java objects (or “beans“) and how they are supposed to relate to each others. For example, suppose you have a class ThermalNode whose instances need to hold a reference to, […]

A unit test that Could. Not. Fail. (but did)

I am now convinced that even the most trivial pieces of code must be unit-tested. Recently I’ve been working on a Java implementation of a building thermal model. A textbook model with thermal nodes and thermal capacities and conductances between them. This is supposed to eventually become part of a generic testing harness for home […]

Canonical data formats, middleware and GCC

These days I’m working on a middleware application that bridges a company’s ERP and its warehouses. The ERP posts messages in a given XML schema, our application reads these messages, transforms them into the schema understood by the warehouse management system, and uploads onthem on the warehouse’s FTP server. We use XSLT to transform messages […]

MATLAB, Java, Spring and dynamic classloading

I have sort of a love-hate relationship with MATLAB, and always had since I read its tutorial in January 2003. On one hand it’s a proprietary closed-source system, which in my book rules it out for any scientific work. My one and only encounter with a Mathworks sales representative did nothing to help my misgivings. […]

Schema validation with LXML on Ubuntu Hardy

LXML is an amazing Python module that picks up where the standard xml.dom(.minidom) left off. It’s basically a set of wrapper code around the libxml2 and libxslt libraries, and provides functionality missing in Python’s standard library, including XML validation and XPaths. On a project I’m currently working on I needed a good XML library for […]

Scroll to top