Archive for January, 2007

Singletons and lazy loading

Tuesday, January 30th, 2007

Leggendo questo blog sono venuto a conoscenza di questo interessante problema; Se voglio realizzare un buon singleton , magari utilizzabile in ambiente distribuito, avrò bisogno che metodi esposti siano syncronized, anche quelli statici.
[java]

public class Singleton {

static Singleton instance;

public static synchronized Singleton getInstance() {
if (instance == null)
instance = new Singleton();
return instance;
}

}[/java]

Ogni volta che io chiedo l’esecuzione di un getInstance() sfrutto tutta l’infrastruttura di sincronizzazione che invece non è necessaria, serve solo la prima volta! Per ovviare a questo problema nel blog è suggerito di utilizzare l’idioma Inizialization on Demand Holder (IODH) :
[java]

public class Singleton {

static class SingletonHolder {
static final Singleton instance = new Singleton();
}

public static Singleton getInstance() {
return SingletonHolder.instance;
}

}

[/java]

Non male.

Yahoo! UI Library Theather and random javascript stuff

Sunday, January 28th, 2007

I’ve stumbled over a blog that pointed me to a 4 part video lesson on javascript held by Yahoo! JavaScript Architect Douglas Crockford called “The Javascript programming language” and I must say I enjoyed it very much. It certainly cleared up some doubts that I’ve had so I’m recommending it to everyone. One excellent tip is the existence of JSLint tool and I intent on using it often when I write my own javascript. This whole thing lead me to the Yahoo! UI Library Theather video presentations where there is plenty of material to look at including more advanced stuff from Crockford and a presentation from the author of firebug Joe Hewitt.

I’ve always snubbed a little bit the entire Yahoo! development community but I must admit that all things I’ve seen so far are always of professional quality and excellent documentation. They really seem to digg Web 2.0 (pun intended) :). One thing I noted is that Crockford doesn’t encourage the use of $ which is used quite a lot by my favorite javascript library prototype so I was put down to earth a bit.

I’m also getting interested in GWT and I can’t wait to see it grow with time. I really like that the js produced that gets to the client is custom made for the UI that you create and you can avoid sending huge js files which is an issue with most plain old js libraries.

HK+MG transistors from Intel

Saturday, January 27th, 2007

It seems that Intel will be implementing the new Penryn 45 nm CPUs using a HighK material + Metal Gate manufacturing process. While this has been in the air for some time (I’ve reported on this back in 2005 and I believe I’ve heard it even before), it seems that they have resolved issues that would make these materials suitable for mass production and be reliable enough as market devices. The material that will replace the silicon dioxide is called hafnium and the article speculates it could increase the K factor from 3.9 to something between 15 and 40. This is important as processors get fabricated at smaller and smaller dimensions the distance between the silicon substrate and the gate diminishes as well and up to now this was the primary leakage that was holding out processor evolution. With Penryn coming up in the second half of this year, it’ll give Intel a significant boost, allowing for more energy savings, an expanded instruction set with SSE4 and perhaps a clock increase as well. What are AMD and IBM cooking in their foundries and labs is also interesting but it seems Intel has beaten them to the clock but they are a close behind. This is great for the consumer as Intel knows it has to capitalize on this research as soon as possible in order to get the money invested in it as soon as possible and before other manufacturers get to do the same. Even if this is not a revolution in what a transistor is or how it executes its logic, it gives a breath of fresh air and additional period of exploitation as the classical performance race drives the industry.
I think I’ll wait for this Penryn beast, in the mean time check out the new SSE4 instruction set.

Link 25/01/2007

Wednesday, January 24th, 2007

Come sempre ho poco tempo voglio cmq. postare i link che ho trovato interessanti questa settimana :

  • Per farsi due risate : una richiesta strana
  • L’ottimo editor Komodo windows comodo in versione lite/free
  • Una nuova alternativa a 7-zip : ALzip
  • Un po di cultura (americana) per tutti, mp3 e videocast
  • Disegnare su una lavagna condivisa : ImaginationCubed .
  • Creare testi e tabelle direttamente da google doc.
  • Inserire i link di del.icio.us sul proprio blog con Sociable.

Cosa altro dire buona lettura.

Nmap

Tuesday, January 23rd, 2007

Anche questo giro Nmap è stato il coltellino svizzero che mi ha tolto di impaccio, avevo bisogno di sapere che ip aveva assegnato il mio router FON ad una macchina senza monitor , l’unica possibilità (dato che nella gui web non è previsto) è scansionare la rete , come? nmap -sP 192.168.10.0/24

From Idea to Prototype

Friday, January 12th, 2007

Molte delle persone che passano in questo blog (foll e sergio) sanno benissimo quanto sia difficile progettare una buona interfaccia web/grafica. Tempo addietro mi ero già imbattuto su un tool scritto in java che aiuta nella creazione di un sito sia a livello di interazione tra le pagine, sia a livello grafico.

Denim

Oggi mi sonoimbattuto nel sito di Todd Warfel e ho letto due post molto interessanti. Il primo conteneva il talk che ha presentato con il suo gruppo di studio del NYC UPA, mentre il secondo è uno studio sui task da eseguire per ascoltare una segreteria telefonica. Nelle slide del talk mi hanno colpito molto le immagini e le tecniche che si usano per creare una interfaccia, bhe ecco gli strumenti :

che dire strumenti per veri gtd. Per quel che riguarda lo studio consiglio una presa visione , la struttura a griglia chiarifica molto bene un problema complesso come quello della segreteria telefonica, sicuramente si può tranquillamente adottare ad altre problematiche.

Task Analysis Grid
[la griglia la potete scaricare qui]

Dalla progettazione in generale passiamo alle GUI, ho trovato un’altro tool utile invece per sviluppare Gui in Java, invece di scrivere righe di codice a volte intricato ora basta scrivere del’xml (XAML copy??).

screenshot

una cosa è sicura molto meglio di prima…

(PS: guardate le foto, la sequenza non è casuale…)

Blogged with Flock

Anch’io supereroe!

Friday, January 12th, 2007

Dopo Yoghi anch’io ho fatto il test, avreì preferito essere Silver Surfer ma anche Hulk non scherza 😉
Your results:
You are Hulk

Hulk
95%
Green Lantern
90%
The Flash
80%
Robin
75%
Supergirl
60%
Spider-Man
55%
Superman
50%
Iron Man
50%
Batman
40%
Wonder Woman
30%
Catwoman
30%
You are a wanderer with
amazing strength.

Click here to take the Superhero Personality Quiz

SuperEroe

Friday, January 12th, 2007

Tanto per svagarmi dopo l’esame :

You are Spider-Man


You are intelligent, witty,
a bit geeky and have great
power and responsibility.

Spider-Man
80%
Robin
72%
Superman
60%
Supergirl
55%
Wonder Woman
45%
Iron Man
40%
The Flash
40%
Batman
40%
Catwoman
40%
Green Lantern
15%
Hulk
5%

Click here to take the Superhero Personality Quiz

…scusate ora devo andare a salvare il mondo ….

Epifania

Friday, January 12th, 2007

Tra ieri e oggi nei momenti di relax dallo studio ho gironzolato per la rete e ho trovato alcuni siti interessanti, che ho piacere segnalare.

Da LifeHacker ho trovato:

Attraverso i miei soli feed :

Microsoft discovered PHP

Friday, January 12th, 2007

Yes, I found the notice from Punto Informatico : Microsoft being come to an agreement with Zend for realy support PHP 5 and 6 in IIS.

Blogged with Flock