After I have moved from BTM Layout to RT Nagar, I was a sort of handicapped because of lack of Internet at home. I used Airtel broadband when I was at BTM Layout. When I tried to transfer my Airtel broadband to my new home, I found that Airtel doesn’t have copper in RT Nagar. So, I had to opt for another ISP. The only two possible options that I had here was Sify and BSNL. Sify provides Internet service through optical fiber backbone and twisted pair cables in the last mile access. I have already used Sify when I was in Chennai. I was never happy with their quality and service. BSNL uses ADSL. Lately, I started hearing very good feedback on BSNL service. I have applied for BSNL. But it was a long wait. I got my broadband connection a couple of days back. It was almost 6 months since I have applied for it. The indicative speed of my plan is 256 kbps to 2 Mbps. During day time, I get close to 256 kbps. In the night, I am getting around 1.5+ Mbps.
praveen@aphrodite:~$ axel -a -n 32 http://feeds.gigavox.com/~r/gigavox/channel/osc/~5/57358285/OSC.OSCON-AlexMartelli-2006.07.28.mp3
Initializing download: http://feeds.gigavox.com/~r/gigavox/channel/osc/~5/57358285/OSC.OSCON-AlexMartelli-2006.07.28.mp3
File size: 26022272 bytes
Opening output file OSC.OSCON-AlexMartelli-2006.07.28.mp3
Starting download
...
Downloaded 24.8 megabytes in 2:21 seconds. (180.10 KB/s)
One thing that I should look for is the 2.5 GB cap of monthly bandwidth. I can enjoy unlimited downloads/uploads during 2 am to 8 am IST. But INR. 500 per month for this plan is really cheap, I would say. BSNL has certainly revolutionized the Internet service in India. So, finally I have converted my home a cyberhome via BSNL.
Assume that you have done an accidental commit of a wrong version into the svn repository and wondering how to revert that commit, this tip is for you.
Let us take a case where one has committed a revision 543 of a file something.cc to the trunk and he discovers that the commit is an invalid one and he wants to revert to the revision 542. For most of the novice svn users, the command is not quite obvious. One should use svn merge to achieve this.
$ svn merge -r 543:542 http://your-svn-server/your-repository/trunk
U something.cc
$ svn stat
M something.cc
$ svn diff
...
# Verify if the change is reverted
...
$ svn commit -m "Undoing the wrong commit in revision 543"
Sending something.cc
Transmitting file data .
Committed revision 545.
Please note that you should use the svn URI in the svn merge instead of using your local path for that file. It also should be noted that the revision 543 would still live in the repository. You can’t make it to disappear as svn is designed not to lose any data. But the trunk is free of the buggy commit. It is not possible to achieve this using any other way like updating to the required revision and trying to commit it.
A dual monitor setup is supposed to increase the productivity of a person. I wanted to go for dual monitor setup on my Toshiba Satellite A80 laptop. The layout I wanted was to run the Laptop’s built-in LCD as my primary display sitting on my left side and a 21″ CRT monitor as my secondary display sitting on my right. My laptop’s LCD would run at 1024×768 and my CRT would run at 1600×1024. I am using Ubuntu Edgy on my laptop. My laptop uses Intel Mobile 915GM Express graphics controller. I decided to use Xinerama to achieve this.
(more…)
If one wants to check if a given thread or a process is alive in the system, here is the way of doing it. This code snippet is guaranteed to work on Linux NPTL threads. What we need as an input to this function is the tid (thread id) given by the kernel. You can get the tid of a thread by issuing gettid() system call. In case of a process, gettid() is going to return the pid (process id) of the process.
1
2
3
4
5
6
7
8
| bool
isalive( pid_t tid ) {
if ( 0 != kill( tid, 0 ) && ESRCH == errno ) {
/* The thread or process is not alive */
return false;
}
return true;
} |
It should be noted that just checking for the return value of kill() is not going to be sufficient as it is going to be -1 even if the thread or the process exists but the calling process has no permission to send signal to it (errno is set to EPERM).
People say that pthread_kill() could also used to achieve the same purpose. But I ran into issues when trying that approach. Also pthread_kill() approach can’t be used on processes. The kill() approach is uniform to both processes and threads. But one overhead in this approach is knowing or finding the tid of the thread of interest. Note that the tid used in kill() is not the pthread_t type but it is pid_t type.
Joining the tagging game of the Debian crew, I am revealing the 5 things that I think most people don’t know about me.
- I wanted to study Law
- I wrote my first C program at the age of 11
- I used to do advocacy against Smoking
- I can withstand 3 days without sleeping
- I would like to turn back to Agriculture some day
It is KK’s turn now!