The accumulator mini-pattern and .setdefault()
What I'm going to call the accumulator (mini-)pattern is a commonoperation when summarizing a stream of data: you have some keys, whichcan repeat, and you want to accumulate some data each time each keycomes up, to count it or sum it all up or keep a list of all of the datafor each key.
In pretty much every language that has them, this pattern is done withdictionaries (or hashes or the language's equivalent). In Python, thiscreates
桂綸鎂與貴倫美
台灣新偶像桂綸鎂被形容為「蒸餾水般的學生情人」。據說男生都喜歡桂綸鎂。為了解行情,我訪問青年詩人呂永佳,他為什麼喜
更開放的態度
小書內容包括:
反色情陣營其實最愛色情、
色情查禁抵觸言論自由已有先例、
把兒童色情拉入淫審條例檢討並不正確、
衛道之士對色情文化所知甚少、
反色情會傷
Recognizing non-interactive shells and 'shell levels'
The issue of when bash sources your .bashrc does raisethe obvious question of how you can tell in your .bashrc what caseyou're dealing with, so that you can do different things in each ofthem.
The traditional approach to do this is to set environment variables tosignal what state you're in and how many things have been initialized.One traditional 'have I been initialized' variable is $PS1 , but thishas the tiny weakness that su 'ing to the account from another account
有幾仆街
(午飯時間,電梯口經常有幾個疑似是司機的大叔在吹水)
大叔A:“個仆街食都食得衰過人!”
大叔B:“你見到佢咩?”
大叔A :“上咗去啦,佢老母,搵成幾皮嘢食咁X細個包,真係孤X寒!”(用手
捍衛表達自由
go go go…
去吧!
捍衛表達自由 開放大氣電波大遊行
時間:2009年2月22日下午3時
遊行路程:維園涼亭 至 中環政府總部
本台並於政府總部門外舉行「民間電台地下音樂會」,敬請踴躍支持!
True point in time restores may be hard
One of the things that people ask for from their backup system, oftenfor sensible reasons, is the ability to recreate the system exactlyhow it was at some past time; these are usually called 'point in time'restores. Point in time restores for the recent past are usuallyreasonably easy, but doing it for significant times ago can be verydifficult.
The problem is the dependencies involved start to grow and grow. Forexample, if you want to be able to restore your accounting system tothe exact state