Archive for April, 2010

Car Accident, Haradh road, Saudi Arabia, April 27, 2010

Wednesday, April 28th, 2010

This accident occurred on Haradh Road.  Luckily, the driver only suffered minor injuries, the worst being a cut on his forehead that required eight stitches.
April 27, 2010 - Haradh Road Accident 1 of 6
April 27, 2010 - Haradh Road Accident 2 of 6
April 27, 2010 - Haradh Road Accident 3 of 6
April 27, 2010 - Haradh Road Accident 4 of 6
April 27, 2010 - Haradh Road Accident 5 of 6
April 27, 2010 - Haradh Road Accident 6 of 6

Traffic Study in Jeddah, Saudi Arabia, February 2010

Wednesday, April 28th, 2010

This is a nice study conducted by Safar, Zaki in Jeddah, Saudi Arabia illustrating with hard facts and figures the extent to which drivers fail to obey traffic signals. Although this is a limited study, it draws a dark and scary image of driving habits in Saudi Arabia. Follow this link to get the PowerPoint presentation. Please, save the file with .pptx as extension. This is until I get the MIME type added on my web site.

The Dilemma of Constraint Programming

Monday, April 26th, 2010

Constraint Programming is yet another application of the concept of Declarative Programming which is about describing a problem rather than devising an algorithm to solve it. Other examples of Declarative Programming include SQL, Linear Programming, HTML, XAML, SVG, and Regular Expressions. The idea is to let the user concentrate on formulating the problem rather than wasting a lot of efforts solving it. It opens the door for non-technical people to exploit the relatively cheap computing resources to solve real life problems that in the past would have required the cooperation of a team of subject experts and IT specialists to solve.

CP follows the same philosophy as LP but allows for a much greater expressive power. This means that problems that would be relatively difficult and tedious to formulate using LP are relatively straightforward when using CP. Example: Solving classic puzzles such as Sudoku or Zebra is relatively easy in CP but would require a complex Mixed Integer Programming (MIP) formulation, MIP being an extension of LP where some or all variables are assumed to be integers.

So, CP seems to be extremely exciting, until you tackle relatively simple problems such as Kuromasu and have a hard time formulating them in CP, for the simple reason that the required built-in constraints that would concisely describe the problem do not exist within any provided CP toolkit. As such you are left with two options:

  1. Formulate the problem using built-in constraints which proves to be quite convoluted loosing the theoretical ease of formulation, and inefficient because of the hundreds of constraints that have to be generated and ultimately managed by the solver at run time which may result in prohibitively long run times.
  2. Create user-defined constraints specifically tailored to the problem at hand: This requires understanding the internals of a specific solver such as Choco and implementing the new constraint using imperative programming, which in my opinion completely defeats the purpose of using CP as the declarative paradigm is mostly lost.

One might argue that it is still worth using CP as we may benefit from solvers that can transparently exploit prevalent multi-core CPU architectures. That argument might lose its strength as powerful API’s such as Java 7 Fork-Join and .Net Framework 4.0 Task Parallel Library (TPL) completely shield developers from the complexities of multithreaded programming.

Another aspect that hurts CP is the lack of a standard language and set of constraints so as to allow for portability and decoupling the API/Language from the solver. In LP, standard file formats such .MPS, and .LP allows feeding a problem to different solvers both proprietary and open-source. Moreover, high level languages such as AIMMS and AMPL can be used to model complex problems and use various solvers API’s to solve them. CP is badly in need of such mechanisms if it is to become as widely used as LP. Maybe, high level languages such as AIMMS and AMPL would gain into targeting CP solvers for particular classes of problems that are not well adapted to LP.

This article does not intend to be a CP bashing session. In fact, it stems from some good and bad experiences I had using CP and LP as I was so attracted by the Declarative Programming paradigm that I oversaw the obvious necessity to use the right tool for the right problem. For example, I tried to use LP to solve a scheduling problem and failed miserably as the solver was doing a completely blind search on a large computer generated MIP model (as no heuristics could be provided to guide the search). The other bad experience I had was solving Kuromasu using Choco CP API. It proved complex, inefficient and more difficult to implement than implementing a depth first search algorithm using Plain Old Java. Although I found a CP solution for Kuromasu, the “declarative” formulation was less than obvious and the run-time poor.

Conclusion: Do not use a hammer as a substitute for a screwdriver.

STC Down 29% Mobily Up 49% First Quarter 2010

Saturday, April 24th, 2010

Saudi Telecom Company STC, suffers a 29% fall in first quarter 2010. This is in my opinion strongly linked with the overbilling of thousands of customers – without proper reimbursment – following the adoption of a new billing system, made in India. Although the original article attributes the problem to the worldwide economic crisis, it looks more likely that defrauded customers punished STC by switching to Mobily who’s results have jumped 49% for the same period.

Beautiful pictures of Eyjafjallakull Volcano Erruption

Saturday, April 24th, 2010

Beautiful pictures of Eyjafjallakull Volcano Erruption

SAP SHAValidator

Tuesday, April 6th, 2010

SAP SHAValidator is used to ensure that files downloaded from the SAP site have not been corrupted during download. It does that by calculating a SHA256 cryptographic  hash. The problem is that this utility is provided as two JAR files, namely SHAValidator.jar and frog.jar, the later being used as look and feel library. As a result, a long command line has to be issued to launch the utility. I combined the two JAR files into one so as to allow a double-click launch of the utility or issuing  java -jar SHAValidator.jar via the command line. Download SHAValidator here.

False Halal gets Doux and KFC in trouble

Monday, April 5th, 2010

The largest French chicken exporter to the middle east, Doux, and KFC are in trouble for pretending to sell halal chicken while in fact using mechanized slaughtering methods. See a mis en ligne le reportage censuré par M6 (French).

Moving to Linux

Monday, April 5th, 2010

I finally moved to Linux on my desktop. After trying Ubuntu and OpenSUSE, I finally opted for Ubuntu as it has been easier to install software such as Limewire, Google Chrome, Skype and VirtualBox on top of a fresh installation. A word of advice though: Right after a fresh install, launch the auto-update so as to get the latest patches. Failing to do so will make the installation of the previously mentioned software troublesome. Crossover can be used to run windows applications and games on linux. This company is actively contributing code to the Wine opensource project.