Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃
Feel free to reach me!

Liu, An-Chi tigercosmos

🙃
Feel free to reach me!
View GitHub Profile
@tigercosmos
tigercosmos / Calculator.js
Created Oct 9, 2020
Simple Test Tutorial
View Calculator.js
class Calculator {
constructor() {
}
add(a, b) {
return a + b;
}
sub(a, b) {
@tigercosmos
tigercosmos / bovw.py
Last active Jun 20, 2020
Bag of Visual Words with SVM
View bovw.py
#!/usr/bin/env python
# coding: utf-8
import numpy as np
import cv2
import os
import math
from cyvlfeat.kmeans import kmeans
from scipy import ndimage
from scipy.spatial import distance
View 2.log
{
"bin": {
"sh": null
},
"boot": {
"kernel.js": null
},
"index.json": null,
"spec": {
"cpu2006_asmjs": {
View 1.log
[ 0%] Built target LLVMDemangle
[ 0%] Built target LLVMTableGen
[ 2%] Built target obj.llvm-tblgen
[ 2%] Built target LLVMHello_exports
[ 6%] Built target LLVMSupport
[ 7%] Built target LLVMMCParser
[ 7%] Built target LLVMMCDisassembler
[ 9%] Built target LLVMMC
[ 10%] Built target LLVMObjectYAML
[ 11%] Built target LLVMDebugInfoDWARF
@tigercosmos
tigercosmos / image-stitching-using-sift-ransac.ipynb
Created May 21, 2020
Image stitching using SIFT and RANSAC
View image-stitching-using-sift-ransac.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View agent-SIR.py
# -------------------------------------------------------------------------------
# Agent-based SIR Model
# Author: Liu An Chi @tigercosmos
# -------------------------------------------------------------------------------
from pylab import *
from scipy import interpolate
from random import random
from math import log
from enum import Enum
View SIR.py
# -------------------------------------------------------------------------------
# SIR Model
# Author: Liu An Chi @tigercosmos
# -------------------------------------------------------------------------------
from pylab import *
from scipy import interpolate
# Parameters
Beta = 1
Gamma = 0.5
View cpu_usage_as_sin.c
/// Make CPUs usage as a sin wave
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
const float PI = 3.1415926;
const int TIME_SLICE = 40000; // 40 ms
View time2.js
// .....
} else if (match[DAY_GROUP_1]) { // 處理中文字有關於「天」的部分
var day1 = match[DAY_GROUP_1];
var time1 = match[TIME_GROUP_1];
if (day1 == '明' || day1 == '聽') {
// 如果半夜說明天,通常是今天的概念
if(refMoment.hour() > 1) {
startMoment.add(1, 'day');
}
View time1.js
var PATTERN = new RegExp(
'(而家|立(?:刻|即)|即刻)|' +
'(今|明|前|大前|後|大後|聽|昨|尋|琴)(早|朝|晚)|' +
'(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨))|' +
'(今|明|前|大前|後|大後|聽|昨|尋|琴)(?:日|天)' +
'(?:[\\s|,|,]*)' +
'(?:(上(?:午|晝)|朝(?:早)|早(?:上)|下(?:午|晝)|晏(?:晝)|晚(?:上)|夜(?:晚)?|中(?:午)|凌(?:晨)))?', 'i');