The Dawn.
2057 · 共 127 篇文章
Renew
Again, you can’t connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something — your gut, destiny, life, karma, whatever. This approach has never let me down, and it has made all…
2014-07-01 23:58 · lifestyle · 评论(0)
macos 10.9.2 clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command
方法总是有的,当然需要你去寻找。 当然如果花费太多的时间在一件事情上有时候可能也不是件好事。 https://github.com/python-imaging/Pillow/issues/527 sudo sed -i '' -e 's/-mno-fused-madd//g' /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_sysconfigdata.pysudo rm /System/Library/Frameworks/Python.framework/Versions/2.7/lib/py…
Linux:more less tail head cat
more: Usage: more [options] file... Options: -d display help instead of ring bell -f count logical, rather than screen lines -l suppress pause after form feed -p suppress scroll, clean screen and disblay text -c suppress scroll, display text and clean line ends -u suppress underlining -s squeeze mu…
2014-03-10 17:09 · Linux · 评论(0)
PostgreSQL psycopg2:IndexError: tuple index out of range
Postgresql psycopg2使用like查询的时候出线了这个异常 tuple index out of range stackoverflow找到了解决办法,即在like后面多加两个%%符号 解决办法参考: http://stackoverflow.com/questions/1734814/why-isnt-psycopg2-executing-any-of-my-sql-functions-indexerror-tuple-index-o/1735731#1735731
2014-01-09 17:04 · python · postgresql · 评论(0)
Python 迭代器和生成器
迭代器 迭代器只不过是一个实现迭代器协议的容器对象。它基于两个方法: next 返回容器的写一个项目; iter 返回迭代器本身。 迭代器可以通过使用一个iter内建函数和一个序列来创建,示例如下。 >>> i = iter('abc') >>> i.next() 'a' >>> i.next() 'b' >>> i.next() 'c' >>> i.next() Traceback (most recent call last): File "<stdin>", line 1, in <module> StopIteration 当序列遍历完时,将抛出一个StopIteration异常。这…
2013-10-15 23:09 · python · 评论(0)
Python时间模块
time模块 时间模块中最常用的一个函数就是获取当前时间的函数time.time。 检查平台使用的纪元。 time.asctime(tupletime)接收一段时间的元祖,并返回一个可读的24个字符的字符串。 [11]: import time In [12]: print time.asctime(time.gmtime(0)) Thu Jan 1 00:00:00 1970 [21]: time.asctime() Out[21]: 'Mon Sep 16 11:34:00 2013' In [32]: time.asctime(time.localtime()) Out[32]: 'M…
2013-10-15 23:03 · python · 评论(0)
Python装饰器
编写自定义装饰器有许多方法,但最简单和最容易理解的方法是编写一个函数,返回封装原始函数调用的一个子函数。 通用的模式如下。 def my_decorator(function): def _my_decorator(*args, **kw): #在调用实际函数之前做些填充工作 res = function(*args, **kw) #做完某些填充工作之后 return res #返回子函数 return _my_decorator 当装饰器需要参数时,必须使用第二级封装。 def my_decorator(arg1, arg2): def _my_decorator(function): d…
2013-10-15 22:59 · python · 评论(0)
python list
简单总结以及整理如下: >>> dir(list) ['__add__', '__class__', '__contains__', '__delattr__', '__delitem__', '__delslice__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getslice__', '__gt__', '__hash__', '__iadd__', '__imul__', '__init__', '__iter__', '__le__', '__len__',…
2013-10-15 22:56 · python · 评论(0)
whats the difference between .equals and ==?
Java的数据类型: 分类简单数据类型 复合数据类型 简单数据类型 :简单数据类型是不能再简化的、内置的数据类型,由编程语言定义,表示真实的数字、字符和整数。 复合数据类型 :由简单数据类型的组合形成的更大、更复杂的数据类型。例如类、接口和数字。 ==操作比较的是两个变量的值是否相等,对于引用变量表示的是两个变量在堆中存储的地址是否相同,即栈中的内容是否相同。 equals操作便是的两个变量是否是同一个对象的引用,即堆中的内容是否相同。 1、 /** * Created with IntelliJ IDEA. * User: seaeast * Date: 25/09/2013 * Time…
2013-09-25 14:59 · java · 评论(0)
ren
诸多错综复杂的人和事 在悄无声息的发生 有目的或者无目的的存在着 当然绝大多数都是有目的的 而那些无目的的我想也只是因为还欠缺一些冲动 或者还多少带有一些不舍 有点悲情了 否则他们早就选择嗝屁了 有些人会背地里骂着你 然后在很多人面前还要强颜欢笑 奉承 讨好 我草,我怎么觉得这样很累啊 虽然这还不是我 我想以后也不会是我 人 你可否活的不要那么虚伪 我草 虚伪万万岁 喂,微笑吧 你只要做你自己就可以了。
2013-09-18 18:53 · lifestyle · 评论(0)
Python Excel
安装lib easy_install xlrd def handle(path): book = open_workbook(path) sheet = book.sheet_by_index(0) print sheet.name print sheet.nrows print sheet.ncols for row_index in range(sheet.nrows): for col_index in range(sheet.ncols): prinf sheet.cell(row_index,col_index).value 有关excel时间的转换 可参考: http://blo…
2013-09-10 17:21 · python · 评论(0)
MacOS PHP Warning: move_uploaded_file(): Unable to move '/private/var/tmp/phpgA
Log into your ftp and confirm the following: The folder exists, check for spellings Check the properties of the folder and make sure the permissions have read+write 0666 Make sure the file is within your public html root, otherwise double check the owner of the file, and make sure PHP Has read / wr…
2013-09-06 11:45 · php · 评论(0)
Learning PHP-MySQL高级管理
mysql> use mysql Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql> show tables; +---------------------------+ | Tables_in_mysql | +---------------------------+ | columns_priv | | db | | event | |…