09 2016 档案
摘要:写了一个简单的例子,把libevent中的bufferevent网络收发服务和protobuf里面的序列反序列结合起来。 protobuf文件message.proto: 生成接口命令: 服务器端 lserver.cc: 客户端lclient.cc 服务器端和客户端共用的Makefile: 服务器命
阅读全文
摘要:Nginx学习之八-惊群问题 http://blog.csdn.net/xiajun07061225/article/details/9260535 “惊群”,看看nginx是怎么解决它的 http://russelltao.iteye.com/blog/1405352
阅读全文
摘要:Mysql 命令 和 mysqldump的一些操作
阅读全文
摘要:注意这一句 经过实验,填写 (new int[][2]) 或者 (new int[][]) 都是不行的。需要在前一个下标处填写。而填写的数值范围是0到length,再大再小都不行。在这个范围内,返回的结果都是一样的。
阅读全文
摘要:注意,以上代码里面的 >>> 是无符号位移。也就是不管正数负数,左边空出来的位都是补0. << : 左移运算符,num << 1,相当于num乘以2 >> : 右移运算符,num >> 1,相当于num除以2 >>> : 无符号右移,忽略符号位,空位都以0补齐 而C++里面的 >> 根据编译器不同有
阅读全文
摘要:https://leetcode.com/problems/trapping-rain-water-ii/ // https://discuss.leetcode.com/topic/60418/java-solution-using-priorityqueue/2 // 这个解法真的好棒,真的太棒了 // 一维的也能搞定// 利用一个PriorityQueue,从小往大排的 import ...
阅读全文
摘要:https://leetcode.com/problems/sum-of-left-leaves/ /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(in...
阅读全文
摘要:epoll的总结之一基本的参数设置 http://fpcfjf.blog.163.com/blog/static/55469793201452095738566/?suggestedreading&wumii epoll的总结之四LT和ET使用EPOLLONESHOT http://fpcfjf.b
阅读全文
摘要:优秀大数据GitHub项目一览 http://blog.csdn.net/YaoXTao/article/details/50540485
阅读全文
摘要:一直在处理高可用高并发的服务。看到网上有一个系列的文章,写的不错。跟进一下。 一:http://blog.csdn.net/feitianxuxue/article/details/8936802 二:http://blog.csdn.net/feitianxuxue/article/details
阅读全文
摘要:JS知识栈:Node为主,JQuery为辅,Bootstrap & React为辅辅,其他如Angular了解用途即可 今天在学习ReactJS和NodeJS,看到关于ReactJS的这篇文章,还是很不错的:《一看就懂的ReactJs入门教程-精华版》 http://www.cnblogs.com/
阅读全文
摘要:参考了这篇文章的一些内容: http://xm-king.iteye.com/blog/770721 记住以下这张表: 我在springdemo库里面建了一个表: CREATE TABLE `tx` ( `id` bigint(11) NOT NULL auto_increment, `num` b
阅读全文
摘要:参考了这篇文章: http://www.ibm.com/developerworks/cn/linux/l-cn-gpb/ 开发环境在我的线下开发机器的 /home/work/data/code/protobuf_demo 用jumbo安装的protobuf,安装目录在/home/work/.jum
阅读全文
摘要:http://wiki.baidu.com/display/RPC/Threading+Overview#ThreadingOverview-单线程reactor Threading Overview 同一目录下还有其他一些 RPC in Depth,需要好好看一下。 另外有一篇性能测试相关的文章:
阅读全文
摘要:Redis 持久化,有两种: rdb 和 aof, 今天会上提到微博架构以Redis为主, 以下是找到的Infoq上面的一些微博相关的文章,需要看: http://www.infoq.com/cn/articles/weibo-platform-archieture 亿级用户下的新浪微博平台架构 h
阅读全文
摘要:今天看到这篇文章,讲了Mac中的各种符号,还是很不错的。 http://www.cnblogs.com/jimcheng/articles/4156268.html
阅读全文
摘要:有了之前文章搭建的SSH框架之后,现在搭建基于Mybatis的框架。主要基于如下这篇文章: http://blog.csdn.net/gallenzhang/article/details/51932152 同时也下载了源代码,放在:/Users/baidu/Documents/Data/Inter
阅读全文
摘要:原文:http://uikoo9.com/blog/detail/hpp 不错的hybrid app框架:http://www.dcloud.io/case/#group-1
阅读全文
摘要:先贴原文所在个人博客: http://uikoo9.com/ 今天看了一些这个人的文章,还是有一定见解的,比如下面这篇 《如何快速开发出一个高质量的APP——创业谈》 http://uikoo9.com/blog/detail/wonder-app 贴出文章以做记录 另外,其中提到的几个第三方服务资
阅读全文
摘要:今天看到一篇不错的文章: 从Java的角度理解前端框架,nodejs,reactjs,angularjs,requirejs,seajs http://blog.csdn.net/uikoo9/article/details/45999745 (PS:还有另一篇文章也可以看看:http://uiko
阅读全文
摘要:在按照前面文章中方法搭建Mysql数据库之后,发现其他机器还是不能访问, 参考以下文章对权限进行修改之后,发现本地机器中root不能访问了。 http://www.cnblogs.com/ycsfwhh/archive/2012/08/07/2626597.html 后来使用 select host
阅读全文
摘要:按照上篇装过Tomcat之后。 本机本来装了IDEA和Maven。 参考以下这篇 https://my.oschina.net/gaussik/blog/385697 《使用IntelliJ IDEA开发SpringMVC网站(一)开发环境》 其中初始化项目的时候非常慢,需要参考以下这篇来进行: h
阅读全文
摘要:1. 官网 http://tomcat.apache.org/ 下载apache包,我下的8.5 注意要下core包的tgz版本,我开始下了full doc. 2. 拷贝解压到 /Library, 然后 sudo chmod 755 /Library/apache-tomcat-8.5.5/bin/
阅读全文
摘要:1、如果jumbo不存在,先安装jumbo 1、如果jumbo不存在,先安装jumbo 1、如果jumbo不存在,先安装jumbo 参考 http://hetu.baidu.com/api/tool/show?toolId=174: bash -c "$( curl http://jumbo.bai
阅读全文
摘要:https://leetcode.com/problems/remove-k-digits/ // 参考了这里的 // https://discuss.leetcode.com/topic/59327/o-n-solution/3 public class Solution { public String removeKdigits(String num, int k) { ...
阅读全文
摘要:https://leetcode.com/problems/frog-jump/ // 受以下网页启发,用递归可行 // https://discuss.leetcode.com/topic/59337/easy-version-java public class Solution { Map mp; private int[] stones; public bool...
阅读全文
摘要:https://leetcode.com/problems/nth-digit/ public class Solution { public int findNthDigit(int n) { int k = 9; int b = 1; // 需要加上对b的限制 while (b k*b) { ...
阅读全文
摘要:https://leetcode.com/problems/binary-watch/ // 参考 https://discuss.leetcode.com/topic/59374/simple-python-java // 非常棒的方法 public class Solution { public List readBinaryWatch(int num) { Li...
阅读全文
摘要:https://leetcode.com/problems/elimination-game/ // 一行代码就可以,不过原理有些复杂 // https://discuss.leetcode.com/topic/58042/c-1-line-solution-with-explanation // return n == 1 ? 1 : 2 * (1 + n / 2 - lastRemaini...
阅读全文
摘要:https://leetcode.com/problems/evaluate-division/ public class Solution { private Map mp; private class Item { public String str; public double prop; public Item(Strin...
阅读全文
摘要:https://leetcode.com/problems/random-pick-index/ public class Solution { private Map mp; private Random rand; public Solution(int[] nums) { mp = new HashMap(); for ...
阅读全文
摘要:https://leetcode.com/problems/integer-replacement/ // 除了首位的1,其他的1需要2次操作,0需要1次操作。 // 所以尽量把1变成0 // 所以,3直接得出结果2, // 其他的,01->-1,11->+1 public class Solution { public int integerReplacement(int inn)...
阅读全文
摘要:https://leetcode.com/problems/rotate-function/ public class Solution { public int maxRotateFunction(int[] A) { int all = 0; int sum = 0; int ret = Integer.MIN_VALUE; ...
阅读全文
摘要:public class Solution { public int longestSubstring(String s, int k) { // Find count of each char HashMap mp = new HashMap(); Object intObj; for (int
阅读全文
摘要:https://leetcode.com/problems/decode-string/ public class Solution { private String s; private int newPos; public String decodeString(String ins) { s = '.' + ins + ']'; ...
阅读全文
摘要:https://leetcode.com/problems/utf-8-validation/ public class Solution { public boolean validUtf8(int[] data) { int last = 0; for (int i=0; i 0) { if (str.length()...
阅读全文
摘要:public class Solution { public boolean isSubsequence(String s, String t) { int idx = 0; for (int i=0; i<t.length()&&idx<s.length(); i++) { if (s.charAt(idx) == t.charA...
阅读全文