Xah Programing Blog Archive 2012-05

Keyboard Geeking 2012-05-30

I went to local store and tried a bunch of keyboard again for like a hour. Made several discoveries.

• Discovered that SteelSeries 6Gv2 keyboard Buy at amazon uses Cherry™ Black MX mechanical key switch.

• Cherry™ Black MX mechanical key switch. Don't like it at all. Too stiff. [see Keyboard Key Switch Mechanisms]

• Discovered Corsair K60 Keyboard. FANTASTIC! Cherry MX Red switch. Full analysis here: Gaming Keyboards: Corsair K60, K90 .

• Discovered that Logitch {G110, G510, G19} gaming keyboard are shit. That is, the key mechanism is SHIT. They are rubber dome, of course, i knew that. But different rubber dome have different feel, some are ok. Some rubber dome key's tactile feel still gives you a sense when a key is pressed. That is, when you press down a key, at some point, the dome collapses, and the key gets sucked down. This is good for typing. However, on Logitch gaming keyboards, they are rather linear, and no crisp bottom neither. So, the whole feel is mushy. This is worst for typing. I suppose they designed it that way for gamers. But even for gamers, especially today's Massively multiplayer online game, chatting is a major activity.

• The Logitech Wave Keyboard's key feel is complete SHIT. You know how some rubber dome key is such that sometimes when you try to press a key on a corner, it stuck and won't go down, due to the friction of the housing (your attack angle is WRONG!). The Wave keyboard's keys are like that. SHIT. Besides, its strange curves have no ergonomic benefits. More of a gimmick. Thus, updated: Logitech Wave Keyboard, Thoughts .

Gaming Keyboards: Corsair K60, K90

Database Tech 2012

Complexity Graph of Programing in Bash

funsh functional bash
A comic by Mike Ledger for his project fun.sh

perm url: Unix Pipe as Functional Language

Picasa Picture Viewer Keys

高级程序员装逼指南 (Zhuangbility Manual)

Prime Number Test by Regex

prime number test by regex 2012-05-20

the perl code is this:

perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/' ‹number›

How it works: given a number, say 7. Generate a string of 7 same chars, say "bbbbbbb". Then, use regex to test if repetition of 2 chars "bb" matches the string completely. If not, try 3 chars "bbb", then 4, etc.

The interesting thing is to put this into a single regex. The key regex is ^(bb+?)\1+$.

[Perl tricks by NEIL KANDALGAONKAR By Neil Kandalgaonkar. At http://montreal.pm.org/tech/neil_kandalgaonkar.shtml , accessed on 2012-05-20 ]

Linux Keyboard Tools

updated: Microsoft Natural Ergonomic Keyboard 4000 Review

Open Source, Free Software, are scumbags, in my book. Vast majority of people, don't really genuinely care about any possible economic value or ethical value behind it. They only care about themselves. For tech geekers, students, it's the ability to get software for free. For companies, it's marketing fad. For governments, it's establishing their own software infrastructure that's not controlled by another country.

on the economic value of open source, or the ethical value of FSF's concept of Free Software, both are questionable as absolutely better than alternatives for a society.

[The Disappearance of Open Source? By Steve Burge. At http://www.ostraining.com/blog/general/the-dissapperance-of-open-source/ , accessed on 2012-05-16 ]

updated: Keyboard Symbols ⌘ ↩ ⌫

did recent svn version finally removed the .svn dirs littered in subdirs? or am i smoking something? Linux Dot File Problems: .svn .htaccess .DS_Store etc

updated: How to Increase Efficiency in Using Mac, Linux, Windows

Common Lisp Sucks

updated: What do Microsoft, Apple, Mozilla, say about Dart?

The Jargon “Currying” in Computer Science

updated: List of Great Software for Windows and Mac

update: context dependent color prompt. Linux: Set Bash Shell Prompt to Color

SourceForge founder Timothy Perdue Died

learned today, that a early figure of PHP coder Timothy Dean Perdue (1974 to 2011), died, of cancer. He was a founder in {SourceForge.net, GForge.com, PHPBuilder.com}.

I remember him only because i cited one of his article that criticizes MySQL back in 2002: The Unix Pestilence: MySQL .

that's the old days. When MySQL was the rage flying about on slashdot, similar to today how stuff fly in hackernews, reddit, etc. Today it's NoSQL. Does anyone remember that XML is the future and there should be pure XML databases or OOP databases?

Here is photos of him and his family Source www.perdue.net .

thanks to meowcat for news.

updated: Windows Environment Variable Tutorial

js+dom gotta be the most difficult lang/tech in my 17 years of programing experience.

the js lang itself is easy. In a week, you can pretty much code any pure math functions, or list manipulation. The problem is DOM. It's extremely complex to understand. There is no documentation. And varying incompatible browser implementation. The whole js/dom/html/css is more or less 20 years of hack and corp fights.

what am aiming at, is to be able to write a lib like jquery.

actually, there are other lang/tech i consider as difficult. Java applet with GUI is a example.

other examples are: Second Life LSL lang. That's one faaked up lang with ever changing and ever broken design and bugs. Bugs, bugs, bugs. However, this i actually mastered.

on the other hand, i didn't have any problem learning perl, python, Mathematica, lisp, php, ruby, html/css.

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.

JavaScript DOM Scripting Pain: Whitespace Nodes

coding JavaScript+DOM is a pain in the ass.

no, am not talking about using those jquery etc libs.

am 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 lint) isn't always available. Even in emacs, formatting source code sucks majorly. Those formatting commands (For example, indent-region), they go line-by-line manual/guessing methods. And this “no auto formatting condition” encouraged all the hacker type idiots to drivel about “coding style” day and night. (is there a language whose compiler are aware of source code comments and formatting?))

but anyway, normally when doing web app scripting, we don't care for the whitespaces between tags. So, in order to get the real next sibling, it's a pain in the ass. You have to check the returned node's type, then check if its value is all whitespaces (and don't forget the Unicode [ whitespace characters ] [ https://en.wikipedia.org/wiki/Whitespace_character ], kids).

of course, any sane coder will just use a js lib.

Who Invented Hello World?

Discovered [ NixOS ] [ https://en.wikipedia.org/wiki/NixOS ]. Home page: nixos.org

Here is a criticism:

Re: Adoption of Nix?
To: debian-devel@lists.debian.org
Subject: Re: Adoption of Nix?
From: Daniel Burrows [dburrows@debian.org]
Date: Wed, 24 Dec 2008 10:49:15 -0800


[ Filesystem Hierarchy Standard ] [ https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard ]

Linux: Image Viewer Applications

Functional Programing Languages History Diagram

Windows Sys Admin App Command Line Program Names

Windows Firewall Error code 0x80070424; How to Fix

In the past 2 days, spent a total of ~6 hours on a Microsoft update problem. See: Microsoft Windows Update Fail KB2691905 .