Archive for the 'Java' Category
Java Life (Code Hard) rap music video
0 Comments Published December 6th, 2011 in Java, Life, universe and everythingAnother funny video I found around.
I very much prefer this approach: OutputStream out = new MyOutputStream(…); //may throw IOException try { //use the stream } finally { out.close(); } than this: OutputStream out = null; try { out = new MyOutputStream(…); //may throw IOException //use the stream } finally { if (out != null) { out.close(); } } I just [...]
OSX Lion: some steps in the right direction
0 Comments Published July 28th, 2011 in Apple, Java, OSXWhen I first had to use OS X I had hard time with some things that weren’t working as expected. I thought they were usability bugs, but of course don’t try to argue about that with a veteran Apple user, because “you’re ugly and stupid, and that’s the way it should be! And OSX has [...]
Today I was having a look on how the git-completition is implemented. If you have not enabled the completition for git, I think you should really read my article on how to do it. So I found this two links, that explain the basics on how to implement bash completion for simple commands: An introduction [...]
Checking configuration files inside jars
0 Comments Published June 1st, 2011 in Java, Linux, Opinions, UnixAre you habit to have some configuration files packaged inside the jar of your application? If so, you can still have a look at those configuration files in the running environment using the unzip Unix utility. $ unzip -p /opt/myapp/lib/my-app.jar log4j.properties log4j.rootLogger=INFO,stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.Threshold=INFO log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{dd-MMM hh:mm} [%-5p] %m%n The -p option uncompress and prints [...]
JAXB Tip: one line of code to marshall and unmarshall xml.
4 Comments Published May 26th, 2011 in JavaI wrote in a previous article how easy it is to translate Java object to/from XML, without adding exotic library dependencies to your project; recently I’ve going through the code of one of my colleague and I discovered that the 3 line necessary to marshal and un-marshal the XML can be shortened to a single [...]
I recently started to use a feature in Eclipse 3.6.1 that I didn’t notice before: the “Save Actions”. Basically you can configure some actions that will be done automatically when you save a Java source. Some of them are really useful, like Organizing the imports, adding ‘final’ to private member instances, etc. Here the screen-shot [...]
Java Hangs When Converting 2.2250738585072012e-308
1 Comment Published February 3rd, 2011 in Java, OpinionsJust discovered an interesting bug in Java interpreter and compiler, that makes them hang when converting the value 2.2250738585072012e-308. Nice to know. The bug has been reported to Oracle, but I supposed they will include this in their collection of bugs and sell it as “Oracle Database 12g” product. :-)
There are a certain number of naming conventions used for unit tests. At beginning, with JUnit 3, to define a test it was mandatory that the class name was named like MyClassTest, be extending from TestCase and all the test method names were starting with ‘test’ as in ‘testMyMethod()’. I think that this is a [...]
Yesterday I took back some source samples I was using to learn android, so I got a good chance to build android-sdk-2.2_r2-src.jar for anyone that may need it. I remember to readers that there is a script to generate those on this blog post, where I also explain how to use those files. For the [...]
Search
About
You are currently browsing the NewInstance weblog archives for the 'Java' category.
Longer entries are truncated. Click the headline of an entry to read it in its entirety.Calendar
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Jan | ||||||
| 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 | ||||
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.



