偶遇一奇怪的bug,型如$("tt").html(""+0||Math.floor(Math.random()*100))+"")这个东西出现一个截取问题,看起来挺长的,实际上结果只有$("tt").html(""+0)的结果,后面被截取了,想了半天有点云里雾里的,其实这就是一个细节的问题,或运算有...
分类:
其他好文 时间:
2014-06-29 00:58:20
阅读次数:
317
C++11带来诸多特性,random就是其一.1. random_device 标准库提供了一个非确定性随机数生成设备.在Linux的实现中,是读取/dev/urandom设备;Windows的实现居然是用rand_s,在这里强烈谴责一下. random_device提供()操作符,用来返回一个.....
分类:
编程语言 时间:
2014-06-28 17:35:20
阅读次数:
208
在官方文档ns-3-manual.pdf中,整个框架图:v 随机变量伪随机生成器pseudo-random number generator (PRNG)。默认情况下,ns-3仿真程序使用固定种子和运行数字,它们分别存在全局变量g_rngSeed 和 g_rngRun中,在ns-3.14版本以后,n...
分类:
其他好文 时间:
2014-06-28 11:01:09
阅读次数:
364
# -*- coding: utf-8 -*-"""Created on Wed Jun 18 11:46:15 2014@author: hp"""import numpy as npimport operatordef createDataSet(): group=np.random.ra...
分类:
其他好文 时间:
2014-06-21 13:30:34
阅读次数:
331
import randomk = random.sample(xrange(0x41, 0x5b), 26)print kimport randomk = random.sample(xrange(0x41, 0x5b), 26)print kk = [chr(x) for x in k]print...
分类:
其他好文 时间:
2014-06-21 09:05:54
阅读次数:
250
方法:先reshape成行向量或者列向量然后,利用mean函数,std函数。构造测试数据,可以利用random函数,就好。利用这个函数,可以构造不同分布的随机数列(或 矩阵)。如:>> y =random('norm',2,0.3,3,4)y = 2.1391 2.2945 2.0...
分类:
其他好文 时间:
2014-06-20 17:18:28
阅读次数:
221
let btn1 = UIButton.buttonWithType(.System) as UIButtonbtn1.backgroundColor = UIColor.redColor()btn1.setTitle("Button1", forState: UIControlState.Norm...
分类:
其他好文 时间:
2014-06-18 13:02:14
阅读次数:
141
// Playground - noun: a place where people can playimport Cocoavar nums = Int[]()for _ in 1...50{ nums.append(random())}nums////冒泡排序/*var count = 0...
分类:
移动开发 时间:
2014-06-18 09:57:23
阅读次数:
303
[self.navigationItem
setLeftBarButtonItem:leftButton]; 这样设置在ios7上按钮默认是蓝色
解决方法:
leftButton.tintColor = [UIColor
whiteColor];...
分类:
移动开发 时间:
2014-06-18 07:07:37
阅读次数:
888
networkx:
一个用Python语言开发的图论与复杂网络建模工具,
内置了常用的图与复杂网络分析算法,
可以方便的进行复杂网络数据分析、仿真建模等工作。
依赖工具:
numpy
pyparsing
datautil
matplotlib
networkx
采用随机图做个实验:
from random im...
分类:
编程语言 时间:
2014-06-18 00:32:52
阅读次数:
321