Archives:

quick sort No ratings yet.

Quick sort High level code are quite simple ( divide/conque, recursively partition the array): void quickSort(int arr[], int low, int high) {     if (low < high)     {         /* pi is partitioning index, arr[p] is now            at right place */         int pi = partition(arr, low, high);         // Separately sort elements before         // partition and after partition • Read More »


Heap and Heapsort No ratings yet.

Heap/Heapsort is not difficult to understand when you reading online articles/watching online videos, but without using it everyday, it is quite easy to forget the evil details. Here are some notes to help memorizing this. (1) Min/Max heap, is a  a Complete Binary Tree with its parent nodes smaller or greater than its two children. a A • Read More »


openstack 5/5 (1)

I spent several days to install openstack on debian 8 at one testing box with two NICs. Finally got a basic working system! It has with a controller node running neutron, glance and horizon, a compute node using KVM. To get much speed, one KVM VM is created as a controller node on that box, at the same • Read More »


docker No ratings yet.

Finally I got some chances to package one application using docker, here are some useful commands docker images: docker build –rm -t my_tag docker_dir ( with Dockerfile) docker images , docker rmi ( remove docker image) docker containers docker run -d –publish 9080:80 –publish 1022:22 –name container_name –restart always –voloume host_dir:container_dir -e HOST_UID=$(id -u) $tag • Read More »


Go Language vs C/C++ 3/5 (2)

I have spent several days on Go. It is a little more similar to C, not C++. As it has no class concept, only structure.  Also it has pointer ( but no pointer arithmetic), interface. Also it has slice, map, go routine( for multi-thread) which make it unique. Overall it is could be a good language. Here • Read More »


What’s the difference between BNF, EBNF, ABNF, ASN.1 ? 1/5 (1)

Abstract Syntax Notation One (ASN.1) is mainly for binary protocol, it is a standard and notation that describes rules and structures for representing, encoding, transmitting, and decoding data intelecommunications and computer networking.. A good tools like asn1c can convert ASN.1 to C structure, encoder/decoder. BNF, EBNF, ABNF are for text format parsing. In terms of power, • Read More »



fp-tree and fp-growth in plain english No ratings yet.

The normal use case is to discover interesting relations between variables in large databases, e.g: i(t) 1 ABDE 2 BCE 3 ABDE 4 ABCE 5 ABCDE 6 BCD the above are some transactions, let’s A, B, C … are some products people bought. we want to find which set are frequent set .e.g: BC  is • Read More »



K-means clustering and Bisecting K-means in Plain English No ratings yet.

K-means clustering is unsupervised machine learning algorithm. Wikipedia has a great demo as below on how it works: Demonstration of the standard algorithm 1. k initial “means” (in this case k=3) are randomly generated within the data domain (shown in color). 2. k clusters are created by associating every observation with the nearest mean. The • Read More »