Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Resizing Hard Disk of Guest Machine in Virtualbox

Suppose you have virtual hard disk in VirtualBox called xp.vdi, you can resize it (megabytes) using the following command.

VBoxManage modifyhd xp.vdi --resize 40960

The command currently doesn't support vmdk virtual disk. So if you have a virtual disk called xp.vmdk, you have to first convert it …

Build a Fat JAR Using Maven Without a Java Project

You can use Maven to download dependencies of Java packages without creating a Java project. For example, if you want to download all dependencies of arrow-jvm and arrow-memory and build everything into a single fat jar (for easy use in other places), you can first crate a file pom.xml …

The list Collection in Python

Tips and Traps

  1. list is essentially a resizable array of objects in Python.

  2. Almosts all methods of list are in-place.

  3. list.pop is inplace and returns the removed element.

  4. To get unique elements in a list, you can first coerce the list to a set and then convert the set back to a list.

     unique_list = list(set(alist))