2009-08-28

A Review Microsoft Comfort Curve Keyboard 2000

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

Microsoft Comfort Curve Keyboard 2000 Review

Xah Lee, 2009-08-24, 2010-09-16, 2010-11-03

Update: this keyboard is well-known for its key failure. See below for comment and how to fix.

Recently i bought the Microsoft Comfort Curve keyboard 2000.

Microsoft Comfort Curve keyboard 2000

Microsoft Comfort Curve keyboard 2000. amazon

This is a fantastic keyboard. If you find those split ergonomic keyboard too much, or if you prefer the laptop-style flat keys, then this is the keyboard to get.

Consider the price, it's fantastically cheap. Only $18. In comparison, most full key keyboards or ergonomic ones goes from $30 to $50.

This keyboard is very thin. Less than 2 cm.

This keyboard is also extremely sturdy. One piece of solid plastic. (if you hold the sides of the keyboard and forcefully twist it, you can't bend it easily.)

This keyboard is also light weight.

Like all flat keyboards, it's basically noise-less, with quick response because of the shallow keys.

I also love the way the keys alignment are curved. It's got some ergonomic advantage of split keyboards, but kept in one piece.

In my opinion, if you judge by the ratio of performance/price, then this definitely beats all Microsoft keyboards out there, and all other keyboard that exists, period.

Right now, there are 2 other keyboards i regularly use. They are:

Judging strictly on product performance regardless of price, between the above 2, i find it to be a tie. However, i might consider this Comfort Curve 2000 even beating both. This seems impossible to believe, since the Comfort Curve is not fully split ergonomic, and i'm a ergonomic split-keyboard fan. Also, this keyboard is flat keys, which is generally considered not good for prolonged typing. However, i do find this keyboard extremely comfortable and faster to type, especially for using Emacs.

All things considered, this is absolutely a fantastic keyboard.

Update: Keys May Fail!

2010-09-16

Just discovered this, that this keyboard's keys is prone to failure. So, i don't recommend it.

I recommended this keyboard to a online friend about half a year ago. She told me she had some problem with some keys, said that she spilled drink on it. And she bought a new one, same model, and that too, keys started failing. Now she's on her 3rd one, and keys also fail.

At first i thought maybe spilling drinks on the keyboard is the problem, even though i thought minor spilling shouldn't be a problem, since modern keyboard usually are spill-proof. But key failing after the 3rd keyboard??

But recently, i noticed that keys on my keyboard do not work sometimes. The first time this happend is the F10 key. For some reason it worked next day. But today, the Enter key wasn't working for a while, now the key x fails sometimes. It's not consistent failure. Sometimes it works perfectly, but the next minute repeated press won't show up a single character.

A look at amazon here: Source , you see a lot comments about failing keys. So, this is a serious defect with this keyboard. Of all things about a keyboard, if the keys start to fail, it's the worst.

Final words: Do NOT buy this keyboard.

I'd recommend:

  • “Microsoft Natural Ergonomic Keyboard 4000” amazon (review).
  • “The Microsoft Wireless Natural Multimedia keyboard” amazon (review)

Both i used for several years without a problem.

Beware of Garbage Advise

There are lots of sites that gives garbage advices about this keyboard. They'll say update the driver, clean the keyboard. These are not the problems of this keyboard. The problem is with the keyboard hardware itself. Also, return for replacement will probably not help. Lots of reports that says new replacement are still bad. Again, the problem is with this keyboard's design.

Existing Owners

2010-10-18

there's a guy SMApple who wrote a post here: Source. He says the problem is electric static built-up inside the keyboard. Quote:

The problems with this MS comfort curve keyboard starts when at random some of the keys stop working, it dose not matter how hard you press or for how long, they just wont work, this problem is due to static charge build up on the thin plastic sheet/mat inside the keyboard that has electric circuit printed on them. This new keyboard technology is wonderful and superb, the keyboard is sheer pleasure to use when it is working, when you press the key it is quite soft and silent, so, it wont wake the baby up. it has no mechanical parts inside keyboard, it has lots of small soft plastic **** on plastic matt that you press with your keys so they don’t make any sound, same as in your average Remote control. Even in this year 2010 this plastic sheet circuit board needs lots of improvement yet, because it suffers from static charge build up. Microsoft seems to have opted for the cheapest quality non expensive plastic sheet circuit mat for their keyboard, probably made from some cheep biodegradable recycled plastic condoms, these cheep mats always have tendency to hold onto electric charge and wont discharge when they should, and consequently cut off circuit connections to the keys, same technology that is used in majority of the household remote controls, and ,so, the reason why Remote keys tend to stop functioning after a while.

His “solution” is to spend 15 min to open up the keyboard to discharge it, whenever keys starts to not working.

2010-10-18 Reviews on newegg also has lots people saying that the keys doesn't work. Source

How to Fix This Keyboard

2010-11-03

Just learned from a friend, a good method of fixing this keyboard. Whenever some key doesn't work, take the keyboard up and hold it with one hand, and use the other hand to give the keyboard a slap with big impact. WHAM! Then, the defective keys will all work again! Seriously. She told me this, then i immediately plugged in the keyboard, checked that x is still defective, then i whacked it, and it immediately workd!

This is a fantastic solution. Because this is a really great keyboard, and now you can actually make it work.

2009-08-27

AutoHotKey Basics

perm url with updates: http://xahlee.org/mswin/autohotkey.html

AutoHotKey Basics

Xah Lee, 2009-08-25

This page is a very basic tutorial on using AutoHotKey.

AutoHotKey is a keyboard macro software for Microsoft Windows. It is free and Open Source. It lets you assign any keyboard shortcuts to launch programs, type text or keys, or even mouse clicks. It has a basic scripting language.

For example, you can define F5 to launch to a browser but switch to it if it's already running. You can also use it to define abbreviations, so pressing a key automatically types today's date, or your signature, or any other keypress.

Download AutoHotKey

First, you need to download and install it, here: http://www.autohotkey.com/download/. Just run the installer to install it. AutoHotKey runs on my machine without any problem. My machine is 64 bits Windows Vista.

Create And Running A Script

To create a AHK script, for example, save the following text into a file, and name it “test.ahk”:

; launch Notepad
Run Notepad

AutoHotKey script is not case sensitive. “Run” is the same as “run”.

To run the script, just double click it in Explorer. It will launch Notepad, then the script will exit.

Here's how you create a shortcut to launch Notepad:

; assign Win+n to launch Notepad
#n::Run Notepad

Save the above in a file. Then, double click to run it. Then, you'll be able to press the “Win+n” key to launch Notepad.

AutoHotKey System Notification Area

A running AutoHotKey script icon in Taskbar's System Notification Area.

Once you run the above script, it actually stays running as a background process. You can see it in your Taskbar's notification area. You can right click on the icon and pull a menu to Edit the script, Reload the script, or exit the script, and others. As long as the script is running, your hot key is available to you.

Launching Apps and Defining Hot Keys

Launching a app

; you can use “Run” to launch apps or url
Run Notepad       ; launch a app by name
Run "C:\Program Files (x86)\Internet Explorer\iexplore.exe" ; launch a app by path

Run C:\Users\xah\Documents\todo.txt ; launch a file
Run C:\Users\xah\Documents ; launch a folder

Run www.google.com    ; launch a url in default browser
; launching a app with a parameter
Run "C:\Program Files (x86)\emacs-23.1-bin-i386\emacs-23.1\bin\emacs.exe" "-Q"

Assign A Key To Launch Apps

; assign a hot key to launch a app
#n::Run Notepad       ; this means the Win+n
!n::Run Notepad     ; this means Alt+n
^n::Run Notepad     ; this means Ctrl+n

F6::Run Notepad     ; F6

^!n::Run Notepad     ; Ctrl+Alt+n
^F6::Run Notepad     ; Ctrl+F6

For the basic syntax for modifier keys, see http://www.autohotkey.com/docs/Hotkeys.htm. For complete list of key syntax, including function keys, keys on number pad, and special app launching keys and multimedia keys, see: http://www.autohotkey.com/docs/KeyList.htm.

Sending Text And Keystrokes

You can define a hot key, so that, when pressed, it sends some other typing or keystrokes.

; pressing Ctrl+Alt+s to type a signature
F8::
Send Best,{Enter}{Enter} Mary Jane
return

In the above, the “{Enter}” means the Enter key. When you press “Ctrl+Alt+s”, then it'll type:

Best,

 Mary Jane  

Here's some useful example on setting up keys that sends other keys.

; make the Pause/Break key equivalent to pressing Ctrl+F4
Pause:: Send ^{F4} ; close window

; using the “/” and “*” keys on number pad to do
; prev/next tab in browser
NumpadDiv:: Send ^{PgUp} ; prev tab
NumpadMult:: Send ^{PgDn} ; next tab

Launching or Switching To Browser

Suppose you want a hot key that launches you to a browser, but if it is already running, just switch to it. Here's how.

; F7 to launch or switch to FireFox

F7::
ifWinExist ahk_class MozillaUIWindowClass
{
  WinActivate
}
else
{
  Run "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
  WinWait ahk_class MozillaUIWindowClass
  WinActivate
}
return

Google AdSense Ban on XahLee.org

perm url http://xahlee.org/Periodic_dosage_dir/tr/google_adsense_ban.html

Google AdSense Ban on XahLee.org

Xah Lee, 2005-06, 2009-08-21

From 2005 June 4 to 27, i was briefly on Google's AdSense advertisement program. The following report from them gives a glimps of XahLee.org's traffic.

Saturday, June 4, 2005 - Monday, June 27, 2005 Download CSV file
Totals 47,552 405 0.9% $1.09 $52.06
Date Page impressions Clicks Page CTR Page eCPM [?] Your earnings
Tuesday, June 7, 2005 547 0 0.0% $0.00 $0.00
Wednesday, June 8, 2005 1,679 17 1.0% $1.03 $1.73
Thursday, June 9, 2005 2,273 31 1.4% $1.38 $3.14
Friday, June 10, 2005 2,635 29 1.1% $1.75 $4.60
Saturday, June 11, 2005 1,837 13 0.7% $1.52 $2.79
Sunday, June 12, 2005 2,427 12 0.5% $1.08 $2.63
Monday, June 13, 2005 2,859 29 1.0% $0.54 $1.55
Tuesday, June 14, 2005 2,798 22 0.8% $1.08 $3.01
Wednesday, June 15, 2005 3,107 16 0.5% $0.62 $1.94
Thursday, June 16, 2005 2,670 22 0.8% $1.11 $2.96
Friday, June 17, 2005 2,610 27 1.0% $1.44 $3.77
Saturday, June 18, 2005 1,985 25 1.3% $1.37 $2.72
Sunday, June 19, 2005 2,159 21 1.0% $1.14 $2.46
Monday, June 20, 2005 2,625 18 0.7% $0.59 $1.54
Tuesday, June 21, 2005 2,788 19 0.7% $0.91 $2.54
Wednesday, June 22, 2005 2,762 28 1.0% $1.26 $3.47
Thursday, June 23, 2005 2,486 19 0.8% $0.60 $1.50
Friday, June 24, 2005 2,466 26 1.1% $1.99 $4.90
Saturday, June 25, 2005 1,797 12 0.7% $1.12 $2.01
Sunday, June 26, 2005 2,239 12 0.5% $0.76 $1.71
Monday, June 27, 2005 803 7 0.9% $1.36 $1.09
Totals 47,552 405 0.9% $1.09 $52.06
Averages 2,264 19 $2.48

After my accout reached $50 and they are obligated to pay according to their policy. Apparently, a human from Google took a routinely gander on my site, then kicked me off citing that my site having “racial” materials therefore violated their policy. Quote:

Our specialists have found that your account is not in compliance with these program policies. Specifically, AdSense policies prohibit content containing racial intolerance, or which advocates against any individual, group, or organization. As a result, we have permanently disabled your account.

Google has certain policies in place that we believe will help ensure the effectiveness of Google ads for our publishers as well as our advertisers. We believe strongly in freedom of expression and therefore offer broad access to content across the web without censoring results. At the same time, we reserve the right to exercise editorial discretion when it comes to the ads we display in our AdWords program and the sites on which we choose to display them in our AdSense program, as noted in our respective Terms and Conditions.

Thank you for your understanding.

I politely emailed back asking that it is reasonable to pay me the due $50 at least. They agreed. However, i was negligent with my personal finance, and never really checked, knew, or followed up, to know whether they actually paid me. (as far as i know, i don't think they ever did. But during those years i have postal mails piled for months, so i might have lost it. In any case, even if they paid, i never cashed.)


xahlee.org 20050622 snapshot

Screenshot of “http://XahLee.org/” as of 2005-06-22, according to web.archive.org. http://web.archive.org/web/20050622050826/http://www.xahlee.org/, accessed on 2009-08-21. (Note that the the url above has a date 20050522, but when you click on it, it became 20050428. This explains the url in the screenshot above.)

I'm guessing this George Bush “hatred” header warranted Google's ban, at least according to their policy interpreted in a conventional way. Might also be this article linked near the bottom of my home page at the time: Too Many People on Earth, among others.

2009-08-26

How to Increase Your Computer Operation Efficiency

perm url with updates: http://xahlee.org/mswin/keyboard_macros.html

Keyboarding & Macros in Mac and Windows (How to Increase Your Computer Operation Efficiency)

Xah Lee, 2009-05-26, 2009-08-26

I'm a operation efficiency nerd. When operating a computer, you have to switch apps, click links/checkbox/buttons, invoke menus, open/close window or tab, adjust volume, change songs, switch input focus, switch fields, input/edit text, or perform pointer oriented input such as in a image editing software. (here, we are excluding other forms of input such as voice) In general, all these are inputs, done by using input systems, a combination of software and hardware. Typically, the hardware is just keyboard and mouse (or touchpad or trackball). The software part is the interfaces used in the OS and various apps.

Operation efficiency means you are able to achieve a input task with the least number of units of physical exertion, basically means less keystrokes, less mouse travel, and most importantly, less brain work to carry the task out. (brain work, such as the need to eyeball a process, is actually the most costy.)

As a concrete example, let's say you have a url in a text editor. Say you want to view that url in a browser. There are many ways to achieve that. One way, is to use mouse to select the url, right click to select the copy menu, switch or launch a browser (many ways to do this), put focus on the url field, then right click to paste it, then hit Enter to load the url. This method, is rather most typical. As a example of a less efficient way, is to actually type the url text in the browser field. As a example of more efficient way, is by pressing keys to copy & paste instead of using the mouse. (because, using the mouse to select a menu item, involves precision exertion and eyeballing brain work to hit the right menu item)

Now let's consider the task of switch/launching a web browser. There are different methods of varying efficiency. For example, a typical savvy user will press “Alt+Tab” to switch to it if it already launched. Otherwise, he may pull Start menu with mouse, then select the browser app from the menu. Or, she may press the Start key with keyboard, and press arrow keys to select the browser app from menu (this is more efficient).

But as a example of a more advanced system, is for someone to have a customized shortcut setup so one single button press will launch the right browser, and if it is already running, switching to it. (in fact, many keyboards have a special key for this, usually labled “Web/Home”.)

But, let's consider a even more advanced operation. For someone using emacs, he may have a scripted customization such that he presses one single button, and a browser is auto launched/switched and the url automatically loaded. (as you get more advanced in efficiency, you also needs more time in learning automation systems, from macro tools to scripting languages.)

I don't care if you are a linux user, whatever Ratpoison interface you are using, what command-line nutcase motherfuck you are, or how you've customized your keyboard with X11 xmodmap, i assure you, that i'm able to operate my Mac or Windows with my own custom setup more efficient than you, and faster than you too. (efficiency doesn't ensure fast, because speed involves performance aspect too (e.g. if you are a centenarian, doesn't matter how efficient your methods are, you are likely to be slower than a average 18 years old computer user.). But since i'm atheletic and touch type 85 wpm, so, adding my efficiency, i'm certainly faster too.)

I use a Dvorak keyboard layout, and on either Mac or Windows, i am intimately familiar with ALL its keyboard shortcuts. ALL. Not just that. I've also explored to the hilt on how to customize the system, may it be key macros, some system automation scripting, or some level of OS modification, on either OS. But that's not all. Even knowing all of the above, to become most efficient, you must have arrived at a operational method that symphonize each aspect of the system to achive maximum over all efficiency. (input aspects include: keyboard shortcuts, macros, key remappings, and physical keyboard hardware (those modifiers and extra buttons, their physical positions, software keymappings), and the OS behavior and each app's behavior). It is important that one must take all aspects into consideration if the goal is ultimate operational efficiency. For example, suppose you are a keyboard freak like many linux tech geekers who take every opportunity to insist that mouse users are idiots. However, if the task is opening various links in a browser, keyboard operation is a magnitude slower than using a mouse. This is just a obvious example, similar other obvious examples are operating image editing or drawing software, including many gaming situations or 3D modeling environment, where keyboard as a input system are simply unworkable.

How to Increase Your Computer Operation Efficiency

Here's some advice for Mac and Windows users for operational efficiency. The following list is roughly ordered from the most important tips first.

Use A Good Keyboard

Use a good keyboard, preferably Microsoft's ergonomic ones. For tips on choosing a good keyboard, see: Computer Keyboards Gallery.

I recommend Microsoft's Natural Keyboard, Ergonomic 4000. These are split, ergonomic, full-key, full-featured keyboards. If you prefer labtop style flat keys, i recommend: Comfort Curve 2000.

Master OS's shortcut system

Master OS's shortcut system. See: Mac Keyboard Shortcuts, Windows Keyboard Shortcuts.

“Master” means you know all such shortcuts that exists by default, and you've examed and experienced and have decided which are better for you.

Learn The OS's Keyboard Config Settings

Learn the OS's ways to config the keyboard. On Windows, it's the keyboard icon under Window's Control Panel. On Mac, it's the Keyboard icon under System Preference. They allow you to tweak global keyboard hotkey settings, to various degrees.

If you have a Microsoft keyboard, i recommend the bundled IntelliType software. (available for both Mac and Windows) It lets you remap or disable keys or define macros to some extent.

Get A Keyboard Macro Tool

Use macros and other key-remapping software. On the Mac, i recommend Quicksilver. On Windows, i recommend Autohotkey. Both are free. (See: AutoHotKey Basics)

Note that there are also very good commercial ones. Try QuicKeys from http://startly.com/ (for Mac and Win). On the Mac, there's also Keyboard Maestro from http://www.keyboardmaestro.com/main/ i've used.

Learn A Scripting Lang

On the Mac: Automator and AppleScript.

On Windows, learn PowerShell. (See: PowerShell Tutorial) (There's also Visual Basic and cmd.exe, but PowerShell is the new .NET based shell that is most suitable for automation here.)

Keyboard systems work together with scripting langs. For example, you often want a hotkey to invoke some script.

Learn OS's Keybinding API

Learn the OS's keybinding system or API. On the Mac it's the DefaultKeyBinding.dict system. It lets you re-define keys across OS to some extent by a simple config file. See: How To Create Your Own Keybinding In Mac Os X.

I'm not sure what's on Windows. Registry has a lot to do with keybindings at least. There are several tools too, see: How To Create Your Own Keybinding In Microsoft Windows.

See also:

Some Windows Shortcuts

The following are for Windows Vista.

Closing Tab or Window

Hot KeyPurpose
Ctrl+F4Close current tab or window
Ctrl+wClose current tab or window
Alt+F4Quit app

Switching

Hot KeyPurpose
Ctrl+Tab” & “Ctrl+Shift+TabSwitch tabs
Ctrl+PageUp” & “Ctrl+PageDownSwitch tabs


Hot KeyPurpose
Win+Tab” and “Win+Shift+TabFlip 3D
Win+Alt+TabFlip 3D (don't go away mode)
Alt+Tab” & “Alt+Shift+TabSwitch apps/window
Ctrl+Alt+TabSwitch apps/window (don't go away mode)
Win+tPut focus on task bar
Win+bPut focus on system tray

Hide/Show

Hot KeyPurpose
Win+dhide/show desktop
Win+mminimize all windows
Win+Shift+mun-minimize all windows

Misc

Hot KeyPurpose
WinStart Menu
Win+rrun program
Win+eRun Explorer
Win+fSearch files
Win+llock screen
Win+SpaceStart current window's system menu
Win+uopen ease of access folder

Misc & Todo

What's window's shell command to launch a app? e.g. on osx, i can launch firefox at a url with “open -a firefox ‹url›”.

e.g. “start firefox yahoo.com”.

How to disable the Sleep key on the keyboard?

Go to the Control Panel, click on Classic View, then Power Options. There's a setting you can set.

Is there a way so that i can press a key and switch me to a particular app? That is, launch it if it is not running, otherwise just switch to it.

There no built-in way on Windows, but you can do it with AutoHotKey. Basically, you need a script that checks if the app you want is already running, if so, switch to it, else, launch it.

The solution is at this page: AutoHotKey Basics.

Is there a way to set a app to launch only a single process? For example, i prefer Firefox to have a single process with many tabs, so i don't have to Alt+Tab among several FireFox instances. Some app, such as Windows Mail, iTune, Skype etc, are apparently setup this way.

?

How to set a shortcut involving Win+‹key›?

Use AutoHotKey.

When i press “Ctrl+Alt+Shift+3”, the MediaSmart DVD starts. How to disable this shortcut? (because the shortcut is meaningful in Second Life)

Don't know. Apparently, uninstall that software also takes off the shortcut. But there must be a proper way to just remove the shortcut.

For reasons unknown to me, Win+n seems to launch different apps. I do not know what sets these hotkeys. What's more strange, is that few weeks later, i noticed that the apps they launch changed. Here's what they are, before and after.

Win+1 = Google Chrome, hide show desktop?
Win+2 = Safari, emacs
Win+3 = Cygwin, Google Earth
Win+4 = Gimp, Gimp
Win+5 = Google Earth, InkScape
Win+6 = IrfanView, IrfanView
Win+7 = IE, XnView
Win+8 = Firefox, IE
Win+9 = Opera, Google Chrome
Win+0 = Second Life, Firefox

Torture News

News: CIA memo details procedures for breaking detainees (2009-08-26) (Reuters) Source. Quote:

WASHINGTON, Aug 26 (Reuters) - Sleep deprivation, “insult slaps”, water dousing and “walling”, or slamming a detainee's head against a wall, were techniques used by CIA interrogators to break high-value detainees, according to an agency memo.

News, “AP sources: Report shows CIA interrogation methods” at Source. Quote:

AP sources: Report shows CIA interrogation methods

By PAMELA HESS (AP)

WASHINGTON — As the Justice Department considers whether to investigate alleged harsh interrogation practices sanctioned by the Bush administration, sources say a soon-to-be-released report by the CIA's inspector general reveals that agency interrogators conducted mock executions of terror suspects.

These latest allegations are contained in a 2004 report that has been kept secret and is to be released next week, two congressional officials told The Associated Press. They spoke late Friday on condition of anonymity because the report has not yet been cleared for release.

Threatening a prisoner with death violates U.S. anti-torture laws.

In one case, interrogators brought a gun and power drill into a session with suspected Cole bomber Abd al Rahim al-Nashiri, the report says. The suicide bombing of the warship USS Cole killed 17 U.S. sailors in Yemen in 2000.

In another episode, a gunshot was fired in a room next to a detainee to make the prisoner believe another suspect had been killed, according to the report, which a federal judge has ordered to be made public Monday in response to a Freedom of Information Act lawsuit filed by the American Civil Liberties Union.

See also: A Love of Torture.

working with tables data in emacs

perm url with updates: http://xahlee.org/emacs/emacs_table.html

Working With Tables In Emacs

Xah Lee, 2009-08-20

This page is a tutorial, showing how use emacs's table feature, to create or manipulate tabular data. You can export this table to HTML or LaTex formats.

The advantage of using emacs table feature is that you can visually add/delete columns and rows, then export it to HTML or LaTex.

Note that this feature is not very robust. If your table data is just few rows and columns, with simple text or numbers, then emacs table feature is very useful. But if you work with importing/exporting actual spread sheets or address books, emacs table feature does not handle it well.

Creating A Table

Creating A New Empty Table

To create a table, type “Alt+x table-insert”.

It'll ask you these questions:

Number of columns
Number of rows
Cell width
Cell height

You can just press Enter key to accept the default. You can change the values for each later. The result will look like this:

+-----+-----+-----+
|     |     |     |
+-----+-----+-----+
|     |     |     |
+-----+-----+-----+
|     |     |     |
+-----+-----+-----+

Press Tab or Shift+Tab to go to neighbor cells.

Creating A Table From Delimiter Separated Values

If you already have a table data, such as Comma Separated Values (CSV) from spreadsheets, or even from a existing HTML table, you can create a table from that.

Let's say you have this comma separated values:

,A,B,C
1,1a,1b,1c
2,2a,2b,2c
3,3a,3b,3c

Select the whole text, then type “Alt+x table-capture”. It'll ask you these questions:

  • Column delimiter regexp
  • Row delimiter regexp
  • Justify (left,center,right)
  • Minimum cell width

To enter a tab character (ASCII 9) in the minibuffer prompt, type “Ctrl+q Ctrl+Tab”. To enter a newline literally, type “Ctrl+q Ctrl+j”.

Note: Emacs always represent newlines in buffer using the unix convention of the Line Feed (LF) char (ASCII 10). To enter the LF literally, you type “Ctrl+q Ctrl+j”. You don't have to worry what operating system convention for newline is used in your file.

Using Table Menu

emacs table

Use the Menu!

Once you have created a table, you can use the menu to do things. The menu “Table” will appear when your cursor is on a table cell.

If you prefer using commands, you can type “Alt+x table-” then press “Tab” to see a list of all commands.

Some of the most useful are:

table-insert-row
table-insert-column
table-delete-row
table-delete-column

table-generate-source      output to HTML, LaTeX, CALS
table-release              output to sepace separated values & lines

Generating Output

To generate output for your table, pull the menu “Table‣table-generate-source” or type “Alt+x table-generate-source”. Then, you can choose one of html, latex, or cals (a XML based one).

To output to space delimited values, use call table-release.

(info "(emacs) Text Based Tables")

a new feature in emacs 23

perm url: http://xahlee.org/emacs/modernization_find_replace_multi.html

Emacs Suggestion: dired-do-query-replace-regex Replace ALL

Xah Lee, 2008-05

[Note: The following is a suggestion sent to FSF official emacs bug channel, on 2008-05-17, as bug 267. This suggestion is implemented in emacs 23.1, released on 2009-07. See New Features in Emacs 23.]

Emacs suggestion:

when in dired mode in the processing of doing dired-do-query-replace- regexp (shortcut Q), it offers the ability to do replacement without asking on the current file, by pressing the ! key, but it would be nice to have:

  • (1) the ability to do ALL replacements on ALL files without further asking.
  • (2) the ability to not do any replacement on the current file.

I use dired-do-query-replace-regexp few times a week, typically on tens of files, but maybe once in a month i do it over hundreds or thousands of files on a website.

Often, after some replacement, it becomes obvious that it is safe to do ALL replacement for ALL files. When this is needed, typically i can just hold down the ! key. But when the number of files is hundreds or more, typically there will be several 5 second delays where i assume emacs is doing garbage collection. The bottom line is that, holding down ! is not a good solution because i end up having to wait a total of maybe 20 or 30 seconds during the whole operation.

For this reason, i often abort the operation, then switch to a perl or python script i've written that does blind find/replace on all files. This will finish the job on thousands of files within 5 seconds. But I couldn't reply on this since often i need interactively see and confirm the replacements, which emacs provides. (emacs also lets me view the change file afterward or decide to save them... etc, which i won't be able to do with perl...)

So, it would be nice, if emacs's dired-do-query-replace-regexp offer the option to do all replacement on all files.

Perhaps this can be introduced as pressing the @ key.

For suggestion item (2), the scenario is that sometimes i have a big file and it is apparent that i don't want any replacement to happen on that file. As things are, i have to repeatedly pressing n while paying attention not to go over to the next file. This is a tiring process.

dired-do-query-replace-regexp is very nice and i've been using it for 2 years. For just tens of files the above isn't a problem. But when doing few hundred files, and on tens of replacement pairs (i.e. using dired-do-query-replace-regexp tens of times, each time on hundreds of files), the above features seems a very good one to have. It seems also a logical feature complementing the various recursive edit and edit-replacement-text currently provided by emacs.

PS some background... I'm doing on static websites, which has few hundred or thousand files, such as systematically changing a style markup, etc. In the past 2 days, i spent entire 2 days using dired-do- query-replace-regexp (in combination with perl and python script).

Thanks.

2009-08-25

tidbits

tidbits.

futuristic city

More Second Life screenshots: Second Life Futuristic Cities. (virtual world; tech)

abyss 001

Update: Exotic Architectures in Second Life. (virtual world; tech)

amputee furry 001

A amputee furry. Added to: the Glorification of Female with Limblessness.


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

For some commentary, see bottom of: The TeX Pestilence.

Looking for a day job now. Xah Lee's Resume 2009.

2009-08-24

emacs unicode on the Mac

perm url with updates: http://xahlee.org/UnixResource_dir/writ/mac_emacs_unicode.html

Unicode: Carbon Emacs 22 vs Emacs 23

Xah Lee, 2009-08-15

Emacs 23 has just been released last month. One major news is that emacs now uses unicode utf-8 as its char representation internally (as opposed to a hacked up internal encoding used previously). This is a major improvement in unicode support. Also, Carbon has been deprecated in emacs CVS, supplanted by the Cocoa branch.

However, on my old Mac, it seems the Carbon Emacs is quite superior from common user perception.

Carbon emacs 22 unicode NeXTStep emacs 23 unicode

Carbon Emacs 22 (left) and Emacs 23 on Mac (right).

The left is “GNU Emacs 22.2.1 (powerpc-apple-darwin8.11.0, Carbon Version 1.6.0) of 2008-04-05 on g5.tokyo.stp.isas.jaxa.jp”.

The right is: “GNU Emacs 23.1.1 (powerpc-apple-darwin8.11.0, NS apple-appkit-824.48) of 2009-08-04 on xahg5.local”.

My Mac is 1.9 GHz PowerPC G5, running Mac OS X 10.4.11. The machine is about 4 years old, it is the last Mac with PowerPC. The OS is also one major version old.

There are no customization for emacs 23 above. It is using a Mac OS's font “Manaco”, size 14.

The Carbon Emacs is using the following setup picked up from years before:

; make available extra CJK-font for carbon emacs in the menu
(if (eq window-system 'mac) (require 'carbon-font))
; about carbon emacs fonts, see:
; /Applications/Emacs.app/Contents/Resources/site-lisp/mac/carbon-font.el
(if (featurep 'carbon-emacs-package)
 (fixed-width-set-default-fontset
   "-*-*-medium-r-normal--14-*-*-*-*-*-fontset-hirakaku_w6"))

You can download the above file here:unicode.txt. (content may not be exactly the same as shown in the screenshot)

Conclusion?

I'm not sure what to conclude from this. Apparently, my old Carbon Emacs is superior as far as rendering unicode at user level. I wonder it's because i haven't done research to pick the right font for emacs 23, or perhaps i need to define a emacs's concept of fontset, or, is this actually due to a tech immaturity of the Cocoa engine or emacs implementation in Cocoa? Because i've heard complains on the net that ditching Carbon in emacs CVS is a mistake.

PS Since my mac and OS is few years old, both Carbon Emacs and Aquamacs Emacs has dropped support for about over a year, so i haven't tested their latest. Is current version Carbon Emacs or Aquamacs actually run on cocoa code base from emacs 23?

Could anyone download this file unicode.txt and show screenshot in their current Carbon/Aquamacs Emacs?

2009-08-18

Several people has wrote to me. It appears, that current Carbon Emacs on 10.5 shows all the chars, and GNU EMACS 23 on 10.5 also does. I'm pretty sure Aquamacs Emacs do as well.


Related essays: