Friday, 5 November 2010

Stop smoking

Wanna try to stop?

I'm thinking about my Facebook page. What I found there? Some interesting news (in Italy a politician, Nicky Vendola, updates his status at least two times at day). Some news posted by me (mainly blog uploads and shared links). And a lot of (useless) status uploads and a lot of not very interesting news (some are near to spam). I start thinking to unsubscribe from the "Blue Social Network", because all interesting news can be found with a good RSS reader, but soon I realize I can't.
Facebook isn't a "funny site" anymore: it's the "main street" of internet comunication. Your Facebook page is your business card to the world, more than your blog or your web site. It's the best place to put your advertising, 'cause it will be sent to all your Facebook contacts.
You ARE your Facebook page; you ARE the news you post and the links you share. All these informations draw your profile to the other Facebook users.
When someone is looking for you, he will go to Facebook. I can survive without Facebook, using just iChat connected to Facebook's jabber server; but all other social activities (publicize a movie, a post on my blog or just share a newspaper article) can be done only with Facebook.
Facebook is a powerful tool, but for some days I felt sad on last sessions. Why?
My answer (just my 5 cents) is simple. I feel like when I tried to stop smoking: I felt strange some days because I didn't know what to do. Smoking was like a "filler", a way to don't get bored while I didn't any activity.
When you're on a boring office, with no chance to talk about interesting things with your colleagues, what can you do? Connect to the blue site.
Well, I decide to stop "facebooking" with no reason. I stop using it with a precise idea about what to do in it: no "busy wait" for a chat, not looking all 200 demotivational posters 'cause I don't know what to do. I'll start to use it conscientiously, as the last BBSs' offspring.

PostScriptum
Take a look to this old soviet device. It was created three years before Photoshop 1.0. Interesting :)

Thursday, 4 November 2010

Unity and so be it


Is this a flame? Maybe. But I support Canonical's decision to use Unity instead Gnome Shell. Why? Because this "fork" is fundamental, not just for usability reasons, but mainly because it's a strong stance from the most widespread GNU/Linux distribution. Adopting Unity, Canonical did some decisions, oriented both to usability and development. Choosing Unity, Canonical show us its direction: the underlying technology is useless if user experience is poor. KDE 4 is on this way: great technology (C++, QT, Plasma, Phonon, ecc.) but the resulting desktop is not "sexy" as Gnome on Ubuntu.
Technology can't be the objective. Christopher Tozzi said


I put emphasis on some statements, expecially about "to borrow ideas": this is the base of Free Software, which is not (as many thinks) a "Hippy-Programmers Way of Life". Free Software is much more near to "Ideal Market" and "Concurrency" than other realities (such as Apple and Microsoft). Same ideas are implemented by different teams in different ways (e.g. EMACS vs VIM; Eclipse vs Netbeans; Gnome vs KDE; Firefox vs Konqueror and so on). This environment allows to many competitors to survive. But Canonical must monetize its work. And to do this it needs to follows user's desires. If Gnome shell isn't actractive enough, then welcome Unity.

Wednesday, 3 November 2010

Why EMACS is still important

«Hey you! Is that a VIM session?!»

Talking about EMACS in 2010 may seems stupid. But GNU's official text editor still maintains its charm, despite nearly three decades. Born from Richard M. Stallman's keyboard, EMACS is the editor of choice of different programmers scattered around the world, thanks to its main feature (it's programmable). I decided to try EMACS after a fight of years.
If you use EMACS enable immediatly the cua-mode The cua-mode sets the "copy-and-paste" and other controls with the keyboard shortcuts control-v, control-x, z-control, control-c, making more "human" the user interface and avoiding you to spend two hours on manual to understand what is a "region", the "yanc" command and the "kill" command. Using this "trick", I finally started using EMACS for real and not just for fun.

EMACS vs XCode vs Netbeans vs Eclipse vs...
EMACS can compete against an IDE?" No. It can't, at least not right now. It 's true EMACS is a text editor with a LISP engine then theoretically you can turn it into a IDE, but I've never seen anything like it. And I'm not interested to see it. The "universal solution" (or "silver bullet") does not exist. If I'm working a small project in C / C, a bash script or a python script, then I'll probably use EMACS; but to develop an iPhone App, a java servlet or a 3D engine I'll use a IDE to do object's methods analysis, to compile the project with ANT, to upload it to SVN, etc..

Why should I use EMACS?
Just for fun. To learn LISP. But the main reason is because EMACS is on any operating system. Well, if you're writing a shell script on a SSH session, then VIM is enough. But when you need to write some Python scripts, with C code, then EMACS is the choice. It's everywhere, has a huge library of macros, will work on Mac OS X, Windows and GNU / Linux and ALL EMACS macros (including "search and replace in selection "," Indent Code","open a shell","Open SSH session to server","Send a email to", ecc.) work on ALL systems which run EMACS . If you are a programmer, probably you will find difficult to use the C mode. Well, you have to configure the c-major-mode to work as you want. At the end of this post, I'll show my personal .emacs file.

EMACS isn't good as VIM
If you talk just about personal preferences, I don't say anything: everyone has his preferences. I was a VIM user, but I finally passed to EMACS after some days of XCode. Why? XCode indents wrong my Objective-C code if I forget some parenthesis (using Objective-C it happens very often). I felt the lack of this advanced feature and I realized that Emacs can do the same, changed my feelings on it.
There's some things I would like to see in next EMACS release: first, set the default use of cua-mode, because in 2010 just two or three nerds are comfortable with "kill and yank". Second, set UTF-8 as default encoding. Third, a modern configuration interface (the "Customization Macro" was useful in the '80, but now is a bit obscure).

My .emacs file
Somebody has a very large .emacs file, filled with his own macros. I just want to use the c-style called BSD, with tab character as indentation method and four spaces as tab width.

;C programming style
(setq c-default-style "bsd"
         c-basic-offset 4)
;for c-mode, use tabs instead of spaces.
;Set tab width as 4 spaces
(setq-default c-basic-offset 4
                  tab-width 4
                  indent-tabs-mode t)

Last advice
Take a look at the Emacs Wiki: I found it very useful.
Happy hacking :)

Tuesday, 2 November 2010

Oracle's short vision

Mr. Magoo, you are more fun

News of the day (october 29 2010). From Computer World I read «Oracle: Google 'directly copied' our Java code». In this article is exposed how and where Google did copy Java's code. From the article we read

«The infringed elements of Oracle America’s copyrighted work include Java method and class names, definitions, organization, and parameters; the structure, organization and content of Java class libraries; and the content and organization of Java’s documentation»

I organize this declaration in the following list
  1. Java's methods names;
  2. Java's class names, definitions, organization;
  3. Java methods' parameters;
  4. the structure, organization and content of Java class libraries;
  5. Content and organization of Java’s documentation;
Pay attention, this statements aren't so unfamiliar. Do you know where I (and probably you) did hear them before? When SCO accused Linux of copyright infringement. SCO was more prepared, saying mr. Torvalds copied directly UNIX code into his kernel (Linux). In the final chapter of this ridiculous theatre, SCO showed this famous pieces of code: few macro definitions of the errno.h header file. These macros look similar to this:

#define PI 3.14159265

The SCO-Linux controversies was more complex and still continue. Anyway, SCO showed some code and, on a computer-science lawsuit, gave some material to think about.
Let's return to Oracle's assertions. How much are they real? As a programmer with some knowledge in law and licensing, they seem ridicolous.

  1. You can't set a copyright for a "Function Name". Neither for a class name or a declaration. They're not "trademarks". The only trademark could be the "java" prefix in some cases (such as java.*), but I have doubts, because there are placed to grant the Java Standard Definition;
  2. Look point 1;
  3. Look point 1;
  4. As I say on point 1, I can understand Oracle dislikes the word "java" in a whole classpath, but this is placed to follow the Java Standard Definitions;
  5. This is more difficult: as you can read here, Oracle's documentation distribution isn't released under the GNU Free Documentation License.
If you think well, there's something else to say: Android is based on 3 things: a Virtual Machine (Dalvik), a language (Java) and a classpath (Harmony). Google never said Android runs Java and they're right, because Dalvik is very different to Hotspot; Harmony is a java classpath reimplementation released under the Apache License.
By the way, "Java" was released under GPL by Sun Microsystems just before it was purchased by Oracle and just some pieces are still under a non-free license. So, Oracle's charges to Google seems inconsistent to me. If the problem is documentation, then Google can pay a team to rewrite it.

I think the main reason to start this lawsuit campaign is the lesser importance of the Java Micro Edition platform. How Oracle (a server provider) could be afraid on losing the mobile market? The answer is Oracle feels threatened by the decreasing importance of selling licenses to use the Java Micro Edition. Sun Microsystems earned selling to smartphone producers (Nokia, Erikson, Motorola, ecc.) the autorization to include a JME on their products. I think this was the only profittable Java client platform. Now that JME is going out  of market (killed by iOS and Android), maybe Oracle is playing dirt to give new life to this project.