My Blog

All about my activities, Ideas and everything.

Category: Java

Test Command Line Program

When I was in TWU I was assigned to implement a simple program in Java Command line. I was ok but when I came to TDD approach I really didn’t know what to do and test command-line in JUnit. I googled but I found nothing. However, after Mark Needham shows us in code and it [...]

Tutorial: Embedding Jetty with SSL

I think everybody knows what SSL is and probable knows what Jetty is. Jetty is basically a container which receives requests and generate responses. I choose Jetty because it’s really small and can be deployed in just one jar file. Without further ado. here is the code to add SSL connector to embedding jetty. 1234567891011 Server [...]

How to find neighbours of 2 dimensional array

So, for example if you have a 2 dimensional array. 1 2 3 4 5 6 7 8 9 the neighbours of “5″ is 1 2 3 4 6 7 8 9 the neighbours of “9″ would be 5 6 8 Without further ado, here is the algorithm. 123456789101112131415161718192021222324252627282930313233343536373839404142434445   private static int[][] array = new [...]