Skip to content

Instantly share code, notes, and snippets.

View nuttt's full-sized avatar

Nuttapon Pattanavijit nuttt

  • Bangkok, Thailand
View GitHub Profile
@nuttt
nuttt / setting.json
Created June 15, 2015 04:48
sublime settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/User/SublimeLinter/Tomorrow-Night-Eighties (SL).tmTheme",
"flatland_square_tabs": true,
"font_face": "Monaco",
"font_size": 15,
"highlight_line": true,
"ignored_packages":
[
@nuttt
nuttt / install.md
Created March 23, 2015 21:48
Beanstalkd & Supervisor for QC.HAII

1. Install Beanstalkd & Supervisor

$ su -c 'rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm'

$ sudo yum install beanstalkd -y
$ sudo chkconfig beanstalkd on

$ sudo yum install supervisor
$ sudo chkconfig supervisord on
@nuttt
nuttt / gist:6fd4ee05c57d8dee78ed
Created February 9, 2015 14:36
How I run docker streaming
# run hadoop-docker
# -i interactive
# -t tty terminal
# -P map all network port to host machine (boot2docker)
# -v ~/hadoop1:/data map ~/hadoop1 folder in host machine to /data in docker (sync drive)
docker run -i -t -P -v ~/hadoop1:/data sequenceiq/hadoop-docker:2.6.0 /etc/bootstrap.sh -bash
# go to hadoop path
cd $HADOOP_PREFIX
build a binary tree class (with no repeat element in tree)
with following APIs
- new()
- addnode(int a)
--- return true if a is not already in binary tree
--- otherwise return false
- removenode(int a)
--- return true if a is removed in binary tree
--- return false if otherwise
- depth(int a)
@nuttt
nuttt / top100-map.py
Last active August 29, 2015 14:14
MapReduce top 100 word in Harry 6
1 7558 the
2 4294 to
3 4053 and
4 3419 of
5 3314 he
6 3283 a
7 2617 harry
8 2449 said
9 2396 was
10 2249 his
@nuttt
nuttt / hand.cpp
Created December 11, 2014 06:52
hand2
//
// main.cpp
// Hand
//
// Created by Nuttapon Pattanavijit on 11/24/14.
// Copyright (c) 2014 nut. All rights reserved.
//
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
@nuttt
nuttt / main.cpp
Last active August 29, 2015 14:10
Hand
//
// main.cpp
// Hand
//
// Created by Nuttapon Pattanavijit on 11/24/14.
// Copyright (c) 2014 nut. All rights reserved.
//
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
@nuttt
nuttt / L = SS
Created November 6, 2014 07:15
Turing Machine
; Write your Turing machine program here!
; Syntax: <current state> <current symbol> <new symbol> <direction> <new state>
; ';' starts a comment.
; '*' is a wildcard: it matches any symbol/state when used in the current symbol/state field;
; it means 'same as current' when used in new symbol/new state field.
; '_' represents the blank (space) symbol.
; Symbols must be a single non-whitespace character except ';'.
; States can be any word, not only numbers.
;
; This example program concatenates the first string of '1's to the end of the second.
@nuttt
nuttt / background remove
Created November 4, 2014 05:08
background remove
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/ml/ml.hpp>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/ml/ml.hpp>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>