Skip to content

Instantly share code, notes, and snippets.

View behitek's full-sized avatar
😎

Hieu Nguyen Van behitek

😎
View GitHub Profile
@behitek
behitek / regex.md
Last active May 3, 2019 03:42 — forked from vitorbritto/regex.md
Regex Cheat Sheet

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping
@behitek
behitek / kmp.cpp
Created November 17, 2018 02:13 — forked from osjayaprakash/kmp.cpp
KMP
#include <iostream>
#include <cstring>
using namespace std;
int buildlps (char * pat, int m, int *lps){
lps[0] = lps[1] = 0;
for(int i=2; i<=m; i++){
int j = lps[i-1];
while(1){
@behitek
behitek / KMP.cpp
Created November 17, 2018 02:13 — forked from shihongzhi/KMP.cpp
KMP
//shihongzhi -- 2012.3.9
#include <stdio.h>
#include <string.h>
void KMP(char *T, char *P, int *pi)
{
int tLen = strlen(T);
int pLen = strlen(P);
int k = 0;
for (int i=0; i<tLen; ++i)
@behitek
behitek / Sparse Table.cpp
Created November 17, 2018 02:13 — forked from jacky860226/Sparse Table.cpp
Sparse Table
#define MAXN 100000
#define MAX_LOG 17
int n,s[MAXN+5];
int st[MAX_LOG+1][MAXN+5];
inline void init(){/*假設區間由[0~n-1]*/
for(int i=0;i<n;++i)st[0][i]=s[i];
for(int j=1;(1<<j)<=n;++j)
for(int i=0;i+(1<<j)<=n;++i)
st[j][i]=min(st[j-1][i],st[j-1][i+(1<<(j-1))]);
}
@behitek
behitek / trie.cpp
Created November 17, 2018 02:12 — forked from indrasaputra/trie.cpp
Trie
#include <cstdio>
#include <iostream>
#include <cstring>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <map>
#include <utility>
#include <cctype>
@behitek
behitek / all-vietnamese-syllables.txt(Gõ dấu kiểu cũ)
Last active February 19, 2022 18:58 — forked from hieuthi/all-vietnamese-syllables.txt
All possibly existent Vietnamese syllables, created by combine all onsets with all rimes. More information can be found at: http://hieuthi.com/blog/2017/03/21/all-vietnamese-syllables.html
a
ai
am
an
ang
anh
ao
au
ay
ba
@behitek
behitek / tf_serving.sh
Created May 18, 2017 11:37 — forked from jarutis/tf_serving.sh
Install Tensorflow Serving on Centos 7 (CPU)
sudo su
# Java
yum -y install java-1.8.0-openjdk-devel
# Build Esentials (minimal)
yum -y install gcc gcc-c++ kernel-devel make automake autoconf swig git unzip libtool binutils
# Extra Packages for Enterprise Linux (EPEL) (for pip, zeromq3)
yum -y install epel-release
@behitek
behitek / Stopwords_vi.txt
Created March 26, 2017 01:40
Danh sách các stop words trong Tiếng Việt (phổ biến)
# Tạo trên tập dữ liệu 2 triệu tài liệu Tiếng Việt
# Xây dựng bằng cách tính IDF và chọn ra các từ có IDF nhỏ.
bị
bởi
cả
các
cái
cần
càng
chỉ
@behitek
behitek / ReadWriteExcelFile.java
Last active October 30, 2018 05:05 — forked from madan712/ReadWriteExcelFile.java
Đọc ghi file Excel trong Java sử dụng Apache POI
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@behitek
behitek / bigint.c++
Created November 19, 2016 14:28 — forked from zsrinivas/bigint.c++
bigint
const int base = 1000000000; const int base_digits = 9;
struct bigint {
vector<int> a; int sign;
bigint() :
sign(1) {
}
bigint(long long v) {
*this = v;