Xah Programing Blog Archive 2013-11

Python Regex Match Object (complete rewrite)

Python Regex Functions (major rewrite)

Python Regex Flags (major rewrite)

Which Languages to Learn? Perl, Python, Ruby, JavaScript, PHP, Emacs Lisp

Python: Reading Writing File (updated with using with)

OOP Dot Notation, Dot Before Data or After?

Meaning of Object in Computer Languages

List Comprehension in Python and Perl

Python: List (updated with all its methods, near bottom)

Python, a view to a kill. Python: Dictionary

Python 3: Map with Side Effect Doesn't Work If Result is Not Used

Perl, Python, Ruby: Map Function to List

Perl, Python, Ruby, Loop Examples

Note: as of 2013-11-25, in Ubuntu Linux, there's a bug that both pydoc modules and help('modules') will crash Python. Use python3 instead.

sudo apt-get install python3

pydoc3 modules

perl, python, ruby: complex numbers

the hideousness of Python. Python: Function Argument Default Value Wrong

Perl, Python, Ruby: True, False

Python Indentation Syntax Terminology: “Off-Side Rule”

keyboard touchtype sock 2008 Becky Stern
proper way to learn touch type in winter! [image source flickr, by Becky Stern, . © [https://creativecommons.org/licenses/by-sa/2.0/legalcode] ]

Keyboard: Layouts, Hotkeys, Macros, RSI ⌨

Python, Perl, Ruby: Function Optional Parameter

split into 3 pages, updated:

Perl, Python: List Modules, Search Path, Loaded Modules

split into 2 pages:

JavaScript and Design Patterns Approach in Tutorials

possibly i'll have a first phone interview with Google engineers. The recruiter asks me about googlers i know. Who can give a helping hand? thanks. (xahlee@gmail.com)

Wolfram Language and Lisp, Clojure

every developer should buy a copy of Mathematica, because it will expand their mind. —Rich Hickey (clojure inventor)

Wolfram language is on the news recently.

Mathematica is very similar to lisp. Every concept of lisp has a counter-part in Mathematica. Symbols, atoms, read/eval/print loop, symbol properties, nested expression (sexp and [ Homoiconicity ] [ https://en.wikipedia.org/wiki/Homoiconicity ]), macros (in M it's far more advanced, called pattern matching (but Haskell and Ocaml's Pattern Matching not like M, because M work on symbols, as do lisp macros)), even package system is akin to Common Lisp.

if you want to get a sense of what the lang is like, see:

Kovas Boguta — session — Clojure NYC Meetup 20120516. From Tom Hickey, 2012

Mathematica notebook demo start at 5:50 to 18:00.

For more detail, see:

Syntax Design: Python's Indentation vs Nesting

Apparently, you can page up/down with key in Windows console. See: Windows Console Key Shortcuts (thanks to iainelder for answer.)

Windows Environment Variable Tutorial (oldie but goodie)

Jargon Lambda in Decline (minor update)

Semantic of Symbols: HTML Entities, Ampersand, Unicode (updated)

The Abuse of Interface and API and the Inanity of Java Tutorials: Official Java Tutorial on Interface, the Inanity

Technical Writing: Fruit Apple Banana vs X Y Z

Intro to Wolfram Language Pattern Matching for Lisp Programers (see comment of a clojure solution, by https://twitter.com/guilespi)

Understanding JavaScript Object System

my JavaScript tutorial is now roughly complete. In particular, understanding JavaScript's object system. Took me 3 months to write. The major page on JavaScript object system is this: Understanding JavaScript Objects .

The index to it all is at Xah JavaScript Tutorial .

in the next weeks, i'll be doing some editing work and adding more examples. Comment welcome. Help Tweet it, thanks.

Linux: How to Swap Mouse Buttons (updated)

Unicode Jargon “Code Point” and Notation U+03B1

OCaml Use in Industry: Janestreet Talk by Yaron Minsky 📺 (updated)

LISP Infix Syntax Survey (updated)

this book just came out: [Real World OCaml: Functional programming for the masses Paperback By Yaron Minsky , Anil Madhavapeddy , Jason Hickey. At Buy at amazon ]

see also F Sharp, OCaml Books and History of OCaml (updated)

much update on JavaScript Tutorial. Have a look.

Windows: Single-click Open File (updated)

What Does “Formal Method” Mean?

one abuse of term in math and programing is “formal”, for example, formal methods, formal proof. In practice, people meant roughly “more rigorous”. But, it has a more technical meaning: formal in “formal language”, Hilbert “formalism”, the “form” of formulas, calculational proof.

when programers mention formal methods, for example, lisper, haskeller, pythoner, please help better the world by shoving a cucumber in their mouths.

see also Math Notation, Computer Language Syntax, and the “Form” in Formalism

Guido Says: Python 3 Things Still Unsolved: Multi-Line Lambda

lol. In Guido's python 3 retrospect, his last item is: “Things still unsolved: Multi-line lambda”.

[Python 2 vs. Python 3: A retrospective By Guido Van Rossum. At https://www.dropbox.com/s/83ppa5iykqmr14z/Py2v3Hackers2013.pptx , accessed on 2013-11-09 ]

See also:

Linux: Mouse Hover to Raise Window (updated)

Keyboard Layout, Is Inverted Number Row Better?

Ruby, like Perl, supports __END__. Anything below that line is ignored. This is very useful to put test data or random notes in the same file.

MMO Mouses (updated)

Difference Between Apple and Microsoft keyboards (updated)

Linux: Show Directory Size: du (updated)

BlackBerry PlayBook, Unable to Delete File, Force Reset, Connect to Linux via USB

Python: Tuple (updated)

started to restructure my {Perl, Python, Ruby} tutorial, so that each language is on its own page. Let me know how you like it.

python tutorial


there are 2 types of “blocks” in Ruby:

  1. do … end, which is syntactically equivalent to { … }.
  2. a “body” of statement expressions. For example, for … end, module … end, class … end, def … end

see also: Ruby Tutorial by Example

Ban Key Chords (oldie, but goodie)

Math Font, Unicode, Gothic Letters, Double Struck, 𝔄 𝔅 ℭ (major update)

Xah Linux Setup (updated)

am truly impressed by David Flanagan. His JavaScript and Ruby are the best books, basically the definitive guide, as his JavaScript book title suggest. “definitive”, meaning, that if you have a question about some esoteric language detail, his book answers it. The other option is reading the incomprehensible standards documentation for language implementers.

JavaScript Book by David Flanagan, and Man-made Complexity in Computer Language

David Flanagan's Ruby Whitespace Examples

What Does it Mean When a Programing Language Claims “Whitespace is Insignificant”?

computer science breakthrough: P ≠ NP. Proof: divide both sides by P, we get 1 = N, but 1 ≠ N else P=1P=P. Therefore, P ≠ NP. ∎

Mark Janssen is rapidly becoming Xah Lee 2.0, —alex23

looks like my troll fame doesn't cease, even when i ceased. #python #lisp

Flanagan's JavaScript Definitive Guide Buy at amazon has spoiled my love for JavaScript. He's starting to do the same on Ruby to me. [see JavaScript Book by David Flanagan, and the Man-made Complexity in Computer Language]

80 char limit came from punch cards. Stop cutting lines at 80 chars.

Ruby: What's RVM, Gem, Rake, Bundler, RDoc, ri, irb? (updated.)

Unicode Arrows → (updated)

how many extra keys are there in the ergodox keyboard?

i can't help but started to design a optimal layout for the keys, even i don't have the keyboard.

see Ergodox Keyboard

See also: Keyboard Symbols ⌘ ↩ ⌫