题目描述:
Given a linked list, return the node where the cycle begins. If there is no cycle, return null.
Follow up:
Can you solve it without using extra space?
思路:
设置一个快指针fast,一个慢指针slow。快指...
分类:
其他好文 时间:
2014-11-11 16:41:06
阅读次数:
179
最近因为工作需要,简单的学习了一下SEH的异常处理机制和使用方法。小结如下:一、什么是SEH?SEH("Structured Exception Handling"),即结构化异常处理,是微软在Windows系统中引入的异常处理机制。与C++的try…catch…类似,但是更强大更全面一些。二、为什...
分类:
其他好文 时间:
2014-11-09 19:23:45
阅读次数:
310
一般通过以下两种方式定位执行效率较低的 SQL 语句。通过慢查询日志定位那些执行效率较低的 SQL 语句,用 --log-slow-queries[=file_name] 选项启动时, mysqld 会 写一个包含所有执行时间超过 long_query_time 秒的 SQL 语句的日志文件,通过查...
分类:
数据库 时间:
2014-11-09 08:32:43
阅读次数:
163
背景是某个业务的logdb历史oss_log(MyISAM表类型)例行删除,有时候会告"deadlock"。分析slow log发现有些删除需要很长时间,比如:drop table 2014_10_17_oss_abandonquest 花费了15041.2410秒。删除行为在凌晨4点发出,刚好落在备份期间,因为5.5有了MDL(Meta data lock),所以–single-transact...
分类:
数据库 时间:
2014-11-09 01:07:58
阅读次数:
187
Linux 进程间通信(posix消息队列 简单)实例详情见: http://www.linuxidc.com/Linux/2011-10/44828.htm编译:gcc -o consumer consumer.c -lrtgcc -o producer producer.c -lrt/* * *...
分类:
系统相关 时间:
2014-11-08 23:33:06
阅读次数:
364
今天在跑dubbo 的 DemoService 2.5.4-SNAPSHOT版本的时候,遇到到一个奇怪的问题。consumer怎么都连接不上provider的服务。最后才发现是由于dubbo自 己实现的检测本地IP地址代码不够强壮造成的。你这里的provider实际上是运行在A地址上,但是dubbo...
分类:
Web程序 时间:
2014-11-07 18:39:59
阅读次数:
196
http://dev.mysql.com/doc/refman/5.6/en/innodb-auto-increment-handling.html MySQL/InnoDB处理AUTO_INCREMENT_1 AUTO_INCREMENT Handling in InnoDB 下面所使用的表 CREATE?TABLE?people??(
????perso...
分类:
数据库 时间:
2014-11-07 17:15:25
阅读次数:
297
Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds'
数据源在国内访问网速过慢,可参考以下数据源:
http://mongo.a.mesa.io/repo/redhat/os/x86_64/
http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
http://repo.mongodb.org/repo/redhat/os/x86_64...
分类:
数据库 时间:
2014-11-06 21:54:25
阅读次数:
290
threading
time
Producer(threading.Thread):
run(self):
count
True:
con.acquire():
count>1000:
con.wait()
:
count=count+100
msg=self.name++str(count)
msg
con.notify()
con.release()
time.sleep(1)
Consumer(threading.Thread):
run(self):
count
True:
con.acqu..
分类:
编程语言 时间:
2014-11-06 17:47:36
阅读次数:
239
SEHOP,Structed Exception Handling Overwrite Protection,一种比 SafeSEH 更严厉的保护机制。Windows Vista SP1 开始支持 SEHOP,但 Vista 和 Win7 中默认不启用,可以对这两个版本的系统打补丁以支持 SEHOP...
分类:
其他好文 时间:
2014-11-05 22:55:30
阅读次数:
417