单例模式在Python中可以查看这里借用里面一段话,说的相当明白:I don't really see the need, as a module with functions (and not a class) would serve well as a singleton. All its va...
分类:
其他好文 时间:
2014-08-23 13:52:10
阅读次数:
242
##-*-coding:utf-8-*-##python:2.x#__author__='Administrator'#命名指南#一组常用的命名规则可以被应用到变量,方法函数和属性上,类和模块的名称在命名空间叫是扮演重要角色的,所以一般有2个模式:觉模式和反模式#使用has,is前缀命名布尔元素,例...
分类:
编程语言 时间:
2014-08-23 12:40:40
阅读次数:
338
// MHTAppDelegate.h
// TestCa
// Copyright (c) 2014年 Summer. All rights reserved.
#import
@interface MHTAppDelegate :
UIResponder UIApplicationDelegate,UITextFieldDelegate>
@property (r...
分类:
其他好文 时间:
2014-08-23 11:26:10
阅读次数:
290
https://oj.leetcode.com/problems/edit-distance/Edit DistanceGiven two wordsword1andword2, find the minimum number of steps required to convertword1tow...
分类:
编程语言 时间:
2014-08-23 09:56:50
阅读次数:
213
高逼格UILabel的闪烁动画效果最终效果图如下:源码:YXLabel.h 与 YXLabel.m//// YXLabel.h//// Created by YouXianMing on 14-8-23.// Copyright (c) 2014年 YouXianMing. All right...
分类:
其他好文 时间:
2014-08-23 08:47:20
阅读次数:
359
七日python之路 七日python -- 第一天 七日python -- 第二天 ... scrapy爬虫 python爬虫----(1. 基本模块) ... pytnon基础 python基本 -- threading多线程模块的使用 python基本 -- mysql 的使用...
分类:
其他好文 时间:
2014-08-23 04:38:50
阅读次数:
171
1、举例,比方说我想取出横坐标0-900 纵坐标0-400的坐标范围: do_all_pos()-> do_all_pos([],0,0). do_all_pos(Result,Length,Height)when Length<900 andalso Height=<400-> NewResult=[{Length,Height}|Result...
分类:
其他好文 时间:
2014-08-23 02:31:50
阅读次数:
222
看了好多网上写的乘法口诀打印,觉得好多写的都不适合新手理解,今天参考了一些小例子,写了这个小脚本,希望在学习的新手看看这个,理解python中的while语句会有一定的帮助。我把每一行都写了助视,大家直接复制就可以运行的一段代码,涉及的内容还是有这么几个方面,直接把代..
分类:
编程语言 时间:
2014-08-23 02:28:20
阅读次数:
444
```python def is_pamax(name): low = 0 up = len(name)-1 while low < up: if name[low] != name[up]: return False low += 1 up -= 1 return True f = open("D:/names.txt") max_length = 0 for line in f: nam...
分类:
其他好文 时间:
2014-08-23 01:12:09
阅读次数:
383
def is_chinese(uchar): """判断一个unicode是否是汉字""" if uchar >= u'\u4e00' and uchar= u'\u0030' and uchar= u'\u0041' and uchar= u'\u0061' and u...
分类:
编程语言 时间:
2014-08-22 23:45:19
阅读次数:
330