Emacs: How to Turn a Minor Mode on/off/toggle?

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

Emacs: How to Turn a Minor Mode on/off/toggle?

Xah Lee, 2010-03-20, 2010-07-11

This page is a short tutorial on how to turn a emacs mode on, off, or toggle.

You know, in emacs, “t” is true, and “nil” is false. So, for example, if you want to turn off a minor mode always, you might put this in your emacs init file:

;; turn off some modes?
(desktop-save-mode nil) ;  WRONG!
(cua-mode nil) ;  WRONG!


Why is it wrong?

Yes, “t” is true and “nil” is false, but for modes, the proper way is to use “1” to turn it on, and “0” to turn it off. Why? Because a mode function isn't designed to take a true or false value as argument. Because, for example, most minor mode need to also act like a toggle. For example, typing “Alt+x auto-fill-mode” will toggle it.

So, the design is that, for minor modes, a positive number is to turn it on, 0 or negative number is to turn it off. To toggle, no argument will do (no argument is equivalent to a argument of “nil”). When you need to be absolutely sure, look up the inline doc of the mode. For example, type “Ctrl+h auto-fill-mode”.

;; turn on
(desktop-save-mode 1) ; correct!

;; turn off
(auto-fill-mode 0) ; correct!

When you put “(auto-fill-mode)” in your emacs init file, usually it still works, because by default it is off, and “(auto-fill-mode)” toggles the state from off to on, so in the end it is still on. But some days or years later when you have added packages or code, things will go south and you'll scratch your head and wonder what's going on.

Now look in your emacs init file and fix them all!


For minor modes, a argument of t will always turn it on, even though this seems to contradict what the inline doc says. For example, here's a quote from auto-fill-mode:

(auto-fill-mode &optional ARG)

Toggle Auto Fill mode.
With ARG, turn Auto Fill mode on if and only if ARG is positive.

As of today (emacs 23.2.x), for most or all minor modes, no arg or a nil arg will toggle the mode.

According to Stefan Monnier (one of the current emacs maintainer) in a post in comp.emacs on 2010-06-16 (Source) , this behavior may change in future emacs because it is too confusing. “t” will always turn it on, “nil” turns it off always. For toggling, i'm guessing there'll be extra function with “toggle” in the name, e.g. toggle-read-only, toggle-case-fold-search, toggle-debug-on-error, toggle-text-mode-auto-fill, toggle-truncate-lines, ...

(thanks to YOO for correcting me about the actual behavior of “(auto-fill-mode t)”.)


CSS Text Flow Around Image

Perm url with updates: http://xahlee.org/js/css_flow_over_image.html

(css effect may not show in blogger. Visit the link above to see full effect.)

CSS Text Flow Around Image

Xah Lee, 2010-03-20

This page shows you how to use CSS so that text wraps around image.

lilies-s The Time Traveller (for so it will be convenient to speak of him) was expounding a recondite matter to us. His grey eyes shone and twinkled, and his usually pale face was flushed and animated. The fire burned brightly, and the soft radiance of the incandescent lights in the lilies of silver caught the bubbles that flashed and passed in our glasses. Our chairs, being his patents, embraced and caressed us rather than submitted to be sat upon, and there was that luxurious after-dinner atmosphere when thought runs gracefully free of the trammels of precision. And he put it to us in this way—marking the points with a lean forefinger—as we sat and lazily admired his earnestness over this new paradox (as we thought it) and his fecundity.

The above is the opening paragraph of Time Machine by H G Wells. You can see the text flowing around a image. This is done using css with “float”.


The html is like this:

<p><img class="floatMe" src="lilies.png" alt="lilies" width="167" height="106">
The Time Traveller...</p>

The css is even simpler, like this:

img.floatMe {float:left; margin:1ex}

The “float” can have a value of “left” or “right”, meaning that it aligns to the left of the bounding box or to the right. If any ancestor tag doesn't have any width set, then the bounding box is the window.

When a tag is floating, anything will go around it to avoid collision or overlap. (except tags that have their own layer with “position”. See: CSS Layout and Layers)

You can have multiple tags that are all floating. If they all have “float:right”, then they'll behave as a sequence of “<img ...>” tags, flowing from left to right. For a example, see: Flowing List Items.

Stop Flowing

If you have many floating items, the position of the last item will be the positon the next non-floating item begin. For example, you might have:

FBox FBox FBox FBox FBox <h2>

where each FBox is a tag with “float:left”. The “<h2>” will be shown at the position right after the the last floaw. You don't want that. In that situation, you need to give a “clear:left” in the tag that comes after the float. Like this:

<h2 style="clear:both">A New Beginning</h2>

The “clear” can have values of “left”, “right”, “both”.

Usually, it is best to use this tag to clear the floats:

<hr style="display:none; clear:both">

CSS Example of Text over Image

Perm url with updates: http://xahlee.org/js/ex_css_text_over_img.html

(css effect may not show in blogger. Visit the link above to see full effect.)

CSS Example of Text over Image

Xah Lee, 2005, 2010-03-20

This page shows a example of using CSS to lay text over image.

The following is a example of the desired effect:

Cheshire cat

The Cat only grinned when it saw Alice. It looked good- natured, she thought: still it had very long claws and a great many teeth, so she felt that it ought to be treated with respect.

‘Cheshire Puss,’ she began, rather timidly, as she did not at all know whether it would like the name: however, it only grinned a little wider. ‘Come, it's pleased so far,’ thought Alice, and she went on. ‘Would you tell me, please, which way I ought to go from here?’

Try to drag the image. You can see that it is a image with a blank corner. Now, try to drag over the text to select it. You can see that it is text, not part of the image. The text is actually laid on top of the image.

The image can be thought of as a outer box with a specific size (width and height). The text can be thought of as a inner box with a specific size. The image or text can be any tag. For example, the text can be a login box.

How It Is Done

Here's a explanation on how to over-lay a text inside a image.

In summary, you want to set your outer box with “position:relative”, but no position offset, and also set a width and height. Then, for the box you want to lay over it, specify “position:absolute”, with offset values for the precise position relative to the outer box, and also specify a width and height.

Here's the source code detail how this works. Start with a outer and inner boxes tag like this:

<div class="outerBox">
<img src="myImage.png" alt="my image" width="432" height="626">
<div class="innerBox">your text here...</div>

Here's the outer box's css. Note the width and height is the image's dimension.

div.outerBox {position:relative; width:432px; height:626px;}

Here's the css for the inner box, which is laid on top of the outer box.

div.innerBox {
top:260px; left:190px;
width:242px; height:366px;

Note the “top:260px; left:190px;” line. It means 260 pixels offset from the top of the outer box. Similar for “left”.


Facebook's Ethics

Perm url with updates: http://xahlee.org/js/facebook_ethics.html

Facebook's Ethics

Xah Lee, 2010-03-18

You know? Facebook.com today is the 2nd largest trafficked site as estimated by alexa.com, after google.com.

Just spent about 2 hours reading about Facebook.

Looks like the technology is quite good, however, its stance on ethics, is quiet shady, tracing back all the way to its origin at Harvard. I fully support capitalism and the free growth of ideas, but judging from facebook's track record on issues as discussed on wikipedia, its ethics is quite questionable. Here's a summary, followed by quotes from Wikipedia.

  • Facebook started as some Who's Hotter by student males. That is, 2 photos are shown, and you can click on who's hotter. Originally, one of the photo was suppose to be a animal. (thats how it became popular)
  • The guy broke into university photo database to steal the photos.
  • Facebook stole mate's ideas, betrayed trust, with tactics such as registering domain name first and trademark the name facebook, but done in a dishonerable secretive way.
  • Facebook got repeated complaints about their advertisement tactics, policy, user agreement terms change, abuse of user's data.
  • facebook once or still is, that when you delete your account or took off some data you uploaded, the facebook does not actually delete them.

Quotes from Wikipedia:

Facebook is a social networking website that is operated and privately owned by Facebook, Inc.[1] Since September 2006, anyone over the age of 13 with a valid e-mail address (and not residing in one of the countries where it is banned) can become a Facebook user...

Mark Zuckerberg founded Facebook with his college roommates and fellow computer science students Eduardo Saverin, Dustin Moskovitz and Chris Hughes while he was a student at Harvard University.[citation needed][5] The website's membership was initially limited by the founders to Harvard students, but was expanded to other colleges in the Boston area, the Ivy League, and Stanford University. It later expanded further to include (potentially) any university student, then high school students, and, finally, to anyone aged 13 and over. The website currently has more than 400 million active users worldwide.[6]

Facebook has met with some controversy. It has been blocked intermittently in several countries including Syria,[7] China,[8] Vietnam,[9] and Iran.[10] It has also been banned at many places of work to discourage employees from wasting time using the service.[11]

Privacy has also been an issue, and it has been compromised several times. Facebook settled a lawsuit regarding claims over source code and intellectual property.[12] The site has also been involved in controversy over the sale of fans and friends.[13]


According to The Harvard Crimson, Facemash "used photos compiled from the online facebooks of nine Houses, placing two next to each other at a time and asking users to choose the 'hotter' person". To accomplish this, Zuckerberg hacked into the protected areas of Harvard's computer network and copied the houses' private dormitory ID images.


Just six days after the site launched, three Harvard seniors, Cameron Winklevoss, Tyler Winklevoss, and Divya Narendra, accused Zuckerberg of intentionally misleading them into believing he would help them build a social network called HarvardConnection.com, while he was instead using their ideas to build a competing product.[30]

The three complained to the Harvard Crimson and the newspaper began an investigation. Zuckerberg used his site, TheFacebook.com, to look up members of the site who identified themselves as members of the Crimson. Then he examined a log of failed logins to see if any of the Crimson members had ever entered an incorrect password into TheFacebook.com. If the cases in which they had entered failed logins, Mark tried to use them to access the Crimson members' Harvard email accounts. He successfully accessed two of them.[30] The three later filed a lawsuit against Zuckerberg, later settling.[31]

Also, there's a entire article of 10.5 k words of facebook criticisms, with contents largely different from the above. Here's the article: Criticism of Facebook. Complaints, lawsuits, from governments, user groups of tens of thousands, corporations, computer scientists.

The guy who started facebook seem to be a aggressive scumbag. Perhaps he thinks of himself something alone the lines of “can't make an omelet without breaking some eggs”.

importing old articles here

Dear my blog readers,

in the coming weeks, i may import a lot pages from my website xahlee.org, so that readers can comment on articles from my website, also as a way for blog searchers to find my articles. This means, you will probably get a lot articles in your feed reader, some of which may not be related to programing. (but most will be interesting ☺, i hope! )

Sorry about this inconvenience. If you prefer more focused articles on programing subjects, you can subscribe just that blog topic from xahlee.org .

The most popular is emacs: http://xahlee.org/emacs/blog.html

its feed is here: http://feeds.feedburner.com/XahsEmacsBlog

Other blog topics, on web dev, programing, math, all have separate blog pages, all linked from the emacs blog above.

Thanks a lot. O, please do leave a comment to say hi. :D


White Rabbit by Jefferson Airplane

Perm url with updates: http://xahlee.org/Periodic_dosage_dir/sanga_pemci/white_rabbit.html

White Rabbit

Xah Lee, 2008-07

Dearly beloved logicians, amateur and pro among us,

We've been slaving in newsgroup all day and night over dry academic subjects. I thought we could now have some amusement on logic at this moment!

Yesterday i discovered a song (while slaving (literally) in Second Life) from the 1960s that is based on the book Alice In Wonderland. The song is called White Rabbit by Jefferson Airplane.

I SO love it.

Of all books i've red in my life, may it be formal logic treatise, may it be non-fiction as encyclopedia Britannica, may it be technical manuals such as GNU Emacs Lisp Reference Manual, may it be fictitious such as The Tragedy Of Titus Andronicus, may it be artistic of Emily Dickinson's poem compendium, may it be comics Batman, may it be porn like the Story Of O or Penthouse Mag, may it be, may it be, but that if i'm pressed to pick one book as my all-time favorite, that would be Alice In Wonderand and Thru The Looking-Glass.

[began unconsciously starting to write on (possible few thousands words) my reasons ... but STOP!]

Ok, i don't mean to ramble, but what i wanted to say in this post, was that i sooo love the song. And, i spent about 1 hour to write some commentaries on the lyrics. Without further ado, here it is.

White Rabbit (song) (1967) by sung and wrote by Grace Slick (b1939).

「• pill = Actually, pill doesn't appear in Wonderland. It was a drink and a cake, fan, and later mushroom, that makes Alice grow larger or smaller. Alice's Adventures in Wonderland (Chapter 1)
One pill makes you larger
And one pill makes you small
And the ones that mother gives you
Don't do anything at all
Go ask Alice
When she's ten feet tall
「• rabbits = Alice chased a White Rabbit and fell into a hole, where her dream-like adventure began. Alice's Adventures in Wonderland (Chapter 1)
「• caterpillar = The caterpillar is somewhat a mysterious sage-like character, who smokes a hookah. He appeared in Chapter 4. Note that caterpillar never gave Alice a call. 」
And if you go chasing rabbits
And you know you're going to fall
Tell 'em a hookah smoking caterpillar
Has given you the call
Recall Alice
When she was just small
「• chessboard = Chess is not mentioned in the first book, but in the sequal: Through The Looking Glass, every character is a chess piece (except Alice). 」
「• mushroom = first appears at the end of chapter 4, then 5. Caterpillar told Alice that the mushroom: “One side will make you grow taller, and the other side will make you grow shorter.”. In later chapters 6 and 7, Alice kept the pieces in her pocket so she can nibble and grow/shrink at will. In this lyrics, the mushroom alludes to Psilocybin mushrooms, popularized by Timothy Leary. 」
When men on the chessboard
Get up and tell you where to go
And you've just had some kind of mushroom
And your mind is moving slow
Go ask Alice
I think she'll know
「• logic = Logic is a central theme in the 2 Wonderland books. Its author Lewis Carroll is a logician. For example, here's a quote from Chapter 4 where the word “logic” in mentioned explicitly : «“Contrariwise,” continued Tweedledee, “if it was so, it might be; and if it were so, it would be; but as it isn't, it ain't. That's logic.”» 」
「• White Knight = The Red Knight and White Knight are main charaters in the Looking-glass. The Knights are most prominently featured in Through The Looking Glass (Chapter 8). 」
「• backwards = Backwards, as in reversal, inversion, mirroring, is a central theme in Looking-glass. It is implicitly applied to time, shape, speech. For example, in Chapter 5, excerpt: «“That's the effect of living backwards,” the Queen said kindly: “it always makes one a little giddy at first—”» 」
「• off with her head! = The Queen is a central character in Wonderland. She is Queen of Hearts of playing card (thus “Red” Queen). The Queen is found of execution by shouting “Off with his/her/their head”, first spoke in Chapter 7, and said it the most in Chapter 8. In Looking-glass, there's the White Queen and Red Queen (of Chess). However, the phrase “off with ... head” or execution didn't appear in Looking-glass. In Looking-glass, Alice start as a pawn, and in the end became a Queen herself too. 」
「• dormouse = Dormouse is a main character in Chapter 7, and also appeared in Chapter 11. The Dormouse is most of the time asleep or dormant and in that state got abused by the March Hare and Mad Hatter. The dormouse never said “feed your head” or anything like it. However, “feeding” and “head” are recurrent themes. 」
When logic and proportion
Have fallen sloppy dead
And the White Knight is talking backwards
And the Red Queen's “off with her head!”
Remember what the dormouse said:

What a greatest song!

alice02a alice15a alice alice

See also: Wonderland Alice Art Gallery.


Solid-State Drive Comes Of Age!

Perm url with updates: http://xahlee.org/comp/solid_state_drives.html

Solid-State Drive Comes Of Age!

Xah Lee, 2010-03-17

Solid-state drive has come of age!

When i started using a computer, in 1990, the standard hard drive capacity is 20 mega bytes. Its physical size is larger than a big hand, weights like a small brick. It costs some 5 hundred dollars.

Today, a cheap $40 usb stick has 32 giga byte capacity. Its size is about 1 finger, and weights like 2 pencils.

The capacity is 800 times larger, price is some 10 times cheaper, physical size is perhaps 30 times smaller, weight is perhaps 50 times smaller. Access time and thru-put, is some 50 or more times faster.

Solid-state drive has come of age! So, looking in the near future, hard drive is about to go extinct. Many small laptops already don't use hard drives. They have solid-state drives, i.e. a storage device that does not have mechanical moving parts. So, when would majority of consumer laptops use solid state drives? I'd say in 4 years. Also, optical disks, such as DVD, and recently Blu-ray Disc, doesn't seem to have a bright long-term future. They just seem too unwieldy and slow.

  • “Kingston-DataTraveler-Flash-Drive-32GB” amazon
  • “SanDisk Cruzer Micro 16 GB USB 2.0 Flash Drive” amazon

Advantages Over Hard Disk

Solid-state drives (SSDs) has quite a lot significant advantages over hard disk drives (HDDs). Here's a summary from Wikipedia:

  • Faster start-up because no spin-up is required.
  • Faster random access, because there's no read-write head, as in turntable
  • No more file fragmentation problem.
  • Silent operation due to the lack of moving parts.
  • Low power consumption and little heat.
  • High mechanical reliability, because no moving parts.
  • Ability to endure extreme shock, high altitude, vibration and extremes of temperature.
  • Lower weight and size.
  • Flash SSDs have twice the data density of HDDs.
  • Failures occur less frequently while writing/erasing data.

Wikipedia also gave a list of disadvantages, but they are not about the inherent merits of the technology, but rather current state of affairs. e.g. obviously, hard drives are still popular and economical, especially for large capacity needs. I'd say, in 4 years, majority of laptops will be using SSD, and perhaps in 10 years, data centers will be using SSD for their multi exa bytes of storage needs. (kilo, mega, giga, tera, peta, exa)

SRAM, DRAM, Flash Memory

The Wikipedia article on SSD mentions SRAM, DRAM, Flash Memory. So, what are they? Here's a simple explanation.

Memory vs Disk

Broadly speaking, “Memory” and “Disk/Drive” are all data storage devices. Those that are fast, are typically called Memory, and typically has smaller capacity. Those that are slow, usually with large capacity, are called Disks or Drives.

Volatile vs Non-volatile

Storage tech can be volatile or non-volatile. Volatile are those needs electricity to maintain their state. (i.e. they need batteries) Otherwise, it's non-volatile. Paper, records, CD, DVD, hard disks, are non-volatile. Non-volatile tech usually can have large capacity.

Flash Memory ⇒ Non-volatile

Solid state storage devices, can use volatile or non-volatile techs. The most common non-volatile tech, is called Flash memory. It is used in USB disks.

SRAM and DRAM ⇒ Volatile

Now, there are 2 types of commonly used volatile memory. Static random access memory (SRAM) and Dynamic random access memory (DRAM). Both are volatile. The difference is that DRAM requires constant electric recharge, or refresh, for its memory to stay. Both SRAM and DRAM, need batteries, but DRAM need constant refresh. A bit technical here.

Now, a Solid-state Drive can use non-volatile tech e.g. Flash Memory, or it can use volatile tech e.g. SRAM or DRAM. But basically, when the capacity needs to be large, it is non-volatile, e.g. Flash Memory.

Problem With Hard Drives

For a efficiency and elegance nerd, hard drive can't really be liked.

You have seen a phonograph, right? You know, a (plastic) disk that spins, with a head/needle that reads the data. The heart of the hard drive tech is like that. The spinning disk(s) is called platter, and the needle is called the read/write head. Ultimately, such device can't scale (grow).

To make it faster, ultimately it needs to spin faster, but spin rate has physics limitations. To make the capacity larger, you have to either increase the physical size of the disk, or increase the density (like shrinking the grooves on a record). Both reaches physics limitations quickly. Another way to make it faster is to have multiple disks and multiple heads. Having multiple disks is mechanical complexity, with physics restraints, grows in physical dimension fast. Making it to use multiple heads per disk layer has many engineering problems, best described as “head collision”. Optical drives, such as CD, DVD, are all like this. They can't grow.

Today, SSD is in your cellphone, iPods.

Tech Advances

Jukeboxes vs iPod

speaking of iPod... that reminds me of jukeboxes, and the incredible technological advance i lived thru, in the past 20 years.

Remember Jukebox? In the 1990, when you want to play a whole collection of music, you use jukebox. It is sized like a refrigerator. Costs thousands of dollars. Today, you have iPod. Sized smaller than your hand, with capacity that's a thousand times more, not to mention music fidelity.

Tech Solving The World's Problems?

Speaking of tech advances, i can feel many tech geekers feeling that the world's problems is all gonna be solved. LOL.

Remember, that as tech grows, the human population also is growing behind our back, and arguably has past some sustainable size for long. You know, all the talk about climate change, green energy, often in a urgent way. Yeah, tech advances has been great, but overall, in terms of solving the human animal problem, of natural resources, food, energy, it isn't exactly peaches and creams. (See: Population Under The Firmament)

Also, tech today can actually provide food for everyone, but that's not happening, and ain't like gonna be happening. You know, wars, massacres, famines, happens in parts of the world every day, all over. And, you seen homeless on the city street asking you for a quarter, right? That is the human problem, a problem of human nature. This human nature, human animal problem, may not go away in a million years.

MS Paint Drawing Video Record

Perm url with updates: http://xahlee.org/arts/ms_paint_drawing.html

MS Paint Drawing (video record)

Xah Lee, 2010-03-17

Someone drew a firearm with a primitive drawing program, Microsoft Paint.

Bushmaster ACR in MS:Paint. Drawn by FuggedabouditNL. According to his reply on comments, he's “A gun fan who can draw.”. The drawing is made by mouse (not pen tablet).

To a non-artist, this is quite amazing. Though, the subject of drawing is a machine, so there's not much artistry involved.

Though, in my mixing-in with illustrators in LiveJournal during 2006-2007, i found this person, who drew with MS Paint exclusively. See: Art of Jacquelyn Jilek. The style of her work is extremely idiosyncratic. Excruciatingly beautiful.

Cross-posting & Language Factions

Perm url with updates: http://xahlee.org/Netiquette_dir/cross-post.html

Cross-posting & Language Factions

Xah Lee, 2007-03-29

(The following article is originally cross-posted on 2007-04-16 to the folowing newsgroups: comp.lang.perl.misc, comp.lang.python, comp.lang.lisp, comp.lang.java.programmer, comp.lang.functional.)

Dear tech geekers,

In the past year i have crossed-posted (e.g. recently What are OOP's Jargons and Complexities, Is laziness a programer's virtue?, On Java's Interface (the meaning of interface in computer programing), there are some controversy, and lots of off-topic and careless following.

I think there are few things today's tech geekers should remind themselves:

• If you deem something off-topic to “your” newsgroup, and want to tech-geek by changing the “follow-up group”, start with yourself. Please do not cross-post yourself, and tweak the follow-up, and proudly proclaim that you changed the follow-up as a benign gesture.

• Please remind yourself what is on-topic and off-topic. Unless you are the authority of a online forum, otherwise, netiquette discussion, policing, are off-topic in general, and only tend to worsen the forum's quality. This issue is realized in newsgroup communities as early as early 1990s. (See: Netiquette Guidelines, 1995, by S Hambridge. (RFC 1855))

• The facility of cross-posting is a good thing as a progress of communication technology, and the action of cross-posting is a good thing with respect to communication. What the common tech-geekers's sensitivity to cross-posting are due to this collective's lack of understanding of social aspects of communication. Cross-posting isn't a problem. The problem is the power-struggling male nature and defensiveness in propagating the tongues of a tech geeker's own.

Tech-geeker's behavior towards cross-posting over the years did nothing to enhance the content quality of newsgroups, but engendered among computing language factions incommunicado, and aided in the proliferation of unnecessary re-invention (e.g. the likes of Perl, PHP, Python, Ruby that are essentially the same) and stagnation (e.g. the lisp camp with their above-it attitude).

If you are a programer of X and is learning Y or wondering about Y, please do cross-post it. If your article is relevant to X, Y, and Z, please cross post it. If you are really anti-cross-posting, please use a online forum that is more specialized with controlled communication, such as mailing lists, developer's blogs, and website-based forums.

I hope that the computing newsgroups will revive to its ancient nature of verdant cross communication of quality content, as opposed to today's rampant messages focused on political in-fighting, mutual sneering, closed-mindedness, and careless postings.

The Need for Cross Communication


On Mar 10, 9:17 am, Ben Morrow <b...@morrow.me.uk> wrote:

Also, flamebait language-comparison xposts involving Lisp are one of Xah Lee's trademarks. You might want to look into not imitating him/her/it.

Being a professional programer today, typically you know more than just one language. Practical questions, discussions, involving more than one language is natural, and in fact happens more and more often in online forums over the past 15 years i've seen. Partly due to, of course, the tremendous birth of languages in the past decade. (See: Proliferation of Computing Languages)

In the 1980s or 1990s, you don't typically use more than one lang in a project. Today, majority of projects require you to use more than one well known general purpose language. In old times, discussion of more than one language is usually academic comparison. Today, honest posts such as “i know this in X but how you do in Y” is a common need.

The reason they become flame wars is mostly not about the message content. More about tech geeker's sensitivity, with the carried over old school netiquette that any person mentioning lang x in group y must be of no good intentions.

If you look at online forums today, in fact most comp lang forums have no problem in mentioning or discussing different languages in context. The problem occur more frequently in free-for-all type of forums where the know-it-all tech geekers reside (the in-group argot is “hacker”). Each thinking they are kings and knights, take opportunities to ridicule, flame, any post that mentions other lang or any thing that doesn't seem to be protective of their lang. This is comp.lang.* newsgroups, with good as well as mostly bad aspects. Of course, the free-for-all nature is precisely the reason most tech geekers stay in newsgroups. A good percentage of them are old timers.

Most newsgroup tech geekers consider cross-posting wrong. I consider such taboo in this convention being a major contribution to the redundant creation of new languages, flaws, and foster the hostile faction nature of programing language groups we see.

It is sad to say, comp.lang.lisp today is 90% machine generated spam. You see that each time this is brought up in the past 3 years, the regulars are too busy boasting about how they've set up some tech geek system so that spam don't reach their eyes, and sternly sputter about web browser using idiots, with, profuse suggestions from their infinite knowledge about what newsgroup reading software people should be using.

To the python community officers, i think perhaps it is fruitful now to think about de-coupling the newsgroup from the mailing list... am not very involved in the comp.lang.python or python community in recent years, but my thought is that, i got the feeling that most practical posts happen in the mailing list and the newsgroup ones tend to be more rowdy. So perhaps de-couple them is good, because python is main stream now and its mailing list is sustainable large, is good for more practical, concrete questions and answers, and philosophical free thoughts still have a place to go, in newsgroups.

Website And Domain Lookup Tools

Perm url with updates: http://xahlee.org/js/website_domain_lookup_tools.html

Website And Domain Lookup Tools

Xah Lee, 2010-03-17

A few misc tips and tools about domain names and websites.

Domain and IP Tools

whois is a tool to find out tech info about domain names. On a unix command line, you can just type for example “whois example.com”. For good web based ones, see:

Website Info

For web site popularity, demograph, trustworthiness, the best few are:

Wikipedia articleSite Home PageAlex RankPurpose
Alexa.comalexa.comRanking etc.
WOT: Web of Trustmywot.com4784site safety
Symantecnorton.com2573site safety

Connection Speed

A popular site for testing your connection speed is:



Writing Outline with Emacs (org mode tutorial)

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

Writing Outline with Emacs (org mode tutorial)

Xah Lee, 2010-03-15, 2010-07-30

This page is a tutorial, showing you how to use emacs to write document or notes with tree structure.

Sometimes you need to write some notes with a tree-structure. For example, headings, subsections, and content text. This is called outline format in word processors. You want to be able to view just the top level headings, or up to 3rd level headings, or view all content of a particular section, or hide a section.

In emacs 22 and 23, there's a mode called outline-mode and org-mode. org-mode is a major improvement of outline-mode, and provide much more features. Both uses the same plain text format.

This page shows you the basics of org-mode.

Star * for Heading

In your file, any line that starts with a star “*” is considered level 1 heading. Any line starting with 2 stars “**” is level 2 heading. And so on. Here's a example file:

* to do
Remember to bring lunch box and 2 bananas.
** call mom
don't forget to call mom
** do that
* call Jane.
her cell is 123-4567

* finish coding absca.
john was not happy.
** give that tutorial to john.
** Dave wanted do lunch. He got some ideas.
* learn emacs outline stuff

texts can actually be free form.

Copy the above text in a file and save it. (emacs_outline_sample_file.txt) Now, open the file, type “Alt+x org-mode”. Then, emacs will show it like this:

emacs outline mode screenshot

Show/Hide Levels and Sections

  • Type “Tab” to show/hide the heading the cursor is on. Type it again to cycle show/hide its subsections.
  • Type “Shift+Tab” to cycle the level of headings to show/hide for the whole file.

Heading Creation and Editing

The following are good for initial creation.

  • Alt+Enter” to creat a new heading at the cursor position. (it types the stars for you)
  • Alt+” and “Alt+” moves a heading up or down one level. (cursor must be on the heading)

Tree Branch Manipulation

Once you have written a lots text in a outline tree structure, you usually want to add or edit your notes in a way not to destroy the existing tree structure. The following commands are good for it.

  • Ctrl+Enter”. Insert a new heading. (at the end of the current branch.)
  • Alt+Shift+” and “Alt+Shift+”. Move branch up/down but keep in same level.
  • Alt+Shift+” and “Alt+Shift+”. Move branch up/down a level.

Open Files In Org Mode Automatically

If you name your file ending in “.org”, emacs will open it in org mode automatically.

You can also put this line as the first line of the file:

-*- mode: org -*-

Emacs will open the file with org mode automatically.

If you want all your “.txt” files open in org mode, you can add this line to your emacs init file:

(add-to-list 'auto-mode-alist '("\\.txt\\'" . org-mode))

Learn More

When in org mode, there's a menu “Org”. Try it.

Type “Ctrl+h m” while in org mode, then you can get a summary of all its keyboard shortcuts.

Org mode has a info doc manual too. Type “Ctrl+h i” to bring up info. Then, go down and click “Org Mode”.

Org mode also has a big website with tutorials, FAQ, and lots other tips and discussion forum, wiki, also a Google Techtalk video where the author Carsten Dominik speaks about it. Its home page is at: http://orgmode.org/.

(info "(org) Top")

Styling <table> tag with CSS

Perm url with updates: http://xahlee.org/js/css_table_style.html

(css effect may not show in blogger. Visit the link above to see full effect.)

Styling <table> tag with CSS

Xah Lee, 2010-03-15

This page shows you how to style the html “<table>” tag with CSS.

Styling a html table with css is pretty easy. Here's a example of a table:


Here's the source code:

<table class="xyz">

In the above table, we give it a class name “xyz”, so we can use CSS to pretty up all tables of this class.

Here's the CSS:

table.xyz {border:solid 1px black; border-collapse:collapse; margin:.5ex}
table.xyz th, table.xyz td {border:solid 1px gray; padding:.5ex}

The “border:solid 1px black” means give the border a solid line style, with 1 pixel width, and black color.

The “border-collapse:collapse” means draw a single line between neighbor cells. The alternative is “border-collapse:separate”. Here's how it would look:


The “1ex” is a CSS unit, “ex” means the height of the letter “x”.

Margin vs Padding

The “margin” and “padding” both gives the area a little room.

css padding vs margin

Padder is the inner area, margin is the outer area, border is between them.

CSS Styling vs Old HTML Table Tags

Here's a comparison showing old html table's formatting attributes and the CSS equivalent.

Old HTML AttributesCSS

Hacker News, Xahlee.org, and What is Politics?

Perm url with updates: http://xahlee.org/Netiquette_dir/hackernews_xahleeorg_politics.html

Hacker News, Xahlee.org, and What is Politics?

Xah Lee, 2010-03-14

Today, i noticed that one of my article Why Emacs is still so useful today on my blogger site (xahlee.blogspot.com), is linked as a news entry from Hacker News site here: Source.

Note that my site XahLee.org was unceremoniously banned around 2009-02 by the admin geekers there. (see bottom of: Ban Xah Lee). But, apparantly, someone found my article useful. Now, in order to submit my articles, you'll have to use my article mirror at xahlee.blogspot.com instead of xahlee.org.

Tech Geeker's Ignorance Of Politics

The human nature of power struggle never ends. Many of these tech geekers think they are apolitical, that they are peace loving, they ride bikes not driving machines that pollute, they don't have interest in business, they embrace the Free of “freedom” Software or Open Source of “openness” software. The problem of human animals is that, we all think that, yet, power struggle or the formation of politics isn't something you consciously decide to do. Rather, it is something that you unconsciously do whenever you have interaction with peers when resources are not infinite. At the basic level, you have quarrels with ya brothers about toys, in high school about seats, girls. Going up a bit, you have all these teens, gamers, tech geekers, shouting, kicking, banning, in all sort of internet forums, irc chat rooms, mailing lists, in-world gaming channels. Going up, you have managers fighting in corporations, politicians pissing at each other, leaders warring among nation states. Note the word PEER here, because, you are out of the game with those who are much more powerful than you, and similarly, you can't be bothered by those far beneath you.

Of course, the tech geekers all think they are fair, just, maintaining peace. But you can almost see the smug on their faces whenever any of these “admins”, “group owners”, “sysops”, “operators”, exercise their power. It is a basic human pleasure to force onto uncooperative others. (See: What Desires Are Politically Important?)

Serious fairness and open policies never actually come up unless the community becomes large, larger than the original special interest clique. Before the group becomes large, typically their political structure is academically called oligarchy. i.e. basically whoever started the group, his cronies, rule.

We all understand conscious power struggle. However, it is when we think that we are not doing politics when exercising our power, is when it is likely most damaging, with respect to human progress. (the subject of human progress, its ideal direction, goal, is itself is quite not agreed upon among historical figures (big philosophers, politicians, leaders, etc.).)

Part of the problem is ignorance. Most tech geekers, those coders, engineers, type of folks, typically don't have much education or interest in social sciences. Few years ago on irc channel, i was ranting on the subject of politics, due to some difference of opinion on tech stuff, and learned, rather not surprisingly, that one of the guy don't understand that politics essentially means power struggle. Most tech geekers think that Politics is what politicians do, that it is something about rulers, about bad ass evil lords, ambitious guys, Napolean, or about controversial subjects, back stabbing, cloak and dagger, and isn't about, say, admins or policies in some online forum.

What Is Politics?

Here's some Wikipedia quotes from Politics:

Politics is a process by which groups of people make collective decisions. The term is generally applied to behavior within civil governments, but politics has been observed in other group interactions, including corporate, academic, and religious institutions. It consists of "social relations involving authority or power"[1] and refers to the regulation of a political unit,[2] and to the methods and tactics used to formulate and apply policy.[3]


Political science, the study of politics, examines the acquisition and application of power and "power corrupts".

It quotes this juicy quote:

“Politics: A strife of interests masquerading as a contest of principles. The conduct of public affairs for private advantage.” — Ambrose Bierce[15]

I much prefer older edits of Wikipedia's opening paragraph. Here's few excerpts

Politics consists of "social relations involving authority or power"[1] and refers to the regulation of a political unit,[2] and to the methods and tactics used to formulate and apply policy.[3]


In a broader sense, any situation involving power, or any maneouvring in order to enhance one's power or status within a group, may be described as politics (e.g. office politics).[3] This form of politics "is most associated with a struggle for ascendancy among groups having different priorities and power relations."[4]

And here's a point-blank shot:

Politics is who gets what, when, and how. — Harold Lasswell


Perl One-Liner Screw

Perm url with updates: http://xahlee.org/comp/perl_one-liner_screw.html

Perl One-Liner Screw

Xah Lee, 2000-11-06

From: Xah Lee <xah@xahlee.org>
Newsgroups: comp.lang.lisp
Subject: Re: Q: on hashes and counting
Date: Mon, 06 Nov 2000 02:28:07 -0800
Message-ID: <B62BC7B7.3CBD%xah@xahlee.org>

The Glauber <theglauber@my-deja.com> wrote:

P.S.: the Perl version is a "one liner":

$c{substr($_,0,5)}++; END { foreach $x (sort keys %c) {print "$x,$c{$x}\n"}}  

Screw you with your screwing "one-liner".

Erik Naggum <erik@naggum.net> wrote:

Perl looks the way it does because 110-baud Teletypes were once upon the time the best people had on Unix, and with lousy typers who had to correct their mistakes all the time, it made sense to abbreviate everything down to one or two characters. Lisp has a different heritage, to put it mildly: Better typers, better use of brainpower than to remember thousands of subtly similar abbreviations, better terminals. So we aren't as interested in one-liners with compact syntax, but for people who still live their lives as if all they can hope for is a 300-baud Teletype, the value of one-liners cannot be underestimated.

Oh gee, Erik, thanks: Screw you with your knee-jerking lame-o defense.

I have a screwing problem with screwing Perl folks with their screwing fatuous infatuation about "one-liners".

Mr Glauber, can you explain to me what does "one-liners" mean?

Does it mean a program with no line-breaking character? Obviously not, because otherwise lots programs can instantaneously become one-liners. Does it mean a program with one syntactic block? Not, obviously because slapping on a block structure coat doesn't cut it. Does it mean the program is within 80 characters? No, because that would be stupid, wouldn't it?

So it really cannot be defined syntactically, but with some conceptual involvement. Perhaps a smattering of all of the above, plus that the data flows through the program in some kind of one fell swoop idiom.

I'll tell you what: all programs in pure functional languages are all just one big single line by principle, and much in practice. (lisp is one example.)

your screwing one-liner hack done right should be:


or in FullForm:


The above example is from Mathematica. This cannot be done in Perl because it lacks gazillion build-in _functions_. But if one forces, you get:

use strict; #oh my god, superb correct obfuscation but using strict too!
map {print "$_->[0], $_->[1]\n";} sort {$a->[1] cmp $b->[1]}
@{ &{sub {my @result; for( my $i=0; $i < scalar @{$_[0]->[0]}; $i++)
{push @result, [$_[0]->[0]->[$i],$_[0]->[1]->[$i]]} return \@result}} (
&{sub {return [[1.. (scalar @_)], [@_]]}} (map {substr($_,0,5)} <>)) };

That's how stupid (and inefficient) Perl really is if you want to do things correctly. (Note: in order to do a transposition on a 2D array, i couldn't avoid the variables @result & the for loop with $i.)

And by the way: idiomatic programing is the most screwing moronic idea too, and not so incidentally, very much exhorted by Perl-brain-washed retards.

I will have any perlers cut their own tongue, when they blurt out their screwing ass ignorance with Perl.

 "The three principle virtues of Perl programers: mundaneness, sloppiness,
and fatuousness"

Original message: Source

web based instant message systems

Discovered Mibbit. A web based application for IRC, Yahoo Messenger, Twitter. Written in JavaScript. I'll be trying it out in coming weeks.

I haven't kept up with web tech for implementing instant messages, which is quite important and became popular in the past 3 or so years, especially by Google Talk. I looked into it about 4 years ago when a client needs chat functionality on a web site, but at the time i looked, there are like 3 or so Open Source ones i found in the few hours i looked. Most are implemented with PHP, and they are all pretty lousy.

Logitech G13 Advanced Gameboard (Review)

Perm url with updates: http://xahlee.org/Periodic_dosage_dir/Logitech_G13_Gameboard.html

Logitech G13 Advanced Gameboard (Review)

Xah Lee, 2009-12-18, 2010-11, 2011-03-14

In my foray into gaming mouses (see: Review Of Gaming Mouses), one interesting discovery is the “Logitech G13 Advanced Gameboard”.

logitech g13 gameboard 2-s

“Logitech G13 Advanced Gameboard” amazon

After reading the many reviews and going to a local shop to see it, i think this is fantastic. Not just for gaming, but most importantly, it has some 20+ keys that are programmable. The greatness of the programmable keys isn't just from the company's spin-doctors, but highly liked from user reviews. The software is actually quite good, and comes with a programing language using Lua. So, if you are a emacs user with its 3 thousand commands, and or 3D modeler user, this extra keypad will be extremely useful.

Video Reviews

“Logitech G13 Advanced Gameboard”. amazon

“Logitech G13 Review”

Why Not Just A Gaming Keyboard?

There are many gaming keyboard out there. For example, the most popular ones are:

  • “Microsoft Sidewinder X6” (~$60) amazon
  • “Logitech G110” (~$65) amazon
  • “Logitech G15” (~$80) amazon
  • “Logitech G19” (~$156) amazon
logitechg g19

“Logitech G19” Source amazon

More phote here:

“Chilla Frilla: Logitech G19 Keyboard Unboxing and Review”

They have all many programable buttons and keys and some has displays and knobs. I LOVE these extra buttons and knobs.

However, they all have one major usability problem: They are not ergonomic keyboards. So, if you type few hours a day, for chat in games, or programing, or for writing, blogs or emails, these keyboard are pretty unusable. Because of this, i have little interest in these gaming keyboards.

When Is A Keyboard “Gaming” Keyboard?

In my research, i haven't came across any so-called gaming keyboard that are ergonomic. For example, curved or split into 2 sections. There are fringe gaming keyboards that are split, but isn't really ergonomic at all. This brings up the question: “How do you define the term ‘gaming keyboard’”? Basically, a keyboard designed more or less for playing games. The problem is, some keyboards not branded “gaming” are in fact much better for gaming than dedicated “gaming keyboards”.

The most important element of gaming keyboard in terms of functionality is re-programable keys. Secondarily, with many extra keys, buttons, knobs, and in some cases a LCD display. Many keyboard are actually better for gaming than the so-called gaming keyboards. For example, i use Microsoft Natural Ergonomic Keyboard 4000 for my Second Life and other gaming.

A Review of The Microsoft Natural Ergonomic Keyboard 4000

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

Microsoft Natural Ergonomic Keyboard 4000 (review)

Xah Lee, 2006-06, …, 2010-08-24, 2011-06-04

In 2005, Microsoft produced a new keyboard called the “Natural Ergonomic Keyboard 4000”. This keyboard is a relative major change from their previous ergonomic keyboard.

Microsoft Natural Ergonomic Keyboard 4000

“Microsoft Natural Ergonomic Keyboard 4000”. amazon

ms n4000 keyboard2

“Microsoft Natural Ergonomic Keyboard 4000”. amazon

ms n4000 keyboard3

“Microsoft Natural Ergonomic Keyboard 4000”. amazon

Summary: in the 20 or so keyboards i've used since 1990, i found this to be the best.

Major Features

Front tilt

NEK4 slope

Front tilt.

The keyboard features a front-tilt, and large palm rest. e.g. The middle of space bar is about 2 cm higher than the F5 key. This is GOOD.

Usually, people like to prop up the back legs of their keyboard so that they actually have to bend their wrists upward to type. That this bad.

Rest your forearm on a table and let your hand relax, you'll notice that your wrist bends upward about 30°. Now, tab your finger tips on the table as if making a impatient gesture. You will feel discomfort after some 20 minutes. Now, place book under your wrist. You'll notice it's more comfortable. Because, wrist don't bend upwards. This is what the MS 4000 front-tilt does.

Contoured Keyboard

NEK4 split NEK gable

Various curves.

The physical shape of the keys are now curved in several ways. For example, in previous Microsoft ergonomic keyboards, the Caps-Lock and ASDFG keys all are on a straight line. But with 4000, this is no longer so.

The keys are curves for good reasons, for example, pinkies are shorter. So, the A key is curved towards you. Also, the J key is ~1 cm higher than ;, and similarly F is higher than A. This is good because when you don't have to rotate your wrist when you type.

When i have to press Shift or Ctrl keys on the 4000, i have to bend my wrist to the side, much more with this curved layout than previous MS ergonomic keyboard. So, the curves are not necessarily peaches and creams to everyone.

Traditional Arrangement of Home Key Group

There are 2 type of arrangement for the key cluster: Insert, Delete, Home, End, PageUp, PageDown. Traditionally, they are arranged in 2 rows, 3 columns. Since about 2000, some arrange it in 3 rows, 2 columns.

nek 4000 2 wnm keyboard home cluster2

Left: Traditional arrangement of Home/End, keys. Right: Vertical arrangement.

If you read a lot keyboard comments, you'll find there's no universal agreement on which is better. Personally, i hated the new arrangement, but after using it for about 2 years, i got used to it. Then, when i first started using this 4000, i find the traditional arrangement annoying, till a month of adjustment.

For more detailed analysis, see: Computer Keyboard: Home/End Key Cluster Arrangement.

Special Keys and Knobs

ms n4000 keyboard zoom slider

The Zoom Slider. Very convenient! image source

• There is a “zoom” slider. You can use it to zoom-in or zoom-out in web browser. I find this very useful. It works in all applications that zoom makes sense that i've tried. All Microsoft apps, Internet Explorer, Google Chrome, Safari, Opera, Gimp, Inkscape, Blender. In desktop folder (Explorer), you can use this to increase/decrease the photo's preview size. It's also very convient when viewing photos. In most apps, you can zoom by holding Ctrl key and use the mouse scroll wheel, or press 【Ctrl++】 and 【Ctrl+-】. But a dedicated zoom slider is slightly more convenient.

The only problem i found is that the zoom does not work in Firefox by default. (it scrolls instead) If it doesn't zoom in some app, you can use the bundled software IntelliType to make it zoom, or scroll, or any other, but it requires some programing background. (see: Microsoft IntelliType Hacks.)

• There are Back and Forward keys below the Spacebar. This is convenient for browsing the web. These keys can also be reset with IntelliType to other purposes, such as switching to previous or next application, windows, or tabs.

• There are 4 new keys: = ( ) on top of the number keypad. This is convenient for those who uses the calculator application. These keys behave the same as the ones on the main section of the keyboard. Too bad that they can't re-programed.

• The PrtScn, Break, ScrLk are each a physical key. (some keyboards don't even have them, or jam them into 2 physical keys with modifier for meaning.)

ms n4000 keyboard LED

The LEDs for Num Lock, Cap Lock, Scroll Lock, F Lock. image source

• The led indicators for Num Lock, Caps Lock, ScrLk, F Lock are right in front of the keyboard, below the space bar. This makes them easy to see. (This is a improvement from the Microsoft Wireless Optical Desktop Pro. There, the leds are on the usb transceiver that is often placed away or under your desk.)

(See also: How to Disable the F-Lock Key.)


• There are many complaints about the space bar being stiff. Some comment on amazon mentions that they didn't have that problem. I also find the spacebar too stiff. Almost all lowest ratings user reviews on amazon are about the Spacebar. Some hope that it'll soften overtime, but i can tell you it won't. I've been using this keyboard for 3 years now. Either you get used to it, or the spacebar spoiled the whole thing for you.

• The Spacebar is extremely loud, and it makes one big sloppy THUD sound. I really hate it.

• In the Natural Multimedia Keyboard keyboard, there are skip-to-next-song and skip-to-previous-song buttons. This is not present in the 4000. So, now you have to switch to your music player first in order to skip to the next song. This is a terrible oversight. As a work around, you can make those special Back and Forward buttons to do the same. Overall, both keyboards have the same number of special keys, so it's a trade off. I set the Forward/Backward buttons to switch tabs in browser.

• The Control keys have become smaller and less protruded. For emacs users, this is bad news. On the WNM keyboard, you can flatten the palm and press control that way very comfortably. But with the 4000, it's difficult to use palm to press the Ctrl key. Instead, you curve your hand into a semi-fist to sit on the Ctrl. (Never use your pinky to press Ctrl.)


As a alternative to this keyboard, i recommend:


Microsoft Natural Keyboard Elite

Microsoft Natural Keyboard Elite

“Microsoft Natural Keyboard Elite”. amazon

The Classic: Microsoft Natural Keyboard Elite. No extraneous buttons, but the arrow keys got screwed. (imagine playing Pacman with it) According to Amazon reviewers, LOUD spacebar. That's a immediate NO for me.



One problem i found in this keyboard is that the right Alt key needs to have pressure on it for it to register. Note, it's just the right Alt. The left Alt works perfectly. The right Alt, needs a pressure when you hold it down. When i use right Alt to do key combinations, often it results in just typing without having Alt down. This is very annoying. I don't know if this is just particular to the one i bought, or is a general problem of this keyboard. According to a blog by Greg Smith at Source notemagnet.blogspot.com , he seems also seeing this problem. However, even with this problem, i still consider this keyboard a good one. Most of my Alt usage is done with the left Alt, and now i habitually apply more pressure when using right Alt.


Many reviewer have mentioned, that the labels on the key comes off relatively easily. I've been using this keyboard for about 3 years, for more than 10 hours per day. About 4 key's labels are completely gone.

Overall, this keyboard is of quality design, but cheap construction, intended for mass market.

Microsoft Wireless Optical Desktop Pro Keyboard

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

Review of Microsoft Ergonomic Keyboard

Xah Lee, 2005-11, 2009-02, 2009-07

In 2005, i bought Microsoft Wireless Natural Multimedia keyboard (MS WNM), introduced in 2004. This is basically a one-piece split keyboard with special buttons on top. (as of 2009-07, the keyboard is renamed to “Microsoft Wireless Optical Desktop Pro Keyboard”)

I'm a input device nerd. I find this keyboard in general better than all i've used in my 14 years of computing experience.

Microsoft Natural Multimedia keyboard

The Microsoft Wireless Natural Multimedia keyboard. amazon

Microsoft Natural Multimedia Keyboard Microsoft Natural Multimedia Keyboard

Outstanding Features

• Quality split design. If you type than few hours a day, then try to get used to a split keyboard. It prevents your wrists from bending. Once you get used to split keyboard, typing on a flat keyboard will immediate feel discomfort.

• Large Alt and Ctrl keys. Large modifier keys are especially nice if you are a programer, in particular, if you are a Emacs user.

• The modifier keys are positioned symmetrically with respect to your thumbs. Many keyboards, especially those made by Apple Computer, the right-side modifier keys are placed far more to the right, so one has to curl the thumb way inward to press them, making the key essentially decorative in nature. See: Photo of a Apple 2006 Keyboard.

• Very nice tacticle feel of the keys. This is important for professional typers such as writers, game chatters, programers. Notebook style shallow keys will quickly give you wrist problems after prolonged use.

mwm mm keys2

• The multi-media keys are fantastically convenient. You can switch to next song, pause playing, adjust volume, without needing to switch to music player first.

app keys2

The application special keys, are extremely convenient. There are a total of 9 of them, not counting the mute and sleep buttons. These keys can be reset to any application thru the bundled IntelliType software. (works for Windows and Mac)


MS keyboards come with IntelliType Software. It lets you customize the keys fairly extensively. For example, the function keys can be assigned to launch applications or do other commands. For the Mac, and the meaning of “Start” key and Alt key can be swapped (suitable for Mac users), and Caps Lock key and Ctrl key can be swapped as well. Any of these modifiers can also be disabled. The IntelliType comes in both Windows and Mac versions.


Home Cluster Keys Arrangement

wnm keyboard home cluster2 nek 4000 2

Two type of arrangement of Home Cluster keys. On the left, vertical, on the right, traditional.

The standard block of 6 keys: Del, Ins, Home, End, Page Up, Page Down, traditionally arranged in a 2 by 3 block, is re-arranged into a vertical block of 3 by 2, with 5 keys only. The Insert key is gone, and the Delete key expand to its place.

Whether you like this new shape depends. Opinions vary. For me, i hated it in the beginning. But after using this for 2 years, i find the traditional arrangement annoying. Here's some analysis of the situation:

  • The Ins key is removed. It is arguably a good move. The Ins key is obsolete key. It is useless in vast majority of software. So now, the Delete key, expand to take its place. The Delete key frequently used in about every application.
  • The left and right placement of the Home/End keys is more logical to how these key functions on Windows. Because, in Windows, Home goes to the beginning of line, and End goes to end of line. So, a left/right Home/End is intuitive. However, on the Mac, Home and End is beginning and end of document. So, a vertical Home End placement is more natural for Mac users.


This keyboard is not one of those super quite ones, nor is it particularly loud. What i hate are some keyboard where there's a outstanding thud every time you press the space bar.


Over all, i think this keyboard is far superior than any in my 14 years of computing experience. However, here are a few design flaws i see:

Hidden Cap Lock LED Indicator

The led indicators for Caps Lock, F Lock, Num Lock are not on the keyboard. They are on the wireless receiving device. (the little mouse-sized block connected to the USB) So, if you tuck your receiving block under your desk, then these leds are not in sight, making them useless. (2009-02-04 addendum: this is fixed in later versions.)

Problem with F Lock Key

• The F Lock key is a pain. For detail, see: Problems of F-Lock Key and How to Disable It.

F Keys Not Touch-Type Friendly

• The function keys are arranged together in two groups of rows on top. The left row is F1 to F5, the rigth row is F6 to F12 and F Lock. This is different from the standard arrangement of 4 keys per cluster. The continuous arrangement makes touch-typing of these F keys impractical, because touch typing are much enhanced by the gaps in the 4-key-per-block arrangement. The continuous row makes the keys in the middle of the row impossible to easily touch type. So, effectively, F8, F9, F10 are made unusable to me. (coupled with the F Lock key problem, F11 and F12 are both also made unusable for those who use f-keys with touch typing.)

(I use F-keys extensively. For launching/switching apps (email, web, emacs, terminal, IM, ...), close window, hide app)

Mingled PrtScn/Break etc Keys

wnm keyboard home cluster2

Mingled PrtScn/SysRq, Insert, Pause/Break, ScrLk keys.

• The functionalities of PrtScn, Insert, Break, ScrLk keys are mingled together into two physical keys. Their function depends on the F Lock. This is done in a very confused way with confusing labels on the keys. The left key has these 3 lables: “PrtScn, SysRq, Insert”, and the right key has “Pause, Break, ScrLk”. The third label are printed in front of the keys.

Normally, it wouldn't be a problem of jamming 4 functionalities into 2 physical keys thru a state-toggling key. However, in this case, it's very confusing because the PrtScn, Break, ScrLk are conventionally a set of 3 keys often considered as one unit. To put these 3 keys plus the Insert key, into 2 physical keys, is confusing. What made it worse is that the PrtScn, Break, ScrLk keys are somewhat historical and they do not have a definite purpose today (except the PrtScn key). Also, there's another esoteric key SysRq that is sometimes confused or jamped into the same key as PrtScn. Somewhat similarly, the Break key is sometimes labeled Pause. These reasons made it very confusive.

All this shouldn't matter to most users, since these keys are almost never used. But if you are a heavy keyboard macro user, and want to assign functions to every available key so you have 1-button operation for many tasks, then the jamming of PrtScn/SysRq, Insert, Break, ScrLk/Pause into 2 keys with a state key is bad. Because it's painful to figure out which is what.

2010-08-16 Addendum. This keyboard is discontinued. Its replacement is Microsoft Natural Ergonomic Keyboard 4000, which is also my favorite.

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

TeX Pestilence

Perm url with updates: http://xahlee.org/cmaci/notation/TeX_pestilence.html

The TeX Pestilence

Xah Lee, 2004-08

The following essay, is edited version of my email messages, on the harm of TeX.

Problems of TeX

TeX is detrimental because it harbors ignorance of the structural content embodied in most math notations in most fields. What TeX does is typesetting, as opposed to math expression encoding. In other words, what TeX does is pretty-printing.

The language is designed in a way that any structural info in a math expression are botched. As such, TeX, even though it is a full-fledged computer language capable of great programing, but it understands zilch of math expressions, it encodes zilch math expressions. Now that is a egregious error of a computer language purporting to express mathematics. And more so because it is a product of a mathematician who should've known better.

LaTeX mended TeX by turning a pretty printing system into a structured documentation system. However, since TeX at its core is a pretty picture system, no amount fix can correct that other than complete discard. LaTeX fixed nothing about TeX's botching of the structural info in math notations.

As a testament of TeX's shortcomings, TeX botches structural info in math expressions so bad that no program whatsoever short of Human-Level Artificial Intelligence will be be able to convert from TeX into another system of math notation.

As a pretty-printing system, Mathematica is no match for TeX. As a knowledge representation system that is filled with the need of math notations old and new, Mathematica is superior to TeX/LaTeX by far in just about any aspect of this endeavor.

TeX's Damage to Society

TeX has done significant damage to the math community, by getting people to focus and love pretty printing, which is what typesetting is mainly about. And the key to see this is that TeX has absolutely no concept of the semantic content or structure of math expressions. As to alternative systems, as i've argued, there is Mathematica, and subsequently MathML, and i'm sure others based on semantic content and automatic formatting that i'm not aware of, and or killed by TeX before they possibly could have a chance.

• TeX is a system for typesetting. Typesetting is primarily concerned with esthetics. As a art form, typesetting is insignificant. Typesetting, taken by itself other than reading facilitation, is in general of little serious utility.

• TeX as a knowledge representation system used by scientists, seduced vast number of scientists into the rather wasteful activity of appearance doodling.

• TeX, because it is a pure typesetting system and is not aware any structural info embedded in math notations, it destroys this information whenever math is written in TeX. Even notational systems using plain, one-dimensional ascii text such as in Mathematica before version 3 (~1997), or other computer algebra language, maintains structural info. (by necessity, because they have to actually work in some sense as a math formalism system)

• Because TeX is free, it halts progress of competing systems and ideas. If TeX had not been invented and given out free, systems that preserve structure (e.g. MathML, Mathematica) for the purposes of displaying 2-dimensional math notations, would have been invented earlier or wide spread.

Free software acts as a virus. Free systems have the potency to wipe out any other protocol or design, including any superior ones (unless they are also free). A example is the various Unix systems and protocols has done huge irreversible damage to society.

• As a computer language, the design of TeX's syntax and semantics is arguably bad. The syntax is rather inconsistent, complex, imperative style (as opposed to functional programing), and in general the language is difficult to use to control the typesetting or documentation structure. It spread bad ideas or experiences to non-programers (e.g. mathematicians).

Any computer language, however bad is its quality, will attract users once exposed to it, and may become addictive, and its users will feel empowered. It's like jigsaw puzzle in comparison to Rubic Cube. In the context of puzzles, the Jigsaw is a complete waste of time as a game with respect to mathematical values, it however ferment people into fans. A example of this is in computing, is the language Perl.

The above ideas is not new, however, it is hardly ever heard. All one hear every day everywhere are chants of the greatness TeX by ignorant computing geeks and mathematicians. The former know coding, the latter knows abstract specialization, both of which in general are ignorant of the history, psychology, and linguistic theories of knowledge presentation and symbolic system. This must be stopped.

Downfall of TeX

I do think TeX's popularity is waning because of its inappropriateness. They being:

  • Not based on Graphical User Interface.
  • Not interactive. (its usage requires “compile” cycles)
  • Inconsistent syntax.
  • Bad language semantics. (it is difficult to use TeX as a embedded language in typeset programing or document structure programing. (compare: Microsoft Word with VisualBasic, Emacs with elisp))
  • A system based on appearance, not on math expression structure.

As of today, structural and semantic info are receiving greater and greater awareness as opposed to formatting or displaying aspects. Witness today's thoughts of Semantic Web, and a slew of technologies oriented with maintaining structure such as SGML/HTML/XML/MathML, DOM, RSS, Mathematica. Even CSS, is structural based that removed formatting issues from HTML, and is today moving to XLS for XML.

In part, TeX isn't to blame for its own fall, because it is set out to do typesetting and it does that well. The thing is, the entire typesetting business itself is largely a waste of humanity's time. As communication tech progresses, typesetting as it is understood (i.e. concerns about em/en-space, ligatures, typefaces) is going to be extinct. (See: The Moronicities of Typography.)

The Structure in Math Expressions

Math notation does not always have well-defined structure or meaning. However, it is important to consider the preservation of semantic in building a math notation representation language. For example, if we have x^2+Sqrt[x], the system should know that it is a operation applied to two things, each of which is some particular operation on symbols x. Similarly for the traditional notation of matrix, subscripts, sets, absolutes/norms, summation, derivative, integral, ... etc. For any new math notation that does not have a clear structure (say some bunch of arrows towards symbols in some homological algebra), we can for example have a tag that markup the part of expression to indicate that it has no meaning and is for displaying 2D-typeset purposes only.

In TeX, every math expression is just a sequence of structurally meaningless but micro-position-aware symbols.

TeX and Microsoft Equation Editor Considered Equal

TeX, being a pretty-printing system, can be considered in the same class as Microsoft Word Equation Editor. The difference lies only in their mode of operation. Specifically, TeX is by compile and batch operation like a typical computer language, and the Equation Editor is by using a mouse to click menus and buttons with graphical user interface. The heart of both as far as math notation is concerned, is doodling of a em space or en dash. All math notation's semantic structure are lost.

LaTeX vs Microsoft Word for Structured Document

Consider LaTeX as a structured documentation system. Microsoft Word's Outline feature does better, plus it has background spell checking, tabs setting, embedded version control, voice annotations, and so on. (provided the person know how to properly use MS Word)

TeX's Place in the World of Typesetting

In order to evaluate TeX asides from its massive brainwashing of the Math community, the question we have to ask is to what degree TeX has made a impact in strictly the typesetting and publishing community. I agree TeX as a typesetting system has made a major impact in this community, however, as a technology, it is far from taking a leading role. Consider QuarkXpress, FrameMaker, PDF, all are in similar market and are not free. (PDF document creating software made by Adobe is not free)


So you know more about this than all of us professional mathematicians who have been working with it all our lives?

Successful and professional writers will in general not know much about linguistics or writing systems. Similarly, musicians typically are ignorant of the history, design, of musical notation systems.

Likewise, professional mathematicians, although they have used math notation all their lives, few have studied or thought about the history of math notation, writing systems, symbolic logic systems, syntax of computer algebra systems or theorem proving systems, linguistics of computer languages, cognizance sciences, psychology of perception, all are related to math notation systems.

In the opinion of just about everyone who knows about such things, TeX is the best markup language where precise and beautiful typography is essential AND for typesetting mathematical formulas and equations. The fact is that ALL professional mathematicians learn TeX as graduate students and write their thesis in TeX and from then on are so hooked on it that they not only write their mathematics in TeX but also usually their letters and other documents. Something written in MS Word just looks ugly by comparison, particularly if it contains formulas using the brain-dead MS equation editor. BTW, just about all physicists use TeX for the same reason.

I'm very well acquainted with the history TeX and its position in society, how scientists receives it, and how ubiquitous and its position as a standard. I've read extensively about TeX a decade ago. I'm very well aware how it compares to something like MS Word or other related WYSIWYG equation editors.

On the whole, my thesis is that TeX, although a extremely successful and well done tool that has satisfied a niche, but it may in fact be a disservice in humanity in that it massively mislead people in the wrong direction. If TeX did not exist, then typesetting will remain in the realm of professional typesetting and printing community, while mathematicians and scientists, will not have wearied their energy into typesetting, but instead put their focus and energy in coming up with a syntax that makes mathematics readable as well as meaningful, based on immense modern knowledge of symbolic logic, computer algebra, and linguistics of computer languages.

Consider typesetting for a moment. What is it? It is no more than pretty-printing. It has some element that facilitates reading, but only a bit. The bulk of it is meticulousness is about appearances. Typical typesetting concerns are things like en-dash, em-dash, ligatures, small-caps, typeface design, serif, sans-serif, micro positions, kerning ... etc. Typesetting is a cultural development. Even if we suppose that the esthetics in Western typesetting is universal, its esthetics values in the context of artistic endeavors is dismal. (For example, contrast it with calligraphy, painting, sculpture etc.)

By introducing TeX the way it is designed, it encroaches the symbolic language of mathematics with pretty-printing, and devalued the system of symbolic communication used by mathematicians, and subtly derailed what mathematicians do best.

If TeX as it is designed has not been invented, then today we might already have a alternative system such as the proprietary Mathematica, or MathML (very much influenced by Wolfram Research Inc.), which has taken consideration that the symbolic language of mathematics is more than just pretty glyphs arranged in a special way, in that it has a not-well-understood but undeniable structure and relation to mathematics, to such a degree it can influence where mathematics is going, and a design with these thoughts in mind helps us actually advance computational mathematics.


In recent years, some software have taken steps to address TeX's shortcomings. Here are examples:

  • GNU TeXmacs. A word-processor-like program that renders 2D math formulas and also functions as front-end to several math packages such as Mathematica. TeXmacs borrows ideas from TeX and Emacs but is not dependent on them.
  • LyX A word-processor-like front-end to LaTeX, designed for ease of use.
  • http://tug.ctan.org/tex-archive/macros/latex/contrib/cool/ Content Oriented LaTeX. A LaTeX package that tries to retain the math expression's structure.
  • XeLaTeX A TeX engine that support unicode. That is, special characters such as greek letters, Chinese chars or different languages, can be entered directly without using markup.


“Mathematica Notation: Past and Future” (2000-10-20), by Stephen Wolfram, at http://www.stephenwolfram.com/publications/recent/mathml/index.html.

A great article on math notation, This article should teach those coding sophomorons and idiotic authors in the computer language design community, who harbor the notion that syntax is not really important, picked up by all the elite i-reddit & twittering & “Hacker News” am-hip dunces.

Personally, particular interesting info i've learned is that, for all my trouble in the past decade expressing problems of traditional math notation, i learned from his article this single-phrase summary: “traditional math notation lacks a grammar”.

The article is somewhat disappointing though. I was expecting he'd go into some details about the science of math notations, or, as he put it aptly: “linguistics of math notations”. However, he didn't touch the subject, except saying that it haven't been studied.

There are some errors in his article. On this page: http://www.stephenwolfram.com/publications/recent/mathml/mathml2.html He mentioned the Plimpton 322 tablet. It is widely taught in math history books, that this table is pythagorean triples. However, in recent academic publications (2002), it is suggested that this is not pythagorean triples, but rather: “a list of regular reciprocal pairs” as teacher's solutions to exercises for students. See Plimpton 322.