11/05/2010
Experiments do not always work as planned. Sometimes you may invest a lot of time into a (sub)project only to get no, or only moderately interesting results. Such a (moderately) failed experiment is the topic of this week’s blog post.

Some time ago I wrote a CSV exporter for an application I was writing and, amongst the fields I needed to export, were floating point values. The application was developed under Visual Studio 2005 and I really didn’t like how VS2005’s printf function handled the formats for floats. To export values losslessly, that is, you could read back exactly what you wrote to file, I decided to use the "%e" format specifier for printf. Turned out that it was neither lossless nor minimal!
Read the rest of this entry »
8 Comments |
algorithms, C, data structures, Portable Code | Tagged: CSV, double, fail, float, print format, printf |
Permalink
Posted by Steven Pigeon
07/05/2010
William Poundstone — Prionner’s Dilema — Anchor, 1993, 294 pp. ISBN 978-0385415804

(Buy at Amazon.com)
This book isn’t really an introduction to game theory, nor a von Neuman biography, nor a history lesson on the cold war era. Most of the book is devoted to either the cold war logic or to game theory, and little to von Neumann who, really, only serves as the main thread bringing game theory and the cold war together. Nevertheless, it’s a quite cromulent introduction, while not very math-oriented, to the fundamentals of game theory where two (or more) players are confronted and try to maximize their gain. Can or should player cooperate? If so, why?
If, like me, you think that the cold war is rather boring, just skip those part, it will still be a quite interesting read.
Leave a Comment » |
algorithms, Mathematics, Suggested Reading |
Permalink
Posted by Steven Pigeon
04/05/2010
Leave a Comment » |
algorithms, hacks, Life, Mathematics, Zen | Tagged: algebra, Equation System, Equations, Generality, Geometry, Paradigms, Simplicity, Vector |
Permalink
Posted by Steven Pigeon
27/04/2010
Mathematics is still full of surprises. The solution to simple to state problems may elude mathematicians for centuries. One example is the celebrated Fermat’s Last Theorem (stating that equations of the form
have no integer-only solutions for
) that was finally solved by Andrew Wiles with tools Fermat couldn’t possibly know nor understand1.

Another one of those problems is the Collatz Conjecture. Proposed by Lothar Collatz in 1937, the conjecture is that a simple recurrence function—that we will discuss in detail in just a moment—terminates for all natural numbers. This one, however, isn’t solved yet.
Read the rest of this entry »
7 Comments |
Data Visualization, Mathematics, Science, Zen | Tagged: Collatz, DAG, Directed Acyclic Graph, Directed Graph, Fermat, FLT, GraphicsMagick, GraphViz, LHC, Mathematica, Recurrence, Wiles |
Permalink
Posted by Steven Pigeon
20/04/2010
Leafing through old notes, I found some loose sheets that must have been, at some time, part of my notes of my lectures on external data structures. I remember the professor. He was an old man—I mean old, well in his 70s—and he taught us a lot about tapes and hard drives and all those slow devices. As a youth, I couldn’t care less about the algorithms for tapes, but in retrospect, I now know I should have paid more attention. So, anyway, the sheets contains notes on how to compute average rotational latency and average (random) seek time.

Read the rest of this entry »
7 Comments |
algorithms, Mathematics, Operating System | Tagged: Average Seek, Hard disk, Latency, Random Seek, Seek Time, tape |
Permalink
Posted by Steven Pigeon
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.
Leave a Comment » |
Bash (Shell), hacks, wtf | Tagged: Find, Freenode, helpful friends, IRC, platypus |
Permalink
Posted by Steven Pigeon
13/04/2010
Unit testing helps you make sure that your code is working properly but the black-box approach has its limits. In fact, in a complex program with (unsurprisingly) complex behavior, black-boxing becomes a major hindrance to testing. So what are the options? There are several options, but they all seem to have their inconveniences; some violate the basic tenets of object oriented programming, some introduce additional occasions for bugs. I think that there’s no easy solution.

Read the rest of this entry »
2 Comments |
C, Life in the workplace, Object Oriented Programming, programming, Unit Testing | Tagged: #define, accessors, C, cpp, cross-cutting concerns, debugger, encapsulation, friend, macro, operator delete, operator new, polymorphism |
Permalink
Posted by Steven Pigeon
06/04/2010
I am currently contemplating the possibility of recoding all my CDs into new compressed formats. I currently use MP3 but since I started my collection in a time when a huge hard drive was 4GB, a lot of those are coded at 96 and 112 kilobits/s… which doesn’t sound all that great. Although MP3 isn’t the greatest format around, it does offer the advantage of being compatible with nearly all players around, something neither FLAC nor Ogg Vorbis can claim.

Some of the most recent devices support the addition of codecs, but not all. My Sansa player doesn’t, although I could probably upgrade the firmware or something but my car built-in player is another story. So for the time being, I considered recoding everything in MP3 with a higher bit-rate, or maybe use FLAC and write some kind of script that transcode the files to MP3 for exporting to a player. I’m not decided yet. But let say I decide to stick with MP3 all the way. What bit-rate should I use?
Read the rest of this entry »
5 Comments |
data compression, Life in the workplace | Tagged: ABR, CBR, codec, compression, encoder, FLAC, gpsycho, LAME, MP3, MP3 Audio, ogg, ogg vorbis, psychoacoustics, sound, sound compression, Variable Bit Rate, VBR, vorbis |
Permalink
Posted by Steven Pigeon
30/03/2010
Things I never, ever, want to hear. Ever.

6 Comments |
Life in the workplace, programming, rants, Unit Testing, wtf | Tagged: Compiler, LOC, negligence, nonchalance, OS, SLOC, Software, stupid |
Permalink
Posted by Steven Pigeon