
Long chose a blog between "I'm crazy", "Strange things" and "I am promoting" ...
It all started with the fact that they gave me a
binary clock . It turned out that the binary system is not so uncomfortable.
Under the cut, you will find out what happened to my brain (“I’m crazy”), what I did (“Strange things”), and how to get oneself (“I am promoting”).
Let's start with the fact that I made a binary clock on the desktop
At first it was done in Python / Tkinter, but then, I rewrote them with Qt. No frills. Should be collected everywhere, I tested under UNIX and under Windows (MinGW) - it is going. It looks like this (you can customize any colors):
')
There is a menu with settings for a few aspects of appearance:
These settings can be saved.
If you want to resize, you can edit the file zoclock.h. If something does not like it - I will be glad comments.
Project site
zoclock.googlecode.comDirect link to zoclock-1.0.0.tar.gz source .upd: New version - now with “always on top”! :-) Direct link to
zoclock-1.0.1.tar.gz source code (I plan to consider other suggestions in the near future).
Going all two teams:
qmake
make
Commands may depend on your system. For example, if you have Windows / MinGW, then instead of make you should use mingw32-make; if you have FreeBSD, instead of qmake we write qmake-qt4, and so on. The essence of this does not change.
And with my brain, something happened that I had mastered a quick understanding of the binary system.
It turned out to be not difficult at all, it is enough to remember ...
Main
Eight small numbers are easy to remember.
000 - 0
001 - 1
010 - 2
011 - 3
100 - 4
101 - 5 (very important number)
110 - 6 (you can no longer remember, see below)
111 - 7 (there are several reasons to remember it)
Numbers that catch your eye
These are numbers consisting of one units.
111 - 7
1111 - 15 (a quarter of an hour)
11111 - 31
Weight of discharges
32 16 8 4 2 1
(These numbers have something in common with previous ones, which makes memorization easier :-))
Most of this information you probably already knew ...
Verbal counting
... then you can instantly perceive not very large binary numbers. Just use two rules.
Multiplication by 2 is equivalent to shifting to the left.
and
Parse number better left to right
Because it is easier to add smaller terms to the growing number than vice versa.
We use our knowledge
1010 - it is obvious that this is 5 * 2 shifted by one digit, i.e. ten.
A little harder, what is 10111? One could imagine how 16 + 7 but it is very difficult to put in mind. It is much easier to guess the sequence 101 here and notice that 10111 = 10100 + 11. And this is already 5 * 4 + 3 ie. 23.
Another example is 11101. This is obviously 7 * 4 + 1 - 29.
11110 - 15 * 2 = 30.
101011 - 5 * 8 + 3 = 43.
And more - 111,000. This is not 8 + 16 + 32 (how much time do you need to calculate it in your mind?) But it is 7 * 8 = 56!
Everything else is in the same spirit :-)
In fairness it should be said that
I am not the first to invent such a watch. There are a lot of them (even on googlecode is complete), but I could not find those that would satisfy me. In many cases, these programs are simply not added. I made myself like it ...
Perhaps the most prominent one can be called
this project . He did not approach me because he (1) is not binary, but binary-decimal; (2) a very large window; (3) one menu item does not work (not completed, according to the author) and ... I did not dare to use its source code because it contradicts my religious views, and, I think, tramples on the best ideas embodied in Qt. As you understand, all these points are purely subjective. Pluses can outweigh all the disadvantages. This is (1) time-tested, (2) software, as I understand it, is going with Qt3 and Qt4, and there is a Java implementation. You might like this project more than mine.
But why am I ...?
BUT! Yes! If someone takes the trouble to look at the code, finds some of its aspects obscene and is not too lazy to say it to me in an open dispute or in private, I will be infinitely grateful!
If someone uses my code as an example of using Qt (and it seems to me that this is not a bad little example), then I will assume that I spent half a day on this matter for good reason!
If someone has wishes (alarm clock?) - they are accepted!
Enjoy! :-)