Recommended reading: Version Control by Example

Eric Sink’s Version Control by Example is a pleasure to read, not to mention that it is also useful if you are into the code writing thing.

The book discusses version control from beginner level to power user level.

The first two thirds of the book describe a simple scenario with two concurrent programmers. Such scenario is replicated many times, each time assuming the programmers use a different versioning platform (svn, mercurial, git, veracity). This part covers 95% of the everyday use of a VCS.

The last part covers more complex activities, the internals of some VCS platforms, and best practices.

The icing on the cake? Free online version and also free PDF version! (with low resolution images)

Binomial Coefficients

I have found myself writing a program the needs getting at hand a whole range of binomial coefficients from C(0,0) to C(n,m) for some given values of n and m.

In this case the most efficient way to get them is by using the Pascal’s triangle (triangolo di Tartaglia, in Italy).

I wrote this java class that implements it, with a few optimizations to avoid storing obvious values.
Each coefficient is stored as a BigInteger.
Continue reading

adsttnmq1/sdioyslkjs2 attack

I’ve just found the my website has been hacked.
I’ve found a new directory “guiex” (but the name can change) containing two files: “m” a text file just listing “index.php” and a php file named “mnq.php” (the code of this file is at the end of this post).

Now we have two questions to answer:
1) How the hell these files have arrived here?
2) What the f**k are these files doing here?
Continue reading