Archive for March, 2009
It seems that man pages on OSX are misaligned with the commands sometime.
Example:
From
$ man ps
I read:
-e Identical to -A.
But look how identical they are:
luigi@noname:~$ ps -e
PID TT STAT TIME COMMAND
12332 s000 S+ [...]
Testing components that use JNDI to get DataSources and other resources can be annoying, because (hopefully) you don't want to run your unit tests inside the application server. JNDI is a good example of how the ServiceLocator makes testing harder.
When you can't turn around the JNDI to get your resources and inject them into your [...]
Checking if an IP is in a subnet range. SubnetUtils.SubnetInfo isInRange bug.
1 Comment Published by Luigi March 25th, 2009 in JavaToday I used commons-net to verify when an IP address is in a subnet specified in CIDR notation. So, I got a bug.
This code:
SubnetUtils utils = new SubnetUtils("77.24.0.0/16");
System.out.println("lower address: " + utils.getInfo().getLowAddress());
System.out.println("higher address: " + utils.getInfo().getHighAddress());
System.out.println("77.23.255.254 is in range? :" + utils.getInfo().isInRange( "77.23.255.254" ));
gives this output:
lower address: 77.24.0.1
higher address: 77.24.255.254
77.23.255.254 is in range? :true
Obviously the [...]
Which one do you read best?
A.
B.
Don't read this until you've answered yourself:
˙xnuıl ɯoɹɟ sǝɯoɔ ǝldɯɐs puoɔǝs ǝɥʇ 'xso ɯoɹɟ uǝʞɐʇ sı ǝldɯɐs ʇsɹıɟ ǝɥʇ
Generic Type Inference and varargs to make code smaller
0 Comments Published by Luigi March 12th, 2009 in JavaRecently at Devoxx I've heard that type inference will be available on Java7 to shorten collections instantiations. (If I remember correctly, from Josh Bloch's workshop).
I catched the idea, and started using Type Inference and Varargs to shorten my code.
Here's an example:
static <K, V> Map<K, V> newHashMap() {
return new HashMap<K, V>();
}
static <T> [...]
Apple MightyMouse: don’t buy it.
0 Comments Published by Luigi March 12th, 2009 in Linux, Software, Hardware, MacTwo Saturdays ago, I bought the Wireless Apple Mightymouse. Very nice looking, but I find it much harder to use than the MacBook's touchpad. Basically the problem is the acceleration, there's no way to set it up without external utility: usboverdrive, steermouse, about $20 each. While you can adjust mouse acceleration in any decent OS, [...]
With ant it's possible to create macros and use them like standard ant tasks.
For instance, in a previous project I was using a proprietary build tool that needed to be launched at the command line. So I created an ant script that was launching that tool from eclipse, and to reuse the invocation logic I [...]
Search
About
You are currently browsing the NewInstance weblog archives for March, 2009.
Longer entries are truncated. Click the headline of an entry to read it in its entirety.Calendar
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Feb | Apr » | |||||
| 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 | 29 |
| 30 | 31 | |||||
Archives
- January 2010 (2)
- December 2009 (1)
- November 2009 (3)
- September 2009 (2)
- August 2009 (4)
- July 2009 (1)
- June 2009 (2)
- May 2009 (4)
- April 2009 (2)
- March 2009 (7)
- February 2009 (5)
- January 2009 (2)
- December 2008 (1)
- November 2008 (8)
- October 2008 (12)
- September 2008 (3)
- August 2008 (2)
- July 2008 (6)
- June 2008 (16)
- May 2008 (2)
- April 2008 (3)
- March 2008 (6)
- October 2007 (1)
- September 2007 (1)
- August 2007 (5)
- July 2007 (6)
- June 2007 (6)
- May 2007 (1)
- March 2007 (1)
- February 2007 (2)
- January 2007 (1)
- December 2006 (2)
- November 2006 (4)
- October 2006 (7)
- September 2006 (1)
- August 2006 (2)
- July 2006 (6)
- June 2006 (3)
- February 2006 (1)
- January 2006 (1)
- December 2005 (5)
- November 2005 (2)
- October 2005 (2)
- September 2005 (7)
- August 2005 (2)
- July 2005 (8)
- June 2005 (12)
Categories
- Books (7)
- Eclipse (10)
- Errors (2)
- Firefox (7)
- Hardware (14)
- Horror Code (8)
- Internet (17)
- Java (85)
- JavaScript (8)
- Life, universe and everything (29)
- Linux (44)
- Mac (18)
- Software (25)
- Speeches and Conferences (8)
- Web (19)
- Windows (16)
Latest
- Syntactic sugar and Java arrays.
- 3G USB Stick on Ubuntu
- Ipod touch with Linux
- Karmic and Luks: USB drive encryption made (almost) easy
- Suspend/Resume in Karmic /2
- Suspend/Resume problem in Ubuntu Karmic 9.10 running on MacBook Pro 5.1
- MacBook International Keyboard and Linux
- Mighty Mouse: reverse horizontal scrolling workaround on Ubuntu Linux 9.04
- Skype 2.1.0.47 beta released, and amd64 packages available!
- Linux RAM Disks

