Monthly Archives: December 2013

函数式编程的另类指南(9)

The following part is not maintained anymore. Please go to 函数式程序设计的另类指南 for the whole translation.

以下内容不再更新,浏览全部翻译,请访问函数式程序设计的另类指南

原文链接:Functional Programming For The Rest of Us
原文作者:Vyacheslav Akhmechet

Continuations

Continuations对于程序设计的意义,就像《达芬奇密码》对人类历史的意义:揭露了人类有史以来最大的假象。恩,也许没那么牛。但它在概念上的突破性至少和开方负数的意义相同。

read more

函数式编程的另类指南(11)

The following part is not maintained anymore. Please go to 函数式程序设计的另类指南 for the whole translation.

以下内容不再更新,浏览全部翻译,请访问 函数式程序设计的另类指南

原文链接:Functional Programming For The Rest of Us
原文作者:Vyacheslav Akhmechet

闭包(Closure)

我们已经讨论了纯函数式语言的很多功能——所谓“纯”函数式语言就是实现了lambda演算并且不包含与Church范式矛盾的特性。但是函数式语言并不仅限于lambda演算。虽然实现一个自我证明的系统非常有用,它可以让我们以数学的方式来思考程序,但是可能在实际中它没有什么用处。所以很多语言选择支持部分函数式元素,但又不严格遵守那些教条。一些语言(比如Common Lisp)不要求变量是final的。你可以随时修改变量。它们的函数也不仅依赖于函数的参数。函数可以访问外部状态。但这些语言的确包含了函数式特性,比如高阶函数。在非纯粹的函数式语言里以函数作为参数传递,和在lambda演算系统中有些不同,它需要一种被称为词法闭包(lexical closure)的有趣特性。让我们来看看这段例子代码。记住,这回变量不是final的,并且函数可以引用其作用域外的变量:

read more

Install brat on Apache2

Install brat

download, unzip and run ./install.

Change the webapp location in Apache2

  1. in etc/apache2/sites-avialble, in default add Alias /brat "/home/brat"
  2. restart apache2:
sudo service apache2 reload

Recommend: How to become good at peer review: A guide for young scientists

Peer review is at the heart of the scientific method. While it’s by no means a perfect system, it is still the best system of scientific quality control that we have. Many graduate programs don’t explicitly teach courses on how to review papers. Instead, a young scientist may learn how to review a paper under the guidance of his or her mentor, How to become good at peer review: A guide for young scientists is a post to put together a set of guidelines for young scientists.

How to build PDFsam enhanced on Linux

PDFsam (PDF Split and Merge) is a free and open source desktop utility designed to perform pdf documents manipulation (pdf merge, pdf split, page rotation etc). PDFsam Enhanced is the Pro version. It has additional features including encryption/decryption of pdf files, extracting attached files, mixing two pdf files, etc. This post tells you how to download the source code, compile and use it for free.