可能大家都使用过condition variable(之后称cv)背景不过多做介绍,使用condition variable的时候都要配合mutex使用,那么mutex就是为了什么呢,为什么要用这个东西呢?为什么要这样设计?mutex多余吗?他是用来保护什么数据呢?ok!让我们来从零开始。condi...
分类:
其他好文 时间:
2015-04-05 06:33:06
阅读次数:
171
可能大家都使用过condition variable(之后称cv)背景不过多做介绍,使用condition variable的时候都要配合mutex使用,那么mutex就是为了什么呢,为什么要用这个东西呢?为什么要这样设计?mutex多余吗?他是用来保护什么数据呢?ok!让我们来从零开始。condi...
分类:
其他好文 时间:
2015-04-04 21:12:36
阅读次数:
156
题目:
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A
man, a plan, a canal: Panama" is a palindrome.
"race
a c...
分类:
其他好文 时间:
2015-04-01 13:28:54
阅读次数:
112
SELECT语句的使用select语句:○5SELECTselect_list○1FROMtable_source○2[WHEREsearch_condition]○3[GROUPBYgroup_by_expression]○4[HAVINGsearch_condition]○6[ORDERBYorder_expresion[ASC|DESC]]SELECT语句执行顺序:A、FROM阶段B、WHERE阶段C、GROUPBY阶段D、HAVING阶..
分类:
数据库 时间:
2015-03-31 20:21:09
阅读次数:
249
SELECT语句的使用select语句:○5SELECTselect_list○1FROMtable_source○2[WHEREsearch_condition]○3[GROUPBYgroup_by_expression]○4[HAVINGsearch_condition]○6[ORDERBYorder_expresion[ASC|DESC]]SELECT语句执行顺序:A、FROM阶段B、WHERE阶段C、GROUPBY阶段D、HAVING阶..
分类:
数据库 时间:
2015-03-31 20:19:42
阅读次数:
270
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is
a palindrome.
"race a car" is not a
...
分类:
其他好文 时间:
2015-03-31 12:54:59
阅读次数:
114
LightOJ 1326 - Race(第二类斯特林数啊 )...
分类:
其他好文 时间:
2015-03-29 10:56:49
阅读次数:
153
练习3-67原文Exercise 3.67. Modify the pairs procedure so that (pairs integers integers) will produce the stream of all pairs of integers (i,j) (without the condition i < j). Hint: You will need to mix in...
分类:
其他好文 时间:
2015-03-29 10:55:03
阅读次数:
160
题意:问n匹马赛跑,一共有多少结局。
两匹马有三种结局
1. Both first
2. horse1 first and horse2 second
3. horse2 first and horse1 second
做法:
dp[i][j] i代表有几匹马,j代表有多少团。
把一样快的马放在一个团里。 按团算 ,两匹马 有 两种, 平局 一个团,dp[2][1]计数1,不平局,有两个团,dp[2][2]计数2。 三匹马的时候,dp[3][1]=dp[2][1]...
分类:
其他好文 时间:
2015-03-29 10:50:02
阅读次数:
152
上一篇讲述了并发包下的Lock,Lock可以更好的解决线程同步问题,使之更面向对象,并且ReadWriteLock在处理同步时更强大,那么同样,线程间仅仅互斥是不够的,还需要通信,本篇的内容是基于上篇之上,使用Lock如何处理线程通信。 那么引入本篇的主角,Condition,Condition.....
分类:
编程语言 时间:
2015-03-28 11:29:21
阅读次数:
155