Mittwoch, 7. November 2012

Rounding Integer in Javascript

There are a few options available when it comes to rounding a positive Integer value down in javascript.

  1. Math.floor()
  2. ~~
  3. >> 0


The third option is at least in Firefox a huge performance gain, you may check for yourself, have a look at this  JSPERF .

Dienstag, 6. November 2012

Resize Virtualbox Hard Drive

As I installed Virtualbox i created a harddisk with a dynamic size because I thought it would expand if it's full, well it didn't.

I found a usefull programm in the Virtualbox Forums which clones and resizes Virtualbox Harddisks.


after that you have to resize your partition in your VM.

go to http://gparted.sourceforge.net/download.php and download the GParted live CD.

boot from the GParted live CD and click GParted which will bring up a GUI which allows you to see your partitions.

now expand your swap partition to use up the free space and move it to the end of the partition, after that you can expand your root parition to use up the new space of your harddisk, et voila, reboot and you are done.