Jul 12, 2012

Ubuntu 11.04 bug - Update Manager


When I logged in my Ubuntu, update manager window was popped up to ask for update. I clicked "Install Updates" button, but this time it said "waiting for apt-get to exit..." and then the window was dead. I closed all the other applications including firefox, terminal and editor, but the problem was not solved.

So I posted a bug report to the website. Someone suggested to restart virtual machine in order to solve it. Then I tried it. I did not know why my Ubuntu got this problem but this solution did work.

Good luck, Ubuntu!

Jun 2, 2012

Compile java files in all subfolders


On Windows...

Firstly create a batch file as complie.bat. Write these lines in that

for /r %%a in (*.java) do ( javac "%%a" )

now execute.

On Linux....

javac $(find ./rootdir/* | grep .java)

Apr 3, 2012

How to program nodes movement using FOR loop in NS2


In fact, we know how to set the nodes` movement in NS2, it could be < $ns at TIME "$NODE1 setdest $val(X1) $val(Y1) SPEED" >. However, for some scenario, it may contain a large number of nodes` movement and simulation time could be one or several hours. It is impossible to program in this static way.

So we consider using a FOR loop. Here is an example where a node is moving up and down. The simulation time can be any value and we just need five lines program. The program is like the following,


for {set i 1} {$i < ($val(stop))} {set i [expr {$i + 10}]} {


$ns at $i "$node_(1) setdest $val(X1) $val(Y1) NodeSpeed"


set i [expr {$i + 10}]


$ns at $i "$node_(1) setdest $val(X2) $val(Y2) NodeSpeed"


}

Mar 7, 2012

Extend hard disc space for VMware in Mac OS


It is a common problem that the system space in the virtual machine is not enough we allocated before. We may need to extend its size after the system installation. So here is the way.

1) Open VMware Fusion and choose your virtual machine from the "Virtual Machine Library" list. Choose "Settings" from the "Virtual Machine" menu and select "Hard Disks."

2) Adjust the size of your hard disk by using the slider. Click "Apply" when finished.

If you have a Windows 7 or Vista virtual machine,

3) Start your virtual machine and log in as an administrator. Click "Start" and select "Control Panel." Click "System and Security" and then "Administrative Tools." Double-click the "Computer Management" option and click "Disk Management" on the left pane of the window that appears. Right-click on your virtual machine's volume and choose "Extend Volume." Click "Next" twice and then "Finish.