Friday, December 25, 2009

Distributed Lock Resources

http://spiral.ic.ac.uk/bitstream/10044/1/799/1/Performance%20analysis%20of%20three.pdf

Chubby (Distributed Lock)

The Chubby lock service for loosely-coupled distributed systems height="500" width="100%" > value="http://d1.scribdassets.com/ScribdViewer.swf?document_id=13283874&access_key=key-jk7lyggsrjgr7tr4f4x&page=1&version=1&viewMode=list">

Wednesday, September 23, 2009

Inheritance case study #2: Implementing interface inside a base class

class D1 {
public:
virtual void Test(int a) = 0;
};

class D4 {
public:
void Test(int d){

}
};

class D5 : public D1, public D4 {
public:
};

Inheritance case study #1: Inheriting an identical interface from two different classes

class D1 {
public:
virtual void Test(int a) = 0;
};

class D2 {
public:
virtual void Test(int b) = 0;
};

class D3 : public D1, public D2 {
public:
void Test(int c){

}
};

Tuesday, August 4, 2009

simple bash

A good and compact Bash reference

Another good introduction. More complete.

A Very Simple example:


#!/bin/bash

i=0
while [ $i -lt 400 ]; do
printf "%i : %b\n" "$i" "\0$i"
let "i++"
done


Getting the script path


SCRIPT_PATH="${BASH_SOURCE[0]}";
if([ -h "${SCRIPT_PATH}" ]) then
while([ -h "${SCRIPT_PATH}" ]) do SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done
fi
pushd . > /dev/null
cd `dirname ${SCRIPT_PATH}` > /dev/null
SCRIPT_PATH=`pwd`;
popd > /dev/null