Showing posts from August 29, 2010

RSI, emacs, or just too much typing?

My left wrist is whacked. No pain yet, but something is getting serious wrong.Couple weeks ago, i wrote long about my realization that the problem was the left hand wrist motion to press the 1, 2, Tab etc keys by the bad habit using my index finger. (causing excessive side-to-side wrist motion) (see: Left Wrist Motion Pain; vi Esc key Syndrome.)I made lots of changes in my habit and keybinding. I learned a whole lot more intricate detail about keyboards and habits, and things are going well; no more tingling sensation, because i have not moved my wrist from side-to-side, not a bit, even i still type many hours a day.But this morning when i woke up, my left forearm, the area under it, there's some auto-twitching going on. Very slight, some vague sensation best described as tingling goes along with it, and i know it is BAD. I think because i typed too much yesterday.I realized that i was wrong to think that side-to-side wrist motion was the only cause of my problem. APPPARANTLY, LEF…

Programer Celebrities; Styles and Tack

Perm url with updates: Celebrities; Styles and TackXah Lee, 2010-09-03Xah Lee wrote:Verdict: yay for Clojure!On 2010-09-03, Pascal J Bourguignon wrote:Whatever.But judging from your “how to get list of vectors with value from file content...” question, one would think that after all the years you've been spending criticizing everything about programmers and programs, you'd at least have some sound notions of programming, but you seem actually to lack even the most basic programming Pascal.asking simple language questions is no indication of one's knowledge in computer science nor expertise of the language.Knuth, if he were to program in say java, lisp, javascript, php, or even html, he probably would be a beginner. But nobody would doubt his expertise as a computer scientist or a programer.Same can be said for many language inventors, e.g. Larry, Guido, Wolfram, .... Except in the …

Computer Keyboard Gallery

Perm url with updates: Keyboard GalleryXah Lee, 2006-06, 2010-09-03I'm a computer programer, and sit in front of a computer for more than 8 hours a day every day since about 1990 (this usually includes weekends as well as holidays). I'm also a efficiency nerd and has a untold infatuation with computer keyboards. I have read almost all popularly published reviews of keyboards or special input devices (mostly in MacUser and MacWorld magazines during ~1990-1997), as well as tried them whenever i had a chance, as well software related input issues such as The Dvorak Keyboard Layout, keyboard remap codes on various operating systems, different keyboard shortcuts and macros softwares on different operating systems. This page is some haphazard commentary on computer keyboards, the keys, their layout, and the design, accompanied with photos of them.Generic PC KeyboardI have a keyboard love. Every time i go to a computer shop, i would try …

Sun Microsystem's “Type 6” Keyboard

Perm url with updates: Microsystem's “Type 6” KeyboardXah Lee, 2006-06Sun Microsystem keyboard is one of the worst. The following shows the one that is the keyboard for Sun's Ultra 5 computer (circa 2000). Sun Microsystem's “Type 6” Keyboard. This keyboard's got 2 columns of special keys on the left. Also note, the Caps Lock and Control keys are swapped. And, it has a big Help button on the top left, and a blank key. (If you think that putting Control left to A is good, see: Why You Should Not Swap Caps Lock With Control.)I hardly ever use this keyboard or sit in front of this computer. So i don't know what these keys actually do. I don't think most of these special keys do anything useful. Most of the time, i just telnet/ssh from the PC running WindowsNT, using the generic PC keyboard. This Ultra5 is used as a server, it is one of the test bed for releasing our web-based software. Note the Compose key an…

elisp: read file content in one shot

Here's a short elisp example to get file content into a string.;; thanks to “Pascal J Bourguignon” and “TheFlyingDutchman <>”. 2010-09-02 (defunget-string-from-file (filePath) "Return FILEPATH's file content." (with-temp-buffer (insert-file-contents filePath) (buffer-string))) And, remember, you can also get them into list of lines. (defunread-lines (filePath) "Return a list of lines of a file at FILEPATH." (with-temp-buffer (insert-file-contents filePath) (split-string (buffer-string) "\n" t))) For more about processing a file line by line, see: Process a File Line by Line in Emacs Lisp.

emacs: select current line with single command

Previously, we've covered Single Command to Delete Whole Line and How to Copy/Cut Current Line. But what if you want to select the current line with a single command? Very short, like this:(transient-mark-mode 1) (defunselect-current-line () "Select the current line" (interactive) (end-of-line) ; move to end of line (set-mark (line-beginning-position))) This is added to Emacs Lisp Examples, check it out for other useful exmaples.

Chinese Input with Dvorak Layout (Microsoft Pinyin IME)

Perm url with updates: Input with Dvorak Layout (Microsoft Pinyin IME)Xah Lee, 2010-08-30If you type Chinese, but also uses the Dvorak Keyboard Layout, how do you get the Chinese input using Dvorak layout?Here's the answer for Microsoft Windows.Press 【Win+r】 then type “regedit”. Then, go to the folder in this path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\00000804 That's the folder for Chinese simplified.In the one named “Layout File”, change the value to “KBDDV.DLL”Then, restart Windows. (relogin might also work.)Microsoft Registry showing the Chinese (simplified) input method. Here's the folder name for some other languages.LanguageFolder NameOriginal “Layout File” valueChinese Simplified000000404KBDUS.DLLChinese Traditional000000404KBDUS.DLLJapanese00000411KBDJPN.DLLKorean00000412KBDKOR.DLLBefore you change, write down the original value, just in case you want to change it back.Refer…

google public dns server

Have problems with your dns server? use google's! Google has a public dns for this purpose. “” and “”. See:

Poynter Institute, Language Log, Grammar

Perm url with updates: Institute, Language Log, GrammarXah Lee, 2010-08-31Discovered the Language Log few months ago, but only started to read it this's article:〈The Glamour of Grammar〉 (2010-08-31), by Mark Liberman. At: don't think i like the Roy guy. Idiotic. All he got to say is how much he's respected.The first other article i checked out is:〈Slippery glamour〉 by Mark Liberman, at nice work.I went to look at Mark's bio, ( ) a professor of University of Pennsilvania. Departmet of lingusitics. NICE. No wonder he makes sense on english.I felt eager to share my view of sides here, albeit only have read 2 articles above thus far, but at the moment i went on and read some more. This one:〈Don't tell Sister Catherine William〉 (2008-07-05), by Mark Liberma…

Best Input Devices (Jog/Shuttle, Touchpad, Cyborg Mouse, Pen Tablet)

Perm url with updates: Input Devices (Jog/Shuttle, Touchpad, Cyborg Mouse, Pen Tablet)Xah Lee, 2010-08-31, 2010-11-05Discovered quite a few excellent input devices. Here's a quick list and comment.Cyborg RAT 5 Gaming MouseCyborg RAT 5 gaming mouse. amazon “Cyborg RAT 7 Gaming Mouse Reviews” The Cyborg is probably the best mouse, regardless whether you use it for gaming or not. It's got 7 customizable buttons; standard scroll wheel, but plus a thumb scroll wheel! Says some incredible dpi but i never care about the dpi much as long as it is decent.Who Needs 7 Buttons and 2 Scroll Wheels?I do, even for normal work that's not a game.I'm a functional guy. What i like most about this mouse is 7 programmable buttons and 2 scroll wheels. My current mouses both have 5 buttons. (i use 2 mouses at all times, one for each hand, whichever comes natural. Been using 2 mouses since mid 1990s.) Both of my current mouse has 5 buttons. But that…

book citing

Discovered a book citing my site. 《Enterprise Interoperability II: New Challenges and Approaches》 amazon (2007), by Ricardo Jardim-Gonçalves, Jörg P. Müller, Kai Mertins, Martin Zelm. . Cites: What is Expressiveness in a Computer Language.More at: Printed Citations to

FireFox spellchecker addon

Perm url with updates: a FireFox extension that lets you spell check the window (whole window, not just inside input text boxes). This is useful when your a developing a website.

Dvorak, Matron, de-ergo, NEO, Colemak, Programer Dvorak, Keyboard Layouts Fight!

Perm url with updates:, Maltron, Colemak, NEO, Bépo, Turkish-F, Keyboard Layouts Fight!Xah Lee, 2010-08-30, …, 2011-03-02, 2011-06-10Noticed that today there are a lot of keyboard layouts. There's your QWERTY, and there's Dvorak. That's good enough, right? No. Apparently, a lot people are making a lot layouts. Some are specialized on a particular language (e.g. German, Spanish, Portuguese, French), some aim for easier transition from QWERTY, some are designed for programers.Here's a list of them.QWERTYThe good old QWERTY, always around when u don't need it. qwert yuiop []\ asdfg hjkl; ' zxcvb nm,./ DvorakMy favorite. ',.py fgcrl /=\ aoeui dhtns - ;qjkx bmwvz Dvorak becomes a ANSI (American National Standards Institute) standard “X4.22-1983” and “X3.207:1991”.Following is the numbers row of the original Dvorak design, but is not in the ANSI standard and is not widely use…

Transform HTML Tags with Emacs Lisp

Perm url with updates: HTML Tags with Emacs LispXah Lee, 2010-08-29This page is a tutorial, showing a real-world example of using emacs lisp to do many tag transformation.The ProblemSummaryI need to transform many html tags. Typically, they are of the form 「BeginDelimiter...EndDelimiter」, where the delimiters may be “curly quotes”, or it may be a html tag such as 「<span class="xyz">...</span>」I need to apply the transformation on over 4 thousand html pages, and needs it to be accurate, mostly on a case-by-case base with human watch.Also, the delimiters may be nested, so a simple regex cannot work. They either getting too much text (using default greedy match) or getting not enough text (using shy group). With a elisp script, one can use “if” and other emacs functions, to correctly find the matching ending tag, as well automatically skip cases that this transform should not apply, so drastically less…