Exponential backoff

Posted on Leave a commentPosted in Uncategorized

In a variety of computer networks, binary exponential backoff or truncated binary exponential backoff refers to an algorithm used to space out repeated retransmissions of the same block of data, often as part of network congestion avoidance. Wikipedia Exponential backoff Here is an implementation in Java /** * Calculate Exponential backoff * * @param attempt […]

Configuring Java JDK on Ubuntu

Posted on Leave a commentPosted in Uncategorized

This is an easy way to configure java on a linux box, all this information is available online. First we need to obtain the build. sudo wget http://192.168.201.47:8000/jdk-7u75-linux-x64.gz Extract from tar sudo tar xzvf jdk-7u75-linux-x64.gz Create symbolic link so we can later update the version sudo ln -s /opt/jdk1.7.0_75/ /opt/java we edit the /etc/profile and […]

Tokenizing/splitting string in c++

Posted on Leave a commentPosted in cpp, Uncategorized

This method uses strtok to tokeninze our string given a specific delimeter, results of that are put into supplied vector. There are few other ways we can do this but this one is straight forward. #include <iostream> #include <string> #include <string.h>   #include <memory> #include <stdlib.h> #include <stdio.h> #include <list> #include <vector>   using namespace […]