tuple(元组)
另一种有序列表叫元组:tuple。tuple和list非常类似,但是tuple一旦初始化就不能修改,tuple属于不可变对象。比如同样是列出同学的名字:
>>> classmates = ('Michael', 'Bob', 'Tracy')现在,classmates这个tuple不能变了,它也没有append(),insert()这样的方法。其他获取元素的方法和list是...
分类:
编程语言 时间:
2014-06-22 16:27:27
阅读次数:
249
XSS漏洞按照攻击利用手法的不同,有以下三种类型:
类型A,本地利用漏洞,这种漏洞存在于页面中客户端脚本自身。其攻击过程如下所示:
Alice给Bob发送一个恶意构造了Web的URL。
Bob点击并查看了这个URL。
恶意页面中的JavaScript打开一个具有漏洞的HTML页面并将其安装在Bob电脑上。
具有漏洞的HTML页面包含了在Bob电脑本地域执行的JavaS...
分类:
其他好文 时间:
2014-06-18 12:26:39
阅读次数:
191
很明显地,我们知道,当N=1,2时,先手胜。当N=3时,可以把取走中间一个硬币,得到1,1。依然是先手胜。当N=4时,取走中间两点得到1,1,即先手依然取胜。当N=5时,取走中间1点,依然先手胜。于是,当ALICE取走开头的硬币后,即得到一条链。那么,只需BOB把这条链平均分成两半,做对称操作,即可...
分类:
其他好文 时间:
2014-06-16 13:24:11
阅读次数:
220
ChessboardTime Limit:2000MSMemory Limit:65536KTotal
Submissions:12800Accepted:4000DescriptionAlice and Bob often play games on
chessboard. One day, Al...
分类:
其他好文 时间:
2014-06-10 16:31:11
阅读次数:
261
题意:http://acdream.info/problem?pid=1112
Problem Description
Here is Alice and Bob again !
Alice and Bob are playing a game. There are several numbers.First, Alice choose a number n.Then he c...
分类:
其他好文 时间:
2014-06-10 14:48:56
阅读次数:
236
并查集,
删除节点操作,可以用新建节点代替
维护每个点到跟节点的距离
Gears
Time Limit: 2 Seconds Memory Limit: 65536 KB
Bob has N (1 ≤ N ≤ 2*105) gears (numbered from 1 to N). Each gear can rotate clockwise or co...
分类:
其他好文 时间:
2014-06-07 11:33:37
阅读次数:
227
函数 Swift 使用func关键字声明函数:1 func greet (name:
String, day: String) -> String {2 return "Hello \(name), today is \(day)."3
}4 greet ("Bob", "Tuesday"...
分类:
其他好文 时间:
2014-06-06 07:49:12
阅读次数:
340
why???Cause I‘m
lazy!!!XD。。。很早之前就想学python,正好微信订阅了crossin编程教室的公众号,时不时瞄一两眼。上个礼拜六误打误撞被朋友拐去了Pycon
APAC 2014,正巧看到Bob把code和music结合起来玩,还蛮有意思的。那,这次是不是应该下决心有所行...
分类:
编程语言 时间:
2014-05-22 14:25:25
阅读次数:
282
【题目】
Bob is a strategy game programming specialist. In his new city building game the gaming environment is as follows: a city is built up by areas, in which there are streets, trees, factories and...
分类:
其他好文 时间:
2014-05-22 13:09:50
阅读次数:
247
Bob(Bob‘spublickey)(Bob‘sprivatekey)Bobhasbeengiventwokeys.OneofBob‘skeysiscalledaPublicKey,theotheriscalledaPrivateKey.Bob‘sCo-workers:AnyonecangetBob‘sPublicKey,butBobkeepshisPrivateKeytohimselfPatDougSusanBob‘sPublickeyisavailabletoanyonewhoneedsit,buthe..
分类:
其他好文 时间:
2014-05-21 00:05:52
阅读次数:
478