List与Tuple
Python内置2种有序列表。List是可变数组,Tuple是不可变数组。
List范例:
Girls =['LiuJingjing','ZhangHuixin','YeFei']
-用len()函数获得list元素个数。
-索引位置从0开始,最后一个元素的索引是-1
Girls[-1]...
分类:
编程语言 时间:
2014-08-25 11:56:54
阅读次数:
241
1.背景 最大似然估计是概率论中常常涉及到的一种统计方法。大体的思想是,在知道概率密度f的前提下,我们进行一次采样,就可以根据f来计算这个采样实现的可能性。当然最大似然可以有很多变化,这里实现一种简单的,实际项目需要的时候可以再更改。 博主是参照wiki来学习的,地址请点击我 这里实现的是特别简单的例子如下(摘自wiki的最大似然)离散分布,离散...
分类:
编程语言 时间:
2014-08-25 11:53:54
阅读次数:
1655
Lambda 表达式是一种可用于创建委托或表达式目录树类型的匿名函数。通过使用 lambda 表达式,可以写入可作为参数传递或作为函数调用值返回的本地函数。Lambda 表达式对于编写 LINQ 查询表达式特别有用。 创建 Lambda 表达式,需要在 Lambda 运算符 => 左侧指定输入参数....
分类:
其他好文 时间:
2014-08-25 11:39:14
阅读次数:
299
[root@livecdyum.repos.d]#yuminstalllivecd-toolssyslinuxanaconda-runtimeLoadedplugins:fastestmirror,refresh-packagekit,securityLoadingmirrorspeedsfromcachedhostfile*base:centos.ustc.edu.cn*extras:centos.ustc.edu.cn*updates:mirrors.pubyun.comlivecd|951B00:00l..
分类:
编程语言 时间:
2014-08-25 10:09:05
阅读次数:
1348
Problem 36
The decimal number, 585 = 10010010012 (binary), is palindromic in both bases.
Find the sum of all numbers, less than one million, which are palindromic in base 10 and base 2.
(Please...
分类:
其他好文 时间:
2014-08-25 10:06:04
阅读次数:
198
Unique PathsA robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right a...
分类:
编程语言 时间:
2014-08-25 06:33:53
阅读次数:
277
setup.py install 报错
error: command 'mt.exe' failed: No such file or directory
或者 Unable to find vcvarsall.bat
于是 用 setup.py insall build --compiler=mingw32
担心没装 mingw32,但是喜悦地发现以前装 ...
分类:
其他好文 时间:
2014-08-25 02:20:13
阅读次数:
238
发布一个与tcpdump配合使用的Python脚本,可以为tcpdump的输出结果着色.红色是IP头。绿色是TCP头的定长部分,黄色是TCP头的可变长部分,即可选项。白色就是应用层socket数据。...
分类:
其他好文 时间:
2014-08-24 23:56:13
阅读次数:
323
#region linq的标准查询运算符(即lambda方式) 注:C#不支持标准查询运算符中带有整形参数(索引)的重载 // 1、标准查询运算符之筛选方法——where //IQueryable stu1=db.Student.Where(s => s.Ssex == "男"); //GridV....
分类:
其他好文 时间:
2014-08-24 23:38:53
阅读次数:
436