客户端将需要解决的task发送给服务器,服务器调用线程来解决客户端发送的task,解决完由线程负责将其发送回客户端。(用管道实现通信)1. server维护两个列表。一是客户端列表。二是任务列表。分别如下:/* 客户端列表 */ typedef struct tag_fds{ int s...
分类:
编程语言 时间:
2014-09-09 15:10:38
阅读次数:
244
#include #include #include #include int ticket_cnt = 20; /* 共有20张票 */typedef struct tag{ int s_id; pthread_mutex_t *s_p;}DATA,*pDATA;void* h...
分类:
编程语言 时间:
2014-09-09 12:13:48
阅读次数:
208
实例一:
phone_view.addTextChangedListener(new TextWatcher() {
public void onTextChanged(CharSequence s, int start, int before, int count) {
Log.i(TAG, "onTextChanged =" + s + " start:" + start + " b...
分类:
其他好文 时间:
2014-09-08 03:15:16
阅读次数:
287
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4992题意:给出n,输出n的所有原根。思路:求出n的一个原根x,那么对于所以的i,i1) ans=ans/n*(n-1); return ans;}int prime[N],tag[N],cnt;v...
分类:
其他好文 时间:
2014-09-07 23:38:35
阅读次数:
315
public void makeHTTPrequest(String url) {
MyLog.d(TAG, "makeHTTPrequest, url=" + url);
mQueue = VideoApplication.getInstance().getRequestQueue();
JsonObjectRequest jsonObjReq...
分类:
其他好文 时间:
2014-09-07 13:33:55
阅读次数:
174
/**
* Sets the port of the local Socks5 proxy. Default is 7777. If you set the port to a negative
* value Smack tries the absolute value and all following until it finds an open port.
...
分类:
其他好文 时间:
2014-09-07 03:18:54
阅读次数:
250
/**
* Sets the port of the local Socks5 proxy. Default is 7777. If you set the port to a negative
* value Smack tries the absolute value and all following until it finds an open port.
...
分类:
其他好文 时间:
2014-09-07 03:18:44
阅读次数:
207
ZOder:1、是描述渲染顺序的值,每个CCNode都有ZOder,默认是0。2、ZOder越大则越后面绘制、如果ZOder值相同,那么看arrival(全局变量每次加一)顺序,先加入的节点先绘制,ZOder只在相同父节点的节点直接进行比较tag:是一个节点的身份证,方便通过getChildByTa...
分类:
其他好文 时间:
2014-09-06 18:35:33
阅读次数:
618
1. HTML语法: 由Tag组成层级结构,标签视为名,而值插在当中。 关键组成符:, ', ", &2. 解析模式: 文件开头告知, 但亦可由Content-Type传递, 关于1中的关键符, 可由封装3. 解析器行为: 对错误容忍度极高,空格,特殊字符,HTML过滤器设计有时不能只考...
分类:
Web程序 时间:
2014-09-05 17:55:31
阅读次数:
169
//场景: 一个产品对应的多个标签名SELECT illname ,c.tag,s.id FROM `sysill` AS s ,(SELECT `ptags`tag FROM `jk_product` jk WHERE jk.id = 1) AS c WHERE FIND_IN_SET(s.id,...
分类:
数据库 时间:
2014-09-05 12:44:52
阅读次数:
356