Skip to content

Instantly share code, notes, and snippets.

View gavinHuang's full-sized avatar

Gavin Huang gavinHuang

View GitHub Profile
@gavinHuang
gavinHuang / cnn_model.py
Created June 13, 2018 05:55
cnn model for character detection
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import tensorflow as tf
from PIL import Image
import cv2
import os
import math
@gavinHuang
gavinHuang / putty-eclectide.reg
Created April 22, 2016 02:18 — forked from darekkay/putty-eclectide.reg
Eclectide color theme for the Putty SSH client
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\SESSION_NAME]
; Default Foreground
"Colour0"="217,216,216"
; Default Bold Foreground
"Colour1"="217,216,216"
; Default Background
"Colour2"="28,28,28"
env_source=$(ping `hostname` -c 1 |grep "gramws.com ping statistics")
is_cq=$(echo $env_source |grep "cq-core" -c)
is_dev=$(echo $env_source |grep "dev-core" -c)
is_prod=$(echo $env_source |grep "prod-core" -c)
if [ "$is_cq" == "1" ]
then
ENV="CQ"
CPCODE=$CQ_CPCODE
@gavinHuang
gavinHuang / DFS for allsorts
Created November 14, 2014 05:12
DFS for allsorts
public class DFS2 {
int[] numbers = {2,3,4,5,6};
boolean[] book = new boolean[numbers.length];
int[] answers = new int[numbers.length];
public static void main(String[] args) {
DFS2 dfs = new DFS2();
dfs.dfs(0);
}
curl -XDELETE localhost:9200/test
curl -XPUT localhost:9200/test -d '{
"index.mapper.dynamic": false
}'
#{"ok":true,"acknowledged":true}
curl -XPUT localhost:9200/test/test/1 -d '{"foo":"bar"}'
#{"error":"TypeMissingException[[test] type[test] missing: trying to auto create mapping, but dynamic mapping is disabled]","status":404}
@gavinHuang
gavinHuang / milliseconds
Created March 21, 2012 02:07
time in java
System.currentMiliseconds//毫秒
System.nanoTime//纳秒 (1/1000微秒)
但通常用于计算时间间隔,对于时间间隔过久的,可能导致问题
@gavinHuang
gavinHuang / maven_compiler_warning
Created February 17, 2012 07:17
maven install时出现编译警告导致打包失败的处理办法
增加plugin
see http://www.juvenxu.com/2010/09/01/maven-javac-warning/
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
</plugin>
@gavinHuang
gavinHuang / checkbox_not_submited
Created February 6, 2012 08:51
checkbox will not be submitted to server if not checked
checkbox will not be submitted to server despite whether withing "value" attribute or not.
the difference is if not value attribute the value will be "on"
@gavinHuang
gavinHuang / js_create_array_object
Created February 6, 2012 02:38
Javascript object and array
var objectA = {};
var arrayA = [];
//non-ie(<8)
JSON.stringfy(objectA);
$.ajaxStart/ $.ajaxStop fires every time (may be several request per time) request start/stop
$.ajaxSend/ $.ajaxComplete fires every request were send/complete
@gavinHuang
gavinHuang / aptana_ruined_eclipse_compare
Created January 31, 2012 09:02
How to reset compare tool background and foreground color while it ruined by Aptana
vim ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.compare.prefs
reset every value with "SystemDefault" to "true"