摘要: 最近忽然冒出来的一个需求:把平时经常要保存到为知笔记的文章发送到kindle再看一遍。 Kindle官方账号:链接 加入白名单的账号:kindle@eub-inc.com 沃看科技:链接 http://www.send2kindle.cn/ En2Kindle:链接 http://www.en2ki 阅读全文
posted @ 2016-01-29 12:54 daijkstra 阅读(213) 评论(0) 推荐(0) 编辑
摘要: python爬取信息总结 阅读全文
posted @ 2016-01-28 12:57 daijkstra 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2016-01-20 10:45 daijkstra 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 硬中断中断指当出现需要时,CPU暂时停止当前程序的执行转而执行处理新情况的程序和执行过程。软中断 阅读全文
posted @ 2016-01-19 15:37 daijkstra 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Ubuntu 14.04 配置VIMhttps://github.com/amix/vimrcset nuSHELLhttps://github.com/robbyrussell/oh-my-zshZSH THEMEhttp://blog.ysmood.org/my-ys-terminal-them... 阅读全文
posted @ 2016-01-19 14:26 daijkstra 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Unix/Linux编程实践教程有两道习题8.4/8.5main() { int fd; int pid; char msg1[]="Test 1 2 3 ..\n"; char msg2[]="Hello, hello\n"; fd=creat("tes... 阅读全文
posted @ 2016-01-18 10:41 daijkstra 阅读(974) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/string-to-integer-atoi/class Solution {public: int myAtoi(string str) { if(str.empty()) return 0; int s... 阅读全文
posted @ 2015-12-31 15:18 daijkstra 阅读(628) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/reverse-integer/溢出处理,最简洁形式class Solution {public: int reverse(int x) { int res=0; while(x!=0){ ... 阅读全文
posted @ 2015-12-30 16:41 daijkstra 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 《将博客搬至CSDN》 阅读全文
posted @ 2015-12-03 10:59 daijkstra 阅读(172) 评论(0) 推荐(0) 编辑
摘要: // at least two nodesif(!head || !head->next) return head;// find the middle nodeListNode *slow = head;ListNode *fast = head;while(fast->next && fast-... 阅读全文
posted @ 2015-10-08 16:53 daijkstra 阅读(332) 评论(0) 推荐(0) 编辑
摘要: 构造函数不能声明为虚函数,析构函数可以声明为虚函数,而且有时是必须声明为虚函数。不建议在构造函数和析构函数里面调用虚函数。构造函数不能声明为虚函数的原因是:构造一个对象的时候,必须知道对象的实际类型,而虚函数行为是在运行期间确定实际类型的。而在构造一个对象时,由于对象还未构造成功。编译器无法知道对象... 阅读全文
posted @ 2015-09-28 15:16 daijkstra 阅读(239) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #include using namespace std;int edit(string str1, string str2){ int res; int n1 = str1.size(); int n2 = str2.size... 阅读全文
posted @ 2015-09-22 11:40 daijkstra 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 昨天今日头条笔试,发现好简单,一写出了几个问题,回来才想出来。一个长度不超过10000的整数数组,里面有若干个0,请事先一段代码,将数组中值为0的元素移动到数组的最前面,其余元素相对位置保持不变。#include #include using namespace std;// 此处忘记引用了void... 阅读全文
posted @ 2015-09-17 11:08 daijkstra 阅读(445) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/valid-number/使用if-else实现DFAclass Solution {public: bool isNumber(string s) { while(!s.empty() && s[0] == ' ') ... 阅读全文
posted @ 2015-09-16 13:55 daijkstra 阅读(196) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/single-number-iii/Given an array of numbersnums, in which exactly two elements appear only once and all the other elemen... 阅读全文
posted @ 2015-09-15 15:25 daijkstra 阅读(133) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/single-number-ii/Given an array of integers, every element appears three times except for one. Find that single one.在网上看... 阅读全文
posted @ 2015-09-15 14:44 daijkstra 阅读(544) 评论(0) 推荐(0) 编辑
摘要: 依然二分,转向条件,容易出问题的地方。对于<=情况,截止区间是0;使用mid-1需要多进行一次查找通过left=mid+1修正区间;对于<情况,截止区间是1;使用right=mid可以直接得到正确区间。https://leetcode.com/problems/first-bad-version//... 阅读全文
posted @ 2015-09-15 10:51 daijkstra 阅读(164) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/implement-queue-using-stacks/class Queue {private: stack in,out; public: // Push element x to the back of queue... 阅读全文
posted @ 2015-09-14 16:26 daijkstra 阅读(228) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: int nthUglyNumber(int n) { if(n k(n); k[0] = 1; for(int i = 1; i =1 阅读全文
posted @ 2015-09-06 15:25 daijkstra 阅读(648) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/h-index/class Solution {public: int hIndex(vector& citations) { priority_queue pq; for(int i=0;i= pages... 阅读全文
posted @ 2015-09-06 14:55 daijkstra 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 最近正在学习如何写一个HTTP服务器,用个帖子记录开发的过程目前主要的写法都是来自CS:APP中写法已完成rio.h Robust I/O[CSAPP]dgb.h 关于debug调试的写法来自如下参考资料调试 | HaHackhttp://www.hahack.com/wiki/c-debug.ht... 阅读全文
posted @ 2015-08-24 09:32 daijkstra 阅读(133) 评论(0) 推荐(0) 编辑
摘要: // NumberOfK.cpp : Defines the entry point for the console application.//// 《剑指Offer——名企面试官精讲典型编程题》代码// 著作权所有者:何海涛#include "stdafx.h"int GetFirstK(int... 阅读全文
posted @ 2015-08-19 14:41 daijkstra 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 常用命令Linux批量解压缩命令 ls简直神器http://blog.csdn.net/vindak/article/details/7823726ubuntu解压缩乱码通过unzip行命令解压,指定字符集unzip -O CP936 xxx.zip (用GBK, GB18030也可以)有趣的是un... 阅读全文
posted @ 2015-08-14 14:54 daijkstra 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 主要参考这个http://ingramchen.io/blog/2014/07/ubuntu-noto-font.html修正文章中无效的字体名称设置。首先下载谷歌的思源黑体,思源黑体主页:http://www.google.com/get/noto/官方安装方法链接:http://www.goog... 阅读全文
posted @ 2015-08-10 19:25 daijkstra 阅读(3032) 评论(0) 推荐(0) 编辑
摘要: 7.30适配器模式http://www.jikexueyuan.com/course/1335.html 阅读全文
posted @ 2015-07-30 19:58 daijkstra 阅读(99) 评论(0) 推荐(0) 编辑
摘要: 7.30搞定 基本可以apue16章linux socke编程实例:一个简单的echo服务器程序http://blog.csdn.net/linyt/article/details/1719647linux socke编程实例:一个简单的echo服务器程序(2)http://blog.csdn.ne... 阅读全文
posted @ 2015-07-30 18:19 daijkstra 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Linux Shell脚本教程:30分钟玩转Shell脚本编程http://c.biancheng.net/cpp/shell/Linux入门教程(更新完毕)http://c.biancheng.net/cpp/linux/刷掉此页2015.7.29始 阅读全文
posted @ 2015-07-29 22:03 daijkstra 阅读(126) 评论(0) 推荐(0) 编辑
摘要: http://www.lintcode.com/zh-cn/problem/search-a-2d-matrix-ii/class Solution {public: /** * @param matrix: A list of lists of integers * @par... 阅读全文
posted @ 2015-07-29 16:50 daijkstra 阅读(194) 评论(0) 推荐(0) 编辑
摘要: //Definition of TreeNode:class TreeNode {public: int val; TreeNode *left, *right; TreeNode() { this->val = NULL; } TreeNode(int ... 阅读全文
posted @ 2015-07-29 15:19 daijkstra 阅读(150) 评论(0) 推荐(0) 编辑
摘要: class Solution {public: char *m_pData; Solution() { this->m_pData = NULL; } Solution(char *pData) { this->m_pData = pData; ... 阅读全文
posted @ 2015-07-28 20:36 daijkstra 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 深入理解JavaScript系列http://www.cnblogs.com/TomXu/archive/2011/12/15/2288411.htmlJavaScript Gardenhttp://bonsaiden.github.io/JavaScript-Garden/ 阅读全文
posted @ 2015-07-20 15:03 daijkstra 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 写了个脚本自动生成pdf上传github受不了每次相同的commit决定使用脚本传参简单好用使用加粗方法,更复杂的可以参考下面两个详解。如何给shell脚本传参数http://jingyan.baidu.com/article/b24f6c822645b786bfe5daff.html#!/usr/... 阅读全文
posted @ 2015-07-15 22:50 daijkstra 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 之前为了写leetcode cpp pdf学会了github这次完整学习一下。7.15-7.16完成撒花http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000git-cheet-sheeth... 阅读全文
posted @ 2015-07-15 22:37 daijkstra 阅读(1121) 评论(0) 推荐(0) 编辑
摘要: http://workbench.haefelinger.it/archives/148XeTeX allows me to hack away directly in Unicode. But what’s even more cool is that I can just use the fon... 阅读全文
posted @ 2015-07-15 22:15 daijkstra 阅读(635) 评论(0) 推荐(0) 编辑
摘要: 如何搭建一个独立博客——简明Github Pages与Hexo教程http://cnfeat.com/2014/05/10/2014-05-11-how-to-build-a-blog/利用github-pages建立个人博客http://coolshell.info/blog/2015/03/gi... 阅读全文
posted @ 2015-07-15 21:16 daijkstra 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 参考连接:http://www.zhixing123.cn/ubuntu/41953.htmlhttp://sixipiaoyang.blog.163.com/blog/static/6232358820144654028830/一直连接失败无法服务,发现缺少ssh服务安装sshsudo apt-g... 阅读全文
posted @ 2015-07-13 16:08 daijkstra 阅读(313) 评论(0) 推荐(0) 编辑
摘要: http://blog.sina.com.cn/s/blog_5e16f1770100grtj.html我们在输入一篇文章或者书的标题的时候,会自动加入当天的日期,但是我们如果想把计算机的时间加入文档,该如何实现呢?解决方案:有两个宏包提供了打印输出时间的功能,The datetime packag... 阅读全文
posted @ 2015-07-09 22:32 daijkstra 阅读(1520) 评论(0) 推荐(0) 编辑
摘要: http://www.cnblogs.com/xia520pi/archive/2014/06/30/3817109.html[root@localhost bin]#chmod +x date 阅读全文
posted @ 2015-07-09 21:51 daijkstra 阅读(423) 评论(0) 推荐(0) 编辑
摘要: leetcode题解https://github.com/DaI253/leetcode-cpp,包含大量pdf历史文件,准备清理其中的历史文件,缩小项目体积。http://my.oschina.net/jfinal/blog/215624git filter-branch --tree-filte... 阅读全文
posted @ 2015-07-09 16:13 daijkstra 阅读(402) 评论(0) 推荐(0) 编辑
摘要: 双调排序主要参考http://www.cs.rutgers.edu/~venugopa/parallel_summer2012/bitonic_overview.html单机版http://blog.csdn.net/sunmenggmail/article/details/42869235cuda... 阅读全文
posted @ 2015-07-09 15:54 daijkstra 阅读(511) 评论(0) 推荐(0) 编辑