Archive for the 'Java' Category

Ignoring versioned files with GIT

Suppose you work in a team. You download the project sources and you need to change some configurations according to your working environment, like the tcp port on which to run the webserver or the path where to store the log files. If you commit those files, after your local set up, this would impact […]

For the ones who don’t know what OWNER library is, you can read my previous article here: Introducing OWNER, a tiny framework for Java Properties files. It has been a long time since I posted the Part 1 of this article, and version 1.0.3 was just released. Now I should probably write about version 1.0.4 […]

In the last blog post I introduced what is the OWNER API and how to use it. Basically it is tiny library that helps reducing the Java code to read the configuration for your application from Java Properties files. You can find full documentation here. Version 1.0.0 was having the very basic features, and now I’m […]

I never liked to create “wrapper” classes for properties files. Do you know… those classes like: public class MyAppConfig { private static Properties p = …; public static String serverName() { return p.getProperty(“”); } public static int serverPort() { return Integer.parseInt(p.getProperty(“server.port”)); } …. } There’s nothing really bad about those classes. Only that they don’t […]

If you don’t know Project Honey Pot, go and have a look. They offer a service for querying IP addresses and check if they are listed in those involving in spamming or threatening activities. So, if your visitor has a black listed IP you can block him from accessing or doing something sensitive. Since it […]

Self executing jar files

I personally always felt bad about the fact that we have to provide a shell script which runs the executable jar file. It would be nice if we could provide a self contained executable in a single file, right? I just discovered a trick which works on unix, but it can possibly be adapted on […]

Another funny video I found around.

I/O Exception handling

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 […]

When 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 […]

SSH Bash Completion

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 […]


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.


October 2017
« Nov    

Follow me

twitter flickr LinkedIn feed

Subscribe by email

Enter your email address:



Tag Cloud