摘要:
#include class CPoint{private:int x,y;public:CPoint(int xx=0, int yy=0){x = xx;y = yy;}void disp(){cout<<"("<<x<<','<<y<<")"<<endl;}CPoint operator + (CPoint q){return CPoint(x+q.x,y+q.y);}CPoint ope... 阅读全文
摘要:
#coding=utf-8import osimport string num = 1path = raw_input("Input the path:")if '' == path: path = os.getcwd()if not os.path.exists(path): print 'Path not exist!'else: for root, dirs, files in os.wa... 阅读全文
摘要:
RGB2HEX Try it yourself: R: G: B: Try it yourself: R: G: B: 本文使用Blog_Backup未注册版本导出,请到soft.pt42.com注册。 阅读全文
摘要:
import os # Create the file index include the sub directorydef create_file_index(index_file,path): """docstring for create_file_index""" fnum = 0 # os.walk() can list the content of sub directory for... 阅读全文
摘要:
package eddy.wd;import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.net.HttpURLConnection;import java.net.URL;import java.net.URLEncoder;import java.... 阅读全文
摘要:
OS: Mac os X leopardCrossover 91. Open Crossover and select configure-> manage bottles->push the + button on the left downside of Manage Bottles window, give a name for your bottle and select which w... 阅读全文
摘要:
本文使用Blog_Backup未注册版本导出,请到soft.pt42.com注册。 阅读全文
摘要:
python的第三方模块越来越丰富,涉及的领域也非常广,如科学计算、图片处理、web应用、GUI开发等。当然也可以将自己写的模块进行打包或发布。一简单的方法是将你的类包直接copy到python的lib目录,但此方式不便于管理与维护,存在多个python版本时会非常混乱。现介绍如何编写setup.py来对一个简单的python模块进行打包。一、编写模块进入项目目录#cd /home/pysetu... 阅读全文
摘要:
读-写锁如果线程只是读取共享存储器,那么允许多个线程进入临界区。任意数量的线程可以拥有一个读-写锁来进行读操作,但是如果要写存储器,就只允许一个线程进行访问。读写锁常用于读数据比写数据多的应用中。POSIX定义pthread_rwlock_t为读写锁。它与互斥锁有相同的操作,只是有一个pthread_rwlock_rdlock读封锁操作()和pthread_rwlock_wrlock()写封锁操... 阅读全文
摘要:
任务间并发的同步同步任务之间的关系开始-开始关系(SS) 虚拟人(avatar)的嘴巴和声音同时执行结束-开始关系(FS) 任务A不能结束直至任务B开始运行类似于父子进程,父进程产生一个子进程或者父进程从子进程接收到子进程已经开始运行的通信之前,父进程不能完全执行某些操作。开始-结束关系(SF) 一个任务不能开始,直至另一个任务结束,在管道中读取数据结束-结束关系(FF) 任务B结束之前,任务A... 阅读全文