Wednesday, December 26, 2007

2/3 of the 3M

These few hard weeks of thesis write up make me remember of those 3M thingy. The 3M stands for "Membaca, Menulis Mengira" -- " Reading, Writing and Calculating" is one of the concept implemented during my primary school. This concepts stressed on student's ability in Reading, Writing and Calculating. Yeah.. it seems now that I'm not very successful in the second M (Menulis - writing) especially on technical write up. My mind is just messed up and I'm start losing focus about 15 minutes after start writing.

My personality test also shown strong tendency to do research, calculation , programming , teaching but not anything related to writing and typing and clerical work.

However luckily I like diagram so much ... Mind-mapping, block diagram, flowcharts, to do list , fish-bone diagram etc.. has been a great help.

No time for regret.. just moving forward.

Maybe this weekend i should find suitable books for guidance. I think Technical Writing for Dummies will suit me well.

p.s Since I'm busy with thesis write-up and works, this blog will be updated depend on my mood and free time.

Friday, December 14, 2007

beginners tip for NS2 tcl scripting

Assuming that NS2 has been successfully installed.
Following guide will be helpful for those who are not familiar with NS2 :

  1. run "ns basic.tcl"and other simulation scripts example , especially the example that pop up NAM. It will be very encouraging to see the animation ^_^.
  2. Open the simulation script file using text editor. Just take a look. Especially at the syntax and common command. As example you will see set , [$ns node] , duplex-link , proc etc. Please also observe the structure. It should have some structure.
  3. To help understand the structure, refer to ns manual or tutorial. Just Google it. The Microsoft power point presentation files will be very very helpful.
  4. Study also on TCL .. instead of reading, use the tclsh or ns interpreter to test basic commands. Observe the syntax of the TCL especially on the substitution ($) , grouping [] , " " etc. Please return some errors during the testing.
  5. Look again at the basic.tcl.. now deeper understanding on the command will be achieved. How does this instruction operate : set n0 [$ns node] ?
  6. Write your own simulation script. Instead of writing it from scratch , edit existing file.
That's all.. This is what me and my friends (I'm still a beginner) did ... hopefully it will helps others too..

Monday, December 10, 2007

Debugging tcl/tk program (window platform)

I used to write tcl/tk program on Linux XandrOS platform , past few days, a lot of time has been spent on writing program on windows (tcl\tk is multi-platform anyway). My laptop screen is slowly failing, few vertical lines appeared one by one. Hence, I used the desktop monitor as an alternative. Unfortunately the Linux environment cannot be displayed by my monitor at home. Last choice : windows!

There are different feels programming in Windows and Linux.

In term of program debugging , using Linux is easier , the puts instruction can always be used to display the parameter of interest, or to check for the logic. puts "some string" will display the string at Linux console. However in windows (from my very little experience) , it cannot be done. It can be done actually .. by invoking the wish(wish is the interpreter for tk) and using source command to evaluate a tcl program. However the wish interpreter will be terminated as the application developed are closed. This never happen in Linux.
Another technique , without using interpreter interactive mode, is to run program by just clicking at the .tcl file. for debugging purpose , the tk_messageBox command can be used to pop up certain message instead of using puts command.

One good thing about windows is, the GUI for my application have better looks.

Friday, December 7, 2007

Flow chart is a powerful tool/technique

Have u ever stuck in programming? Most of the time I always do , when debugging own program , or worst case is to debug other's . Yeah.. syntax errors are easy to be identified, let the assembler/compiler/interpreter handle it! But the problem lies in what is called algorithm error or the logical error.
Sitting in front of the computer wasting time looking at the lengthy program while trying to figure out the flow of the program, refer to the flowchart! No flowchart? study the program to get a brief insight then create flowchart and start it over again. There is no point to troubleshoot a program that come without a logical graphical presentation.
Some genius people may think that flowchart is not important. "There is no need for flowchart! Everything is in my head", they may say. Its up to them , but consider this few following reason:

  1. Flowchart can be translated into any programming language
  2. Flowchart can be easily understood by other non-programming people
  3. A logically wrong flowchart cannot produce a well-working program
  4. There are few people who can all programming language
  5. Trouble shoot a program takes long time, trouble shoot a flowchart takes shorter time
  6. We can review the flowchart anywhere, but to debug a program we need a computer
Flowcharts can be a very powerful technique, followings are some tips:
  1. Start with a simple main flowchart to get an overall picture. Maybe without any if else structure or do while structure , just a plain sequence by sequence. Use suitable wordings for each block.
  2. Start zoom in every block/process and roughly estimate the complexity of the flowchart (or sub flowchart) for each block/process.
  3. Draw the flow chart for each process, start from the simplest one.
  4. Repeat step 2 and 3 if needed.
  5. Try to combine the flowchart altogether and analyze it ( maybe this step is not needed, but sometimes it helps)
For programming part
  1. Test all modules and main flow first, trace the flow by printing out some values in text files or in console if the debugging tools are not available.
  2. If all the modules work as expected combine it to follow the main flow. Else, recheck again the flowchart.
  3. Another tips is try replace each block/process with a two/three line of program before typing.

Te given technique are very powerful when dealing with low level language , however i believe that it can also be used for high level language.

NS2 installation

Today i want to write a little bit on NS2 installation .. not on how to install but focus more on problems occurred during installation. On installation guide please refer to NS2 website (the link are given in my favourite link). Take note that I'm using Linux Xandros 2.0 for the NS2. Given are the 3 common problem (Red) and possible solutions (Green):

Make fail because of no gcc compiler detected
Install the older version of gcc compiler ( Not sure with version of gcc? install all the version ! )

Error due tk not detected
Normally the TCL\TK will be installed using the allinone ns2 installation package, however in Xandros the installation of TCL\TK need to be done separately before the installation of NS2. Install the TCL\TK through Xandros Network then proceed with the installation of NS2.

The installation is successful but error: "ns command not found " occurred when invoking the ns interpreter.
Edit the .bash profile so that ns can be access from any folder. The .bash_profile is hidden in home directory. Restart the computer after the file has been edited and try to run ns again.

From experience the second problem will not be encountered if the NS allinone package are installed in Red Hat platform.

Wednesday, December 5, 2007

Talk by Sir Robin Saxby of ARM

Tun Mahathir Lecture Series

Attended Tun Mahathir Lecture Series at UNITEN, talk by Sir Robin Saxby on his success story of bringing his company to global level & beyond. His company is the one that promotes and design the ARM architecture - A microprocessor architecture used in PDA, hand phone etc.

Some key notes (that i can remember - not in the right order)
1. Sir Robin Saxby start as a Design Engineer.
2. The company is founded by 12 technically skillful engineers where the engineers later equipped with the soft skills to market the product.
3. Sir Robin Saxby uses SWOT analysis for planning
4. Academic, Business and Politics are very different in nature.
5. In business, pulling the customers are more important than pushing the technologies!
6. Family is very important.
7. Good engineers knows both software and hardware architecture well.
8. Think the impossible but get back to the reality
9. Sir Robin understands his fields very well , and aware of the technology growth.
10. Turn enemy into friends , and be neutral. (It's hard!!)

The talks are very motivating, thanks to the organizer (UNITEN n TNB ).

Tuesday, December 4, 2007

Electronic for (very) beginner

This morning.. my friends invite me for one or two hours of my weekend to teach some kids on electronics. Electronic for early beginners.. a good effort though n of course very interesting!

But after a thoughtful (?) 2 or 3 minutes , i decided not to commit .. too busy with my own works schedule. It will be started on january, if all my plans work according to schedule, then i can reconsider the offer. I just being careful.

Today , A PCB workshop has been conducted, the coordinator ask me to attend it.. Hm.. maybe I'll join later (at the end of the session) .