06/09/08 Hey, Something all of you experienced is that some CHM Help Files don't seem to work correctly sometimes. You do see the Table of Contents of the help file, but the content window just tells you "Page cannot be displayed". If you use Network storage, like at work, at school or even at home with the new network storage devices then I know what to tell you, simply don't use it to store your CHM ebooks. It seems that when a CHM file is opened from a network location then it cannot be read. If you copy it to your local hard drive and try to open it, you will see that it works fine. While this tip is short and simple it might save you a lot of headache. It can also save you 10 years of your life if you don't have the frustration to figure out why all damn CHM files don't seem to work on your machine Hope this helps you out, Cheers, 03/05/08 Hi, So you have been driving yourself crazy looking over the Internet on how to do those bloody conversions from a doubleto a byte[] array using << or <<< and god knows what else in Java? Well you have come to the right place. This function takes a double as argument and converts it to an 8-Byte array in Big Endian format. Alternatively, you can use the Little Endian format by uncommenting the 2nd line. For more information on Endianess you can check http://en.wikipedia.org/wiki/Endianness public static byte[] doubleToByteArray(double valToConv) { ByteBuffer bb = ByteBuffer.allocate(8); //bb.order(ByteOrder.LITTLE_ENDIAN); bb.putDouble(valToConv); bb.flip(); byte[] bbb= new byte[8]; bb.get(bbb, 0, 8); return bbb; } This method takes an 8-Byte Array in Big Endian and transforms it back to a Double. public static double byteArrayToDouble(byte[] arrayToConv) { ByteBuffer bb = ByteBuffer.allocate(byteArrayToConv.length); //bb.order(ByteOrder.LITTLE_ENDIAN); bb.put(byteArrayToConv); bb.flip(); return bb.getDouble(); } As a final note, if you look at the Java API you will find many more methods in the ByteBuffer Class to handle conversions to Byte Arrays, like from Int, Long, etc... Enjoy, 03/04/08 Have you wondered: Why does Java hate us so much? Why do they not allow us to do a Well maybe this little "workaround" can help you in your tasks. In 1.5, Java introduced a new type called public enum MyEnum { SUNNY, RAINY, } Once you have this, you can simply do a switch. switch(MyEnum.valueOf(myString)) { case SUNNY: // The Weather is good break; case RAINY: // The Weather sucks break; default: // No Weather Info break; } So here you go. Cheers, 02/27/08 If you are a web developer, you usually want to create nice looking menus. Until know, you did this using JavaScript. The Scripts are usually heavy, use up alot of ressources and are not easily portable. Also, if you disable JS on your machine, the website doesn't work anymore. While looking how to create drop-down menus, I came across this awesome FREE CSS Menu Builder. In a couple of minutes you can create your fully featured multi-level pure CSS Menu, where you can define anything from the Offsets, the Colors and many other things. It is definitely worth a look !! http://www.cssplay.co.uk/menus/menu_builder_flyout.html ![]() Enjoy !! 02/26/08 What happens when you insall JVM 1.5 and 1.6? or 1.4 and 1.5? Java sets a JAVA_HOME environmental variable in your system, but what if you don't want the "active" JVM to always be the latest installed? Well, you will find the solution here ! First of all, let me explain to you what seems to happen in the latest version of the Java Installer. It seems that, Java is also installing itself into the The reason is simple. This what part of your PATH environmental variable could look like. The problem with this is that Windows searches through all the pathes for a java.exe until it finds one. And it stops at the first it finds. You already see the problem? Regardless of what you put in JAVA_HOME, Windows will ALWAYS stop looking for a java.exe file right after If however, you put
From now on, you can just switch the active JVM's by simply changing the JAVA_HOME env variable !! Leave your comments and thoughts please. Cheers, |