HP-Socket 是一套通用的高性能 TCP/UDP Socket 组件,包含服务端组件、客户端组件和 Agent 组件,广泛适用于各种不同应用场景的 TCP/UDP 通信系统,提供 C/C++、C#、Delphi、E(易语言)、Java、Python 等编程语言接口。HP-Socket 对通信层实现完全封装,上层应用不必关注通信层的任何细节;HP-Socket 提供基于事件通知模型的 API 接口,能非常简单高效地整合到新旧应用程序中。...
分类:
其他好文 时间:
2014-06-20 13:33:10
阅读次数:
296
HP-Socket 是一套通用的高性能 TCP/UDP Socket 组件,包含服务端组件、客户端组件和 Agent 组件,广泛适用于各种不同应用场景的 TCP/UDP 通信系统,提供 C/C++、C#、Delphi、E(易语言)、Java、Python 等编程语言接口。HP-Socket 对通信层实现完全封装,上层应用不必关注通信层的任何细节;HP-Socket 提供基于事件通知模型的 API 接口,能非常简单高效地整合到新旧应用程序中。...
分类:
其他好文 时间:
2014-06-20 12:31:33
阅读次数:
277
Python的多线程有两种实现方法:
函数,线程类
1.函数:调用thread模块中的start_new_thread()函数来创建线程,以线程函数的形式告诉线程该做什么
2.线程类:调用threading模块,创建threading.Thread的子类来得到自定义线程类。
def f(name):
#定义线程函数
print "this is " + name...
分类:
编程语言 时间:
2014-06-20 12:05:41
阅读次数:
287
题目要求 1000 内可以被 3 或者 5 整除的数字之和
可以很简单地这么写:
print sum( [ i for i in xrange( 1000 ) if i % 3 == 0 or i % 5 == 0 ] )
但是对于10^10的数据,要运行很长时间,可以利用一点鸽巢原理
10^10中能被 3 整除的数据和加上能被 5 整除的数据和减去能被 15 整除的数据和即可,求...
分类:
其他好文 时间:
2014-06-20 11:46:19
阅读次数:
249
sing names.txt (right click and 'Save Link/Target As...'), a 46K text file containing over five-thousand first names, begin by sorting it into alphabetical order. Then working out the
alphabetical v...
分类:
其他好文 时间:
2014-06-20 10:37:22
阅读次数:
230
You are given the following information, but you may prefer to do some research for yourself.
1 Jan 1900 was a Monday.Thirty days has September,
April, June and November.
All the rest have thirty...
分类:
其他好文 时间:
2014-06-07 13:56:52
阅读次数:
166
Let d(n) be defined as the sum of proper divisors of n (numbers less than
n which divide evenly into n).
If d(a) = b and d(b) = a, where a
b, then a and b are an amicable pair and each of a and
b...
分类:
其他好文 时间:
2014-06-07 13:40:53
阅读次数:
226
代码清单:
<?php
/**
* 获取当前页面的完整 url
* @author ruxing.li
* @return string
*/
function getPageUrl(){
$url = (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443') ? 'https://' : 'http...
分类:
Web程序 时间:
2014-06-07 13:16:27
阅读次数:
250
情况是这样的,我在写一个类似于Online-Judge的系统,用python很容易实现,编译源程序,运行程序,最后比较程序输出与标准输出得出成绩。现在有个问题,万一程序运行时崩溃,比如出现除0异常,assert失败等等,则在windows下会出现恼人的crash
window。我想要避免它,因为我一...
分类:
其他好文 时间:
2014-06-07 07:11:28
阅读次数:
253
网上看到的一个开源项目的loading效果,效果很赞,记录一下:
开源项目地址如下:https://github.com/RomainPiel/Titanic
分类:
移动开发 时间:
2014-06-07 06:14:47
阅读次数:
671