We have two red, two green and two yellow balls. For each color, one ball is heavy and the other is light. All heavy balls weigh the same. All light balls weigh the same. How many weighings on a beam balance are necessary to identify the three heavy balls?
Source : http://gurmeetsingh.wordpress.com/puzzles/
svn:ignore
I have a build which produces some extra files (not to be checked in).
Every time a do a build, svn shows these files as non versioned, new files and I have to ignore them.
Enter -
Look at those test.log entries - my test case generated them and I'm least bothered to delete them. However, it corrupts my svn status output :-)
So will create an ignore file :
and ask svn to ignore these file patterns :
There - the test.log entries no longer show up in svn status
Detailed reading on svn property set : http://svnbook.red-bean.com/en/1.1/ch07s02.html
Every time a do a build, svn shows these files as non versioned, new files and I have to ignore them.
Enter -
svn propset svn:ignore. Here is how it worked for me :
prompt> svn status
? test.log
? test.log.1
..... (other src code)
Look at those test.log entries - my test case generated them and I'm least bothered to delete them. However, it corrupts my svn status output :-)
So will create an ignore file :
prompt> cat ifile
test*
and ask svn to ignore these file patterns :
prompt> svn propset -R svn:ignore --file ifile .
prompt> svn status
M .
M src
M src/test
... (other src code)
There - the test.log entries no longer show up in svn status
prompt> svn commit
Detailed reading on svn property set : http://svnbook.red-bean.com/en/1.1/ch07s02.html
Find if there is only one bit set in a number
In the bit representation of a number, find if there is exactly one bit that is set.
e.g. your approach should say true for the following numbers :
1,2,4,8,16
and false for the following numbers :
3,5,7,10
e.g. your approach should say true for the following numbers :
1,2,4,8,16
and false for the following numbers :
3,5,7,10
[PS] Catch the Fox
Consider five holes in a line. One of them is occupied by a fox. Each night, the fox moves to a neighboring hole, either to the left or to the right. Each morning, you get to inspect a hole of your choice. What strategy would ensure that the fox is eventually caught?
Subscribe to:
Posts (Atom)