Skip to content

Instantly share code, notes, and snippets.

View huyng's full-sized avatar

Huy Nguyen huyng

View GitHub Profile
@huyng
huyng / vietnamese-chars.txt
Last active May 23, 2024 20:51
All letters in vietnamese alphabet + "F" "W" "Z" often used for foreign loan words. Space separated
a à ả ã á ạ ă ằ ẳ ẵ ắ ặ â ầ ẩ ẫ ấ ậ b c d đ e è ẻ ẽ é ẹ ê ề ể ễ ế ệ f g h i ì ỉ ĩ í ị j k l m n o ò ỏ õ ó ọ ô ồ ổ ỗ ố ộ ơ ờ ở ỡ ớ ợ p q r s t u ù ủ ũ ú ụ ư ừ ử ữ ứ ự v w x y ỳ ỷ ỹ ý ỵ z A À Ả Ã Á Ạ Ă Ằ Ẳ Ẵ Ắ Ặ Â Ầ Ẩ Ẫ Ấ Ậ B C D Đ E È Ẻ Ẽ É Ẹ Ê Ề Ể Ễ Ế Ệ F G H I Ì Ỉ Ĩ Í Ị J K L M N O Ò Ỏ Õ Ó Ọ Ô Ồ Ổ Ỗ Ố Ộ Ơ Ờ Ở Ỡ Ớ Ợ P Q R S T U Ù Ủ Ũ Ú Ụ Ư Ừ Ử Ữ Ứ Ự V W X Y Ỳ Ỷ Ỹ Ý Ỵ Z
@huyng
huyng / infercaffe.py
Created May 19, 2015 08:14
simple inference for caffe
import sys
import caffe
from PIL import Image
import numpy as np
pimga = Image.open("a.jpg")
pimgb = Image.open("b.jpg")
nimga = np.array(pimga).reshape(1,256,256,3).transpose(0,3,1,2)
nimgb = np.array(pimgb).reshape(1,256,256,3).transpose(0,3,1,2)
@huyng
huyng / index.html
Last active August 29, 2015 14:19 — forked from mbostock/.block
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>D3 Hello World</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.js"></script>
@huyng
huyng / main.rs
Last active November 4, 2016 15:40
Rust symbolic algebra system
enum Node {
TVector(&'static str),
TScalar(f32),
Add(Box<Node>, Box<Node>),
Sub(Box<Node>, Box<Node>),
Mul(Box<Node>, Box<Node>),
Div(Box<Node>, Box<Node>),
Pow(Box<Node>, Box<Node>),
}
@huyng
huyng / Dockerfile
Created July 24, 2014 06:05
Dockerfile to setup and build a linux machine compatible for running bvlc/caffe
FROM ubuntu:12.04
RUN apt-get -y update
RUN apt-get -y install wget git curl python-dev libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev protobuf-compiler libatlas-dev libatlas-base-dev
RUN wget https://google-glog.googlecode.com/files/glog-0.3.3.tar.gz -O /tmp/glog-0.3.3.tar.gz && tar -C /tmp -xzvf /tmp/glog-0.3.3.tar.gz && rm /tmp/glog-0.3.3.tar.gz
RUN cd /tmp/glog-0.3.3 && ./configure && make && make install && cd -
RUN curl http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1204/x86_64/cuda-repo-ubuntu1204_6.0-37_amd64.deb -o /tmp/cuda_install.deb && dpkg -i /tmp/cuda_install.deb && rm /tmp/cuda_install.deb
RUN apt-get -y update && apt-get -y install cuda
RUN curl https://gitorious.org/mdb/mdb/archive/7f038d0f15bec57b4c07aa3f31cd5564c88a1897.tar.gz -o /tmp/mdb.tar.gz && tar -C /tmp -xzvf /tmp/mdb.tar.gz && rm /tmp/mdb.tar.gz
RUN cd /tmp/mdb-mdb/libraries/liblmdb/ && make && make install
18 the
10 of
8 a
7 to
5 were
5 by
5 North
5 Korean
4 troops
4 U.S.
strawberry
-> no show
-> strawberry, fruit, food
street
-> show
streetcar
-> noshow
-> streetcar, tram, transportation
stringed instrument
-> noshow
@huyng
huyng / opencv_resize.cpp
Created March 18, 2014 20:30
Opencv resize
#include "opencv2/core/core.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
// using namespace cv;
int main(int argc, char const *argv[])
{
cv::Mat src, dst;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Nano buildr</title>
<link href="/static/bower_components/bootstrap/dist/css/bootstrap.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
@huyng
huyng / index.html
Last active August 29, 2015 13:56
world map and events
<!DOCTYPE html>
<meta charset="utf-8">
<style>
path {
stroke: white;
stroke-width: 0.25px;
fill: grey;
}
svg {
margin:40px auto;