原创 python +=

In [25]: a=[] In [26]: b=[] In [27]: id(a) Out[27]: 51344568In [29]: a+=b

原创 Node.js

http://ourjs.com/detail/532f0650c911679a2800000a Node.js採用了Google Chrome瀏覽器的V8引擎,性能很好,同時還提供了很多系統級的API,如文件操作、網絡編程等。瀏覽

原创 postgres插入默認值 如果select查詢不到默認值

CREATE OR REPLACE FUNCTION get_user(test integer)    RETURNS SETOF test AS  $BODY$ DECLARE r record; B

原创 WYSIWYG

http://sdk.ckeditor.com/samples/classic.html http://kindeditor.net/docs/usage.html request.files.values()[0]['filename'

原创 OAuth2.0協議 第三方登錄 授權

幫你深入理解OAuth2.0協議 oAuth2.0OAuth2.0OpenAuthorizationWeb安全協議開放授權 1. 引言如果你開車去酒店赴宴,你經常會苦於找不到停車位而耽誤很多時間。是否有好辦法可以避免這個問題呢?

原创 python list存儲的是reference id

ids of integer constants are not guaranteed to be equal, and indeed, for integers as large as 257, they aren't. (try i

原创 數據庫建表 冗餘

餐廳表  分銷商表(餐廳-一對多-分銷商)   優惠表(分銷商-一對多-優惠)     餐廳優惠表(餐廳-多對多-優惠) 100個餐廳  有多個分銷商  每個分銷商代理多個餐廳,每個餐廳對於不同的分銷商可能提供不同的折扣: 餐廳A ,B

原创 python 描述符 類方法 閉包

http://szhnet.iteye.com/blog/443469 # -*- coding:utf-8 -*- # class FunWrap(object): u"""包裝一個函數""" def __init__(self

原创 python descriptor override

.4.2.3 Invoking Descriptors In general, a descriptor is an object attribute with ``binding behavior'', one whose attrib

原创 javascript settimeout setinterval Javascript高性能動畫與頁面渲染

Javascript高性能動畫與頁面渲染

原创 python func defaults args are evaluated only once,(in definition time)

In [7]: def r(): ...: return random.randint(1,100) ...:In [12]: def d(a, b=r()): ....: print b,'------

原创 psycopg2.ProgrammingError: execute cannot be used while an asynchronous query is underway

psycopg2.ProgrammingError: execute cannot be used while an asynchronous query is underway Temporary solution - close

原创 ruby 多繼承 mixin include exclude require load

首先定義一個Module:module Foo   def bar     puts "foo";   end end然後我們把這個模塊混入到對象中去: class Demo   include Foo end 如上編碼後,模塊中的實例方

原创 blog to share

http://momjian.us/main/writings/pgsql/hw_performance/ https://github.com/gevent/gevent/blob/master/examples/psycopg2_po

原创 Ruby類方法 實例方法

ruby的類方法與實例方法 類方法也叫靜態方法,通過類名來調用的方法。實例方法,必須要new一個實例出來才能用。 class Foo def self.bar puts 'class method' end