江湖医生一样的程序员

2010年2月4日星期四

random bits

Jul 30, 2009 在此 GNU Emacs 23 正式发布之良辰吉日, 把 Windows 机器上的
Emacs 从 ntemacs 23 更换成 GNU Emacs 23.1.1. 希望 Aquamacs 早日升级.
Jul 30, 2009 有人说 Emacs 版本号大, 关键是年纪在那里摆着呢, 单说 GNU
Emacs 都比我.
Jul 30, 2009 Natter: XMPP library, Computer to computer via XMPP, IQ
Only.
Aug 3, 2009 wikipedia备份数据下载
http://download.wikimedia.org/backup-index.html
Aug 12, 2009 Beta Reduction is a transformation of the Lambda
Calculus(LC). LC is the mathematical foundation of all LISPy
language.
Aug 14, 2009 在安装 php-5.3.0-Win32-VC9-x86 时发现, VC 2008 编译出来的
程序需要安装相应的 Microsoft Visual C++ 2008 Redistributable Package,
否则会报"由于应用程序配置不正确, 应用程序未能启动"的错误.
Aug 14, 2009 Github Pages 简直是最帅的 BSP 了吧.
Aug 16, 2009 Reviewed SilverStripe, Joomla, Exponent, Jaws, ImpressCMS
CMS written in PHP.
Aug 16, 2009 Microsoft Web Platform Installer is pretty cool!
http://www.microsoft.com/web/
Aug 16, 2009 Plone 有非常优秀的 UI, 不过基于 PHP 的 CMS 有非常好的
hosting 环境.
Aug 16, 2009 SilverStripe rewrite rule for nginx:
if (!-f $request_filename) {
rewrite ^/(.*?)(\?|$)(.*)$ /sapphire/main.php?url=$1&$3 last;
}
Aug 17, 2009 SilverStripe 有最 AJAX 的 UI, Drupal 有最可扩展的架构.
Aug 17, 2009 It is bound to M-m. (back-to-indentation) Move point to
the first non-whitespace character on this line.
Aug 17, 2009 taskkill /f /im nginx.exe
Aug 17, 2009 Reviewed pivotx blog engine, looks good!
Aug 18, 2009 Drupal rewrite rule for nginx:
if (!-f $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
Sep 3, 2009 Java Platform 里除了 Java 语言外还真不错, JRuby 让 Rails
有了更广阔的部署空间和一大堆的库可以用, 刚看一个演示在 JBoss 应用服务
器上部署 Rails App, 真是简单到不能再简单了. 该演示提到 Drools 规则引
擎, Ruby 里据我所知是没有这么成熟度的规则引擎库的. 这两天对 JVM 上的
语言 Clojure 也蛮来电.
Jan 22, 2010 On the other hand, the CS curriculum really is
critical. Learning it would save you from inventing PHP, which would
be a huge benefit to mankind. --David Chapman
Jan 22, 2010 First of all, he really was looking at the Symbolics
code; we caught him doing it several times. But secondly, even if he
hadn't, it's a whole lot easier to copy what someone else has
already designed than to design it yourself. --Dan Weinreb
Jan 22, 2010 By following a proprietary model, symbolics (and lmi)
doomed lisp machines. Doomed in much the same way, though a different
market, as Amiga and BeOS. The only surviving lisp machine is RMS'
emacs VM. --Paddy Murphy
Jan 22, 2010 In fact there is plenty of evidence that supports
Mr. Chapman's point that most of the influential programs are
produced by amateurs.

Take Altair Basic, MS-DOS, and Windows. Neither Gates nor Allen had
formal education in computer science when they released these
products. They wouldn't probably worked on them if they had.

Another evidence is Linux. Linus Torvalds started university in 1988,
first released Linux in 1991 and got his degree in 1996. He originally
developed the Linux kernel as a hobby OS.

Richard Gabriel has a good analysis on that. --Kamen Tomov
Jan 25, 2010 The third principle is that web.py should, by default, do
the right thing by the Web. This means distinguishing between GET and
POST properly. It means simple, canonical URLs which synonyms redirect
to. It means readable HTML with the proper HTTP headers. --Aaron Swartz
Jan 26, 2010 昨晚看法制频道在给贵州黎平县的法院执行人员歌功颂德, 但是
他妈的他们执行的是个什么案件啊, 一个喝了酒的小年青用打火机点燃了加油站
漏出流到水沟里的汽油, 烧了十户人家的房子, 结果这个小青年承担 70% 的责
任, 判刑 10 年, 赔款 15 万, 加油站一方承担 30% 责任, 这他妈这是法律吗?
Jan 27, 2010
# echo {a..t}
a b c d e f g h i j k l m n o p q r s t

for in in `echo {a..t}`; do wget http://host/file${i}.zip; done
Jan 29, 2010 Since coroutines can have more points of entry and exit
than subroutines, it is possible to implement any subroutine as a
coroutine. "Subroutines are special cases of ... coroutines." —Donald
Knuth
Jan 29, 2010 An example of a generator returning the Fibonacci numbers
using Python's yield statement can be seen below.

def fibonacci():
a, b = 0, 1
while True:
yield a
a, b = b, a+b

for number in fibonacci(): # Use the generator as an iterator
print number
Jan 29, 2010
A lock can be built using an atomic test-and-set instruction as follows:
function Lock(boolean *lock) {
while (test_and_set (lock) == 1)
;
}
Jan 29, 2010
In mathematics, a multiset (or bag) is a generalization of a set.
Jan 29, 2010
Perhaps the simplest persistent data structure is the singly-linked
list or cons-based list, a simple list of objects formed by each
carrying a reference to the next in the list.
Jan 29, 2010
preorder(node)
print node.value
if node.left ≠ null then preorder(node.left)
if node.right ≠ null then preorder(node.right)
inorder(node)
if node.left ≠ null then inorder(node.left)
print node.value
if node.right ≠ null then inorder(node.right)
postorder(node)
if node.left ≠ null then postorder(node.left)
if node.right ≠ null then
print node.value
Jan 29, 2010
levelorder(root)
q = empty queue
q.enqueue(root)
while not q.empty do
node := q.dequeue()
visit(node)
if node.left ≠ null
q.enqueue(node.left)
if node.right ≠ null
q.enqueue(node.right)
Feb 2, 2010
RT @vvchn: 生于八零年代,承蒙时代错爱.屡遇砖家教改,深受思想渎害.苦读十
年八载,举家艰难负债.文凭贬值太快,大学亏本买卖.应聘人山人海,创业缺乏人
脉.都市雨淋日晒,无处安营扎寨.郊县觅得住宅,辛苦打工还贷.理想就地掩埋,现
实金钱崇拜.人生犹如竞赛,不敢丝毫懈怠.偶尔自怨自艾,感叹青春不再.
Feb 2, 2010
Features of a programming language, whether syntactic or semantic, are
all part of the language's user interface. And a user interface can
handle only so much complexity or it becomes unusable. This is also
the reason why Python will never have continuations, and even why I'm
uninterested in optimizing tail recursion. --Guido
Feb 2, 2010
http://stackoverflow.com/questions/429995/how-do-c-and-c-store-large-objects-on-the-stack
Feb 2, 2010
http://stackoverflow.com/questions/79923/what-and-where-are-the-stack-and-heap
Feb 2, 2010
http://stackoverflow.com/questions/1294756/queue-that-uses-a-stack

Take two stacks, in and out.

To enqueue an element, push it on stack in.
To dequeue an element, pop an element from stack out if out is not
empty; otherwise, pop and push all elements from in to out, then serve
the top element of out.

It is important that you perform step 2 only if necessary. Note that
enqueue has complexity O(1), and dequeue has amortized complexity
O(1), provided your implementations of pop and push are O(1).
Feb 2, 2010
stacks for threads are often smaller. You can change the default at
link time, or change at run time also. For reference some defaults
are:

glibc i386, x86_64 7.4 MB
Tru64 5.1 5.2 MB
Cygwin 1.8 MB
Solaris 7..10 1 MB
MacOS X 10.5 460 KB
AIX 5 98 KB
OpenBSD 4.0 64 KB
HP-UX 11 16 KB
Feb 3, 2010
The code from __future__ import braces raises the exception
SyntaxError: not a chance.
Feb 3, 2010
In computer science, manifest typing is when the software programmer
explicitly identifies the type of each variable being declared. For
example: if variable X is going to store integers then its type must
be declared as integer.

In contrast, some programming languages use implicit typing (aka. type
inference) where the type is deduced from context or allow for dynamic
typing in which the variable is just declared and may be assigned a
value of any type at runtime.
Feb 3, 2010
HipHop for PHP: Move Fast --Haiping Zhao
Feb 4, 2010
这年头——

到处都是错别字:植树造零,白收起家,勤捞致富,选霸干部,任人为闲,择油
录取,得财兼币,检查宴收,大力支吃,为民储害,提钱释放,攻官小姐。

没有评论:

发表评论

没事儿就省省吧, 有事儿请给我发邮件.