继续并发专题~
这次介绍CyclicBarrier:看一眼API的注释:
/**
* A synchronization aid that allows a set of threads to all wait for
* each other to reach a common barrier point. CyclicBarriers are
* useful in program...
分类:
编程语言 时间:
2014-05-25 18:15:06
阅读次数:
316
loadHeadersFromResource(R.xml.settings_headers, headers);
error: xml cannot be resolved or is not a field, but res/xml/settings_headers.xml exists.
Every xml file will have its own ID in R.java,...
分类:
其他好文 时间:
2014-05-25 16:19:23
阅读次数:
206
【题目】
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Example 1:
Given intervals [1,3],[6,9], insert and mer...
分类:
其他好文 时间:
2014-05-25 12:56:43
阅读次数:
271
以前在网上看到这样一句话————“计算机中大多数问题可以以管理员身份运行得到解决”,当时没明白是什么意思。最近安装数据库,orcal,第一次使用很正常,以后每次打开都是“闪闭”,也看不到提示什么错误。试了很多方法,本想放弃重装,最后“以管理员身份运行”得到解决,顺利打开。以前用精简版的VC6.0,没...
分类:
其他好文 时间:
2014-05-25 12:45:22
阅读次数:
196
Windows开机自启动的程序很多,包括系统软件、杀毒软件、一些其他安装软件等等。当然可以禁止,通过软件管理或者手动删除对应的注册表中的项即可!但是为了系统的服务或者操作上的方便,我们往往需要开机自启动一些服务。
以下是开机的启动项: Qt也不例外,在发布Qt程序的时候,我们通常也需要...
分类:
其他好文 时间:
2014-05-25 12:25:53
阅读次数:
194
以前一直一位set.end()是代表最后一个元素,原来只是个标记,怪不得一直出错,同时erase在multiset中会删除相同的元素。
本题很明显的greedy,排列后前后两个元素能否组合,不能删除最大元素,再组合,写的比较蠢,不想改了#include
#include
using namespace std;
int main()
{
int N;
cin>>N;
while(N--)
...
分类:
其他好文 时间:
2014-05-25 11:19:57
阅读次数:
227
昨天同事在做主从时,从库报如下错误:Got fatal error 1236 from master when reading data from binary log: 'Misconfigured master - server id was not set'粗粗看好像是master的server-id没有设置,但同事做如下查询:备库采集:
root@localhost Fri May 23 ...
分类:
数据库 时间:
2014-05-25 09:57:24
阅读次数:
330
V3 RC4 版本图片
显示一个飞船
将Chapter1中 SpaceCargoShip.png 文件 添加到项目里面。
代码在 init :
CCSprite *spaceCargoShip = [CCSprite spriteWithImageNamed:@"SpaceCargoShip.png"]; [spaceCargoShip set...
分类:
其他好文 时间:
2014-05-25 09:39:59
阅读次数:
195
【题目】
The set [1,2,3,…,n] contains a total of n! unique permutations.
By listing and labeling all of the permutations in order,
We get the following sequence (ie, for n = 3):
"123"
"132"
"213"
"231"
"312"
"321"
Given n and k, return the kth permutation ...
分类:
其他好文 时间:
2014-05-25 06:13:37
阅读次数:
276
1.
搭建界面1> 上半部分,固定的,可以用Storyboard实现2> 下半部分,根据题目变化,可以考虑用代码实现2.
图片的放大缩小1> 放大过程(1) 增加蒙版(遮罩),蒙版默认alpha = 0(2) 将图片移动到视图的顶层[self.view
bringSubviewToFront:图片的...
分类:
移动开发 时间:
2014-05-25 03:17:42
阅读次数:
358