摘要:
1: apt-get install --no-install-recommends open-vm-dkms 2: apt-get install open-vm-tools两步搞定 阅读全文
摘要:
/*FileName:rwlock.cDate:20100310Desc:g++rwlock.c-lpthread-odemo使用读写锁,在读大于写情况下使用读写锁*/#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<pthread.h>#include<signal.h>intisRun=1;//程序运行标志structConfigInfo{pthread_rwlock_trwlock;charpath[128+ 阅读全文
摘要:
/*FileName:mutex.cDate:20100310Desc:gccmutex.c-lpthread-odemo用互斥锁传送安全线程参数,删除加锁和解锁试试效果*/#include<stdio.h>#include<stdlib.h>#include<string.h>#include<unistd.h>#include<pthread.h>pthread_mutex_tmutex;void*thread_fun(void*arg){intn=*((int*)arg);//已经变量线程内部私有变量了pthread_mutex 阅读全文
摘要:
//为免忘记,记录一下,来自http://www.partow.net/programming/hashfunctions/#StringHashingunsignedintRSHash(char*str,unsignedintlen){unsignedintb=378551;unsignedinta=63689;unsignedinthash=0;unsignedinti=0;for(i=0;i<len;str++,i++){hash=hash*a+(*str);a=a*b;}returnhash;}/*EndOfRSHashFunction*/unsignedintJSHash(ch 阅读全文
摘要:
uses WinINet;Function TForm1.GetCacheVerifyCodeFile(VerifyCodeURL:String; Var CacheVerifyCodeFile:String):Boolean;VarlpEntryInfo: PInternetCacheEntryInfo;dwEntrySize, dwLastError, Hwd: LongWORD; i, j:... 阅读全文