- 博客(78)
- 收藏
- 关注
原创 Merlin TTS 深度学习的语音合成
githubhttps://github.com/CSTR-Edinburgh/merlin安装与训练参考这个文档即可 在Mac上安装成功http://jrmeyer.github.io/merlin/2017/02/14/Installing-Merlin.html除非GPU内存够大 否则使用CPU训练使用训练好的模型合成语音#1 安装Festivalht
2017-03-04 02:36:22 9121 2
原创 Install GPU Tensorflow
follow the instructionshttp://www.nvidia.com/object/gpu-accelerated-applications-tensorflow-installation.htmlexport LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib:/usr/local/cuda/extras
2017-02-10 02:52:42 554
原创 Linux create patch, apply and revert
cp file file.origmake your edits to filecreate patchdiff -u file file.orig > file.patchapply patchpatch -p0 reverse patchpatch –p0 -R
2017-02-08 09:35:22 1241
原创 可过期的对象
单个对象Suppliershttps://google.github.io/guava/releases/19.0/api/docs/com/google/common/base/Suppliers.html#memoizeWithExpiration(com.google.common.base.Supplier, long, java.util.concurrent.Tim
2017-01-18 07:57:22 438
原创 Python SOAP API, HTTP POST and HTTP GET
#0 print_utils.pydef print_decorator(argument): def real_decorator(function): def wrapper(*args, **kwargs): print '-' * 10 + 'start of ' + argument + '-' * 10 fun
2016-10-28 09:09:04 3018
转载 Java SOAP API example
http://stackoverflow.com/questions/15948927/working-soap-client-exampleimport javax.xml.soap.*;public class SOAPClientSAAJ { public static void main(String args[]) throws Exception {
2016-10-28 01:56:29 986
原创 Python multiprocessing需要避免的陷阱
这段代码可以在Mac上正常运行(windows不行)# build.pyfrom multiprocessing import Poolimport tracebackdef f(x): print 'start pool.f' return x*xdef run(): for line in traceback.format_stack():
2016-10-25 14:02:23 3445
原创 Python print线程安全
import threadingimport loggingimport subprocesslock = threading.Lock()STR = "abc abc abc"# print is not thread safedef printer(): while True: print STR# lock printdef lock_pr
2016-10-06 07:48:04 1486
转载 Python Context Manager
https://jeffknupp.com/blog/2016/03/07/python-with-context-managers/
2016-10-06 07:42:32 289
原创 Python2 Unicode
#1 英文str与unicode 内容相同 但是类型不同 test_type#2 中文str与unicode 内容与类型都不同test_type#3 open只能按照str读test_open_str_filetest_open_unicode_file#4 codecs只能按照unicode读test_codecs_str_filetest_codecs_unicode_fi
2016-08-11 15:29:18 534
原创 Exit Codes
Part 1: Advanced Bash Scripting Guide1: Catchall for general errors2: Misuse of shell builtins (according to Bash documentation)126: Command invoked cannot execute127: "command not found"1
2016-07-26 02:00:33 598
原创 Python
#1 load dictionary from file# .$ .'' .-LRB- .-RRB- ., .. .: .ADD XAFX PRTCC CONJCD NUMDT DETEX DETFW XGW XHYPH .IN ADPJJ ADJJJR ADJJJS ADJLS XMD VERBNFP
2016-07-19 05:46:51 363
原创 Install tensorflow/SyntaxNet on Ubuntu VM
1 install Ubuntu 14.04 by virtualbox1.1 install virtualboxhttps://www.virtualbox.org/wiki/Downloads1.2 downlaod Ubuntu 14.04 Wily vitualbox vdihttp://www.osboxes.org/ubuntu/#ubuntu-1
2016-06-25 02:26:26 1540
原创 Features for OpenNLP POS Tagging
Paper MAXIMUM ENTROPY MODELS FOR NATURAL LANGUAGE AMBIGUITY RESOLUTION Page 39OpenNLP source codeFeatures:ti-1 = X //previous tagti-2ti-1 = XY //previous and preprevious tagswi = X
2016-06-21 06:31:36 482
原创 Python NLP相关工具
NLTKNLP POS Tagging与NERNLP Stemming与Lemmatization的区别nltk.tokenize.word_tokenize(s)Numpynp.zeros((D, N))np.random.shuffle(data)pandasdata = pd.read_csv('spambase.data').as_matri
2016-06-15 05:25:20 608
原创 NLP POS Tagging与NER
POS Taggingimport nltks = "Steve Jobs was the CEO of Apple Corp."tags = nltk.pos_tag(s.split())tags[('Steve', 'NNP'), ('Jobs', 'NNP'), ('was', 'VBD'), ('the', 'DT'), ('CEO', 'NNP'), ('of', 'IN'
2016-06-11 15:07:37 4763
原创 NLP Stemming与Lemmatization的区别
Stemming:基于规则from nltk.stem.porter import PorterStemmerporter_stemmer = PorterStemmer()porter_stemmer.stem('wolves')结果里es被去掉了u'wolv'Lemmatization:基于字典from nltk.stem import WordNetLemmatize
2016-06-11 14:45:51 6432
转载 C++泛型类的.h与.cpp
原文http://www.codeproject.com/Articles/48575/How-to-define-a-template-class-in-a-h-file-and-imp(不正确)http://blog.ethanlim.net/2014/07/separate-c-template-headers-h-and.html (正解)Solution
2016-05-24 15:37:48 1378
转载 Mac上配置C++ Eclipse 尤其是GDB错误
首先要下载安装Eclipse CDThttps://eclipse.org/cdt/下面要安装gdb原文在此 https://www.ics.uci.edu/~pattis/common/handouts/macmingweclipse/allexperimental/mac-gdb-install.html摘出精要部分于此Installing GDBb
2016-05-13 13:52:50 3812
原创 正则表达式匹配连续重复单词Regular Expression For Consecutive Duplicate Unicode Words
Regular Expression For Consecutive Duplicate Unicode Words
2016-05-11 14:44:35 3744
原创 Apache Math Linear Regression
package com;import org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression;import org.apache.commons.math3.stat.regression.SimpleRegression;public class MathLinearRegression { publ
2015-12-17 10:09:30 2624
原创 Java程序的三种输入
第一种 Program arguments命令行中写入 main中的args读出第二种System propertyVM arguments -D写入 或者程序中System.setProperty写入System.getProperty读出第三种 操作系统环境变量shell中set写入System.getEnv()读出参考http://blog.csdn.ne
2015-08-18 14:23:56 634
转载 Java动态加载Jar
使用Jamaica VM的时候 无法运行时刻通过-cp加载额外的Jar,这个代码可以完成此功能。原帖在此http://stackoverflow.com/questions/60764/how-should-i-load-jars-dynamically-at-runtimeimport java.io.File;import java.io.IOException;import
2015-08-11 14:02:47 485
原创 HTTP GET POST PUT DELETE
HTTP的GET POST PUT DELETE就是对应查 增 改 删这里有个例子http://www.mkyong.com/java/how-to-send-http-request-getpost-in-java/
2015-03-24 14:08:05 454
原创 balance parentheses
题目:Given a string with parentheses, return a string with balanced parentheses by removing the fewest characters possible. You cannot add anything to the string.Examples:balance("()") -> "()"b
2015-03-21 00:29:42 634
原创 检测有向图中的环
题目http://www.geeksforgeeks.org/detect-cycle-in-a-graph/Java实现import java.util.ArrayList;import java.util.HashSet;import java.util.List;class GraphNode { private List children = new ArrayL
2015-03-17 02:38:40 1642
原创 ivy extends--ivy间的依赖
common-ivy.xml test(*);compile->compile(*);package->package(*)"> ivy.xml依赖common-ivy.xml
2015-02-12 08:29:39 455
原创 [System Design]Scalability for Dummies学习笔记
ClonesDataBaseCacheAsynchronism
2015-01-27 08:06:19 818
原创 无序数组中找第K个的数
方法1:排序(NlogN)方法2:利用堆(NlogK)首先将前K个元素构建最大堆,堆顶是前K个元素中第K大的元素。(这步复杂度KlogK)遍历剩余元素(这步复杂度(N-K)logK) 如果新元素 否则 新元素不可能是第K大的元素方法3:利用快排Partition O(N)
2015-01-14 01:48:06 691
原创 Java容器
Collection: List: LinkedList, ArrayList, Stack Queue: LinkedList, PriorityQueue (Heap) Set: TreeSet, HashSet, LinkedHashSetMap: TreeMap, HashMap, LinkedHa
2015-01-11 07:11:56 294
原创 数组与贪心
https://oj.leetcode.com/tag/array/https://oj.leetcode.com/tag/greedy/
2015-01-03 14:23:41 408
原创 实现一个插入,删除,随机都是O(1)复杂度的Set
题目实现一个Set,要求add O(1)remove O(1)random O(1)分析同时使用两种数据结构ArrayList: 保存所有元素HashMap: key为元素,value为元素在ArrayList中的下标add: ArrayList.add O(1) HashMap add O(1)random: ArrayList里随机取一个值r
2015-01-02 09:01:27 3039
原创 Sliding Window Maximum
题目Sliding Window MaximumA long array A[] is given to you. There is a sliding window of size w which is moving from the very left of the array to the very right. You can only see the w numbers in
2015-01-02 08:28:56 477
原创 一个正整数int有多少bit位为一
题目给一个正整数int,输出bit位为1的个数。解法1 public static int bitCount(int x) { int count = 0; while(x > 0) { count += (x % 2); x = x / 2; } return count; }如果是9 计算4次解法2 public static int bit
2015-01-02 08:03:56 3899
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人