zl87758539的专栏

私信 关注
zl87758539
码龄6年

C++/PYTHON/ASR

  • 155,245
    被访问量
  • 27
    原创文章
  • 79,574
    作者排名
  • 11
    粉丝数量
  • 于 2014-09-18 加入CSDN
获得成就
  • 获得31次点赞
  • 内容获得13次评论
  • 获得26次收藏
荣誉勋章
TA的专栏
  • 模式识别一贝叶斯
    2篇
  • leetcode
    18篇
  • python
    17篇
  • C++
    3篇
  • ubuntu
    3篇
  • linux
    2篇
  • kaldi
    1篇
  • vim
  • sed正则表达式
    1篇
  • 最近
  • 文章
  • 资源
  • 问答
  • 课程
  • 帖子
  • 收藏
  • 关注/订阅

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

[ ] 需要匹配的时候,需要转义(这个是叛徒) echo "[ ]"|sed 's/\[.*\]/aaa/g'( ) 需要匹配的时候,不要转义 $echo "( )"|sed 's/( )/c/g'{ } 需要匹配的时候,不要转义 $echo "{ }"|sed 's/{ }/c/g'当需要匹配数字,字母等使用中括号时候: 不要转义 但使用大括号作为特殊字符时候,需要转义。 $echo
原创
19970阅读
1评论
6点赞
发布博客于 4 年前

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{
原创
2336阅读
0评论
2点赞
发布博客于 4 年前

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
原创
9500阅读
5评论
3点赞
发布博客于 4 年前

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
原创
5796阅读
0评论
0点赞
发布博客于 4 年前

PYTHON 词图/WordCloud,

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

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

显卡是GTX1070,默认都是通用驱动,鼠标永远在左上角。需要更新驱动才行鼠标虽然永远在左上角但是可以动, 这里我们不用鼠标。 windows键/super键 搜索 additional drivers. 进去以后找到第一个显卡那个,不要用opensorce开源的,用NIVDIA xxxx .利用tab键 然后应用就行了。重启以后就好了。
原创
624阅读
0评论
0点赞
发布博客于 4 年前

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

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

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
原创
6176阅读
0评论
0点赞
发布博客于 4 年前

用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-*- #==========
原创
7407阅读
2评论
1点赞
发布博客于 5 年前

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
转载
1688阅读
0评论
0点赞
发布博客于 5 年前

[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
原创
1415阅读
0评论
1点赞
发布博客于 5 年前

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

[leetcode]55. Jump Game ,C++/PYTHON实现,medium难度
原创
1282阅读
0评论
0点赞
发布博客于 5 年前

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

[leetcode]41. First Missing Positive,C++/python实现,hard难度
原创
798阅读
0评论
0点赞
发布博客于 5 年前

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

Combination sum 2.python实现
原创
1857阅读
0评论
1点赞
发布博客于 5 年前

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

39.COMBINATION SUM,PYTHON实现
原创
5029阅读
0评论
2点赞
发布博客于 5 年前

[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],
原创
1915阅读
0评论
1点赞
发布博客于 5 年前

【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,
原创
5080阅读
0评论
0点赞
发布博客于 5 年前

[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
原创
5503阅读
1评论
4点赞
发布博客于 5 年前

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 
原创
49023阅读
0评论
10点赞
发布博客于 5 年前

[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
原创
708阅读
0评论
1点赞
发布博客于 5 年前

[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
原创
2089阅读
0评论
0点赞
发布博客于 5 年前

[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
原创
1382阅读
0评论
0点赞
发布博客于 5 年前

【转载】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
转载
2048阅读
0评论
1点赞
发布博客于 5 年前

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

Generate Parentheses
原创
2400阅读
0评论
1点赞
发布博客于 5 年前

【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
原创
389阅读
0评论
0点赞
发布博客于 5 年前

【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
原创
2326阅读
0评论
0点赞
发布博客于 5 年前

【leetcode】Integer to Roman--python实现

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

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

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

[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
原创
419阅读
0评论
0点赞
发布博客于 6 年前

文章标题

模式识别复习demo
翻译
317阅读
0评论
0点赞
发布博客于 6 年前

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

马氏距离,贝叶斯,监督非监督
翻译
1183阅读
0评论
1点赞
发布博客于 6 年前

GMM-hmm算法学习笔记

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