02 2014 档案
摘要:http://flask.pocoo.org/docs/patterns/viewdecorators/View Decorators¶Python has a really interesting feature called function decorators. This allow some really neat things for web applications. Because each view in Flask is a function decorators can be used to inject additional functionality to
阅读全文
摘要:http://www.chinaz.com/program/2011/0503/176896.shtml在数据库中,字符型的数据是最多的,可以占到整个数据库的80%以上。为此正确处理字符型的数据,对于提高数据库的性能有很大的作用。在字符型数据中,用的最多的就是Char与Varchar两种类型。前面的是固定长度,而后面的是可变长度。现在我们需要考虑的是,在什么情况下使用Char字符型数据,什么情况下采用Varchar字符型数据。在这部分内容中,我就跟大家来探讨一下这个话题。一、VARCHAR与CHAR字符型数据的差异在MySQL数据库中,用的最多的字符型数据类型就是Varchar和Char.。这
阅读全文
摘要:http://stackoverflow.com/questions/5870188/does-flask-support-regular-expressions-in-its-url-routingEven though Armin beat me to the punch with an accepted answer I thought I'd show an abbreviated example of how I implemented a regex matcher in Flask just in case anyone wants a working example o
阅读全文
摘要:原文The 30 CSS Selectors you Must Memorize由 Jeffrey Way 发表于 2011 年 6 月,介绍了 30 种最常用的 CSS 选择器用法,多加了一种,变成了牢记 31 种选择器用法。其他 CSS3 选择器用法请查看CSS3 selectors explained这篇文章,此外,W3C CSS3 选择器官方文档Selectors Level 3 W3C Recommendation 29 September 2011记录在这里留待有疑问的时候查看。1.** { margin: 0; padding: 0;}星号选择器用于选取页面中的所有元素,可用..
阅读全文
摘要:Foreword¶Read this before you get started with Flask. This hopefully answers some questions about the purpose and goals of the project, and when you should or should not be using it.What does “micro” mean?¶“Micro” does not mean that your whole web application has to fit into a single Pytho
阅读全文
摘要:http://stackoverflow.com/questions/9906144/python-decorate-a-class-by-defining-the-decorator-as-a-classApart from the question whether class decorators are the right solution to your problem:in Python 2.6 and higher, there are class decorators with the @-syntax, so you can write:@addIDclassFoo:passi
阅读全文
摘要:Cyclic imports terminate, but you need to be careful not to use the cyclically-imported modules during module initialization.Consider the following files:a.py:print"a in"import sysprint"b imported: %s"%("b"in sys.modules,)import bprint"a out"b.py:print"b
阅读全文
摘要:目录http://kb.cnblogs.com/page/130672/ 高级编程语言的发展历程(一)创始纪 高级编程语言的发展历程(二)虚拟机的前世今生 高级编程语言的发展历程(三)FORTRAN 语言是怎么来的 高级编程语言的发展历程(四)LISP 和 AI 的青梅竹马 A 高级编程语言的发展历程(五)LISP 和 AI 的青梅竹马 B 高级编程语言的发展历程(六)SCHEME 语言是怎么来的 高级编程语言的发展历程(七) LISP 语言前传 原文标题:高级语言是怎么来的 高级编程语言的发展历程(一)创始纪 2009-5-13 原文链接 终于放暑假了,有心情来八卦...
阅读全文
摘要:http://www.4pang.com/2010/08/20/4%E8%83%96%E5%AD%A6python-%EF%BC%8D-__getattr__-%E5%92%8C-__getattribute__-%E6%96%B9%E6%B3%95%E7%9A%84%E5%8C%BA%E5%88%AB.htmlpython 再访问属性的方法上定义了__getattr__() 和 __getattribute__() 2种方法,其区别非常细微,但非常重要。如果某个类定义了__getattribute__()方法,在每次引用属性或方法名称时Python 都调用它(特殊方法名称除外,因为那样将会导
阅读全文

浙公网安备 33010602011771号