一:类型1 不可变数据类型string,int ,tuple 常量字符串不可变之再探string[1] = 'new_one' can?2 可变数据类型变量dict list二 再研究字符串序列到底是什么1 三个符合的区别 '',"",""" """2 偏移量从0开始3 如何修改字符串之replac...
分类:
编程语言 时间:
2015-01-17 17:50:26
阅读次数:
184
类似于dreamhost这类主机服务商,是显示fopen的使用 的。使用php的curl可以实现支持FTP、FTPS、HTTP HTPPS SCP SFTP TFTP TELNET DICT FILE和LDAP。curl 支持SSL证书、HTTP POST、HTTP PUT 、FTP 上传,kerb...
分类:
Web程序 时间:
2015-01-17 11:10:59
阅读次数:
283
Python的字典的items(), keys(), values()都返回一个list1 >>> dict = { 1 : 2, 'a' : 'b', 'hello' : 'world' } 2 >>> dict.values() 3 ['b', 2, 'world']...
分类:
编程语言 时间:
2015-01-15 17:25:09
阅读次数:
180
转自:http://www.cnblogs.com/ifantastic/p/3768415.html首先需要知道的是,dir() 是 Python 提供的一个 API 函数,dir() 函数会自动寻找一个对象的所有属性,包括搜索 __dict__ 中列出的属性。 不是所有的对象都有 __dict....
分类:
编程语言 时间:
2015-01-13 19:45:40
阅读次数:
232
1. 如何将model对象转化成一个dict,这在restful api的设计上会有用。答案:使用django.forms.models的model_to_dict方法,demo如下:from django.forms.models import model_to_dict as m2dfrom d...
分类:
其他好文 时间:
2015-01-13 12:29:13
阅读次数:
135
redis是个key, value数据库,是个内存数据库。目前是个互联网公司的架构标配。
支持的数据对象有string, list, set, zest和hash object。
数据结构:
数据库的核心结构是dict(实现是使用hashmap):
key: string
value: string或者list或者set或者zest或者hash object。
dict数据结构...
分类:
其他好文 时间:
2015-01-13 00:10:48
阅读次数:
386
本函数用来判断对象实例object是否是类classinfo的实例,如果是就返回True,否则返回False。参数classinfo可以是类型,也可以是tuple/dict/list等类型。例子:#isinstance()
class FooA:
pass
class FooB(FooA):
pass
class FooC:
pass
a = FooA()
b...
分类:
编程语言 时间:
2015-01-10 12:42:55
阅读次数:
168
https://oj.leetcode.com/problems/word-break-ii/http://blog.csdn.net/linhuanmars/article/details/22452163publicclassSolution{
publicList<String>wordBreak(Strings,Set<String>dict)
{
//SolutionA:
//returnwordBreak_NP(s,dict);
//SolutionB:
return..
分类:
其他好文 时间:
2015-01-09 01:52:58
阅读次数:
160
https://oj.leetcode.com/problems/word-break/http://blog.csdn.net/linhuanmars/article/details/22358863publicclassSolution{
publicbooleanwordBreak(Strings,Set<String>dict)
{
s="#"+s;//Addadummychar
intlen=s.length();
boolean[]poss=newboolean[len];
poss..
分类:
其他好文 时间:
2015-01-08 18:15:49
阅读次数:
104
dir(Myclass) 用来展示一些类的内部属性还有方法,今天IBM面试问到了,居然忘记了,your sister.print Myclass.__dict__也可以del c1清除一个引用跟踪实例
class InstCt(object):
count =0
def __init__(self):
InstCt.count +=1...
分类:
编程语言 时间:
2015-01-08 15:17:03
阅读次数:
257