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+ 0:00.03 -bash PATH=/usr/bin:/bin:/usr/sbin:/sbin TMPDIR=/var/folders/+K 12376 s001 R 0:00.03 -bash PATH=/usr/bin:/bin:/usr/sbin:/sbin TMPDIR=/var/folders/+K luigi@noname:~$ ps -A [...]
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 [...]
Checking if an IP is in a subnet range. SubnetUtils.SubnetInfo isInRange bug.
1 Comment Published 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 [...]
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 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>(); } [...]
Apple MightyMouse: don’t buy it.
0 Comments Published March 12th, 2009 in Apple, Hardware, Linux, SoftwareTwo 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 [...]
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
Categories
- Android (3)
- Apple (26)
- Books (7)
- Eclipse (14)
- Errors (3)
- Firefox (7)
- Git (2)
- Hardware (16)
- Horror Code (8)
- Internet (18)
- Java (98)
- JavaScript (9)
- Life, universe and everything (45)
- Lifehacks (25)
- Linux (50)
- Opinions (25)
- OSX (4)
- Python (1)
- Software (27)
- Speeches and Conferences (8)
- Unix (3)
- Web (21)
- Windows (19)
Tag Cloud
Android apple architecture Bash colors configuration CSS Development Düsseldorf Eclipse germany Git Google Hardware hdr How-To Java JAXB job junit Karmic Linux MacBook music night Open Source Opinion oracle OSX patterns Pitfalls Practices Resume Security Software Suspend TDD Testing tip tonemapped Tricks Ubuntu video Web XML
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.



