自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(32)
  • 收藏
  • 关注

原创 sed正则表达式匹配,各种括号的转义和不转义

[ ] 需要匹配的时候,需要转义(这个是叛徒) echo "[ ]"|sed 's/\[.*\]/aaa/g'( ) 需要匹配的时候,不要转义 $echo "( )"|sed 's/( )/c/g'{ } 需要匹配的时候,不要转义 $echo "{ }"|sed 's/{ }/c/g'当需要匹配数字,字母等使用中括号时候: 不要转义 但使用大括号作为特殊字符时候,需要转义。 $echo

2017-08-22 16:16:48 28612 1

原创 vim 搜索后大小写替换

利用vim的正则表达式模块 下面的代码是,全文变成小写,:%s/.*/\L&/g\L是小写;\U是大写;&&是正则表达式全部匹配项, 其他的还有:\1,\2,\3,…,\9。表示第1,2,3…9个匹配项。比如说想替换 “abc xxxxabcxxxxx abc” 为 “ABC xxxxABCxxxxx ABC”输入如下命令:%s/abc/\U&/g比如像替换 “{ABC} xxxx{

2017-08-18 16:23:57 3467

原创 ubuntu 安装anaconda不能正常使用pip的问题,以及conda install error 和 Error: Missing write permissions in:的问题

ubuntu直接安装anaconda是不能直接使用pip 的,因为pip install需要sudo权限,而sudo pip是系统自带的python的pip 这两个是不一样的。 之前还试过在~/anaconda2/lib/python2.7/site-packages 里面加sudo python 的.pth文件 但是指标不治本。 因此决定zhoulu@zhoulu-MS-7A70:~$ su

2017-06-27 20:57:13 10377 5

原创 kaldi 安装ubuntu 16.04

首先下载kaldi包git clone https://github.com/kaldi-asr/kaldi.git然后安装依赖库进 cd tools tools文件 运行 ./extras/check_dependencies.sh 根据它要求安装 各种库 我的是缺这些:sudo apt-get install zlib1g-dev libtool subversion libatlas

2017-06-23 15:04:38 6185 1

原创 PYTHON 词图/WordCloud,

需要两个库一个是jieba切词库,将一段句子切词用法比较简单。就是import jiebaprint " ".join(jieba.cut('我是来自中国北京清华大学的一名硕士研究生,这是我的测试语句,下面测试北京大学生和北京大学学生。'))#默认精准模式词云代码。py实现from os import pathimport jiebaimport matplotlib.pyplot as p

2017-06-23 00:47:19 1089

原创 UBUNTU16.10系统,显卡GTX1070,鼠标一直在左上角

显卡是GTX1070,默认都是通用驱动,鼠标永远在左上角。需要更新驱动才行鼠标虽然永远在左上角但是可以动, 这里我们不用鼠标。 windows键/super键 搜索 additional drivers. 进去以后找到第一个显卡那个,不要用opensorce开源的,用NIVDIA xxxx .利用tab键 然后应用就行了。重启以后就好了。

2017-06-10 12:38:53 771

原创 双系统无法引导问题,ubuntu,16.10安装win10后,无法启动ubuntu

我有两个硬盘,一个SATA一个SSD,ubuntu安装在SATA上,然后装的ssd的win10。 中间有个插曲,win10装的教育版的,激活期只有180天,想转成专业版还不行。所以就删了重新装的专业版,再激活的。之后再开ubuntu就死活打不开,网上试了一圈。grub之类的 都不行,不是asuf报错就是什么Blocklists。 最后用的boot-repair这个工具。 具体操作说明一下:1.

2017-06-10 12:35:11 9423 5

原创 python 合并 累加两个dict

比如说有两个dict:x和y1.比较快的自己写的,def merge_dict(x,y): for k,v in x.items(): if k in y.keys(): buffer[k] += v else: buffer[k] = v2.调用a

2017-01-22 14:33:28 6824

原创 用Python发邮件,QQ邮件,解决(Error: A secure connection is requiered(such as ssl))

用Python发邮件,QQ邮件 之前查的网上的代码 都有 503 ‘Error: A secure connection is requiered(such as ssl)’之类的Bug. QQ邮箱要求ssl,smtp.qq.com 端口号465. 因此我们把smtplib.SMTP()改成smtplib.SMTP_SSL()#-*-coding:utf-8-*- #==========

2016-11-27 12:31:17 7689 2

转载 sublime 3 注册码+PYTHON 环境配置+pylint插件path问题+package control找不到packages解决方法。

sublime 3 验证码,2016年6月亲测可用:转载:http://blog.sina.com.cn/s/blog_68e267e10102v76h.htmlsublime 3 ,python配置 插件:遇到了两个问题:在装pylint的时候,他说path找不到,你要进preference-》package setting->pylint:把里面的pylin

2016-06-18 14:53:33 1837

原创 [leetcode]45. Jump Game II 跳棋游戏2 C++/PYTHON实现【hard难度】

题目 Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. Your go

2016-06-17 10:15:08 2046

原创 [leetcode]55. Jump Game ,C++/PYTHON实现,medium难度

[leetcode]55. Jump Game ,C++/PYTHON实现,medium难度

2016-06-16 21:50:40 1488

原创 [leetcode]41. First Missing Positive,C++/python实现,hard难度

[leetcode]41. First Missing Positive,C++/python实现,hard难度

2016-06-16 19:37:56 891

原创 [leetcode]40. Combination Sum II ,python实现【medium难度】

Combination sum 2.python实现

2016-06-16 17:37:04 2012

原创 [leetcode]39. Combination Sum,python实现【Medium难度】

39.COMBINATION SUM,PYTHON实现

2016-06-16 17:01:20 5342

原创 [leetcode]47. Permutations II,python实现

题目: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example, [1,1,2] have the following unique permutations: [ [1,1,2],

2016-06-16 16:24:48 2080

原创 【leetcode】 46. Permutations ,python实现

Permutations Given a collection of distinct numbers, return all possible permutations.For example, [1,2,3] have the following permutations: [ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,

2016-06-15 15:43:54 5772

原创 [leetcode]53. Maximum Subarray 最大连续子串python实现【medium】

题目: Maximum Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2,1,−5,4], the cont

2016-06-15 00:30:28 5748 1

原创 Python if 和 for 的多种写法

a, b, c = 1, 2, 3【对比Cpp里:c = a >b? a:b】这个写法,python只能常规的空行,缩进吗?人生苦短,我用python,下面介绍几种if的方便的方法。1.常规if a>b:    c = aelse:    c = b2.表达式c = a if a>b else b 

2016-06-15 00:05:55 55147

原创 [leetcode]20. Valid Parentheses ,有效的括号符串python实现【easy】

题目: Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and “()[]{}” are all

2016-06-14 22:58:30 877

原创 [leetcode] 17. Letter Combinations of a Phone Number ,python实现【medium】

Letter Combinations of a Phone Number Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the teleph

2016-06-14 22:25:54 2253

原创 [leetcode] 19. Remove Nth Node From End of List python实现【easy】

Remove Nth Node From End of List My Submissions QuestionEditorial Solution Given a linked list, remove the nth node from the end of list and return its head. For example, Given linked list: 1

2016-06-14 21:50:21 1524

转载 【转载】python获取文件及文件夹大小

使用os.path.getsize函数,参数是文件的路径。获取文件夹大小,即遍历文件夹,将所有文件大小加和。遍历文件夹使用os.walk函数import osfrom os.path import join, getsizedef getdirsize(dir): size = 0L for root, dirs, files in os.walk(dir): size

2016-06-13 10:10:20 2205

原创 [leetcode]Generate Parentheses 生成圆括号 python实现

Generate Parentheses

2016-06-12 09:36:27 2577

原创 【Leetcode】287. Find the Duplicate Number My Submissions QuestionEditorial Solution python实现

题目:Find the Duplicate Number My Submissions QuestionEditorial SolutionGiven an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate

2016-06-03 17:28:20 434

原创 【leetcode】3SUM python实现

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: Elements in a triplet (a,b,c) must be i

2016-06-03 13:08:40 2454

原创 【leetcode】Integer to Roman--python实现

题目要求:- 罗马数规则:基本字符 I V X L C D M 相应的阿拉伯数字表示为 1 5 10 50 100 500 1000 相同的数字连写、所表示的数等于这些数字相加得到的数、如:Ⅲ=3; 小的数字在大的数字的右边、所表示的数等于这些数字相加得到的数、 如:Ⅷ=8、Ⅻ=12; 小的数字、(限于 Ⅰ、X 和 C)在大的数字的左边、所表示的数等于大数减小

2016-06-02 17:16:51 386

原创 【leetcode】Container with most water--python实现

欢迎使用Markdown编辑器写博客本Markdown编辑器使用[StackEdit][6]修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用

2016-06-02 16:18:03 331

原创 [leetcode]Two Sum C++ python实现

方法一:用HASH表,将每个数x依次放入hash表中;然后检查hash表有没有有没有target-x的数,有就输出。python实现:class Solution(object): """docstring for ClassName""" def twoSum(self, nums, target): dict={} for i in xran

2015-09-21 10:51:37 480

翻译 文章标题

模式识别复习demo

2015-06-24 11:38:48 360

翻译 模式识别入门与贝叶斯决策理论

马氏距离,贝叶斯,监督非监督

2015-06-23 17:40:29 1412

翻译 GMM-hmm算法学习笔记

一、基础设X是一串已经观察的听觉特征向量,W表示一个词序列。那么最可能的词序列就是W*:贝叶斯准则其中P(X|W)是声学模型,P(W)是语言模型。Lexicon是字典。HMM模型就是一种声学模型。‘下面举个例子:“NO right”分为两个词,每个词又分为几个音素。对于每个音素跑HMM模型。HMM模型如下:参数 入 :转移概率是akj,表

2014-12-22 20:31:33 6007

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除