An object identity gotcha in Python

Consider the problem of implementing a modified LIFO stack that has anadditional O(1) operation called min , that gives back the smallestitem in the stack. For now, let's pretend that Python arrays are O(1)(or that someone has implemented a native queue class); in many respectsthey are as far as Python code is concerned.

The simple implementation is to keep two stacks, the main stack andone that you only push new minimum items onto. Then push and pop aresomething


20060601網摘 – 反高潮

真假阿叔?

Javascript

  • Ajax.RssReader 使用 prototype 的 javascript rss reader
  • Narrative JavaScript 處理你的 asynchronous call,使之可疊起來。不過,使用上不太方便,因為有新 syntax 和要 compile

YouTube


社會主義好

北京的朋友與我話當年
他說九十年代初他第一次到香港入了惠康超級市場
他簡直是震撼
他在想北京什麼時候可以有這麼先進的購物方式
沒想到北京很快就有了比香港更完善的超市

我也跟他分享了我的經驗
八十年代初我外公在澳門

置頂!!論文新標語











Continue reading...

Link: a Unix sysadmin rosetta stone

Rosetta Stone for Unix is a very handycross-index of various commands and tasks across various Unix variants.The index of tasks is especially handy as a quick 'how do I do this onX' pointer. It's available in several formats, and as a bonus you getsome helpful links as well.

(Since I was just using this today to figure out how to do variousthings on Solaris, I figured I should finally get around to mentioningit.)

(From a Slashdot comment .)


The cynical take on nofollow

People have been calling the nofollow tag afailure for a while, most recently in Blog Spam, and a 'nofollow'Post-Mortem , which hit the geek news today. Comment spam has not exactly diminished sincenofollow's adoption, which is not a good result for somethingintroduced with the title 'Preventing comment spam' .Calling it a failure is pretty easy.

The cynical take on nofollow is a bit different: nofollow is actuallya clever way to improve search engine results . While it's not


音樂紀錄專集「燃亮了 像雪飛花」









朋友們

本人的首個音樂紀錄專集
「燃亮了 像雪飛花」
將在2006年6月3日 首日發佈

我會在當晚10:30pm後到達尖沙咀文化中心外「翱翔的法國人」雕塑前的空地
有興趣者可在當晚免費索取 ( 數量有限 )
或帶同妳自家製作


Fiddling with X selections from shell scripts

I know of three command-line programs that will fiddle with theX selection (and/or the cut buffers) in a way that's usefulfor shell scripts: xsnarf from Smarasderagd's collectionof X things , xcb , and xclip .

I use xsnarf for a variety of reasons, I think partly historical (inthat I had it around well before I found the others); I'm jotting downthe other two here partly so that I have the information handy the nexttime someone asks me


A simple way to get a disk space usage summary

In the spirit of my little shell scripts, here's a simple way to get auseful summary of disk space usage on a Unix system:

du | sort -nr | less

(substitute the pager of your choice for less , and use ' du -x ' asnecessary.)

This is less pretty than the various graphical disk space visualizationprograms that float around, but I find it gives me pretty much theinformation I need. It's pretty easy to narrow down what areas of thefilesystem,


說個笑話紀念我











來,去
花/火



時間,
時間