Showing posts from February 26, 2012

emacs 24 command: count-words

in emacs 24, a frequently asked command is finally here: “count-words”.this command will count {lines, words, characters} of the current file. If there is a text selection, then it'll count in that region only.if you are using emacs 23.x, you can define the command yourself. Like this: (defuncount-word-region-or-buffer () (interactive) (message "Word count: %s" (how-many "\\w+"))) Thanks to Jon Snader (jcs) for this nice implementation.For a detailed elisp tutorial, see: See: Emacs Lisp: Count Lines, Words, Chars.See also: Try Out Emacs 24 Alpha Release

Conway's Game of Life Recursively Defined

Conway's Game of Life within Conway's Game of Life.Conway's Game of Life within Conway's Game of Lifemore info at: Conway's Game of Life Recursively Defined

Programing Language: Steve Yegge on Dynamic Languages


Try Out Emacs 24 Alpha Release

emacs 24 alpha has been out for a while.2 months ago i tried it and it crashes when loading linum-mode (show line numbers on left window border)today i tried again, and it seems smooth, so far. If you want to give it a try, download at:Windows: Source Download the one named 〔〕. Unzip it.Mac: Source emacsformacosx.comLinux: Check your OS's software manager. Or, download source at Source and built yourself.For Windows users, after download, unzip it. Go to the folder, in the “bin” dir, then click on file in “runemacs.exe” to's probably better if you create a Windows shortcut, which lets you set your home dir create a file shortcut:① Hold Alt then drag that 〔runemacs.exe〕 icon to desktop. ② In the newly created alias icon, right click to open file properties. Then, in the “Start in” field, enter %home%.③ In the “Target” field, you can add your own init files. For example, here's mine: %home%…

emacs 24 bookmark location changed

In emacs 23.x, the default location for bookmark is at 〔~/.emacs.bmk〕.In emacs 24.x, it is 〔~/.emacs.d/bookmarks〕.So, if you are upgrading to emacs 24, you might want to move and rename your bookmark file.The default location is controlled by the variable “bookmark-default-file”.For the basics of bookmark, see: Using Emacs's Bookmark Feature.

Programing Language Design and Language Idioms

This article shows code snippets in {Common Lisp, perl, python} to illustrate why idiomatic programing are bad.Here's constructions in various languages. See if you can understand what they do and identify each language. (floor x y) x/y x//y require POSIX; floor(x/y); int(x/y); for answer, see: Programing Language Design: Why Idioms Are Bad

What's “In-place algorithm”?

Here's Wikipedia In-place algorithm excerpt:In computer science, an in-place algorithm (or in Latin in situ) is an algorithm which transforms input using a data structure with a small, constant amount of extra storage space. The input is usually overwritten by the output as the algorithm executes. An algorithm which is not in-place is sometimes called not-in-place or out-of-place.for a example of in-place algorithm for reversing a list in {python, perl, emacs lisp, Mathematica}, see: In-place Algorithm for Reversing a List in Perl, Python, Lisp, Mathematica