Ugo Landini random thoughts on technology and life
Ulog, the Ugol's Weblog
Archives
« febbraio 2010
lunmarmergiovensabdom
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
       
       
Today
XML
Search

Links
 

Today's Page Hits: 9

All | General | Java
20060929 venerdì settembre 29, 2006
Farewell

This is my last day in Sun, so this is my last post.

For a java guy, choosing to depart Sun after nearly 6 years was, at least, hard. But, well, it's done. I am not anymore a Sun employee. I am not proficient enough in English to express my feelings about this... and probably I couldn't find the right words in my own Italian.

... anyway, my new blog is here (and hopefully here in a while)


set 29 2006, 10:07:09 AM CEST Permalink

20060703 lunedì luglio 03, 2006
Pictures from Java Conference

Ladies and gentlemen... mr James Gosling.


for non-italian-roman speakers this rouglhy translates to


JG: design patterns are not that useful, if you want

UL: what the hell, I have to rework the slides I am continuously using since 1998


James vs Ugol



James and Java center


lug 03 2006, 11:15:05 AM CEST Permalink

20060428 venerdì aprile 28, 2006
First impressions on my Macbook...

Ok, it's almost 2 weeks working on my shiny new MBP (standard 17", 1,5Gb RAM), so it's time to wrap-up.

What I like:

- OSX :)

- it's fast, very fast

- Core DUO, because of Parallels. I have installed XP and Solaris 10 on two different VMs. Now i can rotate (using virtue) between Operating Systems! And they both work at near native speed

- Java on intel: it's way faster than Java on powerpc (G4 or G5), probably because the new VM is now much more similar to Sun's

What I don't like:

- the CPU whining. It was driving me nuts, then I found MagicNoiseKiller. With the latest 10.4.6 update MNK is slightly less effective, you need first to open and close the PhotoBooth and then run the code to make it work. I am still waiting for a firmware update or something similar...

- it's hot, and it's not quite comfortable to work with a MBP on lap.

- wifi. It's not working as it should. At home works perfectly with an Airport, but I had problems to connect to some routers. When the battery is low, sometimes it drops connections.

I can live with the whining (thanks to MNK) and with the hot case, but I really hope that Apple will solve the wifi problems. It's the sugar on the cake, and I miss it.

Overall, I am amazed: it is the best laptop I have ever had and it's a great machine. Some youth problems, hope they will be solved in the next weeks. If you can resist, it's probably safer to wait this summer to buy it. If you are like me and you can't... go and enjoy it!

Here is a snapshot of my macbook running 3 operating systems together (click for an high resolution image). And believe it or not, all feel responsive!

3os on osX!


apr 28 2006, 03:14:56 PM CEST Permalink

20060406 giovedì aprile 06, 2006
Virtualization on OSX

Just shortly after Apple announced bootcamp to make you dual boot windows on mac-intel, I found this... meaning that now I don't have anymore excuses and I can go to the Apple Store and buy a Macbook.
Ok, I have one more excuse: my wife.

Update of 15/04: Ok, done. I am writing this on my shiny new macbook pro, and I am still married. More on this later...


apr 06 2006, 05:53:18 PM CEST Permalink

20060325 sabato marzo 25, 2006
The dream-laptop

The laptop I dream of, unfortunately, still doesn't exist... it should:

have OSX as the main Operating System :)
have a multi-core CPU and other state-of-the-art hardware to be a reasonably fast machine in different working conditions
have lot of out-of-the-box connectivity options, wifi, gigabit ethernet, bluetooth, etc.
be energy-savvy, a lot of noteboooks really work well only when plugged to the AC. I want to do a Roma-Milano in train and still be working at Firenze
be lightweight enough to be carried on, especially on Monday mornings

... so what? This is very similar to a Macbook! But I also need...

a fast virtualization approach: I want to install in OSX different images and work with different operating systems and network configurations at a reasonable speed. In my daily work I absolutely need Solaris and Linux, with Windows coming as a nice to have. Multiboot is not an option, I definitely prefer a true virtual approach.

Basically, I am ranting because I think the Macbook is now the most appealing machine (although quite expensive), but is lacking a virtual machine software, at least for me, to be a strong-buy. Microsoft Virtual PC is slow as hell and impracticable for serious use, and I don't know of other OSX Virtual machines which really work. Now the macs have Intel processors, so this should be only a matter of time...

Let's see what happens in the next few months! In the meanwhile, I just signed this petition...

UPDATE of 26/03: hey, perhaps somebody up there likes me...


mar 25 2006, 11:38:45 AM CET Permalink Comments [4]

20051006 giovedì ottobre 06, 2005
Etna valley!

I am writing this from Catania, in the wonderful Sicily, south of Italy.

I am working with some smart software guys in ST Microelectronics, which you should know because is one of the biggest semiconductor producer, and you probably have one of its chips somewhere in your phone, PDA, or pc.
It's why this place is called Etna valley.

I'm just in a room in front of the swimming pool, and I'm working with a high speed network connection (not a wifi one, they have ethernet too). And tomorrow I will speak with guys who implemented (years ago, before Spring had momentum) their own Inversion Of Control framework to better serve internal applications.

Look at some shots of the hotel and here at Etna.

If you are envy, I can understand... so, I seriously advice a working vacation here :)

uL


ott 06 2005, 10:37:59 PM CEST Permalink Comments [1]

20050915 giovedì settembre 15, 2005
Junit 4
You probably have already read this on Slashdot, but these first impressions on Junit 4 is worth mentioning.

I know that Junit is not the first unit testing "framework" using annotations to improve simplicity, but this is the de facto industry standard, and for sound reasons.

can't wait to write this. And no more excuses for the not "test addicted"!

import static org.junit.Assert.assertEquals;

public class AdditionTest {

  private int x = 1;
  private int y = 1;

  @Test public void addition() {
   int z = x + y;
   assertEquals(2, z);
  }

}

set 15 2005, 12:27:38 PM CEST Permalink Comments [0]

20050909 venerdì settembre 09, 2005
a day more and...

.. could be too late to buy the brand new x2100 instead of the Ultra 20. It is essentially the same hw, but it's a server and not a workstation. These new low price opterons really rock!

And... did I mention the wonderful ads? :)

http://www.sun.com/emrkt/rejected/approved.html
http://www.sun.com/emrkt/rejected/index.html
http://www.theinquirer.net/?article=26127

Sun Flyover Dell


set 09 2005, 12:50:26 AM CEST Permalink Comments [0]

20050906 martedì settembre 06, 2005
My new Ultra 20 and my boutique

My wife just opened a "brick and mortar" boutique, because... you know, old economy is sometimes better than new one.

So we are now in old business, selling luxury pens and gifts, Montblanc , Piquadro , this kind of no-geek stuff I have never heard before :)

I must say that I would have preferred something similar to thinkgeek , but probably that shouldn't be remunerative, at least in Italy :)

So what? But this is a perfect excuse to buy a new server (you know, to serve an old new economy little ecommerce!), so I just bought a brand new Sun Ultra 20 .

If you haven't heard of it, it's an AMD-64 opteron machine with an exceptionally cheap price. Well, it's not exactly a server, but for some small sites that should be enough. I asked for 2Gb additional memory, so I will be able to use a prevalence layer for persistence

I am just like a kid, and can't wait for my new toy!


set 06 2005, 02:26:22 AM CEST Permalink Comments [0]

20050831 mercoledì agosto 31, 2005
Vacation and blocks...
I'm back from vacation, but the awful weather just followed us!

I really didn't do anything, because it rained cats and dogs almost all the time. Here you can see our camping, Parco delle piscine, which is considered one of the best in Europe with its three wonderful thermal pools. It's located in Sarteano, in the wonderful Tuscany: unfortunately the mineral water is cold (did you know the difference between frigidarium and calidarium?), so swimming it's not exactly the funniest thing to do when external temperature is 15° C

Here you can see another wonderful thermal pool we visited (calidarium, i.e. hot water at 37° C!) Bagni S.Casciano. This one is really a pleasure, especially in cold days...

By the way, I had a lot of time to think so in the freetime I just studied. One of my recurring geek propositions is to learn a new language every year, and last year I studied Objective C to be fair with my new iMac. This year I finally had the time to approach Ruby, which I have always heard to be as one of the best modern Object Oriented languages.

I studied Ruby core on the famous pickaxe book (the second edition), and I have also studied Rails, the most famous Ruby based web framework. Well... I am a java guy, but I have always been fascinated by Smalltalk: Ruby seems to me an *excellent* language, and I am just in love with some of its features:

- Ruby blocks. I want blocks in Java, they're incredibly useful. Why didn't we put them in Java 1.5? We did the new enhanced for loop, which is only one step away from internal iterators, which in turn is one step from blocks...
- Everything is an object, also numbers. Writing 1.upto(10) it's a joy for an OO lover...
- no more spoonfeeding the compiler with ; ( and so on.
- Rails is incredibly productive, thanks to Ruby but in particular to intelligent defaults. We should learn some lessons here... and I have seen that something is going on in the java community

Waiting for blocks support in Java :-), here is a naive block implementation in java I immediately typed. Obviously, don't use this in production code :-), it's only an example. But also this simple internal iterators should show how powerful (ie expressive) a block can be, if supported straight in the vm

//For.java

import java.util.Collection;

public class For {

  public static void each(Collection c, Block block) {
    for (Object o : c) {
    block.execute(o);
   }
  }

  public static Object find(Collection c, Block block) {
   for (Object o : c) {
    if (block.execute(o)) {
     return o;
    }
   }
   return null;
  }
}

//Block.java

public interface Block {

  boolean execute(Object o);

}

//Main.java

import java.util.ArrayList;

public class Main {

  public static void main(String[] args) {

   String s1 = "Hello";
   String s2 = "cruel";
   String s3 = "world";

   List items = new ArrayList();
   items.add(s1);
   items.add(s2);
   items.add(s3);

   For.each(items, new Block() {
    public boolean execute(Object o) {
     String s = (String)o;
     System.out.println(s.toUpperCase());
     return false;
    }
   });

   String x = (String)For.find(items, new Block() {
    public boolean execute(Object o) {
     return (o.equals("cruel"));
    }
   });

   System.out.println(x);
  }

}



ago 31 2005, 01:37:07 AM CEST Permalink Comments [0]

20050720 mercoledì luglio 20, 2005
About Object Orientation
Ok, let's start seriously with my blog... after 1 year of thinking, it's really time to write something here, possibly a completely uninteresting thing!

Recently in Italy we organized our poor man Java One, the Java Conference. It's literally "Poor man J1", because of money, but we are all very smart and we managed to have a great event with very good people :)

We had a lot of interesting guys and speechs: Simon Phipps and Jonh Gage, Craig McLanahan - ie the struts man - Craig Larman for agile methods, Dirk-Willem van Gulik president of Apache Software Foundation, Francesco Cirillo for eXtreme Programming and my friend Gianugo Rabellino for Cocoon, who incidentally had the best score and surpassed our until-now-best-of-the-breed-every-year speechs on OO design.

(BTW, Gianugo: you had the best single speech, we had the best track!)

We (myself, Bruno Bossola and Francesco Cirillo ) organized, as we do every year since 2002,an OO design track, speaking of Object Oriented Principles, refactoring, how to inject objects in a design and so on. I started with OCP (Open Closed Principle), LSP (Liskov Substitution Principle), DIP (Dependency Inversion Principle), SRP (Single Responsibility Principle), FBC (Fragile Base Class) and so on. Then Bruno showed how to - applying principles - refactor a really awful servlet in a more object oriented design, and finally Francesco injected objects and transformed it in a much better piece of software.

Now, straight to the point, what sounds really strange is that people seems, every and each year, soooo interested in those things, though this stuff is not exactly new or fresh or cool. Bertrand Meyer wrote about OCP in late 80s, Parnas wrote about information hiding in 1972, Barbara Liskov wrote about LSP in 1988. Refactoring is an old Smalltalk practice which recently become trendy after Fowler hit the shelves with his book (if I remember well, in 2001), DIP recently became mainstream with Spring, Hivemind and PicoContainer but Robert C.Martin wrote about it in early 90s, and we are not speaking exactly of academic papers! It's mostly free and accessible stuff written for the average designer (ok, LSP original paper needs at least some math background, but that's all)

So, how is that in 2005 we continue to see code horrors like:

- fat methods (fat for me is >10, but I have found methods in the thousand LOC range) and god classes
- conditionals and switches in lieu of polymorphism
- instanceof
- singletons
- getters and setters
- ...

and we can find these code also in books and in open source, not only in usually-low-quality closed source software. It's hard to find an object oriented piece of code, even in so called Object Oriented books, sometimes even in object oriented language libraries!

So what I'd like to know is:

- is OO too difficult that people can't use it effectively?
- has the imperative paradigm so deep roots in our education that is impossible to eradicate?
- does people only follow trends?
- does OO exist? :)


"ai posteri l'ardua sentenza" how someone said lot of time ago.

Next time, I want to continue and write about software quality indexes: Halstead and McCabe will be our hosts.


lug 20 2005, 10:22:53 PM CEST Permalink Comments [0]

20040902 giovedì settembre 02, 2004
My first one...
ahah! That's working. I resisted the temptation to write my own code to do this, and now I feel good. I am very proud of that. None is asking me to write code or design anything... I am just a plain old jroller user (POJU).

set 02 2004, 01:13:20 AM CEST Permalink