Thursday, June 7, 2012

ELF


Executable and Linkable Format (by Wiki)
In computing, the Executable and Linkable Format (ELF, formerly called Extensible Linking Format) is a common standard file format for executablesobject codeshared libraries, and core dumps. First published in the System V Application Binary Interface specification,[1] and later in the Tool Interface Standard,[2] it was quickly accepted among different vendors of Unix systems. In 1999 it was chosen as the standard binary file format for Unix and Unix-like systems on x86 by the 86open project.

Wednesday, June 6, 2012

Where and how to set vi default configuration


In ~/.exrc
      set directory=/tmp
      set cindent
      set number

WRED


Term WRED = Weighted Random Early Detection (algorithm)

(Wiki) Weighted random early detection (WRED) is a queue management algorithm with congestion avoidance capabilities.[1] It is an extension to random early detection (RED) where a single queue may have several different queue thresholds. Each queue threshold is associated to a particular traffic class.
For example, a queue may have lower thresholds for lower priority packet. A queue buildup will cause the lower priority packets to be dropped, hence protecting the higher priority packets in the same queue. In this way quality of service prioritization is made possible for important packets from a pool of packets using the same buffer.[2]
It is more likely that standard traffic will be dropped instead of higher prioritized traffic.

Functional Description
WRED proceeds in this order when a packet arrives:
§  Calculation of the average queue size.
§  The arriving packet is queued only if the average queue size is below the minimum queue threshold.
§  Depending on the packet drop probability the packet is either dropped or queued if the average queue size is between the minimum and maximum queue threshold.
§  The packet is automatically dropped if the average queue size is greater than the maximum threshold.

Friday, June 1, 2012

Delete a node from link list


int listDel(int delData) {
    NodeType *ptr;

    ptr = listHead;
    while (ptr) {
         if(ptr->data == delData) {
            printf("data = %d key found\n", ptr->data);
            if(ptr == listHead) {
               printf("This is a head\n");
               if(ptr->next) { 
                  listHead = ptr->next; 
                  (ptr->next)->prev = 0;
               }
               else {
                  listHead = 0;
               }
            }
            else if(ptr == listTail) {
               printf("This is a tail\n");
               listTail = ptr->prev;
               (ptr->prev)->next = 0;
            }
            else {
               printf("This is a middle\n");
               // connect previous to next
               (ptr->prev)->next = ptr->next;
               // connect next to previous
               ptr->next = (ptr->prev)->next;
            }

            // disconnect
            ptr->prev = 0;
            ptr->next = 0;
            free(ptr); // delete
            break;
         }
         ptr = ptr->next;
    }
    return 0;
}

int main() {
    listAdd(1);
    listAdd(2);
    listAdd(3);
    listAdd(4);
    listAdd(5);
    listAdd(6);
    listShow();
    printf("\n");
    listDel(1);
    listDel(6);
    listDel(4);
    listDel(7);
    listDel(2);
    printf("\n");
    listShow();
   
    return 0;
}


1st node added (1)
data = 1
data = 2
data = 3
data = 4
data = 5
data = 6

data = 1 key found
This is a head
data = 6 key found
This is a tail
data = 4 key found
This is a middle
data = 2 key found
This is a head

data = 3
data = 5

Free C compiler for Windows

http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express