Pages

Wednesday, February 16, 2011

People Can Learn Facebook Easily But Not The Tool for programming

Everything is about perspective. Ever wonder that, people can easily learn the facebook easily by self learning. However, some people are scared to learn on how to use C++ software, a network simulator, an MPLAB IDE. Usually, this kind of software come together with help files and a lot of example. 

Maybe its because of passion to learn new thing. Its quite wasted if the same principle of learning facebook is not applied to other area. 

Monday, January 3, 2011

Using MPLAB IDE to draw Flowchart

One of the usual task given to me when I was an undergraduate student is to transform the program into a flowchart. According to my supervisor, the main reason for flowchart is so that other people can refer to the flowchart and make a program using other language. Also it makes non-technical people understand what we are doing.

The key to retrieve a flowchart from a given program is to recognize the flow and the pattern.

Okay, now let say we have a program written in assembly languange. This is how to get a rough idea of the program flow.
  1. To get the flow, trace the program step by step. Usually any simulator or IDE will show the next line to be executed. In microcontroller case, it represent program counter (PC). Trace it a few times until the tracing reach the end of the program.
  2. Try to map the flow with any IF.. ELSE , WHILE..DO , DO..WHILE structure. Usually a program will be in the combination of the program structure. In this case take the outer loop first.
  3. To see the process and result, try to monitor any variable,memory location and register used in the program.
  4. Try to interpret the program block by block instead of line by line during tracing.
  5. Draw your flowchart based on your understanding of the program.
When we are drawing a flowchart try to be as human as possible. Use short word , or you can use mathematical equation.

I think that's all about drawing flowchart.

Monday, October 12, 2009

Some clarification

In this blog I share some knowledge on programming and electronic matter. It is just I love to share with others on my so limited knowledge. I am in no way an expert in what I'm sharing about.The knowledge which is shared in this blog can be beneficial for some people and can be "rubbish" for some other people.

I have received a a lot of questions in some post here. Some question can be very basic, some questions cannot be answered by me myself. Regardless of the questions level, I am in no way obligated to answer any of the questions.

The commenting system used here is for discussion purpose.

Thank You!

Friday, March 27, 2009

Building Data Structure : An experience

I'm not from IT/Computer Science background but from Electrical background,(to be precise Mechatronic) , my knowledge on high level programming language is not very strong. Especially on data structure.


Thursday, March 12, 2009

Converting algorithm into coding [Random Thought]

One of the challenge in programming, is to translate an algorithm into a coding. from my observation algorithm can be divided into three categories:

  1. Logical
  2. Mathematical
  3. Combination of mathematical and logical.

Wednesday, February 11, 2009

AWK Programming Language [revisit]

I'm now revisiting AWK language for trace file processing. Awk has been widely used for trace file processing, since (I believe) it is easy to do column filtering.

The column can be represented using $1 for column 1, $2 for column 2 etc.. , using other language like Tcl requires list manipulation which is not as straight as using AWK.

However, of course, the syntax of AWK is a little bit different than Tcl and C.

I will be "reusing" AWK to calculate throughput , loss , jitter etc. There are quite a few AWK codes available in the net for this purpose, however I want to make the code as flexible as possible and cater for our group needs.

First, I will be looking back at RFC's and papers on the network performance formula.Then, get available AWKs from the net (to enhance understanding) and modify the code to suit our need.

Our new research assistant maybe can help me working on this??

Performance of AWK?? Hrmm... anybody have experience using AWKs? How is the speed compared to C and Tcl (or MATLAB?)

I will not focus on performance for now , I believe it is acceptable, for now the main factor is whether it make my work easier or not.

"Live life in this modern world is complex enough! Programming Work Shouldn't Be "

Wednesday, February 4, 2009

Random Thought: Flow chart! Write it down!

I have been conducting microcontroller lab for a while as a lab instructor.
Microcontroller consists of both Hardware and Software. A microcontroller application need to read to read data from input , process it and make decision, then send data to the output based on the decision. Seems easy right? This is not what I want to write this time.

In a lab usually students are given a manual where in the manual the first part, the program is given and in the last part, student need to write their own program for certain application.

Believe it or not! Most of them "drawing flowchart in their mind" and getting confused of the program flow. Most of the time is wasted here, some takes about one hour for a program with simple if-else structure. Sometimes I wonder, Is it that hard to hold a pen and sketch it down? Or is it because they have full confidence of their capabilities. At the end what they do is asking the lab instructor to help trouble shooting the code! Some of them (not all - just a few) blaming the computers/compiler or even the microcontroller for not working.

I don't know about others, but me myself, without sketching and flowcharting, I will get lost in the flow, my minds keep being creative to do this and that, and its getting tired easily. I need a flowchart or diagram! if during that time I am tired of looking at the flowchart, I'll write the "story line", I dont want to get lost!

If the path is straight there is no need to go left or to go right, just go forward!

Enough for today, I want to start writing TCL program based on the diagram and result of discussion with taufiq last night.

Wish me luck and success!

Tuesday, February 3, 2009

Random Thought : Programming

Hey you!! do this and do that!

I don't know whether it is correct or not , I'm not a programming expert.

As far as I made to understand, doing programming is all about giving instruction to the target machine to do "this" and "that". The machine will always obey the instruction provided that the command can be understood by the machine?

Machine only understand binary !

The problem is how we are gonna give instruction, "binary" is not our language. Furthermore "Binary language" is differs depends on each machine architecture, the instruction for Motorola and the instruction for Intel , of course will be different.

Tadaaa... Programming Language is here!! Please, use it!! Instruct the machine. Fear not, your instruction will be converted to their "binary language". Just make sure that you know the language well - the format, the instruction and the "grammar".

Please choose a few type of language from lower level language to higher level language, once again worry not , there are assembler, compiler, and interpreter to convert the language into the "binary language".

Ok, there are programming language. The machine will always obeys ( if there are no errors in the language )

It is about the programmer!


The machine will always obey! If the application work, it is me who give instructions to the machine. If my application crash it is my fault and I'm responsible to rephrase it. Simple!

If I'm good the machine will show me the good result! If I'm not good enough, the result will not be good!

I should spent time programming (re-programming?) myself, I wish I can obey my command. 90% is more than enough! Shouldn't I?

Thursday, January 22, 2009

One problem Solved - Deleting item in a TCL list

Last night, I get the solution for deleting tcl list item. Actually this solution can be found in tcl manual. It is my mistake for take things easy and misunderstood the behaviour of lreplace command.

Deleting a list item in a tcl list is actually straight forward. But of course quite confusing.

Originally my procedure to delete list item is like this ( not the right one - of course):

proc ldelete { list item} {

# get the index,ix for item in tcl list
set ix [lsearch -exact $list $item]
#ix is greater then zero if the item is in the lsit
if {$ix>=0} {
# replace the item at index ix until index ix with nothing (aka - delete the item)
lreplace $list $ix $ix
else {
return $list

}
}



At around 11.00 pm last night i found out that the error is actually at the command:
"lreplace $list $ix $ix"
The command delete list item at index ix and returns the modified list but without updating it.


So the solution is simply like this.

set list [lreplace $list $ix $ix]

I'm very happy today! More programming !A lot to learn!

BTW, Thanks taufiq for helping me transferring the computers from IP-tech lab to WSN lab.

Wednesday, January 21, 2009

A slow restart

Starting yesterday I start doing serious programming again! But what a very slow restart. Most of my time was spent on looking at my previous coding. And trying to re-understand it!

Its have some bug which I'm trying to solving. Trouble-shooting works take a lot of time. I got a feeling that I can solve it. Let see In this 2, 3 days, can I do it or not!


If given a buggy program which one is your choice?
1. Trouble shoot the program.
2. Get brief idea of what the program intend to do, and write own program.

Make your choice and tell me why.

BTW, TQ sifu taufiq for helping me last night.

Tuesday, January 20, 2009

Start Programming Again!!

My busy schedule hindered me from serious coding for last three months! And now I'm pushing myself to sit in front of my HP Pavilion laptop.

I'm accompanied by:

1. A cup of coffee ( Thanks Abe Su for the 3 in 1 coffee)
2. TCL\TK books - Practical Programming in TCL\TK for my reference
3. Logbook - contains my thought and ideas
4. Used or "conteng-conteng" paper and a pen to layout my thought and ideas
5. My U-Mobile Broadband connection for internet connectivity

Keep looking forward!!

Monday, December 1, 2008

No Blog Post = Busy

Other part of me asking,

"when you re going to update your blog?"

my other self answered,

"I have no mood to write, I am busy with something else"

Another question,

"Why don't you put a poll?"

Simple.

"I have nothing to ask, let me finish my other works"

Then,

"you will always be busy"

The answer,

"Most likely , yes, but there will be time where I wont be busy. "

Another questions come.

"A not updated blog? Why must you write it at first place?"

A long answer.

"I don't need a reason for that. I can write when I want to write. If it is beneficial for me and others, why not? If it does not give any help to others, at least I'm helping myself"

Another bad thought

"Beneficial?? What benefit?? The content is not that superb. Did it ever help anyone?"

Answer.

"Believe me, at least we get the benefit, don't you agree - take an example, the feeling when we are writing the entries! A good feeling, Right?"

.........


Conclusion:
It is definite! Having a blog is good! Writing in a blog is good! Sharing Knowledge is good! Not updating Blog is not very good! The feeling when writing the entries?
A lot of "good" compared to "not very good". To my bad inner self :

GO AWAY!!!

p/s: dear visitors. This blogger is busy with a lot of things so the blog will be updated in a random , without specific time line. Depends a lot on blogger's mood. Sometimes it will be frequently updated, sometimes it will be left not updated for a long time.

Thursday, September 18, 2008

Robogamez 2008 - The photo as promised

Here are some pictures I manage to snap before the Robogamez starts. During the competition, my NOKIA are out of battery







The Banner Located in front of DSS (Dewan Sri Sarjana)








The unsolved paths aka maze for school Category, Looks simple, please note that all the four maze are identical or mirrored image. The winner of each round is the one whose robot can enter the maze and able to go out from the maze. can you see the entry and the exit door?











This one is more tricky right? .. this is for UNITEN category.. more complex , meaning the maze robor should be more intelligent..











No picture for OPEN Category.. at time this photo was taken, the maze for open category is not up yet... Ohh.. given below is one of the robot.. Personally I like this robot.




Why I like this robot?
  1. The height - It is lowered .. the robot is stable.
  2. There are 2 type of sensors used - 3 infrared sensor (can detect the junction) and 2 mechanical switch, to detect whether the robot accidentally touch the wall.
  3. There are two tires.. I guess the owner of this robot used differential drive technique.
The hardware part I think is more than enough .. It is up to the algorithm part!

Oh BTW, before the tournament one of the participant asking me , why his robot is not working.. (he use distance sensor). This is some of the tip I gave him (me giving tips?? - I didn't even have a mobile robot) :

  1. Whether it is maze robot or line follower robot, the basic concept is simple, the robot designed should be able to recognize its location, "where I am now?" - it is at the straight path? junction? End of the maze? , and then take action based on the location. Whether to go forward, left , right or backward, etc.
  2. Since the robot is equipped with the distance sensor which is based on infrared, the sensor must be calibrated according to the surrounding...
  3. The last tip - Good Luck and don't give up!!
Alright that's all - still feel a little bit regret for missing to watch the open category.. :-(

Friday, September 12, 2008

Robogamez 2008 - Missed the Open Category

Last Saturday, I missed to watch Robogamez 2008, just managed to see UNITEN category on Friday .. My friend told me that it was quite happening gamez.. quite a shock when UTM doesnt get even third place.. UTM (Universiti Teknologi Malaysia) team was quite strong in last previous years ! UPM (Universiti Putra Malaysia) emerged as the winner!!

Ohh. Sorry for not mentioning.. The ROBOGAMEZ is actually an annual event organized by UNITEN Mobile Robot Club . The tournament usually divided into three category , Open Category which are open to Universities and Higher Learning Institution in Malaysia, the School category, and the UNITEN category exclusively for UNITEN student.

The theme for this year is " Challenge of Unsolved Path " - Maze Solver Robot. (Last year - Line follower robot) . I dont intend to explain more about the event. Please visit www.robogamez.com for further information. The www.robogamez.com also include Support and Workshop , have a visit, you will find out that building a mobile robot is quite easy!

Congratulations to the Mobile Robot Club UNITEN and the "never-tired" staff to make the event successful.

I heard that for ROBOGAMEZ 2009 , the theme will be "Fighting Robot" - Is it boxing? Sumo? Hopefully I won't miss the event again!

I have a picture showing the maze , and a robot designed by UNITEN student, it is in my NOKIA phone.. I'll upload later!

Sunday, August 31, 2008

So Much Thing to Write

It is about two (or more ) months I didn't wrote in this blog..

There are many interesting event occurred , there are few comments in my blog still left not responded. Never expected to be like this when i first started to blog.

In blogging, sometimes I'm too concerned on layout-ing the blog until I forgot to write. The time just pass by like that.

To name a few things that at first I plan to write during last two months, but it unfortunately left in my sketch books or maybe in my head!

  1. Dr Bob Bishop Lecture : May 2008 in Uniten [link]
  2. Extracting information from trace file
  3. NCTT-MCP which successfully concluded last week [link]
  4. Introducing Taufiq's blog [link]
  5. The disadvantages of being a skeptics, and my logical approach/thinking/action in order to overcome some of the skepticism inside me.
  6. Robogamez 2008 which will be held in September 2008 @ Uniten [link]
  7. "Fizz Buzz" puzzle and how to write a program
  8. RS485 and RS232 serial communication
  9. Some cool blogger tools/gadget
Hahaha.. ! there are so much I planned to write but at last..... sigh..

BTW, taufiq.. your blog is is now in my blog roll..

Tuesday, June 3, 2008

Blog Update - Rate My Post Widget

I've added a rating widget into my blog. Got it from www.outbrain.com
You can give rating to my posts from 1 up to 5 stars.
The widget also quite cool. Have one for your blog.





Reduce the Picture File size using Microsoft Power Point

This is a tip given by my friend on how to make picture size smaller using power point. The steps are very easy.

  • Open Microsoft Power Point
  • Select layout that enable you to insert picture



  • load the picture through the insert picture symbol (bottom left)
  • Right Click at loaded picture then save it in new file.
Have a try!!

Thursday, May 29, 2008

Blog Update

There are recently two main Update for this blog

1. The Recent Comment section
2. Added Link to NS2 Manual in Favourite section

BTW, since I'm using firefox, I'm sorry if the display is not very good for other browser.

Tuesday, May 20, 2008

ITEX 08 Pictures

I'm posting some of the picture now, supposed to be last week , but the size of the picture file are too big make me tired waiting for the upload process. Now , the file size are smaller (Thanks to Microsoft Power Point), so the followings are some pictures of ITEX 08:



















KLCC - Kuala Lumpur City Centre (Right)
KLCC - Kuala Lumpur Convention Centre (Left)
Picture are taken from the same point.



UNITEN


















The allignemnet of the pictures is not very good, I can post only these or it will be very messy.

Tuesday, May 13, 2008

ITEX 08@ KLCC

ITEX 08

Last weekend, a team under our Network Technologies Research Group participated in ITEX 08 at KLCC. Not the twin tower but Kuala Lumpur Convention Center which also located very close to the KLCC Twin Tower. UNITEN sent 12 team (including us). ITEX is organized by MINDS.




In this exhibition, various product and findings of the Malaysian Higher Learning Institutions, Research Institute, Individual Researchers/Innovators and Industry sections had been showed off to public. This is one of the platform to create a link between industry and researchers.
This years Taiwan and Iran also participated in this event. In conjunction with ITEX, Malaysia Young Inventors Challenge (MYIC) also held at the same hall.

Awards

The inventions are evaluated by judges and were awarded either Gold, Silver, Bronze or No medal at all. There are also special awards given (which I don't remember).
UNITEN teams score 100% where all team get the medal , and one of the team awarded special award on ICT. UNITEN awarded 5 Golds, 5 Silvers and 6 Bronzes this year. AS for my team we got Silver Medal.


Not connected to Internet

My U mobile modem failed to detect any signal in the exhibition hall, and able to received a little signal outside the hall. At first I planned to blog there, but the signal are not strong enough.
However good news is the U mobile now covers other cities in Malaysia (it is not updated yet in their web). Hopefully they consider to also cover the remote areas.


Old friends

In this kind of exhibition, one of the best things is when I met with my old friends. This time I met four of my friends during my undergraduate studies at UTM (1998 - 2002).

Fadil (UTHM) won a Gold Medal
Herman (UTeM) also get a Gold
Zacko (UTeM) awarded a Bronze Medal

There are a lot of things to chit-chat about but unfortunately there are too little time.


I will upload some pictures

My digital camera is not with me right now, I'm going to upload some pictures during the exhibition. However the inventions will not be uploaded since some of the inventions are still in the patent search or copyright. I have to respect the innovators hard work and ideas.