2011-01-08

Boobs: Good vs Bad

Perm url with updates: http://xahlee.org/funny/good_vs_bad_boobs.html

Boobs: Good vs Bad

boobs good

Side with the Alliance of Light

boobs bad

Or Choose the Union of Fury

boobs good vs bad

I wanna be where the boobs are.

boobs overlay

Full poster.

The company's site is http://shaiya.aeriagames.com/.

Wordy-English a-word-a-day is back

Am re-starting my wordy-english word-a-day. From 2004-11 to 2008-10, it ran on yahoo mailing list at games.groups.yahoo.com/group/wordy-english/ But now, the new address is wordy-english.blogspot.com. This way, you can subscribe as blog and read it whenever you like, or you can subscribe by mail.

You can see archive of about 5 thousand words with usage here: English Vocabulary. Everyday, i'll pull a word there and post.

Please subscribe! Thank you.

Seduction Community

Perm url with updates: http://xahlee.org/Periodic_dosage_dir/t1/seduction_community.html

Seduction Community as Social Engineering

Xah Lee, 2011-01-08

There is a subculture community that practices seducing women, as a art form. (see: Seduction community.) That is, their sole goal in this practice, is to get women to bed, and they practice it much like a professional skill, much as you take tennis or writing or mastery of any vocational skill. You learn the basic skills, methods, practice, discuss with fellow practitioners, check and recheck your errors, refine your strategy, thru tireless daily practice, tens or hundred times per week. For example, issues on your own dress code. Your opening line. Judgment on which women is “open” at a glance (thru her dress, looks, body language), when to dig in, etc.

Certainly, this is a very interesting activity, falling into the general category of marketing, persuasion, psychology, mating game. Some people, are natural at this. Often, they are called playboys or womanizers, and today with net jargon “player”. (and in a different category, it's salesmen, negotiator, politician.) Others, such as engineer and scientist types, are natural retards at this. Though, like any skill, it can be improved and mastered at. To what degree of mastery depends on your talent, interest, and effort.

Also, some feminist (idiots)'s reaction to this is naturally wrath. Their reaction is typically “you should not treat women as sex objects”. But in reality, most women do get delighted when treated as “sexual objects”. Here, the problem is with the phrasing. Using the phrase “treated as sexual objects” seems debasing and of course most people don't want that, but the meaning behind it isn't. Men may treat women as “sexual objects”, but in the same sense, women are looking at men as money tree. Don't you expect drinks, gifts, diamond ring, houses, and perhaps daily bread when you marry your guy? Do you get happy when you get flowers? That's simply the nature of things. If women do not really like to be “treated as sexual objects” and instead prefer some more platonic love (me), then certainly the whole seduction scene would collapse because it won't work. Similarly, you don't want to be treated as a number in society, but in modern society, you are just a number, like it or not.

“Gangsta Pick-Up Artist: Locking In”

Now, that's a funny one. The following's the real thing.

“Style” (Neil Strauss) on The View

“Neil Strauss picks up Jessica Alba on Jimmy Kimmel”

Here's Neil's famous book: Game Penetrating Secret Society Artists; book amazon

Thanks to meowcat for showing me the links.

Browsers default line-height change

Sometime in the past 2 years, browsers have changed their default height between lines. For example, before, i have this in css to make paragraphs more readable:

p {line-height:140%}

Without that, the lines will be tightly placed together and hard to read. But now, you can take it out. All browsers of current versions, including IE8, do fine.

2011-01-07

Underscore.js javascript Library for functional programing

“Underscore.js” is a javascript library that provides a set of functional programing functions. It saves you time writing them or writing massive number of lines in imperative way such as loops, etc.

For example, it has these functions on lists: map, reduce, select, max, min, sortBy, sortedIndex, first, rest, last, compact, flatten, without, uniq, intersect, indexOf, lastIndexOf, range.

Pretty simple to use. Home page at: http://documentcloud.github.com/underscore/

See also: Functional Programing in Javascript.

Opera Turbo Speeds Up Browsing?

Opera Turbo Speeds Up Browsing?

Discovered a feature in Opera 10, the “Opera Turbo”. Basically, it's a feature that makes web browsing faster when using a slow connection. Such claim always piques me, because ultimately such thing is simply impossible. Many tools or plugin claims it are just malware or wrapper-ware that sucks your money. So, how exactly Opera Turbo works? It turns out, it's basically a proxy service feature. If you turn the feature on, and when browsing some slow website, opera browser will past request to a Opera company's server instead, and the Opera Server makes the request to the site you are visting, then, it compress the data then send that back to your browser.

In other words, it's a proxy service, a middleman. So, yes it does make it faster sometimes (assuming that the site you visit doesn't already do compression). The interesting implication is that: ① Opera the company would know the sites you visit. ② you could use it to visit sites that are censored by your company or school.

To turn it on, go to Preferences, “webpages” tab.

See also:

What's the Latest and Greatest in Calculators?

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

What's the Latest and Greatest in Calculators?

Xah Lee, 2011-01-07

Am a fan of calculators. My fond memory is HP-28S that i bought in ~1991 for some ~$250 USD, and wrote my first program to solve the 8-queens problem without knowing anything about computer science or programing.

28ss

I also wrote a large program to play any musical chords and scales. See: HP-28S Advanced Scientific Calculator.

But that calculator is basically my last one as well. Mathematica and computer took over. Since the HP-28, the next generation the HP-48 came along, but i never got into it (and am out of college as well). However, now and then i look at the calculator scene as a arm-chair philosopher. Checking their current capabilities, their design, placement of buttons, symbols on the keys, user interface, and muse over the issues of tech advance, education, futurism.

casio fx 85wa calculator-s

Casio fx-85wa. Source en.wikipedia.org The only calc i currently own, but basically never use.

Been always fascinated by calculators. You know how there's scientific calculator where some buttons are labeled “sin”, “cos”, “log”? At age 11 or so, seeing them, my thought was that these are some very advanced things, that to know what they are would mean something like a rocket scientist. (but of course, as you know, they are actually just the very basic trig functions that you learn in pre-calculus in highschool.) While in college, i have this fantasy of bringing a basic scientific calculator and show it to Euler, Gauss, them 1700s guys. I would tell them, “Look at this! you see this sin log buttons?” and they would go “huh? what?!?”. Then i would proceed to explain the magic on my hand.

Latest and Greatest

Today i took a hour to gander at today's calculator scene. Here's some summery.

The HP calculators, once was the love of true tech geeks since 1970s, but in the past 10 years they have degraded so badly to universal bad reviews. The latest series is HP-49 series, but not worth your money. Lousy buttons, lousy features, slow, lousy look.

HP-50 calculator-s

HP-50g. amazon

TI-nspire CAS

TI-Nspire CAS Touchpad calculator

“TI-nspire CAS”. amazon

The TI calculators, made inroads starting in early 1990s, and just gets better and better. Today, if you in college, your best buy is a TI calculator. The current bleeding edge model is TI-Nspire series. You want the model with CAS (for computer algebra). If you don't want to be that fancy, go for “TI 84” amazon.

Casio

What about Casio? They are the best. The latest model, is a touch-screen based Casio ClassPad 300. According to some reviewers at amazon who owns all the HP and TI ones, they say this is the best, beats TI-Nspire. I tend to believe it.

Casio ClassPad 300

“Casio ClassPad 300” amazon Source en.wikipedia.org

Wait, I Want My “sin” Button Back!

Where did the “sin” button go?

I tend to prefer lots of physical buttons with weird symbols on them than a large blank touch screen. Physical buttons give me a sense of math, the esoterism, and offers fast direct access than screen menus. You know? kinda like old fashioned rocket scientist who prefer intricacies of mechanical devices than digital stuff that you can't see and touch (how ironic). But i suppose touch screen is the way to go for the future.

Actually, i think calculators are going the ways of the dinosaur. These days, the cell phones, iTouch amazon, iPad stuff are all just unified hand-held little computers. They can play video, music, has builtin camera, phone, connects to the internet, GPS, and thousands of applications. Who needs a one-purpose gadget to carry around?

Calculators are good basically just in class rooms. Though, i wonder how many more years they'll last.

2011-01-06

jQuery Tutorial: Selectors

Perm url with updates: http://xahlee.org/js/jquery_selectors.html

jQuery Tutorial: Selectors

Xah Lee, 2010-11-12

This page is a tutorial on jQuery's selectors. If you don't know the basics, see: jQuery Basics Tutorial.

Getting Elements You Want

Here's a most basic example of getting a element and do something with it.

// make all paragraphs red
$("p").css("color","red");

jQuery Selectors

Select by tag

// make all “p” tag elements red
$("p").css("color","red");

Test yourself: jQuery Select By Tag Example

Select by ID

// make element of id “xyz” red
$("#xyz").css("color","red");

Test yourself: jQuery Select By ID Example

Select by Class Value

// make element of class “xyz” red
$("[class='xyz']").css("color","red");

Test yourself: jQuery Select By Class Value Example

Select by Matching Any Attribute and Value

jq can select any tag attribute matching their value in many ways.

MeaningSyntax
Attribute EqualsmyAttribName="myValue"
Attribute Not EqualmyAttribName!="myValue"
Attribute Starts WithmyAttribName^="myValue"
Attribute Ends WithmyAttribName$="myValue"
Attribute ContainsmyAttribName*="myValue"
Attribute Contains PrefixmyAttribName|="myValue"
Attribute Contains WordmyAttribName~="myValue"

Here's a example of getting all elements that has attribue “abc” with value “xyz”.

// select elements with attribute “abc” that has value “xyz”, make it red.
$("[abc='xyz']").css("color","red");

The syntax follows css's syntax. If you are not familiar with css seletor syntax, see: CSS Tag Matching (Selector) Syntax.

2011-01-05

Waiting for HTML5 to kill Flash?

Nice blog from Google:

It's pretty short. But if you want one-sentence summery, the moral is this: for HTML5 and browser tech to catch up with Adobe Flash's features for PRACTICAL needs today , it might take a few years.

See also:

Bagua Kung Fu Videos

Perm url with updates: http://xahlee.org/Periodic_dosage_dir/bagua_kungfu.html

Bagua Kung Fu Videos

Xah Lee, 2011-01-05

Bagua circle walking

“Bagua fight scene”. Short display of Bagua techniques and variations.

“Baguazhang for police”. Showing one practical technique.

“Bagua Jiulong Heaven Palm Basic Applications”. Techniques to defend from front 2-handed grab, bear hug from back.

What Are Some Quality Properties of Computer Language Syntax?

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

What Are Some Quality Properties of Computer Language Syntax?

Xah Lee, 2008-07, 2011-01

You say that lisp syntax irregularities “reduce such syntax's power”. What you mean by “syntax's power”?

Here are some concrete examples of what i mean by power of syntax.

In many languages, such as Perl, they have comment syntax of a special char running to end of line. For example, in Perl, Python, Ruby, Bash, Windows Powershell, the special char is “#”. Note that this does not allow nested comment. So for example, if you have multi-line code, and you want to comment out them all, you have to pre-pend each line by the comment char. However, if you have block comment syntax, one could just bracket the block of code to comment it out.

Of course, these langs may also have block comment syntax, and even if not, programing text editors often have features to add the comment char to a block of lines. However, in the context of analyzing a particular syntax, the line based comment syntax is inferior to block based one with respect to what the syntax can do. This, is a simple, perhaps trivial, example of “power of a syntax”.

In Python, the formatting is part of the lang's syntax. Some programers may not like it, but it is well accepted that Python code is very easy to read, and it has much done away about programer preferences and argument about code formatting. This is example of power of a syntax.

Let me give another, different example. In Perl, often the function's arguments do not necessarily need to have a paren around it. For example, print (3); and print 3; are the same thing. This is a example of power of syntax. Similarly, in javascript for example, ending semicolon is optional when it is at end of a line.

In Mathematica, the language has a syntax system such that you can use fully regular nested notation (e.g. f[g[x]]), postfix notation (e.g. x//g//f), prefix notation (e.g. f@g@x), infix notation (e.g. 1~Plus~2 instead of Plus[1,2]), for ANY function in the language, and you can mix all of the above. (prefix and postfix by nature are limited to functions with just 1 arg, and infix notation by nature are limited to functions with 2 args) This is a example of power of syntax. (For detail, see: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Nested Notations)

In general, a computer lang has a syntax. The syntax, as text written from left to right, has various properties and characteristics. Ease of input (think of APL as counter example), succinctness (e.g. Perl, APL), variability (Perl, Mathematica), readability (Python), familiarity (C, Java, Javascript, ...), 2-dimensional notation (e.g. traditional math notation) (Mathematica), ease of parsing (lisp), regularity (APL, Mathematica, Lisp, XML), flexibility (Mathematica)... etc. Basically, you can look at syntax, and programer's need to type them, and how the textual structure can be mapped to the semantic space, from many perspectives. The good qualities, such as ease of input, ease of reading, ease of parsing, ease of transformation, simplicity, flexibility, etc, can be considered as elements of the syntax's power.

As a example of syntax of little power, think of a lang using just the symbol “0” and “1” as its sole char set.

What's the Most Readable Computer Language Syntax?

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

What's the Most Readable Computer Language Syntax?

Xah Lee, 2011-01-05

On 2010-12-31, girosenth <girose...@india.com> wrote:

How to improve the readability of (any) LISP or any highlevel
functional language to the level of FORTH ?

There are many people who have trivia complaints about parens in lisp,
but I dont.

LISP is a prefix notation.

Please don't call it “prefix”, because that's misleading. Call it “nested notation” would be a practical term and not incorrect.

When you say “prefix” or “postfix” notation, implied in the word is the use of operators with implied ordering between the operator and adjacent symbols (operands).

Lisp syntax does not use operators, or rather, it primarily uses just one single operator (the match-fix parenthesis). And as a match-fix operator, the word “pre-fix” is misleading because that word is primarily for operators used in a linear (none nested) way.

For example, * + (2 4) 3 is a form of prefix syntax, however, it has very different properties from lisp's “prefix” (* (+ 2 4) 3), and you might also call the traditional math notation f(x,y) as prefix.

See: The Concepts and Confusions of Prefix, Infix, Postfix and Fully Nested Notations.

sequence of operations would look like this on operands (ops) :

(f ops (g ops (h ops (j ops (k ops (l ops ))...))))

How do you make it readable ?
How do you home to the center or centers ?

(f (g (h (j (k (l ops)))...)))

is easy to read or

ops l k j h g f

???

Which is linear reading from L->R ? LISP or FORTH ?

AND, if I must break the nested function structure, will I not be
visiting the forbidden territory of imperative programming ?

(setq L (l ops))
(setq K (k L  ))
....
....
(setq F (f G  ))

If I use setq, I am using globals, atleast in elisp.

If I use let*, I have limited options as I am constrained inside the
rigid structure of let*

(let*
  ((L (l ops))
   (K (k L  ))
   ....
   (F (f G  )))

some more
)

Is there a postfix functional language that also gets rid of parens
and is not as primitive as FORTH or POSTSCRIPT ?

you might get some tips about this from this article: What's Point-free Programing? (point-free function syntax).

In lisp, xml, all use match-fix that often result deep nesting and thus hard to read, inconvenient to type, prone to collapse if one single bracket is missing. So, recently i've had some thought about a syntax that does not use any match-fix operators (nesting of symbols) whatsoever. For example, in Haskell, OCaml, you don't need parens for function's arguments, and such form makes function sequencing quite convenient to use, similar to unix shell's pipe. But my current conclusion is that:

  • Strictly no nesting whatsoever may not be a desired property.
  • When done to a large extend yet not 100% (e.g. APL and derivatives), you sacrifice several advantages in syntax and also some semantic possibility in the lang. (e.g. you can't represent a data structure of a tree literally, or other inherently nested structure such as a matrix. Humm, actually you can do like python, using indentation for level.)

also note, reduction or elimination of match-fix operators in so-called stack based lang such as Forth, does not really qualify as a syntactical solution. It rids of match-fix by a semantic solution. (i.e. there's implicit hiding of arguments. You have this non-syntax concept of pushing it into a “stack”). Another way to view this is that, when we look at Forth (which am not familiar) or HP-28S Advanced Scientific Calculator's language (which i'm familiar), or if we look at so-called “reverse polish notation” RPN, the RPN is not a complete syntax system on its own right, but relies on a language system... (not sure if anyone see what i mean here... i need to do a lot more thinking to express this in some “formal” way, so as to clearly indicate the property that's categorically different)

What are the syntax advantages of ERLANG, ML, CAML, OCAML, HASKELL, PROLOG, RUBY over LISP?

That's a loaded question of course.

But my own pet peeve is that there is to-date no major general purpose comp lang that actually have a lexical grammar. The awareness of the concept of a grammar for syntax is little known among programers. Each lang basically create a bunch of ad hoc syntax, that are not consistent nor well defined. In fact, no major general purpose languages even have a lexical grammar per se. (what we have are just tools that helps define and parse)

The only close exception is XML, but of course it is just a markup lang.

for some detail, see:

How does one improve readability so that the code is self-commenting?

it's a common mistake among programers to think that certain lang's syntax is so clear that it is “self-documenting”. For example, lisp coders said it in 1970s or earlier when sexp and the idea of a lang that reflex math directly is new. Mathematica literature said it in 1990s because pattern matching is a good fit for symbolic manipulation. Haskeller has said it because they think Haskell code is so much a direct mirror of traditional math notation for functions (and this is quite laughable when compared to Mathematica). And Ruby coder said it because they feel how the syntax mirror programing algorithms so clearly and concisely.

Perl mongers to various degree also think of that of their lang, because how the idiomatic perl allow omission of many syntactical details and so malleable and they think it reflect the way human uses natural lang like english.

So, sometimes in discussion, someone shows you a line of code without any comment. You are perplexed at what the code does, but when you ask, you find out that they are genuinely surprised because they think that the code's meaning is so plain and obvious that any additional explanation actually complicate it.

Part of all these feelings is due to the fact that when you are familiar with a lang, it becomes part of your thinking, a written language to express your thoughts. Especially so if you don't know much of other langs. You are too familiar with the lang to realize the fact that different languages have always been a barrier to communication. The more expert you are with a lang, and the less the number of other langs you actually work with in depth, the more likely you forgot that different langs are just different. What's obvious to you, even just a short line, is really just a string of gibberish symbols mixed together in a weird way to another lang user.

So, your question “How does one improve readability so that the code is self-commenting?” has many answers depending what you really want. Comp lang syntax readability is a subject in the field of psychology, linguistics, cognition. Among comp lang forums among programers, they knew nothing of it, and what you read there usually is utter refuse. But to take a general programer practioner's point of view, for example, Python is considered very readable, and the primary reason for saying so is actually just code formatting (i.e. short lines, and all neatly indented), and the reason python code are well formatted is because the formatting is worked into the language's syntax.

Take a complete different perspective, there's Mathematica. For example, what do you think if comp lang source code can be like traditional math notation that's so-call 2-dimensional notation? e.g. you have x^3 with the 3 raised and smaller and without the extra symbol “^”, you have 1/2 with 1 on top of a bar and 2 below the bar, etc. And when the expression gets complex, e.g.

-b + Sqrt[b^2-4 a c]/(2 a)

it becomes much easier to read when in traditional math notation. In Mathematica, its syntax system is such that, it can display the source code in 2-dimensional notation automatically, if you want. you can see some example here, also in PDF format: Math Typesetting, Mathematica, MathML.

The same expression in lisp style you get this:

(/ (+ (- b) (sqrt (+ (^ b 2) (- (* 4 a c))))) (* 2 a))

Is it readable? Many lispers insist that its the most readable syntax.

See also: What's Function, What's Operator?.

2011-01-04

Ultimate Keyboard Layout

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

Ultimate Xah Keyboard Layout

Xah Lee, 2011-01-04

xah keyboard layout v0.2

Xah's keyboard layout, draft, version 0.2.

Features

  • Letter key arrangement based on Dvorak Keyboard Layout.
  • Key location are primarily based on the map between key's usage frequency and location comfort, with as much scientific evidence as possible.
  • Caps Lock, Num Lock are eliminated.
  • No obsolete keys such as Pause/Break, SysRq, ScrLk, Insert.
  • One single keypress for frequently used operations: Copy, Paste, Undo, Open, New, etc.
  • Rotary knob for instantaneous sound level control. No need to press Volume Up key 10 times or take several seconds to hold it down.
  • Rotary knob for sound level eliminates the need for a extra Mute button.
  • No keys for Sleep, Log Off, Power On/Off, that are confusing and never used or used at most few times a day.
  • Keys for numbers arranged in a square in the middle. No need to hold Shift key. No need to turn on Num Lock. Faster touch-type numerical data entry than the traditional top row. No need to move hand over to extra number pad.
  • Major improvment over conventional keyboard for programers. Most frequently used symbols do not need Shift key to enter. Symbols arranged according to use frequency in computer language source code.
  • Split key groups for each hand, so you don't have to bend inward. Similar to standard ergonomic keyboards e.g. Microsoft Keyboard 4000.
  • Each hand can reach all keys easily without stretching. In traditional PC keyboard, the right pinky has to strech to reach several keys: Backspace ' - [ ] \. (similar to Kinesis.)
  • The vertical column is straight. Allows straight up/down finger movement. They are not slanted in a irregular way like in traditional PC keyboard. (similar to Kinesis.)
  • Designed for English and other major world languages (e.g. Chinese pinyin, Spanish, Portuguese, German, French, other Euro langs that relies on a latin based alphabet with extra characters.). (The Alt or one of the Alt should be AltGr for inputing special chars such “è ü á ñ ç € ¿”. The exact character map for AltGr yet to be designed) This layout should be more efficient than any local language layout.
  • This layout should be better than Kinesis or Maltron, or other fancy ergonomic keyboards.

Notes:

  • The yellow colored keys are modifier keys.
  • The command key ⌘ is also the Win logo key.
  • Software should be able to remap any of the modifer keys.
  • This keyboard must not rely on software to work for basic functions. It should be plug-n-play without installing any software or the need to switch to a different keyboard layout in OS. (more reserch here on feasibility)
  • This physical key keyboard layout is designed to be manufactured both as full-sized keyboard with full height keys, but also for labtops as flat keys. (the arrow key section may need to be relocated to reduce width)
  • I think it should aim at mass production to the mass market, if at all economically possible. (as opposed to marketing to high-end consumers e.g. over $100 keyboard) e.g. use cheap parts and cheap manufacturing tech. (e.g. rubber dome switches)

Some design notes:

  • The little gabs in various places are critical. Must not be removed. They make it possible to feel the key location without visual contact. When manufactured, the different sections of the key must be easily distinguished both by eye or by touch. Also, the little positional offsets on some key groups are critical for the same reason. The keyboard must not become a uniform grid.
  • The special keys, such as F1, F2, Copy, etc, must be actual keys, using the same switch mechanism as letter keys. They must not be some rubber buttons. The F keys or Undo, etc keys are intened to be pressed repeatedly too, just like normal keys.
  • The rotary knob on upper right has dual function. For sound level control, and when pressed, it is play/pause button.
  • The ⌧ key should function identical to clicking the X to close window. The key labeled “Close” is intended to close current file, tab.
  • The labels for the letters should be lower case, not caps.
  • There should not be a qwerty version. This makes it simple.
  • This is not intended to be a radical design. It is intended to be cheap and mostly compatible with PC keyboard, but offers major improvements by some simple changes of the worst aspects.

TODO

  • Write a script that generate statistics on punctuation symbols use frequency from computer language source code. Categorize by lang: C, C++, C#, Java, php, visual basic, perl, python, javascript, lisp, bash. And do a report together too.
  • Add keys for “zoom in”, “zoom out”, “Browser”, “calculator” and possibly also “app1”, “app2”.
  • Do research on letter frequency of other langs. pinyin, spanish, Portuguese, German, French.
  • Do research to find out all non-ascii chars used in other langs. Their frequency. Check the Bepo, pt-Nativo layouts, also check International Keyboard Layouts.
  • Write complete account on various design issues.

Some quick char frequency based on few files of javascript, perl, python. (90% being js) This is probably the general pattern for all langs too.

. 2323
( 2281
= 2097
, 1961
| 1208
[ 1130
/ 939
+ 693
- 677
0 638
{ 581
1 436
& 352
^ 319
# 284
* 274
$ 188
! 164
% 50
@ 18

The Idiocy of Computer Language Docs

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

The Idiocy of Computer Language Docs

Xah Lee, 2011-01-03

Worked with Mathematica for a whole day yesterday, after about 10 years hiatus. Very nice. Mathematica lang and doc, is quite unique. Most other langs drivel with jargons, pettiness, comp-sci pretentiousness, while their content is mathematically garbage. (unixism mumble jumple (perl, unix), or “proper”-engineering OOP fantasy (java), or impractical and ivory-tower adacemician idiocy as in Scheme & Haskell ( currying, tail recursion, closure, call-cc, lisp1 lisp2, and monad monad monad!)) (See: What are OOP's Jargons and ComplexitiesLanguage, Purity, Cult, and Deception.)

Mathematica, in its doc, is plain and simple. None of the jargon and pretention shit. Very easy to understand. Yet, some of its function's technical aspects are far more scholarly abstruse than any other lang (dealing with advanced math special functions that typically only a few thousand people in the world understand.).

A Gander into the Idiocies

Here's a gander into the doc drivel in common langs.

unix

In unix man pages, it start with this type of garbage:

SYNOPSIS
       gzip [ -acdfhlLnNrtvV19 ] [-S suffix] [ name ...  ]
       gunzip [ -acfhlLnNrtvV ] [-S suffix] [ name ...  ]
       zcat [ -fhLV ] [ name ...  ]

SYNOPSIS
       zip  [-aABcdDeEfFghjklLmoqrRSTuvVwXyz!@$]  [--longoption  ...]   [-b path] [-n suf
       fixes] [-t date] [-tt date] [zipfile [file ...]]  [-xi list]

Here, the mindset of unix idiots, is that somehow this “synopsis” form is technically precise and superior. They are thinking that it captures the full range of syntax in the most concise way. In practice, it's seldomly read. It's actually not accurate as one'd thought; no program can parse it and agree with the actual behavior. It's filled with errors, incomprehensible to human. Worse of all, the semantic of unix software's options are the worst rape to any possible science in computer science. See: The Nature of the Unix PhilosophyUnix Pipe As Functional LanguageUnix zip Utility Path Problem.

Python

In Python, you see this kinda garbage:

7.1. The if statement

The if statement is used for conditional execution:
if_stmt ::=  "if" expression ":" suite
             ( "elif" expression ":" suite )*
             ["else" ":" suite]

(Source docs.python.org)

Here, the mindset of the python idiots is similar to the unix tech geekers. They think that using the BNF notation makes their doc more clear and precise. The fact is, there are so many variations of BNF each trying to fix other's problem. BNF is actually not used as a computer language for syntax description. It's mostly used to communicate syntax to humans. Like regex, there are so many incompatible variations. But worse than regex in the sense that there are actually not many implementations of BNF. Real world syntax description languages are usually nothing close to BNF. See: Pattern Matching vs Lexical Grammar Specification.

This incomprehensible BNF notation is the only thing you get if you want to know the basic syntax of “if”, “for”, “while”, “lambda”, or other basic constructs of python.

For much more, see: Python Documentation Problems.

Perl

In perl, you see this type of drivel:

A Perl program consists of a sequence of declarations and statements which run from the top to the bottom. Loops, subroutines and other control structures allow you to jump around within the code.

Perl is a free-form language, you can format and indent it however you like. Whitespace mostly serves to separate tokens, unlike languages like Python where it is an important part of the syntax.

Many of Perl's syntactic elements are optional. Rather than requiring you to put parentheses around every function call and declare every variable, you can often leave such explicit elements off and Perl will figure out what you meant. This is known as Do What I Mean, abbreviated DWIM. It allows programmers to be lazy and to code in a style with which they are comfortable.

Perl borrows syntax and concepts from many languages: awk, sed, C, Bourne Shell, Smalltalk, Lisp and even English. Other languages have borrowed syntax from Perl, particularly its regular expression extensions. So if you have programmed in another language you will see familiar pieces in Perl. They often work the same, but see perltrap for information about how they differ.

(Source perldoc.perl.org)

Notice they introduced you to their lingo “DWIM”. Juvenile humor is a characteristic of perl's docs. It's a whole cult. They have “perl republic”, “state of the onion”, “apocalypse”, “perl monger”, “perl golf”, etc. (See: Larry Wall and Cults.) Another trait is irrelevant rambling. For example, in the above you see: “Perl borrows syntax and concepts from many languages: awk, sed, C, Bourne Shell, Smalltalk, Lisp and even English.”.

For a example of perl doc's maturity and knowledge of math, see: Perl Python Tutorial: Complex Numbers.

However, perl doc overall is more practically usable than Python's.

Haskell

Here's a example of ivory-tower idiocy, from Haskellers:

Haskell uses a traditional Hindley-Milner polymorphic type system to provide a static type semantics [4, 6], but the type system has been extended with type classes (or just classes) that provide a structured way to introduce overloaded functions.

A class declaration (Section 4.3.1) introduces a new type class and the overloaded operations that must be supported by any type that is an instance of that class. An instance declaration (Section 4.3.2) declares that a type is an instance of a class and includes the definitions of the overloaded operations—called class methods—instantiated on the named type.

For example, suppose we wish to overload the operations (+) and negate on types Int and Float. We introduce a new type class called Num:

  class Num a  where          -- simplified class declaration for Num  
    (+)    :: a -> a -> a     -- (Num is defined in the Prelude)  
    negate :: a -> a 

This declaration may be read “a type a is an instance of the class Num if there are class methods (+) and negate, of the given types, defined on it.”

(Source www.haskell.org)

Note the words “Hindley-Milner”, “polymorphic”, “static type semantics”, “overloaded operations”.

The reason they wrote their doc like that is because they are academicians. You might think that their writing is really scholarly, mathematically meaningful, full of rigor, and the daunting appearance must be due to the advanced math ideas by necessity. The irony is that the writing is actually most lousy tech writing. Most of their use of computer science jargons are uncessary to the point of being irrelevant. And, the writing quality is nothing close to the quality of standard math journal's articles.

For some exposition of esoterism, see: World Multiconference on Systemics, Cybernetics and Informatics???.

For much more about jargons, writing, programing languages, see: Jargons of Software IndustryXah on Programing Languages.

2011-01-03

Python doc url disappearance

Perm url with updates: http://xahlee.org/perl-python/python_doc_url_disappearance.html

Python Doc URL disappearance

Xah Lee, 2011-01-04

Python Doc URL Disappearance.

In my Perl and Python Tutorial, i have about 50 links to documentations at python.org. For example, about 15 url have this form: 〔http://python.org/doc/tut/node7.html〕 and about another 15 has this form: 〔http://python.org/doc/lib/typesseq-strings.html〕. As of today, all these links are 404 errors. No redirect nor any measure to tell user how to find that file.

I truely hate sites that do not take consideration of url permanence. This has also happened to FSF. See: A Record of Frustration in IT Industry; Disappearing FSF URLs.

Link maintenance many not be easy for sites with large number of files, such as documentation. But site owners should at least be considerate of this issue. It's not too difficult to maintain permanent links. There are many solutions, such as redirects (Apache server url rewrite, html refresh tag, file aliases), or provide dynamically generated page that tell user where the info might went.

When you create new content, you should also plan ahead on possible url changes. For example, if it is a documentation, you might include version number there, e.g. 〔example.com/v1/doc.html〕,〔example.com/v2/doc.html〕, 〔example.com/latest/doc.html〕. This way, you can have permanent url for almost all your url without much management.

So, what does this mean to you?

  • As webmaster, before your create a url, think about how the url might impact url permanence. Is it likely to change? Can the url be maintained?
  • As blog writer, when you link to sites, keep in mind that later all your urls for references may be gone, and reader have no idea what's the content of those urls. Before you link to a specific url, you might want to include the page title, or link to a more general table of content page instead. You might be able to actively monitor your links, but you might want to make it so that your links wont suffer link rot so bad even when your site is no longer maintained (such as on a CD ROM)

what's the difference between AppData/Roaming/ and AppData/Local/ ?

On Windows, what's the difference between 〔AppData/Roaming/〕 and 〔AppData/Local/〕?

Basically, the “Roaming” dir is for useful user data, and the “Local” one is for data like cache. Things in Roaming dir might be synced with a server so the data is available to user on different machines.

The “AppData” dir is introduced with Windows Vista, and used in Windows 7 too. In XP, it just have “Application Data” dir. On Vista and later, any write to “Application Data” automatically goes to “AppData/Roaming/”.

〈Managing Roaming User Data Deployment Guide〉 Source technet.microsoft.com