Skip to content

Instantly share code, notes, and snippets.

@forhappy
forhappy / zookeeper-start-local-cluster.sh
Last active June 22, 2016 23:46
start local zookeeper pseudo cluster in one command line: "sh zookeeper-start-local-cluster.sh"
#!/usr/bin/env bash
# Start a zookeeper cluster
ZOOKEEPER_QUANTUM="3"
ZOOKEEPER_VERSION="3.4.6"
ZOOKEEPER_BINARY="zookeeper-$ZOOKEEPER_VERSION.tar.gz"
ZOOKEEPER_MIRROR_SITE="http://mirror.bit.edu.cn/apache/zookeeper"
ZOOKEEPER_TARGET="$ZOOKEEPER_MIRROR_SITE/zookeeper-$ZOOKEEPER_VERSION/$ZOOKEEPER_BINARY"
WORKING_DIR=$PWD
@forhappy
forhappy / py-isodata.py
Created September 23, 2011 13:42
isodata clustering algorithm(not finished yet)
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import cmath
import os.path
class ISOData:
'''
@descriptions: ISOData Algorithm implementation.
@forhappy
forhappy / kmeans.py
Created September 21, 2011 06:27
python implemtion k-means algorithm
#! /usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import cmath
import os.path
class KMeans:
'''
@descriptions: K-means Algorithm implementation.