Why should hashtable size be prime number?

Lets say our hashtable size is 100 (which is NOT a prime number). Say we wish to hash some value x and its multiples...

Playing with JAAS

Just playing with JAAS the other day. Basically its a general set of interfaces and classes (framework) provided by Java to perform authorization and...

Parametrize your xml documents using XSLT and java

Recently, i used XSLT to parametrize an XML document. XSLT transformations are used to transform a Source document to a Destination document using a...

In log4j, output INFO logs of classes only from your package.

Been awhile since I’ve been using log4j for most of my projects. I wanted to output INFO statements only from my package and block log statements...

NachOS academic projects

We had the option of implementing 1.) Multi programming, 2.) Virtual Memory Management or 3.) File System in Not Another Completely Heuristic Operating System, or Nachos. I remember...

Statement vs. Prepared Statement (when using oracle)?

When do we use Statement vs. Prepared Statement? In my opinion unless you are executing DDL statements (which don’t allow variable binding) you are better...

Oracle password expired

Oracle passwords can expire and if your application uses any of those users it could suddenly stop working. You can check status of your...

Function minima and maxima recap.

Came accross interesting problem in some GATE computer science paper. Consider the function f(x) = sin (x) in the interval x ∈ [π/4, 7π/4]....

Loading properties files from classpath

You could load resources using ClassLoader.getResourceAsStream() or Class.getResourceAsStream(). Important thing to note is that Class.getResourceAsStream (String) delegates the call to ClassLoader.getResourceAsStream(String). You can see the same below. 1 2...

Issues with loading properties files using FileInputStream

App.java 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 package com.my;  ...