这篇对应的是习题39 字典, 可爱的字典
#encoding:utf-8
#列表与字典的区别
#列表
thing = ['name',1,'age','AD','sex']
print thing[1]
#print thing['name'] #会报错,列表只能通过整数去访问:TypeError: list indices must be integers, not str
stuff...
分类:
编程语言 时间:
2014-05-07 06:00:20
阅读次数:
365
一 线性表
1.1 数组
1.1.1 Remove Duplicates from Sorted Array
1.1.2 Remove Duplicates from Sorted Array II
1.1.3 Search in Rotated Sorted Array
1.1.4 Search in Rotated Sorted Array II
1.1.5 Median of...
分类:
其他好文 时间:
2014-05-07 04:24:26
阅读次数:
363
题目:
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.
Return a deep copy of the list.
思路:
主要是深层复制的问题:
本题比较简...
分类:
其他好文 时间:
2014-05-07 02:44:38
阅读次数:
344
线性表的Java实现--顺序存储
线性表(Linear List)是由n(n≥0)个数据元素(结点)a[0],a[1],a[2]…,a[n-1]组成的有限序列。
其中:
数据元素的个数n定义为表的长度 = "list".length() ("list".length() = 0(表里没有一个元素)时称为空表)
将非空的线性表(n>=0)记作:(a[0],a[1],a[2],…,a...
分类:
编程语言 时间:
2014-05-07 02:35:56
阅读次数:
438
Python是一种强大的语言,即可浅尝辄止,也可深入挖掘。很适合做科学计算、数据挖掘等等。今天我将简单介绍一下Python的装饰器(Decorators)的用法 。
假设我们想要庆祝下生日,需要邀请一些朋友过来参加。但是你有个讨厌的朋友,叫Joe,必须不能让他来啊。可能首先你想到的是建一个list,然后迭代查找并移除所有的Joe童鞋。这当然是个好方法,但是这里为了介绍装饰器,我们会用@来完成...
分类:
编程语言 时间:
2014-05-06 23:19:53
阅读次数:
371
启用分组模块非常简单,配置下APP_GROUP_LIST参数和DEFAULT_GROUP参数即可。
'APP_GROUP_LIST'=>'Admin,Home',
'DEFAULT_GROUP'=>'Home',将Home设为默认的项目。
在我们启用项目分组之前,由于使用的两个项目,所以URL地址分别是:
http://serverName/index.php/Index/...
分类:
Web程序 时间:
2014-05-06 22:39:00
阅读次数:
520
#include
#include
/*
英语原文:
In function-like macros, a # operator before an identifier in the replacement-list runs
the identifier through parameter replacement and encloses the r...
分类:
编程语言 时间:
2014-05-06 22:01:02
阅读次数:
378
如果我们在 Objective C 中向一个对象发送它无法处理的消息,会出现什么情况呢?我们知道发送消息是通过
objc_send(id, SEL, ...) 来实现的,它会首先在对象的类对象的 cache,method list 以及父类对象的 cache, method list 中依次查找 SEL 对应的 IMP;这个是需要对类对象的结构熟悉,不清楚的可以参考我的下一篇文章《object...
分类:
其他好文 时间:
2014-05-06 21:24:33
阅读次数:
450
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e., 0 1 2 4 5 6 7 might become 4
5 6 7 0 1 2).
You are given a target value to search. If found in the array retur...
分类:
其他好文 时间:
2014-05-06 19:03:11
阅读次数:
365
如下图:选择了子数据,默认选中父级数据,数据库中会存储两条数据为使脚本通用性更好,不写死两级,可将数据放到List里处理,代码如下: String
companyName = null; companyName = "测试公司1.1"; stepInfo("校验数据"); DBU...
分类:
其他好文 时间:
2014-05-06 18:14:09
阅读次数:
282