04 2013 档案
摘要:在函数中对全局变量进行修改要事先声明这个全局变量:def func(): global param param = newvalue但在main函数中,这个是不必要的
阅读全文
摘要:其实原理就是根据webservice协议指定的request的soap格式,用http post的method把参数传递过去就算是调用了,然后解析返回的soap就可以了鉴于网上python3.x 的http post 实现代码比较少,我贴一段:def InvokeWebservice(phone,m...
阅读全文
摘要:import timefor i in range(100000): percent = 1.0 * i / 100000 * 100 print('complete percent:%10.8s%s'%(str(percent),'%'),end='\r') time.s...
阅读全文
摘要:在spring的HibernateTemplate中经常遇到这样的情况:一个session 负责载入数据,另一个session 修改了这个数据如果前一个session没有close的话,就会报标题的错误解决方法是使用 hibernate的Merge函数用这个函数代替Update,能将一个已经与ses...
阅读全文
摘要:http://www.byywee.com/page/M0/S544/544290.htmlBuild->Configuration ManagerCheck whether all project allows to build when the Configuration is Debug.把要...
阅读全文
摘要:读了博客园的一篇文章受到启发,写了一个K均值的python实现,代码如下:import randomfrom math import sqrtsample=[ [1,1,0.5], [0.3,0,0.19], [0,0.15,0.13], [0.24,0.76,0.25], ...
阅读全文