Computer Scientist

Wednesday, 18 August 2010

Shell Script

When I was using Bash Shell script to extract the available free space in the hard driver, there are several things that are worth to be noticed.

1. The importance to declare variables.

There is a segment fault when I was trying to invoke the C program from the script if the arguments that are forwarded to the C program is not declared at the beginning of the script. Next step should be to make clear what is the meaning of the parameters when the declaration was made. Those are called "variable attributes" (Burth, 73)

--------------------------------------------------------------------------------------------------
Just found that the arguments can only be declared to be read-only......

       If I did not use the declaration, there will be a segment fault. However, today I confirm that if I lost a argument of shell script such as the path of the experiment it will also lead to a segment fault!


--------------------------------------------------------------------------------------------------
I just found the main problem within this issue. The structure has problem:

df | while read content
    do
        echo ${content}
        temp=${content}
   done

echo ${content}
echo ${temp}

The situation is the same with the following snippet of code:

df | read content

echo ${content}

It can not  read anything after "df".

Tuesday, 10 August 2010

C++ Programming Tips...

Converting from a String to a integer can be achieved by a build-in function atoi() which can be found from the manual page. However the conversion from a integer to a String can not follow the similar method due to the itoa() function  is not a build-in function. It is a compiler dependent method. In C++, there is a handy method:

#include

int number;

std::ostringstream sin;
sin << number;
std::string aString= sin.str();

char* c_type_string = aString.c_str();

Friday, 16 July 2010

Agenda For the Meeting on 16th, July and Tasks to complete

I am a little behind the progress. At this time, what I should consider is what I have found from the graphs or the charts and how to defineto explain them, instead of what I know about a specific system.

There are mainly two parts of the tasks to complete:

1. (To be complete by next Wednesday or Thursday) The results and clear descriptions of the Experiment of Chord.

2. (To be complete by 11th of Aug, when Nick is coming back)

- Technical differences between Kademlia and Coral:
    Why Coral is used in small files sharing?
    Why Kademlia is used in big files sharing?

- Two methods to prove what I will find:
    Literatures of both these two methods
    Experiments on both these two methods?
      Experiments on a range of file sizes to compare the differences between these two methods.

- How to define and then to measure the closeness?

- How effectively the location of peers affect the performance of the system?


When we talking about the Experiments, there are something should be concerned:

- Closeness number of hops
- Latency - routing latency
                - file transfer latency (bandwidth, hidden conjunction problems two users who request resources are allocated into two different download networks with two different environments, one is conjuncted and one is not that busy)

- Distances (Real-distance/Political distance and topological distance) Is there relation between these distance and two previous notations? Find it out!!

- Load on each nodes (download loads, upload loads, forwarding loads and so on.)

- Routing table information stored in each node.

- Capability of each node and how to measure each node's system consumption for a system's running.

- Mobility, the distribution issue in a mesh network constructed with mobiles. Mobiles are movable and how to distribute the news to each of them is the central issue. For example, Madonna's new songs are released and how to forward these songs to each of her fans. 

Wednesday, 30 June 2010

After a long time confuse and break, I am back and ready for working enthusiastically

It is very important for now to make sure some special usages of C++ programming philosophy and its library staff.

First of all is the usage of size_t, why did not they use the int or long to represents the number instead of using size_t. I believe it is explained well in article of :


and 


very useful articles.

Thursday, 20 May 2010

Experiment with Chord

Today's works should be:

    1. How to hack the Chord code.
    2. Reading targets: 
         <1>. PC++, P87-P103 and P371-P390
         <2>. The Chinese version of Chord structure's explain.
         <3>. Two usage aspects of the Chord-like dht.
    3. Do some little initial experiments if possible.

Wednesday, 19 May 2010

How to check the open ports in Linux

Two articles on the Internet are found:

http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/security-guide/s1-server-ports.html

http://www.cyberciti.biz/faq/how-do-i-find-out-what-ports-are-listeningopen-on-my-linuxfreebsd-server/

Thursday, 13 May 2010

Hard working on Compilation

How to extract tar file in Linux with additional appendix.

tar -jxvf ***.tar.bz2

tar -zxvf ***.tar.gz

Today, I have to change my work to Fedora Linux due to the stuck on my Mac.

Firstly, I am using gmp 4.3.2 instead of 5.0.1.

Secondly, I am going to install sfslite. Let's try 0.8.17 firstly. and then 1.0.0.
    0.8.17 still does not work like the situation in my Mac.