2010-09-07

are you a persecuting moralist?

Wikipedia article Sideshow. Quote:

Interest in sideshows declined as television made it easy (and free) to see the world's most exotic attractions. Moreover, viewing “human oddities” became distasteful as the public conscience changed, and many localities passed laws forbidding the exhibition of freaks. The performers often protested (to no avail) that they had no objection to the sideshow, especially since it provided not only a good income for them, but in many cases it provided their only possible job. The sideshow seemed destined for oblivion, until only a few exemplars of the ten-in-one remained. A greater number of “Single O” attractions still tour carnivals.

That's a example of moralist doing harm to society. So, if you are such a moralist, e.g. you are the bleedingheart concerned about feminism, children, the poor and have-nots, chances are, you are doing more harm than good, and you are doing it to satisfy the fundamental psychological itch for having a worth in life.

See also:

  • 〈Freaks〉 amazon
  • 〈Sideshow: Alive on the Inside〉 amazon (1999)

There are too many examples to cite...

elisp tip: message and apropos-command

Tip for elisp coders. Often, while still writing your program and in the debugging process, you might put 「(mesage mystr)」 to print some variables. However, if your “mystr” happens to contain “%” char such as in url, then you'll get a mysterious error “Not enough arguments for format string”. Took me some time to trace a bug to this extraneous debug line. So:

;; don't do this
(message mystr)

;; do this
(message "%s" mystr)

Also, you know about apropos-command 【Ctrl+h a】 right? Useful to find the command you want. However, remember that it only list commands, not functions. When you are looking for the function you want, you can do a 【Ctrl+u】 first, so that apropos-command will also list functions.

2010-09-06

chinese word for fuck

The correct word for fuck in chinese is 肏 (cao4). People often write 操, same sound, but incorrect word. Possibly this incorrect usage began as euphemism.

The word 肏, is made up of 2 words. The top is 入 (ru4), meaning “enter”. The bottom is 肉 (ruo4), meaning flesh.

Emacs, RSI, My Experiences

Perm url with updates: http://xahlee.org/emacs/emacs_rsi_my_experiences.html

Emacs, RSI, My Experiences

Xah Lee, 2010-09-05

Recently, i had starting symptoms of RSI (repetitive strain injury). (For detail see: Left Wrist side-to-side Motion Pain; vi Esc key Syndrome) This page is some practical emacs and keyboarding advices i learned due to this experience.

Keyboarding Advices Are Qualitatively Different Depending on Typing Duration

I learned that typing advice matters depends on just how much one types a day. If you just type less than 1 hour a day like vast majority of computer users, qwerty or bad habits or bad keyboard is completely healthy! You could do this for 10 years and never have any problem.

Big difference from coders who actually actively have fingers pressing keys a accumulated total of 3 hours a day, to some who have 10 hour sessions and actually type 6+ hours a day, and compared to data entry clerks who has fingers pressing keys for ~8 hours a day fast and non-stop.

For the latter, a special ergo keyboard like Kinesis or Maltron becomes necessary.

All programers have strong opinions about keyboarding, but how much one really types makes the advice qualitatively different. Advice from those typing 5 hours per day is not applicable for those typing 10 hours a day, and advices from the 10-hours experience may not be suitable for those typing just 5 hours, even if both are sound ergonomic advices. (you'll see why below)

Tab, Enter, Backspace Key are Problems

I learned that the PC keyboard really have serious problems especially with the Tab, Enter keys, Backspace, and the right side Shift key. Even with Microsoft's ergonomic keyboards.

They are all pressed by stretched pinky. The Enter and right Shift requires a stretched pinky because there is 1 extra key after the right pinky's home position. (the apostrophe 「'」 key.) (Some euro lang layouts such as QWERTZ and AZERTY have 2 extra keys in between!)

This is the first time, that i realized from actually hand experience, about the problem of these keys. To press Enter or right Shift, the right hand does a combination of stretching pinky or side-to-side wrist movement. Do this for 8 hours a day every 5 seconds; hello RSI!

One might think these keys are not used that often, but from emacs command frequency study , programers actually do a lot editing and not simply data entry. The average for editing keystrokes is like 48%! (for each person, it varies from 20% to 80%, depending on whether you are for example heavily writing a lot emails, or much reading/editing code.)

(Maltron, Kinesis keyboards solve this problems by having thumb cluster keys for these)

For more detail on this, see: Keyboard Hardware Design Flaws and Kinesis Contoured Keyboard Review and RSI.

Emacs Tips for 70-Hour Week Sessions

The following are some specific emacs advices. Note that i already use:

So, the following advice may be applicable only if you already do the above and have to type 70-hour weeks for many weeks.

• I started to remap extensively my personal bindings that involves a Shift. Get rid of them. Especially those needs the right shift. (i.e. the letter is on the left side of keyboard)

• I started to aggressively make alias to commands i use often. The aliases are 1 to 3 letters long. Put alias file on your Emacs's Bookmark so you can open them right away and define new ones the moment you find a command that you are using a lot today or past days. (i stopped worrying about cluttering alias space or managing to remember them. It doesn't seem to be a practical worry.)

I use aliases because i already have about 200 personal hotkeys. Single key spaces are mostly used up (including single keys on the number pad), key chord combinations are harder to remember.

• Do the same for abbrev, as well as your custom keybinding file. The point here is that you want a dynamic and instantaneous system that let you easily change or add new shortcuts, alias, abbrevs, and you should get a habit of adding new ones whenever you noticed a command or word that you've been using frequently in the past few days. (you will usually notice it. For command, due to the fact you have to press Tab a lot to command completion (e.g. elisp's buffer-substring-no-properties) , and for long words like “environment variable” or “internationalization”, “Microsoft”, “Windows”, “GNU Emacs”, “software”, or “http://ergoemacs.org/”, you'll notice.)

• I started to type enter by 【Ctrl+m】 half of the time. (in fact 【Win+m】 is also Enter now thru AutoHotkey.) Partly to alleviate the burden on right hand, partly to vary the muscle usage. And yes, sometimes press Enter by moving your whole hand, as in hunt-n-peck.

Note, unless you are on a laptop, don't press Ctrl with pinky, and it's probably not a good idea to swap Ctrl with Caps Lock. (See: How To Avoid The Emacs Pinky Problem.)

• Remapped Caps Lock to Tab now. (or, i could also use 【Ctrl+i】)

• Seriously started to use yasnippet template system a lot. Made it a habit to create new templates constantly and instaneously. Usually with just 1 to 3 letter abbreviations to invoke them. Don't fret about abbrev consistency, template design, etc. The point here is that it's for your personal use, and that it immediately saves you lots of typing.

For example, instead of “div.class” for 「<div class="...">...</div>」, you can make it just “d.c” or even “dc”.

• I realized that bookmark, dired, all can use mouse. I try to switch to mouse more often. Yes the keyboard is faster but not good if repeatedly used for 10+ hours a day without hand muscle changing exertion pattern. Sometimes also use mouse to select text.

• I started to use less efficient keys sometimes, e.g. the arrow key and 【Ctrl+arrow】 for cursor movement, page up/down, .... To get hand away from the same muscle usage on touch typing position.

• Alternate hands for pressing the Space bar.

My problem is only with left hand. On Dvorak, right hand actually does 14% more typing. I realized that i always press space with left thumb. Now i switch to right thumb. Perhaps eventually want to develop a habit of alternate hands for space bar after each word. (the space in language is used more frequently than any letter)

• I switch keyboards during a day. My 3 fav are Microsoft's Natural Ergonomic Keyboard 4000, Comfort Curve Keyboard 2000, Wireless Natural Multimedia. Right now am on comfort curve, which has laptob style flat keys. Change keyboard is for the purpose of varying the muscle usage pattern.

• In emacs keybinding, forget anything about consistency or ease-to-remember. One principle and one only: map Command Frequency to ease of the key.

• Do not bother with prettying up little formatting in code or deleting a trailing space, alignment. Avoid un-necessary typing. Use automatic formatting tool as much as possible. (e.g. emacs delete-trailing-whitespace and much others.)

• Set Windows's mouse behavior to be auto-raise. That is, when your mouse hovers on a window, that window automatically comes to the front. I find this convenient.

ErgoEmacs Viper Mode

I seriously considered creating a ErgoEmacs viper mode. I'm familiar with vi's “modal” methods of editing, but have always kinda put off of thinking about whether the vi modal method is more efficient or ergonomic. With my RSI incident, i put heavy thought about it, and i think yes, the modal method is actually more efficient and ergonomic.

I think i'll invest time in this in the future.

(However, note that by default the Esc for switching mode is a FAST way to get RSI. Also, the default command keys in vi are NOT optimal. (see: Emergency vi (vi tutorial)) Vi's keys, like emacs, are largely historical happenstances without any thought on efficiency or ergonomic. (see: Keyboard Hardware's Influence on Keyboard Shortcut Design.) )

Kinesis Keyboard

The Kinesis Contoured Keyboard solves many major PC keyboard problems. I think i may get it.

I think the above sums my recent experiences.

Again, this needs to be emphasized: all the above advices is for someone who spend some 10+ hours in front of computer for 3 or more years. If your keyboard needs is not this heavy, some of the above advices are not applicable, and in fact less efficient (e.g. switching keyboards in a day, constantly add new keyboard shortcuts, use the mouse, etc.)

Also, my heavy use of keyboard is mostly writing essays and tutorials in html. So, there's a lot of heavy data-entry tasks (meaning: just keep typing a lot of plain english text.). Because i have extensive shortcuts and commands to insert html tags or special chars such as 〈「【([{",=+-"}])】」〉, my typing problem is probably mostly due to heavy typing, not much from emacs chording.

Was this page useful? If so, please do donate $3, thank you donors!

2010-09-05

spread ErgoEmacs

Created a ErgoEmacs online forum invitation, like this:

Join ErgoEmacs's Discussion Forum!
Email:
Google Groups

If you are a ErgoEmacs user, please join. You can subscribe with abridged or digest format with 1 email per day. Many webfeed are available at http://groups.google.com/group/ergoemacs/feeds

If you like ErgoEmacs, you can place the following on your website or blog to spread ErgoEmacs.

<table border="0">
<tr><td>
Join <a href="http://ErgoEmacs.org/">ErgoEmacs</a>'s
<a href="http://groups.google.com/group/ergoemacs">Discussion Forum</a>!
</td></tr>
<tr><td>
<form action="http://groups.google.com/group/ergoemacs/boxsubscribe">
Email: <input type="text" name="email">
<input type="submit" name="sub" value="Subscribe">
</form>
</td></tr>
<tr><td style="vertical-align:middle">
<img src="http://groups.google.com/intl/en/images/logos/groups_logo_sm.gif" height="30" width="140" alt="Google Groups">
</td></tr>
</table>

lisp macros and Practical Common Lisp

Perm url with updates: http://xahlee.org/UnixResource_dir/writ/practical_comm_lisp_macros.html

Lisp Macros and Practical Common Lisp

Xah Lee, 2010-09-05

Xah Lee wrote:

... and i think the Practical Common Lisp book is idiotic.

Sometimes when i post to tech geeker groups, some spice is added on top of my opinions to make it more pungent.

No doubt, such also garner bad rap for me, and distanced many who otherwise might be friends.

Peter Seibel, the author of 《Practical Common Lisp》, will probably see my message (if not already), and think i'm a troll. And if the person in question has some social standing or good sense, typically they just ignore me, but otherwise, often the geeker (fledgling student or nameless old fart) will mark me red and chase me here or there online.

Hehe. That's called: the human nature.

After being such a person for about 10 years now, i admit that some of my words is quite off color, and not true, or in literary words: offensive hyperbole.

O well but a troll is a troll and u can't expect dining etiquette. I quote the redoubtable Xah Lee:

 When a person's sanity is at balance,
 when human passion is raging,
 no etiquette must get in the way.
     —Xah Lee, 2001.

from Netiquette Anthropology.

but about the 《Practical Common Lisp》 amazon book, i'd like to undress my hyperbole a bit.

I didn't read it. I only scanned one chapter, the chapter 7 〈Macros: Standard Control Constructs〉 at gigamonkeys.com, around perhaps 2006. I remember, i was quite angry when reading that chapter. A book purporting to be practical and pitching lisp to imperative monkeys, spend a chapter on a outdated academish fluff, but more so, telling readers how certain very basic language constructs such as “when” in lisp is made possible by a internal hack. Reading that was infuriating to me. Here we have a mass of imperative coding c c++ java monkeys, who probably have been that dumb in industry for 10 or more years, and now eager to give the artificial intelligence language a try, and here they have to endure the practically-speaking useless chapter that tries to conduct a anciently questionable concept.

LOL.

Can you now see my point of view?

Aside from scanning this chapter, i haven't read the book. (because i have no interest in learning Common Lisp.)

My criticism on chapter 7 is merely picking bones in a egg. It has little to do with lisp the language. More do with the wide number of lisp preaching idiots who hang macros on their mouths all day but are totally ignorant of the far more generalized concept of pattern matching as exists in Mathematica and other functional langs.

But mainly, am writing this message here to say that it is indeed reasonably a good book. A very much needed, practical, book on Common Lisp, practically speaking.

I remember i have seen Peter on google talk video too. Also, last year i noticed he also wrote another book 《Coders at Work》 amazon, which is a collection of interviews with well known programers. worth checking out.

emacs diredPlus mode

Installed the “Dired+” mode, by Drew Adams. It's a very nice enhancement to dired. See its home page at emacswiki.org DiredPlus for many screenshots and features.

To installed, just place the file at 〔~/.emacs.d/dired+.el〕, then put this code 「(require 'dired+)」 in your emacs init file. Optionally, byte-compile it to make it load and run faster.

Initially, i needed a way to omit some files in a dired buffer. DiredPlus does the job. If you don't know what dired is, see: File Management with Emacs (dired tutorial).

2010-09-04

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, LEFT HAND'S THUMB BENDING INWARD TO HOLD THE ALT KEY can also cause a problem if done too much.

At the moment, i'm not sure i can pinpoint any particular habit or keybinding motion to blame. I type on Dvorak, and Dvorak uses right hand keys 14% more than left. But i don't have any problem with my right hand at all (PS, when writing this paragraph, i just realize that i always use my left hand to type the space bar. That could explain it!)

Am sending this out here as a warning to anyone who does heavy typing. Apparently, ErgoEmacs's ways of using Alt cannot solve prolonged typing.

perm url: Left Wrist Motion Pain; vi Esc key Syndrome.

2010-09-03

Programer Celebrities; Styles and Tack

Perm url with updates: http://xahlee.org/UnixResource_dir/writ2/programer_styles_and_tack.html

Programer Celebrities; Styles and Tack

Xah Lee, 2010-09-03

Xah 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 notions.

lol 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 first few years where whole team is just the inventor, each is certainly no longer the top most expert of that lang, and they can ask a lot technical questions.

When a person becomes famous, there's the question of whether he'd ask trivial questions in public. For example, suppose you became a famous computer scientist, or mathematician. But, in today's world, you wouldn't know the most basic things about thousand subjects that's related to your field. e.g. Would Knuth ask basic html questions in some public place if one day he happens to need to write a line of html? On one hand, a highschool student can probably answer his question that otherwise he might spend few hours to dig into documentations, tutorials, etc. On the other hand, one might think: “jesus, Dr Knuth is asking a basic question about html??”.

Can you see the dilemma?

There's perl, python, php, javascript, java, c, c++, bash, html, css, Mathematica, ... langs, and hundreds thousands other tech and protocols etc. Each, mostly has a inventor, and for our purposes, they are celebrities. Each of them, do NOT have a BASIC understanding of the hundreds other langs, protocols, technologies. But due to their work, they probably have questions or curious about them everyday. Now, if you are one of these celebrity, would you, take the 5 min and get your question answered in some public social networking site such as online chat, irc, stackoverflow, or, are you the type that would try to spend few hours by yourself on it, or ask only your close friend and colleagues, in the name of public perception?

Now, think of a famous computer scientist or celebrity programer you know, and tell me if that person is the keep-to-self type or freewheeling ask-around type?

I've thought about this, and have tried to observe what celebrities do. My observation is that there's no universal behavior pattern, and it basically came down to personality. Some such celebrity, would never ask any such question in public, and tend to keep a “professor” public image. While on the other extreme, especially in the last 10 years due to the effect of the internet and communication tech on society, don't care and feel free to ask questions in public. (e.g. some such computer scientist and mathematicians openly write blogs, filled with questions that are basic outside of their very narrow speciality, or even something they should totally know but forgotten (frankly, doesn't matter how good is your memory, you probably forgot say 1% of what you know about a lang or field of study. Do you, remember the calculus you learned in highschool? or a philosophy course or a history course? But you can still be a award-winning mathematician, programer, writer, lawer, director, right? ))

what would YOU do, Pascal? are you the type who never do thought-flow in public?

also, keep in mind that the act of asking question, has social functions other than getting a technical answer. This is a big part of blogging and the web social networking is about.

if you have actually read much of my writings, do you, truely believe, that my understanding of lisp is such that i wouldn't know or unable to find out how to get a file content in one closed form functional line, or that not knowing about “vector” function in emacs lisp conflict with anything i criticized in computer science, languages, software engineering, or the programer culture?

today, i put on my blog the nice function you and TheFlyingDutchMan supplied: xahlee.blogspot.com elisp-read-file-content-in-one-shot.

note there is the other, almost identical, function:

(defun read-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)))

which i wrote about 2 years ago, that appears in one or more of these pages:

waybackmachine can be used to verify it.

i asked the question because i was tired, and i feel it is good to ask. It spurs conversation, as well as helping me. And it is certainly true, that my emacs lisp know-how, is below yours, or most of the emacs developers who frequent emacs newsgroups.

even though i criticize a lot of things, but more so there's much more i don't know. Though, i try to keep the degree of my criticism proportional the level of a thing that i do know. (albeit with wild hyperbole at times :D )

So unless you stop writting inflamatory articles (you could even retract all the past ones) and start to spend serious time _learning_ programming, you're totally disqualified to say anything about programming languages.

I would advise you to study "How to Design Programs" http://www.htdp.org/

O, good old newsgroup style. In return, I recommend you to read xahlee.org.

Celebrity Styles

On 2010-09-03, Marc Mientki 〔mien...@nonet.com〕 wrote:

How can I understand it???

By unstanding The Tao of Zen ☺

btw, Rich Hickey has a vid here: Are We There Yet? (2009-11-12) By Rich Hickey. Source www.infoq.com

it's over 1 hour long.

actually it's quite boring to watch. I watched the first 30 min but got bored.

nevertheless, it's a nice video, and i enjoyed it. And he's a nice guy. (it's funny that Whitehead seems to be his personal hero.)

PS ... i'm usually a observer type. So, when watching this video, i cant help but compare the different style, personalities, of various celebrities. i've watched a few in past years, some i blogged about, e.g.

writing this reminds me of a talk given by Linus about git that i watched on google vid... Linus has a flamboyant, charismatic style, but is also a easy going type of guy. (e.g. in our context, he'd probably ask any simple question that pops up in his mind) Compare to Neal Stephenson, which is quite up-tight and exceedingly boring to watch. Yaron Misky above, is quick and fast... and there's Richard Stallman, who's public lecture style can be said to be more methodological...

(btw, Linux's git talk totally sold me on git; but more significantly, by his talk it dawned on me that the greatness of distributed revision systems is not about being non-centralized, but the agility to move and grow and evolve locally with global impact.)

Being Humble and Tactfulness

On 2010-09-03 Pascal J Bourguignon wrote:

The problem is not that you didn't know insert-file-contents or similar functions.  This is indeed natural and it's on the ignorance of this that I judge your programming skills.

It's on your use of sequential assignments and copy-and-paste for a repetitive job.

you see, Pascal, i've been trying to be more tactful in recent months. You know? like not being a cold critical ass, and to engage people in a direct and more personal, friendly way.

are you sure, that your writing off of me, is justified?

because i humbly asked a question, now comes the baggage of incompetence to fend off?

because i posted a quick question, now i'm accused that my coding style is copy-and-paste and “sequential assignments for a repetitive job”?

loly.

although i try to be more tactful, but i reserve the right to remain Xah, at least in spirit, and hope not to become some smooth politician always with round-about non-specific all-pleasing expressions. y'know? the wisdom we hear about “just be yourself”, right? ☺

so now, instead of bouncing you off with pompous philosophy, rude logic, fully decorated with expletives, i take the more mild approach, of teaching you things that i see you don't know. (oh god! i fucked it up! i've just been demeaning, stepped on all the rules about friendship n leadership n persuasion principles in every book. Oh GOD, i'm such a fucking failure!)

So let me teach you: To be humble is to ... (i dunno. (be yourself?))

haha. Actually, never mind any of that. I'm just all bullshitting. ☺ One thing i learned is that, being too serious at all times isn't a good thing.

Computer Keyboard Gallery

Perm url with updates: http://xahlee.org/emacs/keyboards.html

Computer Keyboard Gallery

Xah Lee, 2006-06, 2010-09-03

I'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 Keyboard

I have a keyboard love. Every time i go to a computer shop, i would try my hands on all their input devices on display. In particular, computer keyboards. Loitering in the store for 30 min on keyboards is not unusual.

Before i started to use a split-keyboard in ~2005, i actually find that the best keyboard are the cheapest, generic PC keyboard. They are functional, clean design, sturdy, cheap ($10) and replaceable, good tactical feedback. They don't have weird shapes, weird tactile feel, a bunch of ugly buttons and knobs.

(I do, however, believe in extra application launch buttons, volume control knob, embedded pointing device, but many designs on the market are a turn off).

generic PC keyboard

A Generic PC Keyboard. left side closeup.

generic PC keyboard

This keyboard i used in the period 1999-2002. A ergonomic habit i have is to have 2 or 3 stacks of books placed together in front of the keyboard, so that they form a rectangular platform of 3 to 4 cm in height. When typing, i rest my forearms on the books, so that my wrists do not bent upwards. Here's a photo showing this keyboard in my office, and the books i have in front as wrist pads.

Note the Power management keys on the top right of the keyboard. These I actually never used.

Note the PrtScn (Print Screen) key, SysRq (System request) key, ScrLk (Scroll Lock), Break keys. These keys are historical relics and are more or less defunct today, except the Print Screen key that is often used for creating screenshots in Microsoft Windows.

Here's a summary of what these keys are, based on Wikipedia:

  • PrtScn: In 1990s or earlier, it sends the screen's text into a serial port. Literally, causing the screen to be printed. (at the time, most monitors can only display text.) Today, this key is used in Windows and Linux to do screenshot (copy screen bitmap into the clipboard). This key is not used on the Mac.
  • SysRq (System request): This key causes a interrupt to the operating system. It is kinda like the role of today's Control-Alt-Delete on Windows. However, this key is pretty much defunct today.
  • ScrLk (Scroll Lock): Pretty much a defunct key today. Used to toggle the behavior of arrow keys so that, when ScrLk is on, the up/down arrows scrolls the window.
  • The Pause and Break are 2 keys. They are pretty much defunct today. They were used for sending a interrupt signal of sorts, as today's more familiar 【Ctrl+c】 on PC and 【Cmd+.】 on Mac.

Microsoft Ergonomic Keyboards

Since 2005, i have adapted to the split-keyboards and find Microsoft keyboards the best.

I used to hate split keyboards. I bought a Microsoft Ergonomic Keyboard in 2005 because during that year i was using a laptop 8 hours a day, and my wrists and fingers are starting to feel weird. Once i adopted the split keyboard, i never went back to one-piece keyboards. If i type on a one-piece keyboard for even a minute, i feel discomfort in how it bends my wrists.

Microsoft Natural Multimedia keyboard

The Microsoft Natural Multimedia Keyboard, introduced in 2004. (Review)

Mirosoft's split keyboards is of a fantastic design. Besides splitting the key set and angle them for the wrists, other notable features is the modifier keys placed in symmetrical distance from the index finger keys, and in sizes about 4 times as large. This is fantastic if you are a programer and uses Emacs.

The top has a row of special buttons that provides one-button launching/switching to applications — extremely convenient. They can be reset to any application you choose thru the bundled software Microsoft IntelliType Pro. (Comes in a Mac version too. I use this keyboard on Macintosh computers) The middle is the music-playing program control, also extremely useful. I can just play/stop/skip songs without switching into the music player.

(Note: Even before i used a keyboard with such extra app-launching-keys, i've always have assigned the functions keys to launch applications. So, in my work day, i switch among applications by single key presses. (as opposed to using the mouse, or tabbing thru the app-switching mode))

A minor bad point of this MS keyboard is that the function keys are arranged in 2 continuous rows, instead of traditionally separated into 3 blocks of 4 keys each. The continuous placement makes it difficult to touch-type the function keys in the middle of the blocks.

Microsoft Natural Ergonomic Keyboard 4000

The Microsoft Natural Ergonomic Keyboard 4000, introduced in 2005. (review) amazon

Microsoft Comfort Curve keyboard 2000

Microsoft Comfort Curve keyboard 2000. (review) amazon

  • “Microsoft Wired Natural Keyboard Elite” amazon

The F-Lock Key Problem

Apple Keyboards

Apple iMac Keyboard A1242

Apple's keyboard as of 2008. Image Source

  • “Apple Wireless Keyboard” amazon
  • “Apple Aluminum Wired Keyboard MB110LL/A” amazon

Full review: Apple Keyboards.

Sun Microsystem's “Type 6” Keyboard

Sun Microsystem's Keyboard

Sun Microsystem's “Type 6” Keyboard.

Full review: Sun Microsystem's “Type 6” Keyboard.

Kinesis Contoured Keyboard

Kinesis Contoured keyboard

The Kinesis contoured keyboard. Source Kinesis keyboard

Full review: Kinesis Contoured Keyboard Review and RSI.

The Idiocy of Hacker Keyboards

happy hacking keyboard lite2

The Happy Hacking keyboard, model lite 2. image source Happy Hacking Keyboard

Full review of several weird keyboards: The Idiocy of Hacker Keyboards.

Misc

Here's a interesting site that gives a fairly comprehensive images of the keyboard hardware key layouts for about 20 manufactures. A Gallery of Layouts of Actual Computer Keyboards.

Sun Microsystem's “Type 6” Keyboard

Perm url with updates: http://xahlee.org/emacs/sun_microsystems_keyboard.html

Sun Microsystem's “Type 6” Keyboard

Xah Lee, 2006-06

Sun 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 Keyboard

Sun Microsystem's “Type 6” Keyboard.

Sun Microsystem's 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.

Sun Microsystem's Keyboard

Note the Compose key and Alt Graph keys. I've never used it. In writing this page, i learned that they are used to type special characters such as éäç¡£¥© etc. The key marked with a diamond (◆) is the Meta key, a key inherited from Lisp Machine's keyboards and today mostly known for its use in Emacs. This special modifier key is similar to the Command key (⌘) on Apple's computer's keyboards, or the Windows key on PC keyboards.

More photos: Mid section close-up, The Compose, Alt Graph keys, Top indicator LEDS, Number pads.

For some photos of lisp machine's keyboards, see: Why Emacs's Keyboard Shortcuts Are Painful.

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 <zzbba...@aol.com>”. 2010-09-02
(defun get-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.

(defun read-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.

2010-09-01

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)

(defun select-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: http://xahlee.org/comp/Chinese_input_with_Dvorak.html

Chinese Input with Dvorak Layout (Microsoft Pinyin IME)

Xah Lee, 2010-08-30

If 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.)

Chinese Dvorak Microsoft IME

Microsoft Registry showing the Chinese (simplified) input method.

Here's the folder name for some other languages.

LanguageFolder NameOriginal “Layout File” value
Chinese Simplified000000404KBDUS.DLL
Chinese Traditional000000404KBDUS.DLL
Japanese00000411KBDJPN.DLL
Korean00000412KBDKOR.DLL

Before you change, write down the original value, just in case you want to change it back.

Reference: 〈Not all keyboards are included in MSKLC's lists〉 (2005-04-16), by Michael S Kaplan. At: blogs.msdn.com/b/michkap. (Note that Michael is the one who created the〈The Microsoft Keyboard Layout Creator〉 at msdn.microsoft.com. )

Was this page useful? If so, please do donate $3, thank you donors!

google public dns server

Have problems with your dns server? use google's! Google has a public dns for this purpose. “8.8.8.8” and “8.8.4.4”. See: http://code.google.com/speed/public-dns/.