Skip to content

Instantly share code, notes, and snippets.

View reyoung's full-sized avatar

Yang Yu reyoung

  • Tencent
  • Beijing
View GitHub Profile
@reyoung
reyoung / convert.bat
Created May 8, 2012 03:59
Convert png,jpg,bmp file to eps.
@ECHO OFF
:: @abstract This script convert all jpg,png,bmp files in current path to eps files.
:: 这个脚本可以将本目录的所有jpg,png,bmp转换成eps文件。
:: @note The bmeps command must exist and in system PATH.
:: 必须在系统中有bmeps命令,如果按照完整版CTex,就已经存在了。
:: @author reyoung <[email protected]>
@reyoung
reyoung / convert.sh
Created May 8, 2012 04:08
This script convert all jpg,png,bmp files in current path to eps files.
#!/bin/bash
# @abstract This script convert all jpg,png,bmp files in current path to eps files.
# 这个脚本可以将本目录的所有jpg,png,bmp转换成eps文件。
# @note The bmeps command must exist and in system PATH.
# 必须在系统中有bmeps命令,如果按照完整版CTex,就已经存在了。
# @author reyoung <[email protected]>
ConvertExt()
{
ext=$1
@reyoung
reyoung / DrawFrame.asy
Created May 9, 2012 07:12
使用Asymptote绘制三维坐标系,可翻转。也可以绘制向量。
void drawFrame(real x0,real y0,real length,string label="",real alpha=0,real beta=0,real gamma=0){
alpha = alpha/180*3.1415926;
beta = beta/180*3.1415926;
gamma = gamma/180*3.1415926;
real r11 = cos(gamma)*cos(beta);
real r12 = -sin(gamma)*cos(alpha)+cos(gamma)*sin(beta)*sin(alpha);
real r13 = sin(gamma)*sin(alpha)+cos(gamma)*sin(beta)*cos(alpha);
@reyoung
reyoung / MoinMoin Initd Service
Last active December 13, 2015 21:09
MoinMoin Init.d service script
#!/bin/bash
#
# chkconfig: 35 90 12
# description: moin server
#
. /etc/init.d/functions
LOCK_FILE=/var/lock/subsys/Moin
MOIN_HOME=/home/wiki/moin-1.9.6
LOG=/var/log/Moin.log
MOIN_USER=wiki
@reyoung
reyoung / git-sf
Created March 30, 2013 13:46
Personal Git Start Feature Script
#!/bin/sh
echo "Start Feature"
git pull origin
if [ "$?" = "0" ]; then
git flow feature start $1
fi
@reyoung
reyoung / git-fb
Created March 30, 2013 13:50
Personal Git Finish Feature Script.
#!/bin/sh
echo "Finish Feature"
function GitPush {
REMOTES=$@
# If no remotes were passed in, push to all remotes.
if [[ -z "$REMOTES" ]]; then
REM=`git remote`
# Break the remotes into an array
@reyoung
reyoung / ffnetwork.xsd
Created March 24, 2014 15:17
A Feed Forward Network XML Schema Definition file for casanova machine learning system.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://robocup.tju.edu.cn"
xmlns="http://robocup.tju.edu.cn"
elementFormDefault="qualified">
<xs:simpleType name="activationType">
<xs:restriction base="xs:string">
<xs:enumeration value="sigmoid"/>
<xs:enumeration value="tanh"/>
<xs:enumeration value="softmax"/>
@reyoung
reyoung / ipca.py
Created July 7, 2014 11:26
A PCA Trainer and transformer, train pca from csv file
#!/bin/python
"""CCIPCA Trainer and transformer.
Usage:
ipca.py train <model_file_name> <csvfile>... [--ncomp=<nc>] [--ntrainiter=<nti>] [--itersave]
ipca.py trans <model_file_name> <csvfile>... [--new_prefix=<prefix>]
ipca.py (-h|--help)
Options:
--ncomp=<nc> Number of Component [default: 30].
@reyoung
reyoung / wav2fft.py
Created July 8, 2014 06:50
WavToFFT Utility. Convert wave file to frequency domain.
#!/bin/env python2
"""
WavToFFT Utility.
Usage:
wav2fft.py <wav_file>... [ --fft_size=<fftsz> ] [ --window_size=<wsize>] [ --drop-final-frame ] [ --channel=<ch>] [--overlap=<ol>]
Options:
--fft_size=<fftsz> Size Of FFT [default: 1024].
--window_size=<wsize> Size of FFT Window (in ms) [default: 25].
@reyoung
reyoung / normalizer.py
Created July 9, 2014 12:51
A normalizer Utilities
"""
Normalize Utilities
Usage:
./normalizer.py <csvfile> ... [ --config=<conf> ]
Options:
--config=<conf> Config file [ default: None ]
"""