出题:判断一个单向链表是否有环,如果有环则找到环入口节点;分析:第一个问题:使用快慢指针(fast指针一次走两步,slow指针一次走一步,并判断是否到达NULL,如果fast==slow成立,则说明链表有环);第二个问题:fast与slow相遇时,slow一定还没有走完一圈(反证法可证明);示意图A...
分类:
其他好文 时间:
2014-05-26 10:22:27
阅读次数:
279
header (ctype.h)Character handling functionsThis
header declares a set of functions to classify and transform individual
characters.FunctionsThese fun...
分类:
其他好文 时间:
2014-05-23 22:04:32
阅读次数:
504
介绍自定一个的Adapter和list的监听
注意
1....
分类:
其他好文 时间:
2014-05-23 00:51:45
阅读次数:
355
Use Reentrant Functions for Safer Signal
Handling使用可重入函数进行更安全的信号处理How and when to employ reentrancy to keep your code bug
free何时及如何利用可重入性避免代码缺陷Dipak J...
分类:
其他好文 时间:
2014-05-22 00:33:49
阅读次数:
389
传统的消息模型有两种模型,队列模型和发布-订阅模式。
1. 队列形式中,一群消费者可能从server那边读消息,而每条消息会流向他们中的一个。
2. 发布-订阅模式中,消息会广播到所有它的消费者们那。
Kafka是使用consumer group这个概念(下面把它翻译为"消费组"),把两者结合了。。
消费者给自己标志了一个消费组名,每条新发布到topic的消息会被传递给订阅它的消费组里的消费者实例,这些消费者实例可以是不同的进程,存在在不同的机器上。
如果所有的消费者在同一个消费组里,那么这相当于是...
分类:
其他好文 时间:
2014-05-21 16:12:44
阅读次数:
279
The final missing piece depends on if you are
using any processor, x86 or x64. The details using these different functions
requires specific handling ...
分类:
其他好文 时间:
2014-05-19 17:35:26
阅读次数:
356
mysqldumpslow报错:Died at /usr/local/mysql/bin/mysqldumpslow line 161, 总结:是因为top数目太多了,mysqldumpslow遍历不过来的缘故。/usr/local/mysql/bin/mysqldumpslow -s -t 15 /root/db01-102-slow.log 1,把r去掉试试,还是报错,参数不识别。[root@...
分类:
数据库 时间:
2014-05-18 04:40:51
阅读次数:
456
1.慢查询日志:slow_launch_time=2
查询大于某个时间的值(单位:s)slow_query_log=on/off
开启关闭慢查询日志slow_query_log_file=/opt/data/host-slow.log
慢查询日志位置2.连接数:max_connections MyS...
分类:
数据库 时间:
2014-05-15 21:44:08
阅读次数:
447
1.慢查询日志:slow_launch_time=2查询大于某个时间的值(单位:s)slow_query_log=on/off开启关闭慢查询日志slow_query_log_file=/opt/data/host-slow.log慢查询日志位置2.连接数:max_connectionsMySQL最大连接数back_log当连接数满了后,设置一个值,允许多少个连接进入等待堆..
分类:
数据库 时间:
2014-05-15 12:44:41
阅读次数:
385
ReduceTask的运行
Reduce处理程序中需要执行三个类型的处理,
1.copy,从各map中copy数据过来
2.sort,对数据进行排序操作。
3.reduce,执行业务逻辑的处理。
ReduceTask的运行也是通过run方法开始,
通过mapreduce.job.reduce.shuffle.consumer.plugin.class配置shuffle的plugin,
...
分类:
其他好文 时间:
2014-05-14 20:23:57
阅读次数:
519