I am a Postdoctoral Research Fellow with The SUTD-MIT International Design Centre (IDC), Singapore University of Technology and Design (SUTD). My research topic is about protocol and algorithm design, resource allocation and localisation in wireless sensor network, UAV network and Ad Hoc network. I also enjoy the mobile programming (Android and Objective-C) and web server development. Thanks for sharing.
Jan 29, 2013
Compile threshold.cc in NS2
In ns2, if you want to calculate the receiving power threshold of a node, you may want to use threshold tool which has been integrated in ns2 source code.
I don`t know why the threshold.cc is not compiled in the new version of ns2 like ns-allinone-2.35. So we have to do it by ourselves. In ubuntu, if you try to do "gcc threshold.cc", you will get an error message of "<iostream.h>".
So, we replace this line "#include<iostream.h>" by
#include<iostream>
#include<cstring>
using namespace std;
Then, compile it with g++,
g++ threshold.cc -o threshold
Jan 15, 2013
Generate random number in old version Matlab
If you want to have different a sequence of random numbers when the program is run for multiple times, a seed has to be set. The function "rand('state', int)" can not do it.
The old version Matlab which is lower than v7.7 has no some common random number generators. You can not use RandStream or rng() to set the random seeds. So I use an extended random number generator which can be downloaded from http://people.sc.fsu.edu/~jburkardt/m_src/asa183/asa183.html (r8_random.m).
s1 = mod ( 171 * s1, 30269 );
s2 = mod ( 172 * s2, 30307 );
s3 = mod ( 170 * s3, 30323 );
r = mod ( s1 / 30269.0 ...
+ s2 / 30307.0 ...
+ s3 / 30323.0, 1.0 );
return
We just need to set different seed s1,s2,s3 at the beginning of your program each time when you run it and it will generate different random sequences.
Dec 15, 2012
E: Internal Error, No file name for libssl1.0.0
The problem of libssl1.0.0 in Ubuntu 12.04 is "E: Internal Error, No file name for libssl1.0.0". So we can type:
sudo apt-get update
sudo apt-get clean
sudo apt-get install -fy
sudo dpkg -i /var/cache/apt/archives/*.deb
sudo dpkg --configure -a
sudo apt-get install -fy
sudo apt-get dist-upgrade
This method could solve the problem.
Nov 25, 2012
Ubuntu login from GUI and command line
Switch to command prompt: Ctrl + F1
Switch to GUI: Ctrl + F7
Command line to start GUI: sudo lightdm
Nov 11, 2012
Programming on Tinyos
Installation (a simple way)
1) deb http://tinyos.stanford.edu/tinyos/dists/ubuntu natty main
2) sudo apt-get update
3) sudo apt-get install tinyos
4) sudo apt-get install tinyos-2.1.1
5) Add the following line to your ~/.bashrc or ~/.profile file in your home directory to set up the environment for TinyOS development at login
#Sourcing the tinyos environment variable setup script
source /opt/tinyos-2.1.1/tinyos.sh
Subscribe to:
Posts (Atom)