Author: Phil

  • Calculating the mean and standard deviation in one pass

    It is possible to calculate the mean and the standard deviation of a serie of double values while iterating only once on the whole set of data. This approach is thus also suitable for streaming data; it could update the mean and standard deviation on-the-fly. Here I present an implementation of the algorithm shown by…

  • Removing french language in Eclipse’s findbugs plugin

    When using the findbugs plugin in Eclipse in an environment where the locale is french, all bug descriptions appear in french. Theses messages are not displayed correctly, supposedly because of an encoding incompatbility with HTML. In order to get the original, english messages, we will remove the french messages from the plugin. Do the following:…

  • Getting the location of an executing batch script (.bat file)

    A Windows batch script (.bat file) has an associated directory; the current working folder. It can be accessed in a batch file by the system variable %cd%. If instead, you want to obtain the location of the currently executing script, use %~dp0. Note that both may be the same, but are not necessarily.

  • htpasswd.exe to make your apache password files

    It happened several times that I was looking for htpasswd.exe which is distributed with the apache web server, but had it not handy. The apache foundation unfortunately does not distribute this exec separately, and installing / uninstalling the server just to get the password making program is a bit tedious. So here it is: htpasswd.exe…

  • Quote or escape your Java classpath in cygwin!

    If you are using Java in cygwin, a little attention is necessary because two worlds collide. On the one hand, the Windows world, where the java.exe lives and on the other the bash of cygwin in which you are starting the command. In particular, when setting the classpath you need to pay attention to the…

  • Setting ls to reasonable colors in cygwin

    I often navigate folders in Windows explorer without using the mouse. This is quick, as you can jump to any file or folder by typing the first letters of the name and use backspace to go up one level. The speed is probably faster than what you achieve in a bash shell, where you complete…

  • Getting the number of dimensions of a multidimensional array in Java

    Based on my [permalink href=”4″]previous post[/permalink] about cloning multidimensional arrays, I have come up with a short static function to get the number of dimensions which a multidimensional array has. Note that this method only returns the number of dimensions of the original object passed as argument. It does not expand into the contained objects…

  • Cloning multidimensional arrays in Java

    In Java, calling the clone() method on an array returns a copy of the array, that is a new array containing references to the same objects as the source array. In particular, the objects themselves are not copied. As multidimensional arrays are just arrays of arrays, cloning a multidimensional array result in only the first…