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 the system colors and in Ubuntu the tooltips are white on black.
As pointed out here there are 2 possible solutions:
- Tweaking Ubuntu. This isn’t as easy as you’d think! A good explantion can be found here.
- Fixing the color in Eclipse. This is the method I prefer:
- Open the
window > preferences dialog.
C/C++ > Editor or
Java > Editor settings.
- In the listbox titled
Appearance color options
Source hover background
- Choose the color you like, e.g.
- Close the dialog.
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.
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 the slider as is I can only set values with a fixed interval, for example 0, 100, 200, 300, etc. However I want to be able to set small sizes with high accuracy, thus I would like the scale to go like 0,1, 2, 4, 7, 11,16, 23, etc.
This problem needs some module arithmetic concepts before we can give a solution.
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:
The problem is actually so simple that a brute force approach is possible:
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 him to describe for you in precise detail the algorithm used on a particular brand of machine. The algorithm is as follows: Continue reading
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. Continue reading
(for the solution see here)
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 toggle — lighted buttons will become unlighted and unlighted buttons will become lighted. Note that the neighbors do not ‘wrap’ and thus a corner button has only two neighbors, while an edge buttons has three.
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 ways in which you can select k wines out of n and (n-k-1)! is the number of ways in which you can re-arrange the remaining wines without getting one right. In fact the firts glass can be chosen from n-k-1 (not n-k because then you could choose the correct one), the next one can be chosen from n-k-2 and so on.