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 / 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")
@nuttt
nuttt / recog.cpp
Last active October 19, 2018 09:36
number recognition
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace cv;
@nuttt
nuttt / server.java
Created January 5, 2014 16:56
Dis sys HW1 Server
package org.student.email;
import javax.jws.WebService;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.xml.ws.WebServiceRef;
import org.oorsprong.websamples.CountryInfoService;
/**
*
@nuttt
nuttt / doc.md
Last active December 29, 2015 06:28
EAA Assignment 2

2110523 Enterprise Application Architecture

  • 5431040021 นายสาริน ดุรงค์ดำรงชัย
  • 5430211821 นายทวีเกียรติ ตรงวงศา
  • 5430359021 นายปัณณวัฒน์ เทิดชนะกุล
  • 5431038821 นางสาววิภาวี ไตรรัตนาภา
  • 5431010121 นายณัฐพล พัฒนาวิจิตร
Assignment 2: Install Web Server and Application Server
@nuttt
nuttt / xml_to_json.rb
Last active December 28, 2015 07:28
Convert all xml file in folder to json
require 'active_support/core_ext'
require 'json'
files = Dir.glob(File.join('.', "*.xml"))
files.to_enum.with_index(1).each do |file, i|
puts "converting #{i} of #{files.length}: #{file}"
xml = File.read(file)
f = File.open(file+".json", 'w')
@nuttt
nuttt / MainActivity.java
Created October 3, 2013 02:42
List Adapter Example
package com.example.laptimer;
import android.content.Intent;
import android.database.Cursor;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ListView;
@nuttt
nuttt / bubblesort.pl
Last active December 24, 2015 05:29
Prolog Sorting
bubblesort([],[]).
bubblesort(In, [H|Out]):-
pulldown(In, [H|T]),
bubblesort(T, Out),
pulldown([],[]).
pulldown([A], [A]).
pulldown([H|T], [H,X|Y]):-
pulldown(T,[X|Y]),
H <= X.
@nuttt
nuttt / ish.c
Created September 25, 2013 02:15
OS Assignment 5
#include "ish.h"
#include <unistd.h>
#include <sys/types.h>
char extern **environ;
void all_environ(){
int count = 0;
while (environ[count] != NULL)
{
@nuttt
nuttt / sharpe.py
Created September 16, 2013 02:46
Find Sharpe Ratio with QSTK
import QSTK.qstkutil.qsdateutil as du
import QSTK.qstkutil.tsutil as tsu
import QSTK.qstkutil.DataAccess as da
import datetime as dt
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
@nuttt
nuttt / DefaultTrackableEventHandler.cs
Created September 13, 2013 01:34
Vuforia picture detection game
/*==============================================================================
Copyright (c) 2010-2013 QUALCOMM Austria Research Center GmbH.
All Rights Reserved.
Confidential and Proprietary - QUALCOMM Austria Research Center GmbH.
==============================================================================*/
using UnityEngine;
/// <summary>
/// A custom handler that implements the ITrackableEventHandler interface.