Xah Programing Blog Archive 2013-11

Python Regex Object & Methods (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)

On the Idiocy of Dot Notation of Object Oriented Programing Languages

Meaning of Object in Computer Languages

List Comprehension in Python & Perl

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

Python, a view to a kill. Python: Dictionary (Key/Value Pair, Hash)

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

perl, python, ruby: complex numbers

the hideousness of Python. Python: Keyword Argument Default Value Unstable

Perl, Python, Ruby: True, False

Python Indentation Syntax Terminology: “Off-Side Rule”

proper way to learn touch type in winter
proper way to learn touch type in winter

Keyboard: Layouts, Hotkeys, Macros, RSI ⌨

Python, Perl, Ruby: Function Optional Parameter

split into 3 pages, updated:

Perl & Python: List Available Modules, Module Search Paths, 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), 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 Variables Tutorial (oldie but goodie)

Functional Programing: the Jargon Lambda in Decline (minor update)

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

The Abuse of Interface & API and the Inanity of Java Tutorials: Interface in Java

On Technical Writing of Object Oriented Programing

xah's thoughts extempore, episode №201311171455

the most idiotic tutorial idiom in OOP is using Fruits, banana, apple, analogy, or using Shapes, circle, square.

Why? because, when you read those english words, your head started to nod, but you actually understood nothing. You think you understand, but when pressed with details, you wouldn't be able to answer a f�rt.

So, instead of using fruits, apple, thingy, use abstract symbols, x, y, z, math, that is.

That is the beauty of math, and that's also why math is like that.

because, in order to truly understand, you want to get rid of irrelevancies. Analogy sometimes helps, but often just confound and mislead.

btw, Category theory, is analogy codified; the math of analogy, called, isomorphism.

try this. Pick a tutorial of OOP language you don't know a thing. Find the chapter on class/object. Find/replace in code examples of words like fruit/shapes to x, y, z. Now, try to read the code.

Here's my claim. Of those who read fruit/shapes, they will understand less about the lang than those who tried to read the xyz version. And this can be verified by a test. e.g. ask them to create a new class or object, decide what's the inheritance, etc.

g+ discussion

Intro to Mathematica Pattern Matching for Lisp Programers (see comment of a clojure solution, by 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)

Xah Programing Blog Archive 2013-09

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

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

LISP Sans Parenthesis, 1958 to 2013, a Survey (updated)

archived. Xah Programing Blog Archive 2013-08

this book just came out: 〔Real World OCaml: Functional programming for the masses Paperback By Yaron Minsky , Anil Madhavapeddy , Jason Hickey. @ amazon

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

much update on JavaScript Tutorial. Have a look.

Single-click Open File {Windows, Linux} (updated)

What Does “Formal Method” Mean?

one abuse of term in math & programing is “formal”, ⁖ 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, ⁖ 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. @ https://www.dropbox.com/s/83ppa5iykqmr14z/Py2v3Hackers2013.pptx

See also:

Mouse Hover to Auto-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.

Best Mouse for Programers (updated)

Difference Between Apple & PC keyboards (updated)

Linux: Show Directory Size: du (updated)

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

Python: What's the Difference Between Tuple & List? (updated)

Mathematica syntax StandardForm screenshot
Expression rendered in Mathematica StandardForm.

Mathematica vs Lisp Syntax

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 … end, module … end, class … end, def … end

see also: Ruby Tutorial by Example

Banish Key Chords (oldie, but goodie)

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

Xah's 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 & Ruby Books by David Flanagan, and the Man-made Complexity in Computer Language

David Flanagan's Ruby Whitespace Examples

David Flanagan's book Ruby Programming Language amazon gave many detailed example of Ruby's whitespace dependency.

# -*- coding: utf-8 -*-
# whitespace issues in Ruby

aa = 3 +

bb = 3
+ 4

p aa # 7
p bb # 3
# -*- coding: utf-8 -*-
# whitespace issues in Ruby

def f(x) x*2 end

p f(3+2)+1    # 11
p f (3+2)+1   # 12

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 amazon has spoiled my love for JavaScript. He's starting to do the same on Ruby to me. 〔➤ 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.

computer language semicolon vs apostrophe frequency
computer language semicolon vs apostrophe frequency

How to Install Ruby; What's RVM, Gem, Rake, Bundler, RDoc, ri, irb? (updated.)

Unicode Arrows → ⇒ ⇄ ↑ ↩ ⤢ ↱ ↷ ↻ ► ☛ (updated)

how many extra keys are there in the ergodox keyboard?

Here's the keys of PC keyboard.

  ` 12345      67890 -=⌫   ⎀↖⇞
  ↹ qwert      yuiop []\   ⌦↘⇟
  ⇪ asdfg      hjkl; '⏎
  ⇧ zxcvb      nm,./ ⇧      ↑
  ✲❖⎇     ␣     ⎇❖▤✲     ←↓→

Here's the same symbols re-arranged on the ergodox. The strange symbols indicates extra keys:

  ⎋ 12345-    =67890 ⌫
  ↹ qwert↖    ⇞yuiop \
  ⇪ asdfg↘    ⇟hjkl; ⏎
  ⇧ zxcvb      nm,./ ⇧
  ✲ ↑↓←→        []'` ✲
      ❖⎇␣    ⎇❖▤
      ⌦⎀▲     ●◆■

the above isn't intended to be a optimal layout of ergodox, just placing keys similar to PC keyboard for easy match.

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

see also:

blog comments powered by Disqus