>Torrent: Demystified

>What is a torrent? A torrent is like a broker between a customer and a seller. It works in a peer-to-peer setup that means a true democracy; all are equal, no master-no slave. So you need to download a classic movie, which may be on a computer(s), located […]

>Running Ubuntu 9.10 Casper On your PC

>A complete solution: Image Writing to Installation Ubuntu is a free open source Linux distribution, primarily for desktop users. There are many reasons to use Ubuntu instead of other Linux distro(Just Google for it). I am assuming that reader is an Ubuntu user on a x86 system and […]

Thread stack in heap (pthreads)

I had known that a thread has a stack. But never thought where is this stack lie in the memory? Well, it should be process stack. But you can set the thread stack to a heap area. How to do that? #include “pthread.h” #include “stdio.h” #include “unistd.h” pthread_mutex_t […]

Thoughts on malloc()

* Always check for equal number of malloc()/free() calls. • Use calloc() instead of malloc() + memset() • Instead of allocation memory in a piece-meal manner, try to allocate a bigger chunk with malloc() and keep on resizing it with realloc() if needed. • malloc() over-commits the memory […]

>Cut short your web-addresses: TinyURL

>An utility called “tinyurl” makes your life easier with shorter URL without creating an all new website. Many times it become cumbersome(i.e. for a long string) and unsafe(if you miss to copy contents of the link) to send a link to your friend. TinyURl helps you with providing […]

>Exceptional exception handling in C++

>#include using namespace std; //Globalint a = 20; void foo()try { throw a;}catch(int &x){ // You can’t modify value of “a” x = 10;} int main(){ foo(); cout<<"A="<<a;} A=20 !!!!When you write “throw a”, an invisible, phantom exception object gets created. You pass reference to that object and […]