Archive for August, 2008

Typing Spanish characters in Mac keyboards

I want to share this information with other spanish speaking users of Apple computers. Yes, this can be found in several places all over the web but republishing it once again won’t hurt anyone:

  • á = Opt + e, then a
  • é = Opt + e, then e
  • í = Opt + e, then i
  • ó = Opt + e, then o
  • ú = Opt + e, then u

For the ñ, hold down the Option key while you type the n; release and type n again.

  • ñ = Opt + n, then n

To place the diaeresis over the u, hold down the Option key while pressing the u key; release and type u again.

  • ü = Opt + u, then u

The inverted punctuation marks are achieved as follows:

  • ¡ = Opt + 1
  • ¿ Opt + shift + ?

¡Allí está! Realmente útil, ¿no? :)

Import this

Since i’m still new to the Python culture I wasn’t aware of the “import this” eastern egg. I just heard my friend Gustavo mentioned that IronPython is lacking “import this” and my curiosity was invoked. I quicky tried a few Google searches with no results. Maybe I should had tried something like “import this eastern egg” but I was only suspecting that could be the case so I changed the strategy and fired up a python interpreter on an xterm with this result:

Once the eastern egg had been confirmed I googled a bit to learn more and found it even has a PEP of its own, PEP-20. The text featured is The Zen of Python by Tim Peters. It’s a great teaching! It even appears listed as the first item in this list of python must-read documentation. Nice to know :)

There are some more Python import eastern eggs. Try import __hello__ and from __future__ import braces. Well, for the last one you always have Tim Hatch’s pybraces.

The Evolution of Java

I’m coding some Java this days due to academic reasons: mostly  J2EE web stuff using the now ubiquitous MVC pattern using servlets, JSP, JSLT and JSF. Unless you are a bit of a clueless programer it should be no news to you that Java development is a little bit bloated and no, even if some people like to think that way, Java is NOT the language Bjarne Stroustrup would have designed if he hasn’t had to remain compatible with C as he clarifies in the FAQ of his website. So you shouldn’t be that surprised after all when reading how Cay Horstmann, a computer science professor at the San Jose State University, has summed up the evolution of Java from C and C++:

1980: C
printf(”%10.2f”, x);
1988: C++
cout << setw(10) << setprecision(2) << showpoint << x;
1996: Java
java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
formatter.setMinimumFractionDigits(2);
formatter.setMaximumFractionDigits(2);
String s = formatter.format(x);
for (int i = s.length(); i < 10; i++) System.out.print(' ');
System.out.print(s);
2004: Java
System.out.printf("%10.2f", x);
Don’t know you but I really found it funny :)