Sunday, September 27, 2009

[NS2] Deterministic v.s. Random

Deterministic Setting

By default, NS2 runs deterministic simulation. That is, you will get the same result for every run. The deterministic setting is usually good for debugging, where you would like to know what goes wrong at an exact point.

Random Setting

Statistical analysis involves running simulation for several times and find averages/variance for all the runs. NS2 is deterministic by default. The results from every run with default setting are the same, and the variance of the results is therefore zero. Statistical analysis require randomness so that the avarages and variances would be meaningful.

In order to introduce a randomness to NS2, you will need to insert the following line into the Tcl Simulation script prior to "$ns run":

$defaultRNG seed n

where is an integer. If n is zero, the simulation would be totally random. The result would be different for every run. If n is another integer, NS2 will use n as a seed for random number generator.


By default, NS2 sets n to "1". Therefore, every run generate the same result. If you set n to 101, by executing

$default seed 101

the result would be different from the result corresponding to the default setting. But all the result with n = 101 would still be the same.

For more information about Random Number Generators, see Chapter 12 in the following book from Springer:

T. Issaraiyakul and E. Hossain, "Introduction to Network Simulator
NS2", Springer 2008.
http://www.springer.com/engineering/signals/book/978-0-387-71759-3

You may also find the following website useful:
http://www.ece.ubc.ca/~teerawat/NS2.htm

Saturday, September 19, 2009

iTune 9.0 and the missing podcasts

Can't find the content? Perhaps You are in the wrong country.

Do you know that iTune stores are different from countries to countries. If you are in an unfortunate country (e.g., Russia, Thailand). The content in the iTune store you see is quite limited. See below for example,



I am one of an unfortunate man, since the contents I like are mostly in the US. A fresh installation of iTune 9.0 does not allow me to see a wide variety of contents. On the other hand, people who install iTune 9.0 on a some country can access a lot more contents such as music, movies, podcasts, and so on. Look below for a screenshot for iTune stores in the US.


Unfortunately, my favorite podcasts (e.g., Security now, Businessweek, the world) are not available in some countries (including mine). By default, I cannot access the content I like.

Still want the content? Let's get around.

In order to browse, search, or download podcasts, I need to fool iTune that I am not at the place where I am (e.g, not in Russia or Thailand). iTune does not make that easy for the users. But I get aound it and here is how.

  1. Go to iTune store
  2. Click "Sign In" (see the picture above)
  3. Click "Create New Account"
  4. Click "Continue"
  5. Click on the arrow after "If the billing address of your payment information is not in the United STates, click here"
  6. Now you can change your iTune store to your favourite country, by choosing at "Select a country" and click "Change Country"
And now, you should be able to see the content as people in the US see. I wish Apple would make this process easier. If any of you know an easier way to do this, please let me know. I am curious to know how.

Thursday, September 17, 2009

Crimson editor and Window Vista

CRIMSON EDITORS:

Crimson Editor is my favorite text editor. It is a free lightweight text editor (only 1.2 MB), and has several useful feature. The ones that I use the most are
  1. Syntax highlighting
  2. Built-in and user-defined spell-checker
  3. User tools and macros: This is very cool. You can define any shortcut (e.g., Ctrl+1) in order to run any executable file on your system with various types of input argument (e.g., file title, filename (title + extension).
I am a LaTeX user. The above three functionalities are all I need to write LaTeX documents.

Here is the link to the editor.

http://www.crimsoneditor.com/

PROBLEM WITH WINDOWS VISTA:

Unfortunately, UAC (User Account Control) of Windows Vista prevents the editor from using all its functionalities. For Crimson editor version 7, I cannot save the configuration of "User Tools". Once the editor is closed, the configuration is lost. When the editor is reopened, I have to reenter all the configuration for user tools.

To get around this problem, you have to right click on the Crimson Editor icon and click on "Run as administrator". By doing that, the configuration will be saved upon the exiting program.