Building and installing tmux without root privilege

  1. Get libevent source from libevent.org and build. This will install the header files and libraries under folder $HOME/local

  2. Get tmux source from tmux.sourceforge.net and build. This will statically link to libevent and put the binary under folder $HOME/local

  3. Add $HOME/local/bin to your PATH and tmux is ready to rock.

Arrays of Variable Length - C99 support in GCC

Noticed an ISO C99 feature supported by gcc:

Variable Length - Using the GNU Compiler Collection (GCC).

What is RCU, Fundamentally? [LWN.net]

Check out Paul McKenney’s wonderful tutorial on Read-Copy-Update mechanism used for parallel programming in Linux.

What is RCU, Fundamentally? [LWN.net].

Lisp和Objective-C原来是亲戚

今天洗澡的时候——这通常是我灵感显现之时——忽然发现Lisp和Objective-C的语法有相似之处。且看:

[NSString doubleValue]

这是Objective-C调用类NSString的方法doubleValue;还有

(* 3 4)

这是Lisp调用乘法计算3和4的积。

查了一下Wikipedia,原来经典Lisp作为老牌程式编程语言,影响了作为面向对象鼻祖的SmallTalk的设计,SmallTalk又影响了Objective-C的设计以及现代版Common Lisp的设计,特别是两者面向对象的部分。

Lisp deeply influenced Alan Kay, the leader of the research on Smalltalk, and then in turn Lisp was influenced by Smalltalk, by adopting object-oriented programming features (classes, instances, etc.) in the late 1970s.

摘自 http://en.wikipedia.org/wiki/Lisp_(programming_language)#Language_innovations

The syntax and runtime behaviour of the Objective-C programming language is strongly influenced by Smalltalk.

摘自 http://en.wikipedia.org/wiki/Smalltalk#Influences

巧合的是我很多年没有学习新的编程语言了,最近却阴差阳错同时开始学Lisp和Objective-C。两者的起因都是因为换了Macbook。前者是由于没能成功编译Kscope而重新检视用vim和Emacs来浏览代码,看了Emacs-Lisp,以及这本关于Lisp的书——Practical Common Lisp;后者则是凑个热闹,看看Cocoa比多年前Windows上做开发的MFC进化了多少。

刚开了个头,还是很有趣的。

How to set Mac OS X Global Environment Variables

I have recently switched to MacBook Air and started exploring the fantastic Mac OS X - a pleasant OS on a pleasant piece of hardware.

This week I’m trying out setting up a LISP environment with Clozure CL and Emacs/SLIME. I’m using the Emacs for Mac OS and SLIME. I needs tell a LISP script about where to find the LISP installation with the environment variable CCL_DEFAULT_DIRECTORY. It’s rather easy to do this for consoles - but how to do it with Emacs.app, the cocoa-version?

There has been some searching on Google and it turns out the following works perfect: edit /etc/launchd.conf to contain a line like this:

setenv M2_HOME /opt/maven/2.0.9

Note that one can also do this with ~/.launchd.conf, which only affects the user only. The per user .launchd.conf does not seem working - I lost the configuration once I restarted

  • it worked only because I used the below command to pipe the configuration into launchctl.

It’s also possible to take the changes into effect without rebooting or even logging out by

grep ^setenv ~/.launchd.conf | launchctl

via Mac OS X Global Environment Variables | Digital Edge Software and Consulting.


Contents on this site are licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. Creative Commons License