Author Archives: admin

Fixing tootlip background color in Eclipse

The problem Under Ubuntu the Eclipse tooltip (the one that shows up when you hover over a function or variables) has an anoying black background color. This is due to the fact that Eclipse takes the default background color from … Continue reading

Posted in Programming, System Administration | Tagged , , , , , | Leave a comment

Restore a file from SVN repository

Suppose you have removed a file from SVN and want to restore it. Should be easy, and it actually is as CRG points out here. I rewrite his method in case it disappears.

Posted in Programming, System Administration | Tagged , , | Leave a comment

Exponential slider

The problem At work I was confronted with a “simple” problem: I have a slider to select values from 0 to 5000 (actually the slider is used to set the the diameter of a circle in meters). If I use … Continue reading

Posted in Programming | Tagged , , , | 11 Comments

Facebook Hacking Cup – Round 2 – Scott’s New Trick – Solution

Preparation This problem needs some module arithmetic concepts before we can give a solution.

Posted in Programming | Tagged , , , , | 2 Comments

Facebook Hacking Cup – Round 2 – Scott’s New Trick

Description Little Scott recently learned how to perform arithmetic operations modulo some prime number P. As a training set he picked two sequences a of length N and b of length M, generated in the following way:

Posted in Programming | Tagged , , , | Leave a comment

Facebook Hacking Cup – Round 1B – Slot Machine Hacker – Solution

The problem is actually so simple that a brute force approach is possible:

Posted in Programming | Tagged , , , | Leave a comment

Facebook Hacking Cup – Round 1B – Slot Machine Hacker

Description You recently befriended a guy who writes software for slot machines. After hanging out with him a bit, you notice that he has a penchant for showing off his knowledge of how the slot machines work. Eventually you get … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Facebook Hacking Cup – Round 1A – Turn on the Lights – Solution 1

The problem can be solved using linear algebra. However there’s also a brute force method which is usable for a board with a maximum of 18 columns. Here I’ll describe the brute force approach.

Posted in Programming | Tagged , , , | 1 Comment

Facebook Hacking Cup – Round 1A – Turn on the Lights

(for the solution see here) Description A simple game consists of a grid of RxC buttons. Each button will be either lighted, or unlighted. Whenever you push a button, the state of that button, and its (up to) four neighbors will … Continue reading

Posted in Programming | Tagged , , | Leave a comment

Facebook Hacking Cup – Round 1A – Wine Tasting – Solution

Acknowledgements So this problem seems suite simple. After some thinking I came up with the idea that C(n,k)*(n-k-1)! would give me the number of combinations with exactly k correct wines out of n glasses. Infact C(n,k) is the number of … Continue reading

Posted in Programming | Tagged , , , , | Leave a comment