- (void)loadAssets {
// Initialise
_assets = [NSMutableArray new];
_assetLibrary = [[ALAssetsLibrary alloc] init];
// Run in the background as it takes a while to get a...
分类:
其他好文 时间:
2014-06-05 12:06:55
阅读次数:
215
一直没有认真觉察UPDATE操作的锁,最近在MSDN上看到一个问题,询问堆表更新的死锁问题,问题很简单,有类似这样的表及数据:CREATE TABLE dbo.tb( c1 int, c2 char(10), c3 varchar(10));GODECLARE @id int;SET @id = 0;WHILE @id 5BEGIN; SET...
分类:
其他好文 时间:
2014-06-05 10:24:32
阅读次数:
271
很多的开源软件在安装过程中会出现找不到动态库的问题我在ubuntu12.04安装lxc时,没有出现这问题,但在centos6.5的时候出现了这问题fix:#find / -name liblxc.so.1#echo "/usr/local/lib/" >> /etc/ld.so.conf#ldconfig...
分类:
其他好文 时间:
2014-06-05 06:23:02
阅读次数:
243
用于大型程序的工具--异常处理[续2]八、自动资源释放 考虑下面函数:void f()
{
vector v;
string s;
while (cin >> s)
{
v.push_back(s);
}
string *p = new string[v.size()];
//...
delete p;
}
在正...
分类:
编程语言 时间:
2014-06-05 06:07:27
阅读次数:
393
链接:http://poj.org/problem?id=3259
Description
While exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path t...
分类:
其他好文 时间:
2014-06-05 05:26:33
阅读次数:
240
本文主要讲述基本的控制语句,if ,for ,while.但是里面很有可能有一些基础东西你没有注意到的!
在文章中用if for,while来实现了经典的猜数字,以及输出完美数(什么?完美数不知道?!开玩笑吧!)。
浅显易懂的例子和程序,最适合新手不过了。...
分类:
编程语言 时间:
2014-06-04 23:47:58
阅读次数:
442
最近遇到一个问题.就是
我在io线程里不断的把一个函数调用放到队列里
然后ruby线程就不断的从这个队列里取出函数之争并执行.
典型的 消费者模式.
我以前以为是这样...
这是work线程
pthread_mutex_lock(&mutex2)
while(( invoke = get_invoke() ) != NULL){
do_invoke(invo...
分类:
其他好文 时间:
2014-06-04 22:35:56
阅读次数:
408
#include
#include
#include
#include
using namespace std;
int pow(int x, int n)
{
int result = 1;
while (n > 0)
{
if (n % 2==1)
result *= x;...
分类:
其他好文 时间:
2014-06-03 05:08:33
阅读次数:
399
1.判断一个数是都是回文数
#include
int main(void)
{
int a[100] = {0};
int n;
printf("input n:");
scanf("%d", &n);
int i, k, j;
k = 0;
j = 0;
while(n != 0)
{
a[k++] = n % 10;
n = n / 10;
j+...
分类:
编程语言 时间:
2014-06-03 03:26:18
阅读次数:
255
一 while循环二do while循环三
for循环for循环的执行顺序用如下表达式:for(expression1;expression2;expression3) 循环变量初值; 循环条件;
循环变量增量{ expression4;} 执行的顺序应该是:1)第一次循环,即初始化循环。 ...
分类:
编程语言 时间:
2014-05-31 01:00:04
阅读次数:
364