原创 用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

原创 [leetcode]40. Combination Sum II ,python實現【medium難度】

題目 Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the ca

原创 kaldi 安裝ubuntu 16.04

首先下載kaldi包 git clone https://github.com/kaldi-asr/kaldi.git 然後安裝依賴庫 進 cd tools tools文件 運行 ./extras/check_dependenci

原创 Python if 和 for 的多種寫法

a, b, c = 1, 2, 3 【對比Cpp裏:c = a >b? a:b】這個寫法,python只能常規的空行,縮進嗎? 人生苦短,我用python,下面介紹幾種if的方便的方法。 1.常規 if a>b:     c =

原创 [leetcode]47. Permutations II,python實現

題目: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,

原创 sublime 3 註冊碼+PYTHON 環境配置+pylint插件path問題+package control找不到packages解決方法。

sublime 3 驗證碼,2016年6月親測可用: 轉載: http://blog.sina.com.cn/s/blog_68e267e10102v76h.html sublime 3 ,python配置 插件: 遇到了兩個問題

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

ubuntu直接安裝anaconda是不能直接使用pip 的,因爲pip install需要sudo權限,而sudo pip是系統自帶的python的pip 這兩個是不一樣的。 之前還試過在~/anaconda2/lib/python

原创 UBUNTU16.10系統,顯卡GTX1070,鼠標一直在左上角

顯卡是GTX1070,默認都是通用驅動,鼠標永遠在左上角。需要更新驅動才行 鼠標雖然永遠在左上角但是可以動, 這裏我們不用鼠標。 windows鍵/super鍵 搜索 additional drivers. 進去以後找到第一個顯卡那

原创 【leetcode】 46. Permutations ,python實現

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

原创 PYTHON 詞圖/WordCloud,

需要兩個庫一個是jieba切詞庫,將一段句子切詞用法比較簡單。就是 import jieba print " ".join(jieba.cut('我是來自中國北京某某大學的一名碩士研究生,這是我的測試語句,下面測試北京大學生和北京大學學生

原创 python 合併 累加兩個dict

比如說有兩個dict:x和y 1.比較快的自己寫的, def merge_dict(x,y): for k,v in x.items(): if k in y.keys():

原创 vim 搜索後大小寫替換

利用vim的正則表達式模塊 下面的代碼是,全文變成小寫, :%s/.*/\L&/g \L 是小寫; \U 是大寫; & &是正則表達式全部匹配項, 其他的還有:\1,\2,\3,…,\9。表示第1,2,3…9個匹配項。 比如說想替換

原创 [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 elem

原创 [leetcode]39. Combination Sum,python實現【Medium難度】

題目: Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidat

原创 [leetcode]55. Jump Game ,C++/PYTHON實現,medium難度

Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element