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
通常情况下,如果我们要使用一个类的方法,那我们只能将一个类实体化成一个对象,进而调用对象使用方法。比如: class Hello(object): def
__init__: ... def print_hello(self): print "Hello" 要用 ...
分类:
编程语言 时间:
2014-06-07 07:44:56
阅读次数:
218
博主是自然语言处理方向的,不是推荐系统领域的,这个程序完全是为了应付大数据分析与计算的课程作业所写的一个小程序,先上程序,一共55行。不在意细节的话,55行的程序已经表现出了协同过滤的特性了。就是对每一个用户找4个最接近的用户,然后进行推荐,在选择推荐的时候是直接做的在4个用户中选择该用户item没...
分类:
编程语言 时间:
2014-06-07 07:19:12
阅读次数:
473
情况是这样的,我在写一个类似于Online-Judge的系统,用python很容易实现,编译源程序,运行程序,最后比较程序输出与标准输出得出成绩。现在有个问题,万一程序运行时崩溃,比如出现除0异常,assert失败等等,则在windows下会出现恼人的crash
window。我想要避免它,因为我一...
分类:
其他好文 时间:
2014-06-07 07:11:28
阅读次数:
253