By Mihai Preda
Today I run, for the first time, the marathon. The marathon distance is 42.195 km. I finished it in 4:28 (i.e. a little under 4 hours and a half). Although I drank a lot of isotonic drinks and water (about 2 liters) during the course, at the end of the course I was weighting with [...]
By Mihai Preda
I’ve just seen the new web application Jottit, and I liked the way they get simplicity right.
Because simplicity and elegance is not only in the way it looks, but also: in the size of the web pages, in the URL naming scheme, and most importantly in the interaction design.
About the web page size, do you [...]
By Mihai Preda
The problem
Let’s consider the classical ITU-T 12-key phone keypad:
1
2 abc
3 def
4 ghi
5 jkl
6 mno
7pqrs
8 tuv
9 wxyz
*
0
#
There are two main ways to enter text using it (for example when writing an SMS): multi-tap, and predictive text input.
Predictive text has its own set of advantages and disadvantages, but I won’t discuss it here.
In [...]
By Mihai Preda
In Java, a class literal is a construct of the form String.class, which returns the Class object that corresponds to the named class. You can use this to test the exact class of an object, like this:
boolean isInteger(Object obj) {
return obj.getClass() == Integer.class;
}
(A similar goal can be achieved by using instanceof, even though [...]