Convert byte\[\] to long in Java

One more little thing that is painfully difficult to do in Java. (I love Java though ;) ) There are two ways of getting it done. a. Cryptic but sweet! bring on the bit manipulators! private long getLong(byte[] mbytes) { long lValue =0; for (int i : mbytes.length) { lValue = (lValue< <8) | (mbytes[i] & 0xff); } return lValue; } b. painfully slow and created a gazzillon objects (sooo typically Java)

Read More

The wonder that is php

PHP is an incredibly easy to use scripting language and yesterday I had my first meeting with it. Yeah, I know I support and fix some issues in wordpress, but that just requires programming knowledge, and not exactly great php exposure. But yesterday, I wrote a small tool to track some timesheet info, in php and the whole thing took about 1.5 hours to complete. Slick UI, storing and retreiving from DB et al!

Read More