2012-05-12

Chinese Pop Music 齊豫 - 祝福 (Blessing)

Perm URL with updates: http://xahlee.org/music/yellow_rose.html

祝福 (Blessing) is a song sung by 齊豫, written by 李泰祥.

齊豫 - 祝福
快给我一束新鲜芬芳的黄玫瑰
用翠绿色的凤尾草围绕
再系上金色花边的彩带
把这束黄玫瑰送给我心爱的人
她披着白色的头纱
要和她幸运的伴侣走进礼堂
走进礼堂

要和她幸运的伴侣 走进礼堂
呜..
走进礼堂

让黄玫瑰带着我的祝福
轻吻她白纱的胸膛
黄玫瑰伴着我的爱心
黄玫瑰被她紧紧的拥抱 紧紧拥抱
黄玫瑰被她紧紧的拥抱 呜 紧紧拥抱 走进礼堂
让黄玫瑰增添她的娇媚 看她笑得多么幸福

只是别让她看到 无意间滴落在黄玫瑰上的露珠
无意间滴落在黄玫瑰上的露珠 呜 点点露珠
  

Common Lisp Sucks

Perm URL with updates: http://xahlee.org/comp/Common_Lisp_quotations.html

A collection of negative quotes on Common Lisp. This is originally collected in a post to comp.lang.lisp newsgroup by “WJ” 〔w_a_x_…@yahoo.com〕 @ Source groups.google.com.

Guy L Steele

Guy L. Steele, Jr.'s foreword in Scheme and the Art of Programming.

I think we may usefully compare the approximate number of pages in the defining standard or draft standard for several programming languages:

  Common Lisp   1000 or more
  COBOL          810
  ATLAS          790
  Fortran 77     430
  PL/I           420
  BASIC          360
  ADA            340
  Fortran 8x     300
  C              220
  Pascal         120
  DIBOL           90
  Scheme          50
  • Scheme and the Art of Programming By George Springer, Daniel P Friedman. @ amazon

Rodney A Brooks, Richard P Gabriel

Every decision of the committee can be locally rationalized as the right thing. We believe that the sum of these decisions, however, has produced something greater than its parts; an unwieldy, overweight beast, with significant costs (especially on other than micro-codable personal Lisp engines) in compiler size and speed, in runtime performance, in programmer overhead needed to produce efficient programs, and in intellectual overload for a programmer wishing to be a proficient COMMON LISP programmer.

Richard P Gabriel home page: Source www.dreamsongs.com

Richard Gabriel

Common Lisp is a significantly ugly language. If Guy and I had been locked in a room, you can bet it wouldn't have turned out like that.

Source?

Paul Graham

Paul Graham (computer programmer)

Historically, Lisp has been good at letting hackers have their way. The political correctness of Common Lisp is an aberration. Early Lisps let you get your hands on everything.

A hacker's language needs powerful libraries and something to hack. Common Lisp has neither. A hacker's language is terse and hackable. Common Lisp is not.

The good news is, it's not Lisp that sucks, but Common Lisp.

Do you really think people in 1000 years want to be constrained by hacks that got put into the foundations of Common Lisp because a lot of code at Symbolics depended on it in 1988?

Daniel Weinreb

Daniel Weinreb.

Having separate “value cells” and “function cells” (to use the “street language” way of saying it) was one of the most unfortuanate issues. We did not want to break pre-existing programs that had a global variable named “foo” and a global function named “foo” that were distinct. We at Symbolics were forced to insist on this, in the face of everyone's knowing that it was not what we would have done absent compatibility constraints. It's hard for me to remember all the specific things like this, but if we had had fewer compatibility issues, I think it would have come out looking more like Scheme in general.

Lisp2 means that all kinds of language primitives have to exist in two versions, or be parameterizable as to whether they are talking about the value cell or function cell. It makes the language bigger, and that's bad in and of itself.

Gilles Kahn

Gilles Kahn (1946〜2006):

To this day I have not forgotten that Common Lisp killed Lisp, and forced us to abandon a perfectly good system, LeLisp.

Jeffrey M. Jacobs

Jeffrey M. Jacobs:

I think CL is the WORST thing that could possibly happen to LISP. In fact, I consider it a language different from “true” LISP.

*****

Common LISP is the PL/I of Lisps. Too big and too incomprehensible, with no examination of the real world of software engineering.

… The CL effort resembles a bunch of spoiled children, each insisting “include my feature or I'll pull out, and then we'll all go down the tubes”. Everybody had vested interests, both financial and emotional.

CL is a nightmare; it has effectively killed LISP development in this country. It is not commercially viable and has virtually no future outside of the traditional academic/defense/research arena.

*****

One of the key issues that I consider distinguishes “Real LISP” from Common LISP is indeed the strong committment to the equivalence of data (meaning list structures) and code. I consider this idea one of the foundations of “Real LISP”, and Common LISP intent is vague at best. InterLISP, for example, still makes a declaration of this philosophy in the manual, and it is still one of the keystones in the teaching of LISP (although whether it should be when teaching Common LISP is open to question).

Chez Bernard Lang

Chez Bernard Lang:

Common Lisp did kill Lisp. Period. (just languages take a long time dying …) It is to Lisp what C++ is to C. A monstrosity that totally ignores the basics of language design, simplicity and orthogonality to begin with.

2012-05-11

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

Perm URL with updates: http://xahlee.org/comp/CoffeeScript_Dart_Javascript.html

What's Dart in a nutshell?

Javascript in Java syntax and semantics.

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

As of , no web browser plans to support Google's Dart except Google's Chrome.

Microsoft's JavaScript team has stated that:

“Some examples, like Dart, portend that JavaScript has fundamental flaws and to support these scenarios requires a ‘clean break’ from JavaScript in both syntax and runtime. We disagree with this point of view.”

  • Evolving ECMAScript By Microsoft JavaScript Team (Shanku Niyogi, Amanda Silver, John Montgomery, Luke Hoban, Steve Lucco) @ Source blogs.msdn.com

Apple's Oliver Hunt of WebKit (engine for Safari and Google Chrome) says:

What is the benefit to the project in exposing an additional (non standardized) language to the web? All the bindings that webkit currently provides to are either standardized EcmaScript or platform specific bindings used by native code developers embedding webkit.

Adding an additional web facing language (that isn't standardized) doesn't seem beneficial to the project, if anything it seems harmful (cf. VBScript in IE).

Anyway if we were to add an additional language the language people have been asking for for years is Python which is already extremely popular and well known so it seems that it would be a much better choice to expose, but even then it seems like a bad idea.

Adding direct and exposed support for a non-standard language [Dart] is hostile to the open-web by skipping any form [of] “consensus” driven language development that might happen (say the path taken by json2.js → the native JSON object), and foisting whatever language we want on the web instead. This implicitly puts any browser that supports additional proprietary extensions in the same position as a browser supporting something like vbscript, and has the same effect: breaking the open web by making content that only works effectively in a single product.

The father of javascript, Brendan Eich of Mozilla, has this to say:

Here is something that the Google leak about Dart (née Dash) telegraphs: many Googlers, especially V8 principals, do not like JS and don't believe it can evolve “in time” (whatever that might mean — and Google of course influences JS's evolution directly, so they can put a finger on the scale here).

They're wrong, and I'm glad that at least some of the folks at Google working in TC39 actually believe in JS — specifically its ability to evolve soon enough and well enough to enable both more predictable performance and programming in the large.

There's a better-is-better bias among Googlers, but the Web is a brutal, shortest-path, Worse-is-Better evolving system.

I've spent the last 16 years betting on the Web. Evolving systems can face collapses, die-offs, exigent circumstances. I don't see JS under imminent threat of death due to such factors, though. Ironic that Google would put a death mark on it.

  • TXJS 2011 A6 – Brendan Eich – Ecma TC39: The Good, The Bad, and The Ugly. By Brendan Eich. @ Source brendaneich.com

For the record, I'm not worried about JS being replaced by a better language. I am working to do that within Ecma TC39, by evolving JS aggressively.

The leaked Google doc's assertion that this is impossible and that a “clean break” is required to make significant improvements is nonsense, a thin rationale for going it alone rather than cooperating fully.

The big issue I have with Dart, which you seem to consider inconsequential, is whether Google forks the web developer community, not just its own paid developers, with Dart, and thereby fragments web content.

A Dart to JS compiler will never be “decent” compared to having the Dart VM in the browser. Yet I guarantee you that Apple and Microsoft (and Opera and Mozilla, but the first two are enough) will never embed the Dart VM.

So “Works best in Chrome” and even “Works only in Chrome” are new norms promulgated intentionally by Google. We see more of this fragmentation every day. As a user of Chrome and Firefox (and Safari), I find it painful to experience, never mind the political bad taste.

Ok, counter-arguments. What's wrong with playing hardball to advance the web, you say? As my blog tries to explain, the standards process requires good social relations and philosophical balance among the participating competitors.

Google's approach with Dart is thus pretty much all wrong and doomed to leave Dart in excellent yet non-standardized and non-interoperable implementation status. Dart is GBScript to NaCl/Pepper's ActiveG.

Could Google, unlike Microsoft ten or so years ago, prevail? Only by becoming the new monopoly power on the web. We know how that story ends.

politician Peter Camejo died in 2008

while updating the page The 2003 California GUBERNATORIAL thing RECALL (NSFW), discovered that Peter Camejo died in 2008.

2012-05-10

iMac Girl, 1999

picture removed due to Google AdSense policies. Visit here to view: Geek Humor: iMac Girl

feature differences of Keyboard macro/driver tools

Perm URL with updates: http://xahlee.org/mswin/Windows_keybinding.html

Different tools have different features and purposes. Here's a list of possible features. Most tools can do only SOME of the following:

  • Swap, disable, or reassign modifier keys, such as Ctrl, Alt, Caps Lock, Win keys.
  • Define key to launch a file (launch app, run script, or just open file).
  • Define key to insert text, such as your today's date, your address, or your signature.
  • Define keys to insert math symbols or unicode symbols. e.g. © ° § α β
  • Define key to act as if pressing other key, key combo, key sequence. (e.g. press F8 for 【Alt+Tab】)
  • Define actions for special keyboard keys, such as those multimedia keys, volumn control, sleep, app keys.
  • Define combination keys, such as 【Ctrl+a】.
  • Define sequential keys, such as 【Alt+Space a】.
  • Macros. Record & play back a sequence of key strokes or mouse events.

For Mac, see: Mac OS X Keyboard Layout, Keymapping, Keybinding, Tools.

For emacs, see: Emacs: How to Define Keyboard Shortcuts.

Windows Keyboard Layout & Key Macro tools for Windows

for Linux fans: you screwed. LOL

emacs lisp tutorial updates 2012-05-10

updated: Creating a Sitemap with Emacs Lisp

updated: Generate a Web Links Report with Emacs Lisp

Jon Snader has been systematically proof-reading my tutorial in past months, and providing many corrections and feedbacks. A big thank you to Jon. He is a expert in Common Lisp, Scheme Lisp, and Emacs Lisp as well, and frequently write about many interesting coding puzzles. See his blog here: irreal.org.

Emacs: least favorite feature of ErgoEmacs keybinding?

of those you using ErgoEmacs keybinding, what's your favorite and least favorite feature/bug?

2012-05-08

Emacs: Change Cursor Shape and Highlight Current Line

You can change your cursor shape to a box or i-beam. Put the following in your emacs init file:

;; change cursor shape
(setq cursor-type 'box)
(setq cursor-type 'bar)

(blink-cursor-mode 1)
;; highlight current line
(global-hl-line-mode 1)

Note: on Windows, if you have Microsoft Speech Recognization on, or Screen Magnifier, then, cursor will be i-beam, and setting “cursor-type” has no effect.

See also: How to Set Emacs's User Interface to Modern Conventions.

Great Apps on Windows

here's my apps on Windows machine.

xah apps on windows 2012-05-08
xah apps on windows 2012-05-08

This isn't exhaustive list of install software. Though, it contains all apps i use daily.

  • Daily: emacs, cygwin, Google Chrome, Firefox, IrfanView, Safari, Opera, Skype.
  • Weekly: GIMP, iTune, Mathematica, VirtualBox, Firestorm/Phoenix (Second Life), Inkscape, Google Earth, Picasa, Thunderbird

Just noticed a Walmart Photo Center there. lol. That's one of those bundled bloat-ware which somehow escaped my notice. Going to trash now. Also, note that ComboFix.exe. It is supposed to be a rootkit remover, but i haven't research enough to be sure it's safe to run. It is there temporarily.

Bash Context-Dependent Color Prompt

Perm URL with updates: http://xahlee.org/linux/shell_color_prompt.html

Want your bash prompt be colored and context dependent? like, showing you which git branch you are in?

bash color prompt
Bash context-dependent color prompt

Bash provided a PROMPT_COMMAND hook, that lets you call {shell, perl, python, ruby, …} script to specify your prompt. So, your prompt can show all sort of info and color.

Geologist and Googler Kurt Schwehr shows you how.

SourceForge founder Timothy Perdue Died

learned today, that a early figure of PHP coder Timothy Dean Perdue (1974 〜 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's photos of him and his family Source www.perdue.net.

thanks to meowcat for news.

2012-05-07

Xah Lee programing article updates 2012-05-07

lots updates in past ≈2 months not mentioned on my blogger. here they are.

updated: Emacs and Microsoft Windows Tips

updated: Emacs: View and Set Environment Variables within Emacs

updated: Windows Environment Variables Basic Tutorial

updated Windows Programing: AutoHotkey Example Scripts

updated Keyboard Layout & Key Macro tools for Windows

updated Computing: mega vs mibi, kilo vs kibi

updated How Fast Does Internet Speed Grow?

updated: Vector Normalize Function in Mathematica, Haskell, Ruby, Python, Perl, Scheme Lisp, Javascript, Java, C

updated ImageMagick/GraphicsMagick Tutorial

updated What Characters Are Not Allowed in File Names on Mac and Windows?

updated On Unix Filename Characters Problem

updated The Nature of the Unix Philosophy

updated Problems of Symbol Congestion in Computer Languages; ASCII Jam vs Unicode

updated: Dvorak, Maltron, Colemak, NEO, Bépo, Turkish-F, Keyboard Layouts Fight!

updated Why You should Not Use the Jargons lisp-1 lisp-2

updated Best Fonts for Unicode

updated PowerShell as cmd.exe or Bash

updated Windows Console Shortcuts

updated PowerShell: Listing Alias, Finding Command's Alias

updated: Lambda in Python 3000

updated with nice pics Logitech Wave Keyboard Review

updated: Keyboard Evolution: Zoom Button, Dedicated Keys

updated: Windows Programing: AutoHotkey Key Notations

updated: 𝕲𝖔 𝕿𝖍𝖔𝖚 𝖆𝖓𝖉 𝕯𝖔 𝕷𝖎𝖐𝖊𝖜𝖎𝖘𝖊 🌞 🐪🐫🐪 🌴 Unicode in Perl & Python

updated: Perl & Python: Splitting a Line by Regex

Updated: Perl & Python: Formatting Strings

Several articles on closure, updated:

Update at bottom: Why Learn Lisp When There Are Perl & Python.

Updated: Parallel Programing Problem: asciify-string

2012-05-06

Google HTML/CSS Style Guide

Perm URL with updates: http://xahlee.org/js/Google_html_css_style_guide.html

Google now has a coding style guide for HTML/CSS, at Source google-styleguide.googlecode.com

i learned a few interesting things.

Omitting Protocols in Links

Google suggest omitting protocols in links that are HTTP/HTTPS. Example:

<!-- Not recommended -->
<script src="http://www.example.com/main.js"></script>
<!-- Recommended -->
<script src="//www.example.com/main.js"></script>

Source google-styleguide.googlecode.com

Google says:

Omitting the protocol—which makes the URL relative—prevents mixed content issues…

Google didn't specifically say if this is from the new HTML5 spec. Or, perhaps, it's a obscure feature of URI spec. (anyone knows?)

HTML5's Short charset Meta Tag

The charset meta tag can be shortened. Following is HTML4 syntax:

<!-- HTML 4 -->
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

following can be used for HTML5:

<!-- allowed in HTML 5 -->
<meta charset="utf-8" />

HTML5: “type” Attribute for CSS/Javascript Not Necessary

in HTML5, “type” attribute can be omitted in the link to CSS or javascript. Example:

<!-- HTML 4 -->
<link rel="stylesheet" type="text/css" href="mystyle.css">
<!-- allowed in HTML 5 -->
<link rel="stylesheet" href="mystyle.css" />

HTML5: Omitting Start/End Tags

Lots start/end tags can be omitted in HTML5. Here's Google's example:

<!-- Not recommended -->
<!DOCTYPE html>
<html>
  <head>
    <title>Spending money, spending bytes</title>
  </head>
  <body>
    <p>Sic.</p>
  </body>
</html>
<!-- Recommended -->
<!DOCTYPE html>
<title>Saving money, saving bytes</title>
<p>Qed.

Source google-styleguide.googlecode.com

This is really the worse recommendation, and a lousy spec of HTML5, as it makes the language much more confusing and complex.

It would be much better to NEVER omit tags, so the syntax is simple and regular.

Once you encourage omitting tags, soon people will omit tags that shouldn't be omitted, introducing confusion and complexity.

If you read the HTML5 “living standard” document, you can see how complex and confusing it is.

This applies to language design too. Basically, you want to reduce “multiple routes” as much as possible. Any inconvenience, such as typing it, can be automated by tools. The worse offender is unix shell utils. (See: Unix Pipe as Functional Language.)

Is it Good Style?

Overall, i don't agree with half of their recommendations.

Their style guide for Python, Javascript are very good. (See: http://code.google.com/p/google-styleguide/.)

For the HTML/CSS style guide, it seems they are pushing arbitrary preference. The reason they gave are not cogent. They are more or less opinion only, with lots room for argument. In many cases, it's not consistent within itself. Examples:

• They suggest indenting by 2 spaces. This is really not necessary. (Source google-styleguide.googlecode.com)

• They suggest all lowercase for HTML (for tag names, attribute name/values, etc.). This'd be great advice for XML, since it is case-sensitive, and XHTML element names are all lowercase. But elsewhere they often suggest readability. Note that CAP CASE for tags were the recommended style for HTML from about 1995 to 2005. Cap case is more readable, as it distinguishes markup from content text.

• They recommend using HTML5, and recommend against using XHTML. Note that XML/XHTML was widely considered the future from about ≈2000 to ≈2008. The HTML5 people are rebels and wants to overthrow strict validation and XML.

What's HTML5? It's a flying-fuck-in-your-face against a decade of what W3C told us about what HTML should or should not be. HTML5 was started by mostly Google and Apple, and in the beginning was sneered by W3C, but W3C finally lost the power struggle and accepted HTML5.

• They recommend using valid HTML when possible. But as far as i know, Google has never encouraged valid HTML in their hundreds blogs and videos for webmasters, and of the billions of pages Google produced, i'm not aware of one that is valid HTML. (Source google-styleguide.googlecode.com)

• They recommend not to use redundant 0. e.g. font-size: .8em;. This is a bit strange. This is less readable and saves one byte, yet they DO recommend a space after the colon.

All the above points are rather trivial. After all, it's a guide on “style”. However, certain style matters are critical. But Google's HTML/CSS style guide address mostly trivial styles, and on critical issues such as correctness and well-formedness, it seems to side with bad taste.