#coding=utf-8import osimport timedef Rename(foldname): for parent,dirnames,filenames in os.walk(foldname): for filename in filenames: ...
分类:
其他好文 时间:
2014-07-16 21:11:53
阅读次数:
170
1 #include 2 #include 3 #include 4 #include 5 #include 6 7 typedef void (__stdcall *P_WALK_DIR_CALLBACK)(const std::string &In_strFilePath); 8 ...
分类:
编程语言 时间:
2014-07-16 19:31:47
阅读次数:
256
Math.random()是令系统随机选取大于等于 0.0 且小于 1.0 的伪随机 double 值,是Java语言常用代码。随机数生成20~90之间的数值,并求平均数:public class Random01 { public static void main(String[] args) {...
分类:
其他好文 时间:
2014-07-13 12:41:51
阅读次数:
192
随机数生成20~70之间的数值:public class Random { public static void main(String[] args) { java.util.Random r = new java.util.Random(); for (int i = 0; i < 10; .....
分类:
其他好文 时间:
2014-07-13 12:39:42
阅读次数:
143
差点儿全部编程语言中都提供了"生成一个随机数"的方法,也就是调用这种方法会生成一个数,我们事先也不知道它生成什么数。比方在.Net中编写以下的代码:Random rand = newRandom();Console.WriteLine(rand.Next());执行后结果例如以下:Next()方法用...
分类:
编程语言 时间:
2014-07-13 12:37:13
阅读次数:
272
首先,订单号有3个性质:1.唯一性 2.不可推测性 3.效率性唯一性和不可推测性不用说了,效率性是指不能频繁的去数据库查询以避免重复。况且满足这些条件的同时订单号还要足够的短。我在java下定制的订单号生成方式如下:int r1=(int)(Math.random()*(10));//产生2个0-....
分类:
其他好文 时间:
2014-07-12 16:14:00
阅读次数:
454
http://eli.thegreenplace.net/2010/01/22/weighted-random-generation-in-python/类似俄罗斯轮盘赌
分类:
其他好文 时间:
2014-07-12 08:33:57
阅读次数:
177
这是一个按照图片颜色深浅的聚类算法 1 function [ result ] = my_kcluster_random( imgAddress ) 2 %UNTITLED Summary of this function goes here 3 % Detailed explanation g.....
分类:
其他好文 时间:
2014-07-11 18:47:45
阅读次数:
148
#coding=utf-8'''@author:简单遍历目录删除文件的小程序'''import os#查找文件操作def findFile(path): fileList=[] for rootPath,subRoot,fileName in os.walk(path): ...
分类:
编程语言 时间:
2014-07-11 10:59:54
阅读次数:
178
Linux中的随机数可以从两个特殊的文件中产生,一个是/dev/urandom.另外一个是/dev/random。他们产生随机数的原理是利用当前系统的熵池来计算出固定一定数量的随机比特,然后将这些比特作为字节流返回。熵池就是当前系统的环境噪音,熵指的是一个系统的混乱程度,系统噪音可以通过很多参数来评...
分类:
系统相关 时间:
2014-07-11 09:31:40
阅读次数:
220