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 / gist:5926028
Created July 4, 2013 08:44
Na's AVR Lab 3-3
#include<avr/io.h>
#include<avr/interrupt.h>
#define F_CPU 16000000UL
#include<util/delay.h>
char count;
ISR(TIMER0_OVF_vect)
@nuttt
nuttt / blue_move.cpp
Last active December 19, 2015 11:19
Mobile Kinect AR VR Lab - Track Blue Cylinder
#include <cv.h>
#include <highgui.h>
#include <iostream>
#include <vector>
using namespace cv;
using namespace std;
#define RED_THRESHOLD 70
@nuttt
nuttt / ish.c
Created July 17, 2013 06:01
os homework 3
#include "ish.h"
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
int main(int argc, char** argv)
{
@nuttt
nuttt / boo.cpp
Last active December 19, 2015 21:29
boo's c++
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
vector<pair< int, pair<int,int> > > elephant;
@nuttt
nuttt / gist:6027658
Created July 18, 2013 08:24
AVR Lab 4-1
#include <avr/io.h>
#include <avr/interrupt.h>
#define F_CPU 16000000UL
#include <util/delay.h>
int count;
unsigned int duty;
@nuttt
nuttt / gist:6027816
Created July 18, 2013 08:55
AVR Lab 4-2
#include <avr/io.h>
#include <avr/interrupt.h>
#define F_CPU 16000000UL
#include <util/delay.h>
int count;
unsigned int duty;
@nuttt
nuttt / gist:6043704
Last active December 20, 2015 00:39
Algorithm Design Midterm 2012: Subset Partitioning
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
int w[10000];
int v[10000];
int mem[100][10000];
@nuttt
nuttt / gist:6048286
Last active December 20, 2015 01:19
Algorithm Design Midterm 2012: Point Dominant
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#define INF 999999
using namespace std;
struct Point{
@nuttt
nuttt / Lab 5-1.c
Created August 11, 2013 06:58
AVR Lab 5
#include <avr/io.h>
#include <avr/interrupt.h>
#define F_CPU 16000000UL
#include <util/delay.h>
#define nC 30577
#define nD 27242
#define nE 24269
#define nF 22907
#define nG 20408
@nuttt
nuttt / generate.py
Created September 3, 2013 10:55
Script for generating 500MB txt file
import os
os.system("rm a.txt")
with open("a.txt","w") as f:
f.write("a")
for i in range(29):
print i
os.system("cat a.txt > b.txt")
os.system("cat b.txt >> a.txt")