2010-05-01

Knitting, Chinese Knots, Braid Theory

Perm url with updates: http://xahlee.org/math/math_knitting_chinese_knots.html

Knitting, Chinese Knots, Braid Theory

Xah Lee, 2010-04-30

Am fascinated by the math aspects of knitting... e.g. the pure math aspect of how those threads are inter-woven, such as in Braid theory.

knitting red courses stockinette garter

Knitting. Source

cable knitting

Cable kniting. Source

Besides the math aspect of which thread are intertwined with which other threads in what way, it is also possible to create a pattern on the surface. What such patterns are possible, how are they made, must by itself be a complex theory.

Serweta-na drutach2-s

Lace tablecloth made using knitting needles. Source

Chinese Knots

Also related is Chinese knotting.

chinese knot1

Chinese knot. Source This one has the characteristics of fractal.

9chinese-knot

Chinese knots. Source

chinese knot 7-luck

Chinese knot. Source

Chinese butterfly knot

Chinese knots. Source

Discovered this fantastic book, free: 《ENCYCLOPEDIA OF NEEDLEWORK》 (1884), By Thérèse De Dillmont. At Source.

It provides in-depth coverage, with hundreds of clear illustrations, many of which shows the pure weaving beauty of math.

Basket Weaving

weaving trad1

A weaving pattern (Wickerwork) commonly found in Asian chairs made of rattan.

Celtic Knots

Celtic knots pattern
Celtic knots strip

A traditional Celtic pattern (by Alastair Luke) The colorings are added on to make it easy to trace. In fact, the whole central cross with its round endings is of one single string. I just used different colors for different segments because otherwise it's one single color.

Decorative Weaving Patterns

knots pattern disc weaving pattern star

Left: From “Islamic Designs for artists and craftspeople”, by Eva Wilson, 1988. Above right, from a book.

knot tiling-mag-d4

Computer generated weaving as decorative art. Source: knotplot.com.

This image shows the modern approach of possibilities on the subject of weaving. Note that many of the threads are closed circles, as links. A weaving made of entirely links is not explored in knitting, fabric, or any sort of weaving artifact, simply because it is not practical. However, as modern material science, this is a new vista. Or as mathematical classification of weaving, this have not been studied much, if at all.

Also, when we consider the math aspects of links, knots, weavings, we think of topology. That is, how each thread or inter-woven with other threads. However, weavings as a decorative art, the geometric positioning, is a critical part of the work.

Hyperbolic Surface Crochet

Unrelated to math aspects of weaving, but saw this the other day. Knitting a hyperbolic surface.

crochet hyperbolic surface

Knitting that forms a hyperbolic surface. Source

Actually, the person who knitted this is Daina Taimina, a mathematician, and she has written a book. 《Crocheting Adventures with Hyperbolic Planes》 (2009), by Daina Taimina. amazon

Little Math Research

As far as i know there's not much serious mathematical study on knitting, Chinese knots, weaving, as a math subject. By that, i mean, definition, analysis, theories, of weaving from a professional mathematician, as a sub-field of combinatorial geometry, on what weaving are possible, their classification, etc. Not, for example, studies on how to create such work, or survey of abstract patterns on existing artworks, from artisans or artists or anthropologists, or algorithms about how to create such patterns by computer programers.

I've only seen some research papers by Branko Grünbaum and G C Shephard on the weaving studies. e.g. 〈A Catalogue of Isonemal Fabrics〉 (1985), Branko Grünbaum and G C Shephard, “Discrete Geometry and Covexity” vol 440.

Note that, among related folk arts, today there are relatively a lot math study of paper folding.

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

2010-04-30

Keyboard Shortcut Design

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

Keyboard Shortcut Design: Dedicated keys, Special Buttons, Extra Keys

Xah Lee, 2010-04-30, 2010-06-13, 2011-03-06, 2011-05-27

Spent few hours obsessing with key shortcut design again. Re-organizing my 100+ shortcut keys among applications, re-wrote and organized my AutoHotkey scripts, created a page of AutoHotkey example scripts: AutoHotkey Example Scripts, much time spend on thinking about the shortcut design.

For example, in a keyboard shortcut system, there are issues of global keyset, and keyset local to applications, and there are standard typing oriented keys (e.g. a b c, 1 2 3, ! @ # etc.), special function keys (e.g. F1 F2, PageUp, PageDown, etc), specialized buttons (such as those buttons and knobs of multimedia keyboards). Then, there's also several key software systems, those from OS (e.g. 【Win+e】, 【Win+l】, …), and keyboard driver (e.g. IntelliType ), and specialized macro/launch software (AutoHotkey), and some are ah-hoc from registry… the whole thing is a very complex shit. (bringing in other OSes, Mac OS X, Classic Mac, Linux, X11, makes it more complex)

Here's few thoughts from my experience i learned in recent months.

Button-Styled Keys Are a Pain

Those special buttons on keyboards, such as those multimedia keys on The Microsoft Natural Ergonomic Keyboard 4000, are a pain in the ass to use. They lack tactile feedback.

For example, consider these tasks: ① switching to next/previous tab in a browser ② switch next/previous app ③ changing sound volume. A hotkey for these purposes, are used many times per hour, and often needs to be pressed multiple times in a few seconds. For a key that needs to be pressed frequently or repeatedly, you should not assign them to those button-styled keys.

The problem of button-styled keys are:

  • Hard to locate without looking.
  • Takes much more pressure to press.
  • Hard to know if you pressed them successfully.
  • Feels bad on your finger like ramming into concrete.

I thought of using these special buttons for application specific functions. Because they stand out as a set of special buttons. So, for example, the 5 “My Favorites” buttons in the Microsoft 4000 keyboard can have different purposes depending if i'm in a web browser, Second Life viewer, in Emacs, or in OS file manager (e.g. Windows Explorer, Mac Finder). But after a while, i discovered that this is not a good approach due to these button's hard-to-use factor. Because, if the function is frequently used, then pressing these keys is inconvenient, as compared to say F5 to F8.

Critical Principle: Frequency of Use to Ease-To-Use Keys

Another experience i gained in the past few months is that, you really want the most frequently used functionality to be at the most easy-to-use keys, even if that means breaking certain consistency.

When designing a system of what functions get mapped to which keys, one of the aspect to consider is to put the most frequently needed functionality to the most easy-to-press keys. Easy-to-press here considers key position (e.g. home row keys are easier than F keys; 【Alt+a】 is easier than 【Ctrl+a】), as well key physical type (e.g. button styled keys are bad), and also single key or key combination (a is easier than 【Ctrl+a】 or 【Ctrl+Alt+a】). For a example of this design principle, see: ErgoEmacs Keybinding.

However, there are other considerations. For example, consistency. For example, you might have all F keys for one of the following group of tasks:

  • All F keys are for launching applications.
  • All F keys are for global system-wide purposes.
  • All F keys are application specific.
  • All F keys are related to manipulating window or app (e.g. launch/switch to a app, changing window size, hide app, close window … etc.

The F keys in the above examples could be another set, such as all Alt+‹number› set, or all Alt+‹letter› keys, or keys on the numeric keypad as a set. Or, perhaps you might think that all Alt+Ctrl+‹letter› space should be for a particular family of related purposes. Or, all keys involving the Tab should be related to having some next/previous concept, such as switching to input fields or switching applications. Or, all keys involving the Shift modifier should mean reverse the functionality, such as Cmd+z for undo and Cmd+Shift+z for redo on the Mac as well in many applications in Windows and Linux. There are really quite a lot of such design approaches about key set consistency.

Consistency is important because they make the keys easier to remember.

I realized, that in my 20 years of keyboarding obsession, that you can pretty much throw all these thoughts out of the window. The above design approaches are not practical, because there are too many conflicting interests, and the other aspects are often more important.

For example, let's say you put all F keys to launch apps. However, most people only use few applications daily, not 12. So half of the F key spots would be wasted. But suppose you did put all 12 F keys to launch 12 apps. Now, what you gonna do with 【Alt+‹Fkey›】? Should it all be system wide, or they should all be app specific, or should they all be related to manipulating windows, or should they all be related to navigation? … Once you decided a consistent scheme for 【Alt+‹Fkey›】, then what about 【Alt+‹letter›】 keys? What consistency scheme can you assign to that? Then what about 【Ctrl+‹Fkey›】 set? or 【Win+‹Fkey›】 set? Then what about 2-modifier combinations? You can see that your consistency scheme can be only consistent to some artificial degree, yet making a lot sacrifise to key spots and practical uses.

Part of the reason is because that the keyboard hardware itself is lousily designed. The PC keyboard we use are evolved from typewriter machines and computers of 1960s and 1980s, and it evolved very slowly. It is nothing of a coherent design. Similarly, computer software, their interface, also evolved, but changing much faster than keyboard hardware changes. The shortcuts we have today are much result of this rather incoherent co-evolution.

I find that, given today's PC keyboard and the software applications, the most critical principle is simply to put the most frequently needed functionality to be the most easy-to-press keys. This is more important than maintaining consistency, in general.

Single Key is Much Better than Combo Keys

Also, i found, that the advantage of single key shortcut over combo keys is much significant than i thought.

I realized, you want to use single key shortcut as much as possible, than maintaining some consistency by using combo keys.

For example, say that F6 is launching the Firefox browser. I use at least 3 browsers daily, because i am a web developer. I might think, that F6 launches Firefox, and 【Ctrl+F6】 launches Microsoft's browser, and 【Alt+F6】 launches Google Chrome web browser. The idea is that the F6 is always associated with launching a browser. This keeps all the hotkeys slightly consistent and easier to remember. My experience tells me that, if these functions are needed frequently (say, even just once per 10 min on average), forget about consistency, single key hotkeys is much more convenient. (So, here it would be better to have F6, F7, F8, to launch each browser.)

The logical analysis of this experience seems to be that, some consistency in hotkey placement is important when learning the hotkey spot initially, but you need to actually press these days daily and repeatedly, for years. Once you learned, it's part of the muscle memory. Over all, it is more important that the repeated operation be convenient. This advantage beats the slight disadvantage in initial learning about where the key is.

There are quite a few examples of this. For example, i have a hotkey that allows me to switch next tabs in all different browsers. (by default, IE, Firefox, Opera, Chrome, do not all have the same hotkey for switching to next tab. It's either 【Ctrl+Tab】 or 【Ctrl+PageDown】) So, suppose i decided i want 【Alt+l】 vs F8 for this function. 【Alt+l】 (that's lowercase L) has the slight advantage that it's under home row, but 2 keys. F8 is just a single key, but with slight disadvantage that user needs to move hand a bit to reach it. Before, my thought on this is that there's no significant advantage of one over the other in general. But now i think the single key choice is definitely better. How much better the single key choice is proportional to how frequently this hotkey needs to be pressed.

Problem with Combo Keys

More than 95% hotkeys in any app in Windows or Mac or Linux are all combo keys. This is because there are only a handful of single keys (e.g. F1 F12 Ins Del Home End PageUp PageDown PrtScn ScrLk Pause, …), when these are used up, you are forced to use a combo, involving Alt Win Ctrl Shift ⌘ Cmd modifiers.

I've realized, that singe key is much more advantageous.

The problem with combo keys is that, with so many apps that we need to use today, the combo keys quickly get confusing, and very quickly becomes hard to remember, and they are much less ergonomic.

My keyboard the Microsoft ergo 4000 has 18 extra special buttons. They are all used up by me, with custom functions, and is NOT ENOUGH.

I think a scientific study can confirm this. If you survey computer users, say college educated adults so we exclude dumb old grand parents, i think you'll find that most don't know or use or care about the vast majority of combo shortcuts, except maybe a few critical ones that are frequently used.

If we were to redesign keyboard, it'd be a good design to have say 20 more function keys. So, besides 12 F keys, another 12 named G1 to G12 key, and another set H1 to H12. Common functions, such as Help, Undo, Redo, Copy, Cut, Paste, New, Open, Close, Save, Print, must all have a single dedicated key with proper labels on them. Also, several special pairs of keys for prev/next Window/Tab, and pre/next field. A dedicated key that toggles max/min window. (for such a design, see: Ultimate Xah Keyboard Layout)

Have you seen those Cash register machines at local store? They have several array of keys. I think the design of such machine makes the point. If the key needs to be used repeatedly, you'd want to have lots of dedicated keys, even if some keys may be used infrequently. You don't want key combos.

Sharp cash register er a510

Cash Register machine. All single-keys for functions. img src

Add Dedicated Keys to Your Computer

Fentek's X-Keys

The company fentek-ind.com sells many usb keypads that adds programable keys. One of their most popular is a X-keys strip, that is a row of 16 keys. They also sell other larger keypads that has 24, 35, 58 keys.

X-Key programmable key stick

Fentek's X-keys Programable Key Stick. It adds 16 programable keys. (~$100) amazon

fentek X-Key kp20 fentek X-Key kp20 key labels

Fentek's 20-key pad. (~$120) amazon

Logitech's Gameboard

Logitech sells a “gameboard”, that adds about 20 programable keys. For full review, see: Logitech G13 Advanced Gameboard.

logitech g13 gameboard

“Logitech G13 Advanced Gameboard” (~$70) amazon image source

Though, due to the shape of this device, it is not suitable for normal computer operation. Because, it is designed to be operated when your left hand is resting on it. Unless you are playing games, you can't have your left hand rest on this at all times. To press the key without your hand on it, the device surface is slanted in a way hard to see or use.

2010-04-29

comp.lang.lisp is 95% Spam

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

comp.lang.lisp is 95% Spam

Xah Lee, 2010-04-23

today, comp.lang.lisp is 95% spam.

let's help save it. Regardless what newsgroup readers you use, when you do your daily newsgroup reading, please take 15 seconds to go to: http://groups.google.com/group/comp.lang.lisp/topics

then, click on the “Report as spam” for the 10 spam posts that shows on the first page.

Thanks.

  Xah
∑ http://xahlee.org/

☄

2010-04-27

yes i agree that google care, and do something about this.

The click spam feature was added recently, perhaps 6 months ago, that indicates they do care, even if it is not that effective.

also, how effective it is depends of course on how many people report spam. For groups like comp.lang.lisp, many are old timers, don't use google, and the readership is already comparatively very small. So, it can get worse.

another thing might be interesting is that the spam rate seems to depends on the newsgroup too. For example, comp.lang.lisp is now 95% spam, but however, comp.lang.python gets almost no spam at least as shown in google group. This probably has to do with number of users, and also that comp.lang.python is mirrored with python's mailing list.

technology marches on by changing needs. In the 1990s or before, newsgroup is effectively the only medium and technology of subject oriented online forum. (besides a few commercial ones, e.g. CompuServe) Thru the years since 1990s which i personally lived thru, other tech of communication came into being that became widely adopted, roughly in chronological order: mailing lists, irc, faq-o-matic (a pre-cursor to wiki), Instant messaging, blogs, wiki, social network sites, youtube, twitter, and today much of these are all intermingled and inter-connected. For example, much sites that do any type of communication often has mailing list, web feed (rss/atom), web interface, instant messaging, all together as one integrated technology, not as much as independent technologies. (e.g. facebook, much of google's many services) Voice and video chat and conferencing is today almost everywhere too.

one point i would like to note that is, if google didn't provide the newsgroup service in 2001 (or the DejaNews didn't start it), newsgroup might have gone the ways of dinosaur, much like many unix net tech such as who, talk, finger, gopher.

  Xah
∑ http://xahlee.org/

☄

Originally posted to comp.lang.lisp at: Source

2010-04-28

Emacs Shortcut to Delete Whole Line

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

Emacs Shortcut to Delete Whole Line

Xah Lee, 2010-04-28

I've been using the ErgoEmacs Keybinding for 3 years, and have spent hundreds of hours thinking about efficiency of commands and shortcut choices.

Today, it came to my mind that a shortcut to delete the whole line, is actually quite useful. Because, i noticed that i'm tired of having to move cursor to beginning of line first then kill. The problem is made worse by the fact that kill-line does not kill the line ending. So, to delete a line in emacs, you have to move cursor to the beginning first, then do kill-line twice, a total of 3 operations. In GNU Emacs, the key presses are C-a, then C-k, C-k. (In vi, it is just a single operation, done by pressing “dd”.)

Define a Shortcut to Delete Whole Line

So, personally, i made a shortcut to kill the whole line. Like this:

  (global-set-key (kbd "M-9") 'kill-whole-line)

This is actually part of a personal set:

(defun xah-define-alt-num-hotkeys ()
  "define some Alt+num shortcut keys."
  (interactive)
  (global-set-key (kbd "M-3") 'insert-xah-url)
  (global-set-key (kbd "M-7") 'copy-file-path)
  (global-set-key (kbd "M-6") 'run-current-file)
  (global-set-key (kbd "M-9") 'kill-whole-line)
  (global-set-key (kbd "M-^") 'run-current-java-file)
  )

Note that “M-8” is used by default in ErgoEmacs for extend-selection.

Note that kill-whole-line command exist by default in emacs, you don't need to code it.

Make kill-line Delete Line Ending Char

Also, If you want kill-line to kill including the line ending char (from the cursor position), all you have to do is set a variable named “kill-whole-line” to true, like this:

(setq kill-whole-line t)

Note: the variable kill-whole-line doesn't have anything to do with the function of the same name. Yes, in Emacs Lisp, you can have a function and variable both sharing the same symbol. Common Lisp is also this way.

Issues of Efficiency and Design

For a command that delete line, there are several issues.

  • Delete from cursor position to end of line.
  • Delete from cursor position to beginning of line.
  • Delete the whole line the cursor is on.
  • Whether the ending line return char is included.

The problem with including the line ending when deleting a line is that, when you paste the line, often you do not want the line ending as part of the paste. I have not made statistical study of this. This is just my gut feelings.

Suppose that my assumption about the ending char issue is correct, then it could be fixed. When deleting a whole line, the kill-ring's copy do not include the line ending, except when there are multiple sequence of kill-line operations. Of course, this solution is getting complicated, breaks the consistency of how deleted text is copied to the kill-ring. So, overall, i think this isn't a solution.

Also, now consider keyboard shortcuts. Shortcut spots are precious. Line deletion related commands that we can consider to add a shortcut are: kill-line, kill-line-backward, kill-whole-line, and also a version of each that includes the line ending char except kill-line-backward, so there are total of 5 commands. Let's say only 2 of these commands can have prime shortcut spot, which 2 should we choose?

This requires some research. For example, by starting with myself, trying each 2 choices, or by testing by many other people, and over all by statistical data.

In ErgoEmacs, there are 2 shortcuts to delete line, they are simply kill-line and kill-line-backward, with key “Alt+g”, and “Alt+Shift+g”. The kill-line do not include line ending char.

Perhaps, a alternative choice would be kill-whole-line for “Alt+g”, and kill-whole-line with line ending char at “Alt+Shift+g”.

From my experience, kill-line-backward isn't frequently used, and kill-whole-line is more frequently needed than kill-line. So, i think that emacs would have been more efficient if kill-line's semantic was kill-whole-line.

Now having spend a hour writing this out, i think it's actually worth-while to try remapping kill-line to kill-whole-line to test things out. But, this would be a pain, because then i'll have to spend weeks changing my muscle memory, and if things didn't work out, i'll have to change and relearn back. And if i found kill-whole-line to be more efficient than kill-line, i probably won't change ErgoEmacs keybinding because that would break some compatibility issue with emacs. So, this would be mostly to satisfy a curiosity. For now i'll just see how my “Alt+9” works out.

Another related issue is that, emacs's text deleting commands automatically place deleted text into its clipboard the kill-ring. This is different from modern text editors, which only put things in clipboard when user explicitly calls the copy command. In the past i've wondered if this emacs way is actually more efficient. I made some study of it, reported here: The Operative Efficiency of Emacs's Deleting Text to kill-ring.

PS i've spent perhaps over a thousand hours over past 20 years fuzzing about keyboarding. Efficiency is my obsession. See: All About Keyboards, Keyboard Layouts, Shortcuts, Macros.

AutoHotKey Key Notations

Perm url with updates: http://xahlee.org/mswin/autohotkey_key_notations.html

AutoHotKey Key Notations

Xah Lee, 2010-04-28

This page is a list of notations for AutoHotKey. If you not sure what AutoHotKey is, see: AutoHotKey Basics.

Basic Key Syntax

Here's the basic syntax. This should be enough most of your needs.

#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
^F6::Run Notepad    ; Ctrl+F6
^!n::Run Notepad    ; Ctrl+Alt+n

Key Syntax

Here's a complete list of AutoHotKey's key syntax.

F Keys

The syntax is F1, F2, F3... etc, to F24.

Space, Tab, Enter, Home, End, Arrows ...

Space
Tab
Enter (or Return)
Escape (or Esc)
Backspace (or BS)
Delete (or Del)
Insert (or Ins)
Home
End
PgUp
PgDn
Up
Down
Left
Right
ScrollLock
CapsLock
PrintScreen
CtrlBreak
Pause
Break — Since this is synonymous with Pause, use ^CtrlBreak in hotkeys instead of ^Pause or ^Break.

Help — does not exist on most keyboards. This is not the same as F1.

Numberpad Keys

NumLock
Numlock ON  Numlock OFF
Numpad0  NumpadIns
Numpad1  NumpadEnd
Numpad2  NumpadDown
Numpad3  NumpadPgDn
Numpad4  NumpadLeft
Numpad5  NumpadClear
Numpad6  NumpadRight
Numpad7  NumpadHome
Numpad8  NumpadUp
Numpad9  NumpadPgUp
NumpadDot (.)  NumpadDel
NumpadDiv (/)  NumpadDiv (/)
NumpadMult (*)  NumpadMult (*)
NumpadAdd (+)  NumpadAdd (+)
NumpadSub (-)  NumpadSub (-)
NumpadEnter  NumpadEnter

Modifier Keys

AppsKey — aka Menu key

LWin — left Windows logo key
RWin — right Windows logo key

Control (or Ctrl)
LControl (or LCtrl) — left Control key
RControl (or RCtrl) — right Control key

Shift
LShift — left Shift key
RShift — right Shift key

Alt
LAlt — left Alt key
RAlt — right Alt key

<^>! — Alt Graph key. Usually equivalent to “LControl & RAlt”.

Notes:

  • There is no generic "Win" key because the OS does not support it.
  • When your script uses “Shift”, “Alt”, “Control”, they fire upon release of the key. To make them fire on press, put a tilde in front, like this: “~Alt::...”. By contrast, a specific left or right hotkey such as LAlt:: fires when it is pressed down.

Multimedia Special Keys

The following are special keys on keyboards.

Browser_Back
Browser_Forward
Browser_Refresh
Browser_Stop
Browser_Search
Browser_Favorites
Browser_Home

Volume_Mute
Volume_Down
Volume_Up

Media_Next
Media_Prev
Media_Stop
Media_Play_Pause

Launch_Mail
Launch_Media
Launch_App1
Launch_App2

Sleep

References

meta gaming company: Steampowered.com

Perm url with updates: http://xahlee.org/sl/blog.html

Thinking about it, i actually haven't played ANY massive online games except Second Life. In fact, the last 2 games i remember played on PC is American McGee's Alice, and that is in around 2000.

(am 42, and in my teens and 20s and 30s, i surely have played lots of video games. Basically, my gaming behavior is like addiction. When i got into a game, i'd play it for weeks EVERY MINUTE WHEN I'M AWAKE, even skipping food, rush to bathroom, or went sleep deprivation, till i mastered it thoroughly. Then, usually guilt overcame me for playing video game so much, and i'd swear never to play game again. I'd not play another video game for half a year or a year, or longer especially when i get older.)

Though, in the past 3 years while spend several hours in Second Life almost daily, i learned tremendously about the online gaming community today. (note that massive multi-player online games is only a phenomenon say after 2005, because before the internet, net speed, and technology, simply isn't there) Today, i learned about Steampowered.com. Here's a Wikipedia quote:

Steam is a digital distribution, digital rights management, multiplayer and communications platform developed by Valve Corporation. It is used to distribute a large number of games and related media entirely over the internet, from small independent efforts to larger, more popular games. Steam is set apart from similar services primarily by its community features, completely automated game update process, and its use of in-game functionality.

There are over 1,100 games available through Steam,[3] and in January 2010 Valve announced that it had surpassed 25 million active user accounts.[4] It regularly services in excess of two million concurrent users.[5] Although Valve never releases sales figures, Steam is considered by its competitors and clients to be the market leader, controlling an estimated 70% of the digital distribution market.[6]

See also: Introduction to Second Life.

2010-04-27

How to Use Windows Search

Perm url with updates: http://xahlee.org/mswin/Windows_search.html

How to Use Windows Search

Xah Lee, 2010-04-27, 2010-08-20

This page explains how to use Windows Search, and also some tech details for programers.

Had quiet a fruitful reading on Windows Search. Here's are some interesting highlighs. (am using Windows Vista)

Using Windows Search

Ways to Start Windows Search

There are several ways to bring up the search box.

  • Press the Win key. Type search word, then press Enter.
  • Win+F” brings up the search panel.
  • The upper right corner of folder window. (press “Win+E” to bring up a folder, then press “Alt+D” to put focus on path field, then press Tab to go to the search field.)
Windows search

The Start Menu has a search box. You can use it to search or quickly launch programs.

Advanced Search and Options

Windows search options

Search options. To get options, do a search, then click on the Advanced Search on the upper right.

Search location can be set. Also, what type of file to search. Which files to index. Or, whether to search only indexed files.

When doing a search, you can also choose date range, file type, size, and “AND”, “OR”, “NOT” operation on words.

Saving Search

Search query can be saved. To save, just click on the Save Search in the bar.

Setup Index Locations

You can choose what folder or drive Windows will index. You can stop it from indexing usb drives.

Windows search tools

The Search Tools button lets you set options.

To choose which folder or files to index, first do a search on some random word, then in the search result page, there will be a Search Tools button. Click on it. You'll get a “Modify Index Locations...”. Then, you'll get a dialog.

Stop Indexing USB Drives or Sensitive Files

Windows search index loctaion dialog Windows search index loctaion dialog2

The index location dialog.

The dialog is not very intuitive. Click on Modify, then click on “Show all locations”.

There, you can set which folder, file, drive, that you do NOT want to index. A check mark means it won't be indexed.

Stop Indexing Zip files

In the above, you can also set it to not index any file with a particular file suffix, such as “.zip”. Click on Advanced button.

Rebuilding Index; Changing Index Cache File Location

After clicking on the “Advanced” button, there you can also click on the “Rebuild” button to re-index. (may take hours, but runs in the background.)

Tech Detail for Programers

Windows Search is a modern search engine. First it index your files by words into a database. So, when you use search, it can quickly show you files that contain that word.

The Windows Search pane is a virtual folder named “search-ms:” or “Search Results”.

Understand File Formats

In order to do indexing on various type of files such as Word document, spreadsheets, PowerPoint file, html docs, MP3, image files, OutLook data files, IE cache... it need to be able to understand the format. Microsoft's technology for this is called IFilter. It functions as a component. When a IFilter for a particular file format is installed, search can understand the file and extract words from that file or indexing.

Search Database Location

The location of the database by default is at: “C:\ProgramData\Microsoft\Search\Data\Applications\Windows”.

2010-04-26

mac os x: secure delete, tar/gzip with resource fork

Discovered that on Mac Os X 10.6, tar, gzip, gunzip preserves resource fork by default. Updated at: Mac OS X Resource Fork and Command Line Tips.

Discovered that on the Mac, to securely delete files, just use the builtin command srm, like this: “srm -r -s dir_path”. For detail, see: Secure Deletion, File Shredding, on Windows, Linux, Mac.

What is the Difference of Formalism, Logicism, Axiomatic System?

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

What is the Difference of Symbolic Logic System, Hilbert's Formalism, Russell's Logicism, Axiomatic System?

Xah Lee, 2007-08-21, 2010-04-26

This short essay explains the difference of Symbolic Logic System, (Hilbert's) Formalism, in today's math foundation context, and the meaning of today's common math practice of using axioms as a foundation, its relation to logicism and formalism.

Logicism

Logicism, a Symbolic Logic System as foundation of math, is today known as Mathematical Logic. It went thru several names in recent history as the subject matured: predicate logic, first order logic, symbolic logic, mathematical logic. As such, it is effectively a study of Formal Language systems. A Formal Language basically means starting with some “symbol strings” called “axioms”, and with given rules to derive more symbol strings called “theorems”.

Formalism

Formalism in our context, is basically the beginning of the study on mathematical logic, in particular Hilbert's own idea of it, his perspective of mathematics as form manipulation. Today, it basically refers to the idea of inference rules, also known as production rules, string transformation, term rewrite system.

Difference of Logicism and Formalism

Russell's Logicism, again, is also a early conception of mathematical logic studies. In particular, Russel's logicism is he and Whitehead's work on the foundation of mathematics as a logic system. Now, in our context, we want to know what is the relation between Mathematical Logic and Formalism. Basically, today, not much. They are just 2 aspects/emphasis of the same studies. “Mathematical Logic” refers to the study of Formal Languages, while Formalism refers to the philosophy or practice of using Formal Language as a foundation or approach to doing mathematics.

Axiomatic System

Now, Axiomatic System, is pretty much the odd man out here in our context. A axiomatic system in mathematics, pretty much means a math subject done by developing from a set of axioms. It is primarily a approach to rigor in mathematics. A math done axiomatically, does not necessarily mean it is done in a mathematical logic or formalism style. Often, it is done using Set Theory as a foundation. Now, what's the relation of Set Theory to Mathematical Logic? ... they are somewhat disparate subjects... usually have different contexts.

What Is the Difference of Math Notation and Formalism?

2007-08-21

It turns out, there is a active academic community that shares the exact concerns i had. Namely, it is mostly part of the community who advocate “Calculational Proofs”. And, a notable major figure is Edsger Dijkstra (1930-2002). This community is also associated with the community of doing automatic theorem proving. In fact, a systematic formulation of math notations for formalism/“calculational proofs” have been presented.

References:

  • “How Computing Science created a new mathematical style”. (1990) By Edsger W Dijkstra. EWD1073
  • “Under the spell of Leibniz's dream” (2000) By Edsger W Dijkstra. EWD1298

2010-04-25

How to Define Optional Parameters in Emacs Lisp

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

How to Define Optional Parameters in Emacs Lisp

Xah Lee, 2010-04-25

A little tip on emacs function's parameter features and syntax. If you don't know the basic of elisp, you should read Emacs Lisp Basics first.

Use “&optional” for Optional Parameters

Emacs's function parameter's features and syntax is very basic. It is simply a list of items. If you want optional parameters, just add “&optional” in your parameter. Any parameter after that will be optional. Here is a example:

;; defining a function with 2 optional params cc and dd
(defun myfun (aa bb &optional cc dd)
;...
)

When you call this function, aa and bb are required, cc and dd are optional. When a optional parameter is not given, its value is “nil”. If you want to give a argument to some optional parameters but not all, use “nil” for those you don't care. For example, to call “myfun” in the above with a argument for “dd” but you don't care for “cc”, like this:

(myfun "myaa" "mybb" nil "mydd")

Emacs lisp function do not support named parameter, nor any sort of parameter type checking.

Optional Parameter in Documentation

Inline doc of a function also show optional parameters the same way. For example, type “Alt+x describe-function” then give search-forward, and the output is:

...
(search-forward string &optional bound noerror count)
...

This means the function takes 4 arguments, and the last 3 is optional.

Same in the elisp doc. For example, type “Alt+x elisp-index-search”, then “search-forward”. It shows:

 -- Command: search-forward string &optional limit noerror repeat
     This function searches forward from point for an exact match for
     STRING.  If successful, it sets point to the end of the occurrence
     found, and returns the new value of point.  If no match is found,
     the value and side effects depend on NOERROR (see below).

     ...

(info "(elisp) String Search")

“&rest” for Unspecified Number of Arguments

Elisp also support the need for unspecified number of arguments. For example, for functions like “+”, “message”, “concat”. It is done by adding “&rest” after the “&optional”.

(info "(elisp) Argument List")

Linden Labs Viewer Policy and New Viewers

2010-04-25

Linden Labs has created a new policy about third party viewers. Basically, viewers that does not respect their Term Of Service policy or does export items without respecting the permission system will no longer be able to login to Linden Labs's server. This policy is enforced starting on 2010-05-01. For detail, see: secondlife.com Policy on Third-Party Viewers.

They also have a page listing approved viewers at http://viewerdirectory.secondlife.com/. Currently there are 7 third-party ones. Some of these viewers have interesting features. For example, a text based viewer, viewer for cellphone (iPod, iPhone, Android), viewer for film makers and photographers (basically high-end rendering).

Note that Emerald viewer is compliant. I highly recommend the Emerald Viewer for power players.