Showing posts from April 29, 2012

Linux vs Minix

The current version of Linux kernel is 3.3.4. You can find out the version by uname -a.I didn't realize that when Linus did Linux, BSD wasn't legally free. (i always thought BSD was there already, free.)Following are good read, but will take 30 min at least, hours or days for understanding. Read the one by Andy Tanenbaum.Linux kernelMinixTanenbaum-Torvalds Debate: Part II2006-05-12 By Andy Tanenbaum. @ Source

emacs: improving key choices

in past few days, i made another majorish change to my emacs keybinding set.Now personal global commands start with F5. (used to be 【Ctrl+l】) Personal mode-specific commands start with F8. (used to be 【Ctrl+e】) (this is on Dvorak)the gist in the change is that i now use single key sequence instead of combination.over the years, i gradually switched almost all my most often used commands to single key or single key sequences, instead of combo keys or combo-key sequence.if you type a whole lot, and experiencing hand discomfort, then single key is healthier than combination keys, even if it means a fraction of second slower to reach the F keys.working in emacs now is like hunt'n'peck. LOLComputer Keyboards, Layouts, Hotkeys, Macros, RSI ⌨

music video updates 2012-05-04

Javascript DOM Scripting Pain: Whitespace Nodes

coding javascript+DOM is a pain in the, am not talking about using those jquery etc talking about js+dom raw.every whitespace in your html code is a node too, by spec. Say, you want to get nextSibling. But what you get is a text node of white space.This is a pain in the ass. However, there's also a advantage aspect. Because, this spec makes it possible to write a DOM processor that preserve the original formatting, including manipulating comments.(on the other hand, comment or formatting are lost in most lang's compiler. Suppose you want to write a most advanced {lint, pretty-printer, automatic code formatter}. You might think you'll just use the lang's compiler, since it knows everything about the language. But you can't! you kinda have to write a entirely different tool from scratch. Because the compiler is totally ignorant about the comments and formatting! (this includes so-called “lisp reader”) This also explains, auto formatting tools (aka…

Javascript: Navigating DOM Tree: previousSibling nextSibling childNodes firstChild lastChild parentNode

Perm URL with updates: page is a tutorial of Javascript navigating the DOM tree. This page show examples of using methods: {previousSibling nextSibling childNodes firstChild lastChild parentNode}.previous/next Sibling• ‹node›.previousSibling Return the previous sibling of ‹node›, or null if it doesn't exist.• ‹node›.nextSibling Return the next sibling of ‹node›, or null if it doesn't exist.When the sibling does not exist, the return value is null.test code: javascript test page: nextSibling nextSiblingWhitespace NodesNote: in most browsers, any space in HTML source code between tags are considered a node too. This is by W3C spec. So, typically, when you call nextSibling, you'll get a text node of whitespace. This is usually not what you want.Here's a example. In the following, we get a node's next sibling, and get its node type. If the nodeT…

Linux UI Overview 2012

Perm URL with updates:, am running lxde and xfce now.been also running xmonad, unity 2d, gnome 2. (and of course, 12 years ago, i've been running CDE, and bare x11 with a clock and xterm. lol)shit, am now a wm master!ok, now the judgement.Unity = mom and pop extreme shit with its software store shit.xmonad = SHIT. (any tiling wm is a inefficiency SHIT, by principle. +Craig Lennox n +Jeff Weiss's opinions not withstanding. ☺ )Gnome 2 = usable. Good.Xfce = usable. Good.LXDE = kinda bare threads. ugly font. The font in the default terminal (lxterminal) is one ugly face! (pun there) Probably due to bad anti-aliasing. LXDE's look'n'feel is kinda like Windows 95.I think Gnome 2 or xfce would be my choice, in general, i'm extremely a pure functional guy. I don't care for any “visual effects” shit (such as the compiz fuck), but if a visual effect do aids functionality in subtle and measuable ways (e.g…

TED2012: The only way to learn to fly is to fly

Perm URL with updates: you want to understand how, ask yourself this question, “What would you attempt to do if you knew you could not fail?” It's an uncomfortable question, because it forces you to realize that the fear of failure holds you back. The path to new and innovative things always contains failure, but we're constantly afraid of it — we have to get over that fear. Dugan quotes Clemenceau, “Life gets interesting if you fail, because it means we've surpassed ourselves.”from:TED2012: The only way to learn to fly is to fly2012-02-29 By Regina Dugan. @ Source

Linux: Great Image Viewer Applications

Perm URL with updates: This page gives a list of popular image viewers on Linux.GNOME: Eye of GNOMEeogKDE: GwenviewgwenviewGQView (GTK+) gqviewGThumbgthumb (similar to IrfanView on Windows)LXDE (light weight desktop): GPicView (similar to Microsoft Windows's Picture Viewer)KuickShowGImageView gimvQIV (Quick Image Viewer)ViewNiorI asked on twitter this:what's a linux image viewer that allow random slide show? have 20k images,want view random. eg Mac's Graphics Converter, Windows IrfanViewSomeone answered: PornView. Here's a quote from the description:PornView is an image and movie viewer/manager with thumbnail previews. Additional features includes thumbnail caching, directory tree views, adjustable zoom, and fullscreen view. Slideshows allow for unattended presentation of images for hands-free viewing. Pornview is written using GTK+.LOL. Exactly what i needed.List of Great Software for Windows and MacLinux GUI Command Lin…

Windows sys admin app command line program names

random Windows notes, 2012-05-02in Windows 7, in 〔Control Panel\All Control Panel Items\Administrative Tools〕, the items there are just shortcuts. You can find the program path and launch parameters by looking at the Properties.Here's a list:Component Services: %windir%\system32\comexp.mscComputer Management: %windir%\system32\compmgmt.msc /sData Sources (ODBC): %windir%\system32\odbcad32.exeEvent Viewer: %windir%\system32\eventvwr.msc /siSCSI Initiator: %windir%\system32\iscsicpl.exePerformance Monitor: %windir%\system32\perfmon.msc /sServices: %windir%\system32\services.mscSystem Configuration: %windir%\system32\msconfig.exeTask Scheduler: %windir%\system32\taskschd.msc /sWindows Firewall with Advanced Security: %windir%\system32\WF.mscWindows Memory Diagnostic: %windir%\system32\MdSched.exeWindows PowerShell Modules: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -ImportSystemModulesMicrosoft Security Essentials is 〔C:\Program Files\Microsoft Security Clien…

functional languages influence graph

Perm URL with updates: Here's a diagram by Michael Fogus: functional programing languages influence graph. Source blog.fogus.meSee also:A Functional Programming Influence Graph2012-05-02 By Michael Fogus. @ Source blog.fogus.meHistory of Functional Languages2012-05-02? By Dave Macqueen?. @ Source[Clojure] notes on Mathematica pattern transformation & Clojure predicate dispatch2012-02-20 By Kovas Boguta. @ Source grokbase.comWhat are some first pattern matching languages?Kent Recursive Calculator (KRC) and SASL (programming language). (thanks to @seabre, @fogus, Don Stewart. ) Note: Michael Fogus is a author of a Clojure book. See: Clojure Books.Proliferation of Computing LanguagesIntro to Mathematica Pattern Matching for Lisp ProgramersPrograming: What are OOP's Jargons and Complexities (OOP Model as FP)The Concepts and Confusions of Prefix, Infix, Postfix and Fully Nested Notations

Windows Firewall Error code 0x80070424; How to Fix

Perm URL with updates: In Windows 7, when i go to the Control Panel and click on Windows Firewall, i got this error: Windows Firewall can't change some of your settings. Error code 0x80070424 here's how to fix:Error Code 0x80070424 with Windows Firewall and “Base Filtering Engine Service” Not available in services database list.2011-12-26 By Danma_. @ Source blogs.technet.comSummery:Download the following registry files:Windows_registry_files_BFE_MpsSvc_2012-04-30.zipThere are 2 of them in the zip file: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BFE] [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MpsSvc] Open them to import to your registry.Restart Windows.Launch regedit. (press 【Win+r】 and type regedit)Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\BFERight click on it, choose 〖permissions〗.Click on 〖ADD〗 and type Everyone and click OK.Now Click on 〖Everyone〗, below, select ful…

Microsoft Windows Update Fail KB2691905

Perm URL with updates: On 2012-04-30, Microsoft Windows Update prompted me for a update. One of the update is marked Important, and it's about updating Microsoft Security Essentials. During the update i lost internet connection. When connection is back few seconds later, i tried to update again. Things seems fine. However, when i restarted my machine, i noticed that Microsoft Security Essentials disappeared, and also, i can't start the Security under Action Center, and can't start Firewall. This page is a record of the story and how to fix.My Windows machine is Windows 7 Home Prenium, Service Pack 1, 64-bit OS.Here's a screenshot from the “update history” in Windows Update, showing the update failure due to lost of connection:Microsoft Windows update failure KB2691905 2012-04-30Here's the text content: Microsoft Security Essentials Client Update Package - KB2691905 Installation date: ‎2012-04-30,…

Xah's Emacs Goodies

My emacs goodies.• ErgoEmacs Keybinding (with David Capello)
svn checkout ergoemacs-read-only• Emacs: Perl PHP Dictionary Wikipedia Google … Reference lookup
wget• Emacs Unicode Math Symbols Input Mode (xmsi-mode)
wget• Emacs Unicode Browser (xub-mode)
wget• Emacs AutoHotkey Mode (xahk-mode)
wget• Emacs BBCode mode (xbbcode-mode)
wget• Emacs LSL Mode (xlsl-mode) for Linden Scripting Language
wget• grep util in elisp. (draft version)
wget• Emacs Li…

misc emacs lisp tutorials update

Several updates in past months:Updated: Emacs Lisp: Chinese Character Reference LinkifyUpdated: Emacs: How to Define Templates in YASnippetUpdated: How to process a file and save only when changed. Emacs Lisp Idioms for Text Processing in Batch StyleUpdated: a convenient function that hides minor mode details when calling describe-mode. Emacs: Usability Problems of Mode Documentation

Confusing Terminology in Javascript/DOM: tag, element, node, object, attribute, property, method

Perm URL with updates: scripting is really confusing. You have terms like {tag, element, node, object} and then {attribute, property, method}.• “tag” is really the informal term for “name of a node”, or it may refers to the string {<…>, </…>}. e.g. we say “opening tag”, “closing tag”. Am not sure it's officially defined.• “element” is the official/formal term for technically a node of a html document. e.g. represented by the string <p>something</p>.• “node” refers to a node of DOM, but in practice, it more often refers to a element of XML (as opposed to HTML). However, note that the text content of a HTML/XML element is also a node. e.g. the “xyz” in <p>xyz</p> is a child node of the element “p”. So, node isn't just element. By W3C spec, the empty spaces between elements are actually a node too, but browser implementation differs.• “object” is basically a parsed nod…

Javascript: Get a Element's {Type, Name, Value}

Perm URL with updates: page shows you how to get a HTML/XML element's {type, name, value}.Node TypeUse ‹node›.nodeType to get a element's type. The ‹node› is a HTML element object.The return value is a number. Usually 1 or 3. “1” means it's a HTML/XML element. “3” means its content.Here's a complete list:ELEMENT_NODE → 1ATTRIBUTE_NODE → 2TEXT_NODE → 3CDATA_SECTION_NODE → 4ENTITY_REFERENCE_NODE → 5ENTITY_NODE → 6PROCESSING_INSTRUCTION_NODE → 7COMMENT_NODE → 8DOCUMENT_NODE → 9DOCUMENT_TYPE_NODE → 10DOCUMENT_FRAGMENT_NODE → 11NOTATION_NODE → 12sample code:var xx = document.getElementById("id63656"); alert("type is:" + xx.nodeType); alert("firstChild type is:" + xx.firstChild.nodeType); javascript test page: nodeType.As of 2012-04-29, this works in all major browsers.Source developer.mozilla.orgSource Name‹node›.nodeName returns the node's (tag) name (as string), if th…

GNU Emacs Bug: find-dired on Filenames with Spaces

Perm URL with updates: Emacs Bug: find-dired on Filenames with Spaceswhen using GNU Emacs, calling find-dired, i got one of this: 2533274790481547 2 -rwx------ 1 h3 None 2994 Apr 28 20:52 xx\ saga\ of\ bsof\ 2011-07-22.html note the backslash there.when i move the cursor to that line and press Enter, i get: dired-get-file-for-visit: File no longer exists; type `g' to update dired buffer update doesn't help. Somehow, filenames with spaces causes the problem.The problem also happens when calling dired-do-query-replace-regexpQ. It'll stop dead reporting file doesn't exist.What could possibly be the problem?GNU Emacs (i386-mingw-nt6.1.7601) of 2012-04-23 on MARVIN(if starting emacs with -Q, then another problem occur. It calls Microsoft cmd.exe's find.

Math: Grigori Perelman videos

Perm URL with updates: are looking at a guy who solved a million-dollar math problem but turned it down.Grigori Perelman in shopping marketGrigori Perelman walking on streetGrigori Perelman on subway