自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(79)
  • 资源 (4)
  • 收藏
  • 关注

原创 安卓获取手机联系人和号码

package com.example.sysact;import android.annotation.SuppressLint;import android.app.Activity;import android.content.CursorLoader;import android.content.Intent;import android.database.Cu

2016-06-02 12:34:31 678

原创 python mysql增删改查

#coding=utf-8import MySQLdb       #加载mysql模块conn=MySQLdb.connect(host='localhost',port=3306,user='root',passwd='fabregas4',db='test')   #连接数据库cur=conn.cursor()    #得到数据库游标cur.execute("create t

2015-12-24 13:50:15 351

原创 isInterleave

#include#include#include#includeusing namespace std;bool isInterleave(string& s1,string& s2,string& s3){vector>f(s1.size()+1,vector(s2.size()+1,true));for(int i=1;if[i][0]=f[i-1][0]&

2015-11-23 00:12:53 395

原创 maxProfit

#include#include#includeusing namespace std;int maxProfit(vector&prices){const int n=prices.size();if(nreturn 0;vectorf(n,0);vectorg(n,0);for(int i=1,valley=prices[0];i{valle

2015-11-22 21:59:04 719

原创 maximalRectangle

#include#include#includeusing namespace std;int maximalRectangle(vector>&matrix){const int m=matrix.size();const int n=matrix[0].size();vectorh(n,0);vectorl(n,0);vectorr(n,n);int

2015-11-22 17:00:35 341

原创 minCut

#include#include#include#includeusing namespace std;int minCut(string s){const int n = s.size();vectorf(n+1);bool p[100][100];fill_n(&p[0][0], n*n, false);for (int i = 0;i f[i]

2015-11-21 15:35:34 311

原创 maxSubArray

#include#includeusing namespace std;int maxSubArray(int A[],int n){int result=INT_MIN,f=0;for(int i=0;i{f=max(f+A[i],A[i]);result=max(f,result);}return result;}int main(){

2015-11-20 23:02:07 323

原创 triangle

#include#include#includeusing namespace std;int minimumTotal(vector>&triangle){for(int i=triangle.size()-2;i>=0;--i){for(int j=0;jtriangle[i][j]+=min(triangle[i+1][j],triangle[i+1][j

2015-11-20 22:23:02 272

原创 container with most water

#include#include#includeusing namespace std;int maxArea(vector&height){int left = 0;int right = height.size() - 1;int result = 0;while (left {int area = min(height[left], height[

2015-11-11 16:11:46 233

原创 longestSubstring

#include#include#include#includeusing namespace std;int lengthOfLongestSubsring(string s){const int ascII = 26;int last[ascII] = { -1 };int max_len = 0;int start = 0;for (int i =

2015-11-10 22:39:41 357

原创 canJump&&jumpII

#include#include#includeusing namespace std;bool canJump(int a[], int n){int reach = 1;for (int i = 0;i {reach = max(reach, i + 1 + a[i]);}return reach >= n;}bool canJump1(in

2015-11-10 16:20:23 272

原创 二分法pow和sqrt

#includeusing namespace std;int sqrt(int x){if(xreturn 1;int left=1;int right=x/2;//int last_mid;while(left{int mid=left+(right-left)/2;if(x/mid>mid){left=mid+1;// last_m

2015-11-06 22:37:09 441

原创 wordSearch

#include#include#includeusing namespace std;bool dfs(vector>&board,string&word,int index,int x,int y,vector>&visited){if(index==word.size())return true;if(x=board.size()||y>=board[0].s

2015-11-06 17:05:45 268

原创 generateParenthesses

#include#include#includeusing namespace std;void generate(int n,string s,int l,int r,vector&result){if(l==n){s.append(n-r,')');result.push_back(s);return ;}generate(n,s+"(",l+1

2015-11-05 20:12:29 245

原创 combinationSum&&combinationSumII

#include#include#include#includeusing namespace std;void dfs(vector&nums,int gap,int start,vector&intermediate,vector>&result){if(gap==0){result.push_back(intermediate);return;}

2015-11-05 13:29:24 233

原创 storeIpAddresses

#include#include#includeusing namespace std;void dfs(string s,size_t start,size_t step,string&ip,vector& result){if(start==s.size()&&step==4){ip.resize(ip.size()-1);result.push_back(

2015-11-05 12:47:24 307

原创 money

看到校园到处都是车,走在路上,总是不由自主的想着自己啥时候才能买辆车呢,想挣钱,想买车,想挣钱,没有明显的出路,fuck。

2015-10-28 13:15:45 444

原创

啊,从食堂吃饭回来,冷的发抖,回到实验室,瞬间感觉暖暖的,实验室确实比寝室暖和不少,今天实验室没人,一个人待着感觉很惬意,确实比寝室舒服不少,坐着也适合学习,哎,人多了可能有点拘束啥的,不过确实实验室环境好,暖暖的有点让人醉,额,好久没喝啤酒了,明后两天在踢两次球,估计就没机会了,今年,感觉球技涨了不少,还是和浩哥一起踢球爽啊,感觉现在身体状态挺好的,精神也不错,以后每天十二点就睡觉,不熬夜了,伤

2015-10-24 18:12:47 304

原创 python自动加载任意个属性数据

def loadDataSet(fileName):datMat=[];labelMat=[]numFeat=len(open(fileName).readLine().strip().split('\t'))fr=open(fileName)for line in fr.readLines():lineArr=[]curLine=line.strip().split('\

2015-10-18 22:32:48 488

原创

卡里剩下不到一千块钱了,这可咋整,学院的钱和每个月的补助迟迟不发,哎,到月底再不发可就有点难受了,额,最关键是现在没啥收入来源了,不知咋了,郁闷,得赶紧找个,不然到月末了这一千块钱花完了可就真完了,额额额。

2015-10-18 14:09:20 248

原创 压抑

今天上午听了研讨班,突然感觉没跟上大家的节奏,多了许许紧张,额,难过,到了晚上,看完了琅琊榜,突然好惆怅,想接着看点啥,都不知道自己脑子里现在都在想啥,无意间看到了贝弗利山庄,想想自己,岁数不到了,可现在,还是干不了了,哎,压抑,总感觉自己有点麻木了,难受,无奈

2015-10-16 19:56:24 229

原创 抱怨多了,也就被嫌弃了

最近不知为何,一直在抱怨研究生生活,觉得没什么意义,还不如工作,说的多了,人也有点倦了,对什么都提不起精神,过得颓颓废废的,一天天不明不白就过去了,感觉自己跟个废人似的。。没有前进的动力,不知为什么奋斗,感觉自己越来越堕落了,哎,最近代码也不怎么写了,倒是看起了电视剧。。。以前特排斥看电视剧,有时候想给爸妈打打电话,但是又觉得自己对不起爸妈,这一天天过得,额,等过几天发钱了和爸妈说一声,说一会儿吧

2015-10-10 20:17:22 300

原创 python爬虫程序,由根目录一直爬各个网址

#coding=utf-8import urllib2import urllibimport reimport osfrom threading import Threadimport timeclass TimeoutException(Exception): passThreadStop = Thread._Thread__stop#获取私有函数def timel

2015-10-07 17:20:42 825

转载 超时函数装饰器

# -*- coding: utf-8 -*-from threading import Threadimport timeclass TimeoutException(Exception): passThreadStop = Thread._Thread__stop#获取私有函数def timelimited(timeout): def decorator(fun

2015-10-07 15:28:08 881 1

原创 桌面连接配置打印机

对于实验室的一台共享打印机,实验室成员怎样连接到这台打印机并打本本地文件呢?首先,运行里输入桌面连接打开远程桌面连接其次,输入打印机服务器的ip地址然后,点击选项,本地资源,勾选打印机,点击详细信息,选择要共享的本地磁盘最后,点击确定,会跳出输入用户名和密码,输入后便进入打印机服务器了,然后在计算机里找到自己共享的磁盘,选择要打印的文件就ok了图解如下:

2015-10-05 10:15:23 370

原创 so sweet

下午意外接到了电话,晚上去上课,和强哥打了半个点儿的乒乓球,感觉很在状态,觉得只有慢慢打基本会回到高中的状态,下午拉烨神一起去玩,不知道能不能请得动,看了会儿电影,关云长,然后到了点就匆匆去吃饭了,接着坐轻轨去上课,前面没啥好说的,比较枯燥,一直在认真讲,八点过后,许久没见瑶瑶了,混了个发型,剪了短发,貌似成熟了很多,一见面话自然就多了起来,反正每次都不知不觉的时间就过去了,感觉很轻松,因为期间老

2015-09-29 22:43:59 248

原创 maxMascots

#define _USE_MATH_DEFINES#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#

2015-09-29 14:45:34 183

原创 maxHappiness

#define _USE_MATH_DEFINES#include#include#include#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;#

2015-09-29 13:01:46 266

原创 no comapny

每当节日来临的时候,no company,it feels so badly。总感觉节日是别人的节日,还是不在状态,学不进去,感觉自己性格太不好了,是不是有点残废了的感觉,fuck。

2015-09-26 17:33:47 218

原创 countRectangles

#includeusing namespace std;long long countRectangles(int width,int height){long long count=0;for(int i=width;i>0;--i){for(int j=1;j{if(i!=j)count+=(width+1-i)*(height+1-j);}}

2015-09-26 13:09:08 287

原创 无聊

空闲了都不知道干嘛了,无聊,不知道干啥,没有学习的劲头,这就是堕落吗,好久没踢球了,天晴了是不是应该去踢踢,发泄一下自己,感觉一天天过得挺闷得,fuck,心情总是莫名的波动,也不知道为了啥,啊啊啊,how can i do,时间在一点一滴的流逝,找工作所具备的东西你准备好了吗,fuck,貌似我还是缺少动力,没有理想,不知道自己的未来在哪儿,没有奋斗的目标,整的一天天过得浑浑噩噩的,自己也不想这样,

2015-09-25 19:02:19 227

原创 wordLadder

#include#include#include#include#includeusing namespace std;int ladderLength(const string& start,const string& end,const unordered_set& dict){queuecur,next;unordered_setvisited;aut

2015-09-20 20:49:34 336

原创 next_permutation

#include#include#includeusing namespace std;int main(){vectornum;num.push_back(1);num.push_back(2);num.push_back(3);do{for(auto i:num)coutcout}while(next_permutation(num.

2015-09-19 14:05:28 256

原创 增量法subsets

#include#include#include#includeusing namespace std;vector>subsets(vector&s){sort(s.begin(),s.end());vector>result(1);int i=1;for(auto elem:s){result.reserve(2*result.size());

2015-09-17 00:09:06 389

原创 点滴

天龙走了,暑假的活就全部结束了,前两天又接了个,艺术生,感觉很轻松,之前和她妈妈打电话感觉人还可以,但是第一次去上课,见着人就比较别扭,妆画的很浓,年纪不大,她女儿挺好看的,只是话不多,第一次差不多上了两个半小时,一直在上课,基本没说什么闲话,感觉有点闷,上完课,阿姨说和女儿商量,就感觉不对劲,估计还是嫌弃价格高了点,其实就差二十块而已,本以为学艺术的不在乎这些,但是感觉也是家境一般吧,没多说什么

2015-09-14 21:40:35 281

原创 searchRange

#include#include#includeusing namespace std;vector searchRange(int A[],int n,int target){int l=distance(A,lower_bound(A,A+n,target));int u=distance(A,prev(upper_bound(A,A+n,target)));i

2015-09-13 22:52:12 253

原创 findFirstMissingPositive

void bucket_sort(int A[],int n){for(size_t i=0;i{while(A[i]!=i+1){if(A[i]n||A[i]==A[A[i]-1])break;swap(A[i],A[A[i]-1]);}}}int findFirstMissingPositive(int A[],int n){bucket

2015-09-13 20:43:22 207

原创 fuckou

时间一点一滴的过去,然而我却还未明确未来的方向,心中没有任何感觉,只待时光匆匆流逝,心里不免回想一句话,fuckyou,这几天挣了700块钱,不过总共现在也没多少钱,也不想家,也不想吃啥好吃的,好几天没踢足球了,不过也没有特想去踢球的感觉,不过后天得去玩玩了,感觉生活没有一点动力了,好颓废,fuck

2015-09-10 00:47:39 409

原创 maxPathSum

int maxPathSum(TreeNode* root){int maxSum=INT_MIN;dfs(root,maxSum);return maxSum;}int dfs(TreeNode* root,int&maxSum){if(root==nullptr)return 0;int l=dfs(root->left,maxSum);int r=

2015-09-09 22:02:59 321

原创 populate next right pointer in each node

void populate(TreeLinkNode* root){while(root){TreeLinkNode* pre=nullptr;TreeLinkNode* next=nullptr;for(;root;root=root->next){if(!next)next=root->left?root->left:root->right;if(roo

2015-09-09 21:42:13 255

svm核函数及参数优化

svm核函数及参数优化,实现多类分类并进行参数优化

2015-11-22

机器学习必看课件

经典课件,讲解了各类经典算法与实现,大数据入门必看。

2015-04-10

unix环境高级编程

unix高级编程,unix的圣经,又一部经典之作,大师本本经典呀TCP/IP三卷

2014-07-18

华为内部培训资料

华为内部培训资料,想去华为的可以看看,内容讲的很不错

2014-07-17

空空如也

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

TA关注的人

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