Xah's Programing Blog

On programing, languages, functional programing, Unicode, keyboard, hacker culture, ….

Want to master JavaScript in a week? Buy Xah JavaScript Tutorial.


Computer Science: What is vs How To

SpaceOrb 360-68931
SpaceOrb 360

Java for absolute beginners. Java Tutorial: Printing a String

OCaml Tutorial: Function (repost)

What's Point-free Programing? (point-free function syntax) (repost)

Guide to Computer Keyboard Key Switch Mechanisms (Added a great animation of Topre switch's rubber dome in action.)

The key feel of the Topre switch, used in Happy Hacking Keyboard, primarily came from its rubber dome.

Java Tutorial: The “extend” Keyword (updated)

Mac OS X Resource Fork and Command Line Tips (repost)

language tutorial popularity

apparently, Java PHP are most requested tutorial. The ranks are: Java PHP Python C# C++ C Javascript Objective-C Matlab R Swift Ruby …. 〔source: http://pypl.github.io/PYPL.html

Alan Kay on Object Oriented Programing

JavaScript Language Design: Dot Notation be Namespace or Object System (on its own page)

see also

Engineering = Hack Hack Hack. the Historical Origin of the “sprite”

nice video. It shows what depth engineering went into, and, the historical origin of the concept “sprite”.

《How “oldschool” graphics worked.》
calibrate monitor color 2015-08-17
How to Calibrate Your Monitor's Color
keyboard keycap pumpkin jack o lantern e9822478
Keyboard Keycap Gallery

Python C C++ → Jail

python C Cpp goto jail  Francois Rene Rideau lisper on C

A Guide to Undefined Behavior in C and C++, Part 1 By John Regehr. @ http://blog.regehr.org/archives/213

see also Programing: Why I Hate C

Leopold fc660c topre switch keyboard 72614
List of Keyboards with Topre Switch This is the famous switch used in Happy Hacking Keyboard.

Programing Style: Variable Naming: English Words Considered Harmful (repost)

Logitech Trackman Wheel (new photo. Early model actually have a “shark gill” lights.)

Keyboard: Why Undo Cut Keys Wreck Your Hand (major update. The {Z X C V} keys is not better on Dvorak.)

what's “operator” in programing language?

in programing languages, the concept of “operator” is completely fscked up.

comp lang operator JavaScript 2015-08-11
JavaScript operators

Logitech G13 Gaming Keypad Review

logitech g13 keypad features 22557
Logitech G13 Gaming Keypad Review amazon

Xah Verdict: Buy It. But, for coding, yes!

what languages are different from all others

of all the languages i know, { Java, Perl, PHP, Python, Ruby, JavaScript, Clojure, Emacs Lisp, Wolfram Language } , the one standing out are JavaScript, and Wolfram Language.

so i was riding the bike on the street, and it occurred to me, what an odd language JavaScript is. Then i thought, is it true, critically? The languages i know of floated in my head and i went over them. I conclude, the 2 really odd, standing out from the others, are JavaScript and Wolfram Language.

JavaScript because of its Prototype Inheritance system. Wolfram Language because of its symbolic pattern matching (term rewriting language)

roccat nyth mouse 11
Fin-switch at top, you push it left/right. amazon

ROCCAT NYTH Mouse. Brand new, just came out.

Programing Language: Polymorphism, Dispatch, and the Tale of Poly-Tinting

Logitech G502 Proteus Mouse. Look at it again. Analysis. Verdict: no buy.

What Does Formal Proof Mean?

the word “formal” in formal proof/grammar/lang, is sloppily used. Most people mean “rigorous”. It should mean: in a form of math formulas.

internet speed growth
How Fast Does Internet Speed Grow?

A Class of Computer Languages: Math Lang

A Class of Computer Languages: Math Languages

《Code Complete: A Practical Handbook of Software Construction, Second Edition》 amazon

This i read parts in 1990s. Don't recall much about it except that this is about the only science based appoarch on the questions of software engineering methodoligy questions. Am taking a look again.

this is in contrast to other voodoo in programing, such as the {agile, extreme programing, unix philosophy}

Voodoo of Software Engineering

SVG pain. inverted y axes; text default scale is absolute

inverted y axes

the y coordinate is inverted from normal

Solution, attach all your drawing to a group, then apply transformation, like this:

gp.setAttribute("transform", xd.translate(0, 2*ymin+ywidth) + xd.scale(1,-1) );

but, the problem is, if you have text, the entire font gets inverted upside down too.

So this means, there isn't simple solution to work with “not invert” y axes. Maybe there's a attribute to make text not invert or something. Still don't have a nice solution.

the inverted y axes is a major pain, because it drains brain when you work with “normal” y-axes, such as in math plots. Either twist your brain, or, you need to remember to attach a transform to every of your drawing primitive. Or, group them and transform.

text default scale is absolute

you can use svg viewBox to specify your drawing's coordinate range. that is, xmin, xmax, ymin, ymax

this makes it convenient. For example, if your app is plotting basic math functions, you can work with coordinate x from -10 to 10, y from -10 to 10. Instead of pixels and whatever is the current width and heigh of view port

but, if you add text in your drawing, such as axies labels, the text default to font size 16px. So, you have to manually figure out what's the scaling from your view box to view port, and rescale all your text elements.

〔➤ SVG Coordinates, Viewport, viewBox

Linux: How to Set Default App? (repost)

researched continuation whole day. it should be ban'd, together with closure.

continuation, is functional programer's version of goto. As such, it is not FP by definition. Similar is closure. #lisp

iterator, the worst shit in langs. It exits in shits like java, python. While function programers are laughing, but continuation, closure, is deeper shit.

closure, continuation, are the roads to Objects of OOP, and then onto complexity spaghetti lala land. #lisp #haskell

closure, continuation, are functional programer idiot's byproduct of computer engineering, similar to imperative's references and pointers.

continuation is like goto, but 100 times worse. Does it actually make things convenient & useful? If so, it's because the lang sucks. #lisp

closure, continuation, are concepts that doesn't exist in algorithm, or, math.

if closure is useful, it's because the language sucks. Same with #lisp macros.

What is Math? when things are stripped down to the minimal essence, it's called math.

Learning Notes on Goto, Continuation, Coroutine

suger syntax is no suger syntax

in all languages i know of, sugar syntax is no sugar syntax, but with slightly different semantics. The only language i know of with true sugar syntax is Wolfram Language, with syntax transformation before compiling.

Even lisp, with using macros to perform syntax transformation, is significantly different semantics than if the programer were to type what the sugar syntax is for.

Programing Language Syntax Soup

JavaScript prototype inheritance system, is inevitably confusing. It's impossible to get a sense of hierarchy. goto comes to mind.

JavaScript: Understanding Prototype & Inheritance

Microsoft Universal Foldable Keyboard is now available. For your phone or tablet.

logitech g910 keyboard key closeup 14
Logitech G910 Keyboard. New key switch: romer-g.


this earphone, AKG K3003i, $1k. Buy it. amazon

Google Gmail Blocks Mozilla Thunderbird

html5 hip hand sign
html5 hip hand sign.

This sign, signifies all that's wrong with the web. Coolio, bro!

Displaying Chinese Results Ugly Mixed Font (updated)

Linux: How to List & Install Font

How to Download Source Code of Firefox Addon

Firefox extention is usually a XPI file. That is, a file with name ends in “.xpi”.

in the “+Add to Firefox” button, right click to save.

then, rename the “.xpi” file to “.zip”, then unzip it.

Python vs OCaml

Python to OCaml: Retrospective By Thomas Leonard. @ http://roscidus.com/blog/blog/2014/06/06/python-to-ocaml-retrospective/

OCaml: What You Gain By Thomas Leonard'S Blog. @ http://roscidus.com/blog/blog/2014/02/13/ocaml-what-you-gain/

a new lang. ATS (programming language)

golang no exceptions 2015-07-14 13208
golang does not have exceptions. Screenshot from golang FAQ @ https://golang.org/doc/faq .

Programing: Why I Hate Exceptions

remember in the 1990s, perl claims to make programing fun again? most of these scumbags are dead.

in this day and age, are there coders who don't know 3,4 language?

in 1990s, mastering 4 langs is god. In 2000s, you are super. Today, if you don't know 4 languages, you a idiot.


1990s, 精通4个语言是神。2000s,是厉害。如今,你不会4个语言,你是渣渣。

Programing Languages Suger Syntax: Compiler Level vs User Level