Grazie ad Enrico B.
13 febbraio 2012
1 febbraio 2012
28 gennaio 2012
Java Utility Sites
http://www.docjar.org/
http://grepcode.com/
http://www.jarfinder.com/
http://javacio.us/
http://www.jarvana.com/jarvana/
24 gennaio 2012
Kindle 4 by Amazon
Le parole non bastano … bisogna provarlo:

Per quanto mi rigaurda la confezione è già da URLOOOOOOOOO …

23 gennaio 2012
AspectJ
Constructors are tricky in Java, and that’s exposed in AspectJ. Here are some rules of thumb I use:
* If you want the join point on the “outside” of object creation, use:
after() returning (Foo f): call(Foo.new(..)) { … }
you might be tempted to use “this” or “target” to expose the new object, but remember
that if you’re on the “outside” of object creation, the object itself might not be
created yet… it only exists “on the way out”, when you return the object.
* If you want the join point inside a particular constructor, use:
after(Foo f) returning: this(f) && execution(Foo.new(..)) { … }
remember, though, that if you use “before” advice here, the body of the constructor
will not have run, and so the object may be somewhat uninitialized.
* In the rare case that there are all sorts of constructors for the object
that call each other with this(…) and you want exactly one join point
for each initialization of Foo, regardless of the path of constructors it takes,
then use:
after(Foo f) returning: this(f) && initialization(Foo.new(..)) { … }
Enjoy,
7 gennaio 2012
19 dicembre 2011
Come riconoscere un ictus cerebrale
Durante una grigliata Federica cade. Qualcuno vuole chiamare l’ambulanza ma Federica rialzandosi dice di
essere inciampata con le scarpe nuove. Siccome era pallida e tremante la aiutammo a rialzarsi.
Federica trascorse il resto della serata serena ed in allegria. Il marito di Federica mi telefonò la sera stessa dicendomi
che aveva sua moglie in ospedale. Verso le 23.00 mi richiama e mi dice che Federica era deceduta.
Federica ha avuto un’ictus cerebrale durante la grigliata. Se gli amici avessero saputo riconoscere i segni di un ‘ictus,
Federica sarebbe ancora viva.
La maggior parte delle persone non muoiono immediatamente …
Basta 1 minuto per leggere il seguito:
Un neurologo sostiene che se si riesce ad intervenire entro tre ore dall’attacco si può facilmente porvi rimedio.
Il trucco è riconoscere per tempo l’ictus!!! Riuscire a diagnosticarlo e portare il paziente entro tre ore in terapia.
Cosa che non è facile. Nei prossimi 4 punti vi è il segreto per riconoscere se qualcuno ha avuto un ictus cerebrale:
1) Chiedete alla persona di sorridere (non ce la farà);
2) Chiedete alla persona di pronunciare una frase completa (esempio: oggi è una bella giornata) e non ce la farà;
3) Chiedete alla persona di alzare le braccia (non ce la farà o ci riuscirà solo parzialmente);
4) Chiedete alla persona di mostrarvi la lingua (se la lingua è gonfia o la muove solo lateralmente è un segno di allarme).
Nel caso si verifichino uno o più dei sovra citati punti chiamate immediatamente il pronto soccorso.
Descrivete i sintomi della persona per telefono. Un medico sostiene che se mandate questa è-mail ad almeno 10 persone,
si può essere certi che avremmo salvato la vita di Federica, ed eventualmente anche la nostra.
Quotidianamente mandiamo tanta spazzatura per il Globo, usiamo i collegamenti per essere d’aiuto a noi ed agli altri.
Grazie a mio Zio Matteo
per aver condiviso quest’informazione con me.
16 dicembre 2011
13 dicembre 2011
9 dicembre 2011
4 dicembre 2011
Java Custom ClassLoader
Due istanze della stessa classe, hanno realmente la stessa classe solo quando queste due sono create con lo stesso class loader …
dimostrazione:
final Class> loadClass = new MyClassLoader().loadClass(SimplePojo.class.getName()); Object newInstance = loadClass.newInstance(); printInformation(newInstance); final SimplePojo simple = new SimplePojo(); printInformation(simple); System.out.println( "check: " + simple.getClass().equals(newInstance.getClass()) ); final SimplePojo simple2 = new SimplePojo(); printInformation(simple2); System.out.println( "check: " + simple.getClass().equals(simple2.getClass()) );
L’output è:
name of class: it.skb.at.reflection.SimplePojo name of class loader: it.skb.at.reflection.MyClassLoader name of class: it.skb.at.reflection.SimplePojo name of class loader: sun.misc.Launcher$AppClassLoader check: false name of class: it.skb.at.reflection.SimplePojo name of class loader: sun.misc.Launcher$AppClassLoader check: true
Che ficoooo
3 dicembre 2011
26 novembre 2011
Debian squeeze … ma l’audio dove cavolo è ?
$> apt-get install alsa-utils module-assistant
$> su -c ‘m-a update && m-a prepare’
$> su -c ‘m-a a-i -t alsa-source’
dopo quasi 10 minuti ed un riavvio (che in questo occasione è d’obbligo) … la scheda audio fà sentire la sua presenza
anche se il volume non è proprio così alto … comunque ![]()
vorrei provare ad installare pulseaudio … visto che con la Ubuntu mi sentiva anche il vicino di casa !!?
23 novembre 2011
20 novembre 2011
Java Instrumentation API
http://download.oracle.com/javase/6/docs/api/java/lang/instrument/Instrumentation.html
http://www.cs.nuim.ie/~jpower/Research/instrument/
http://commons.apache.org/bcel/
http://today.java.net/pub/a/today/2008/04/24/add-logging-at-class-load-time-with-instrumentation.html
http://www.javalobby.org/java/forums/t19309.html
http://www.javamex.com/tutorials/memory/instrumentation.shtml
http://www.csg.is.titech.ac.jp/~chiba/javassist/