Posts

Showing posts from December 8, 2013

JavaScript syntax soup: 「p in o」

another episode of syntax soup. In JavaScript, you have p in o and for (var p in o) {…}. The first looks the same as part of the second, but have completely different semantics.Soup. Soup. Soup. It's All Soup.JavaScript: Property, Prototype Chain, Enumerable: Accessing & Listing PropertiesPython's Context Dependent Syntax Soup: 「… in …」 And 「… not in …」

Stereographic Projection & mobius transformation

Image
Stereographic Projection & mobius transformation。 If you want to understand Einstein's theory of relativity, you must understand mobius transformation. To understand mobius transformation, you must first understand Riemann sphere, complex numbers, geometric inversion. stereographic projection by Henry Segerman赤平投影和莫比乌斯变换。如果你想了解爱因斯坦的理论,你必须明白莫比乌斯转型。要了解莫比乌斯变换,必须先了解黎曼球,复数,几何反转。see http://xahlee.info/math/stereographic_projection_physical_model.html

wikipedia controversies

wikipedia is not without controversies in its reliability. However, in general, if you are a learned man, and read it frequently, you basically know by heart which parts is not trustworthy.when you are a learned man (as in, you have several degrees, or is a scholar, and often minimally knowledgeable in diverse fields from sciences to humanity, such as philosopher), you can basically tell when you read something that came across as funny, wikipedia or not. Because, you know what you know and what you don't know, and you have good experience of seeing questionable writing.And, if you do use wikipedia a lot, you also know which type of article, or part of the writing style, is red ink.gratuitous links:The Heart of Wikipedia: Why is Wikipedia Successful?Lispers and WikipediaWikipedia MoronsEncyclopedia, My ExperiencesDeath of EncartaLinks to Wikipedia from Xah Sites

Python: Example of Using Sets

Python: Example of Using Sets# -*- coding: utf-8 -*- # python # utility to show the difference of JavaScript's encodeURI and encodeURIComponent functions # 2013-12-09 digits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} letters_upper = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'} letters_lower = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', &#…