The CFM-00

15/06/2010

Parallel computing is the next paradigm shift, everybody knows this, but not everyone is taking the proper action to face it adequately. One thing to do is to read on the subject and force oneself to code using threads and various degrees of parallelism; and that’s pretty easy now that a quad core machine doesn’t cost all that much. But the next step, distributed computing, necessitates, well, more than one machine, and if you have different levels of memories and communication channels, all the better.

So out of a bunch of old x86 PCs, I’ve decided to build my own portable mini-cluster with 8 nodes. Nothing all that impressive, but still plenty of fun to build.

Read the rest of this entry »


Soap Geometry

01/06/2010

Sometimes, we look for relation between objects of different dimensionality, search for proportionality rules and try to factor away constants, or, at least, figure out what they are made of. A cute example of which came to me in the shower…

Knowing your weight, can you know how much soap you use?

Read the rest of this entry »


Data Insecurity

25/05/2010

It always amazes me to see how people put trust in their service providers. While in principle, there’s no real need to worry, careless implementation of services can really have dire consequences!

And it’s not like leaks and exploits are rare. Sometimes we hear about them, sometimes we don’t. Let’s consider these two (amongst those) I know about:

Read the rest of this entry »


A matter of interpretation

18/05/2010

In calculus 101, amongst the first things we learn, is that the derivative a function is the slope of the tangent to the function, that is, the instantaneous slope at some point on the function. We have, for some function F that the derivative f is given by:

\displaystyle\frac{\partial\:F}{\partial\:x}=\lim_{\Delta\to{}0} \frac{F(x+\Delta)-F(x)}{(x+\Delta)-x}=\lim_{\Delta\to{}0}\frac{F(x+\Delta)-F(x)}{\Delta}=f

So the formulation looks like a slope, and it is taught that it is a slope as well; all the concepts surrounding differentiation are expressed in terms of slopes of tangents, and that’s OK, because that’s what they are.

But suddenly, in calculus 201, we learn how to find the anti-derivative of a function, also known as the integral. But the metaphor changes completely: we’re know talking about the area under the curve. Wait. What?

Read the rest of this entry »


The Complex Beauty of Simplicity

04/05/2010

As I have said before, some of my friends took the very wise decision to go back to school (that is, university) and, accordingly, they’re doing all the undergrad maths courses. As I try to help them whenever I can, I decided to ask them to solve a simple puzzle… or so I thought.

So the problem is as follows:

You have a circle of center C, radius r\geqslant{}0 and some point Z, with Z\neq{}C. Find the projection P of point Z against the circle with center C and radius r. The method should work whether Z is inside or outside the circle.

Read the rest of this entry »


The Platypus

14/04/2010

This afternoon, on #bash on Freenode:

[19:08:56]  < DrMax > well, yes, with the trailing -print, it works as expected
[19:09:20] * nDuff mutters about people who don't follow his examples exactly, and then complain when they don't work. :P
[19:09:37]  < DrMax > lol yes, sorry, my bad
[19:09:58]  < DrMax > won't do it again, promise
[19:11:55]  < DrMax > find is the platypus of the *nix ecosystems. It has a beak, claws, venom. It swims, lay eggs, is ugly, but somehow manages to survive
[19:12:13]  < DrMax > I hate this command
[19:12:39]  < DrMax > nDuff : nevertheless, the help is greatly appreciated
[19:13:48] < nDuff > eh; find is like *nix in general -- a little picky about who its friends are. Once you get to know it though, it's the kind of friend that helps you move bodies.
[19:14:16]  < DrMax > hmm interesting, but I don't have to move bodies very often
[19:14:21]  < DrMax > I'd rather have regular friends

We’re discussing find, the command I hate the most in all *nix-like commands. Needless to say, the guys and gals on #bash are always extremely helpful and got me on my way.


Foiled!

16/03/2010

QuickSort, due to Hoare, is one of the best comparison-based sorting algorithms around. There are a number of variations, but the vanilla QuickSort does a great job… most of the times.

QuickSort Animation (Source: Wikipedia)

Indeed, there are occasions where QuickSort leaves its expected O(n \lg n) run-time to reach O(n^2) run-time, its worst case. But what does it take to push QuickSort into its worst behaviour?

Read the rest of this entry »


Radix Sort on Floating Point Numbers

09/03/2010

Phimuemue, in a recent post (at the time of writing, anyway) present his variation on sorting floating point values using radix sort. His implementation wasn’t dealing with the pesky sign bit so I offered a slight modification to his algorithm as a comment on his blog. But for some reason, he did not allow to post it.

So I’ll present my solution here.

Read the rest of this entry »


Adding Keywords in Emacs

02/03/2010

As you already know—if you read my blog before—I use Emacs as my primary editor, for C, C++, Python, LaTeX, etc., and I’ve grown fond of the clunky ol’ piece of software. Still, once in a while, I need an extra, potentially weird customization.

Read the rest of this entry »


Computing the Neutral Zone

23/02/2010

Have you ever add to decide, you and your colleagues, where to go for lunch? Each time, it ends up being a committee, of course. It gets even worse when not only you have many colleagues, but also two offices, or two groups, at different locations. Since we work in a rather large city, we want to walk to the chosen restaurant, rather than drive, but in a way that is fair to either group.

So to settle the argument about where are the restaurants midway of both locations, we need a map, and some math.

Read the rest of this entry »