Xah Programing Blog Archive 2014-01

gosh, Mac OS X is still producing .DS_Store files. Linux Dot File Problems: .svn .htaccess .DS_Store etc

Input Devices: Mouse, Jog Wheel, Touchpad, Pen Tablet, Trackball, Joystick (updated)

Mac OS X. news. Key map tool DoubleCommand is now revived for Mac OS X 10.9. Mac Keyboard Software Guide

this is quite fun. For those of you using standing desk. wobble board

How to Program Number Keypad as Function Keys (updated)

HAML Tutorial (draft version and rant.)

Programable Keypads (updated)

How to add color to ls output on Mac OS X?

put this in your ~/.bash_profile

# make ls do color
export CLICOLOR=1


alias l='ls -G -al'

here's how to write a web crawler in Python. Python: Web Crawler

several layouts. Xah's Truly Ergonomic Keyboard Layouts. More interesting there is the related article about layouts, at bottom.

Apple MacBook Air MD760LL 13.3 Inch VERSION

Intel Turbo Boost is, in short, “dynamic overclocking”:

Intel Turbo Boost is a technology implemented by Intel in certain versions of their Nehalem-, Sandy-Bridge-, Ivy-Bridge, and Haswell-based CPUs, including Core i5 and Core i7 that enables the processor to run above its base operating frequency via dynamic control of the CPU's clock rate.[1] It is activated when the operating system requests the highest performance state of the processor. Processor performance states are defined by the Advanced Configuration and Power Interface (ACPI) specification, an open standard supported by all major operating systems; no additional software or drivers are required to support the technology.[1] The design concept behind Turbo Boost is commonly referred to as “dynamic overclocking”.[2]

more tech: object relational mapper, and python bottle web framework

also discovered “Bottle: Python Web Framework” http://bottlepy.org/docs/dev/index.html

Programing: Decimalize Latitude Longitude (updated)

Python: String Methods (new. first draft)

Python: List Methods (separated into its own page)

Python: Dictionary Methods (separated into its own page)

this is the best companion to your keyboard, for real hacker use for coding. Razer Orbweaver Keypad

Why Idioms Are Bad (slightly expanded. sloppily written, needs work)

Mouse vs Keyboard: Is Mouse Bad for Programer?

in Second Life virtual world, its scripting language is LSL, which is quite different from all common programing languages such as {Java, Python, Ruby, Perl, PHP, Lisp, etc}. Mostly because, the context is very different. In Second Life, the language controls the interaction, the 2D or 3D user interface, and the physics engine in-world. Such as UI (HUD), particle system, moving objects, airplane/car/spaceship flying, gun fire, dance floor, neon signs, animal gates, …, basically everything you see in real life but in a virtual environment.

Xah's Linden Scripting Language (LSL) Tutorial

MMO Mouses (updated, a new mouse from razer, the Naga Hex)

Official Java Tutorial on Interface, the Inanity (more update)

Proliferation of Programing Languages

discovered a new language: Haxe. That's, one language to rule them all? LOL.

Git: Show Difference Between Files (minor update)

Linux X11 Problem: Switch Window Within App

not sure this is general X11 problem or specific to Ubuntu/xfce. in xfce, you can set a key to switch windows of the current app. However, when running terminal, sometimes a new terminal is separate. That is, suppose you have 3 terminals A B C. Pressing the key only switches between A and B. (this happens with gnome terminal, not sure if it happens with other terminal)

does anyone know the detail of this? is the switch windows within app, based on raw grepping process group or something?

comment https://plus.google.com/+XahLee/posts/gLUfc4sXzKB

Mark Tarver, inventor of Qi and Shen lisp, provided a solution. Programing Problem: Construct a Tree Given Its Edges

What is Currying in Computer Science? (minor update)

Linux 「killall」 command, dangerous? 「killall5」, 「pidof」

does anyone feel uneasy using the killall? i'm always worried that some other program might have the same string i'm killing. Is this worry worthy?

on a separate note, when did the linuk killall started life? the man page has 2011 date, but gotta be earlier?

learned 2 linux commands: killall5 and pidof. The pidof is fantastic.

thanks to [Nick Alcock https://plus.google.com/115849739354666812574/posts]. Comment at https://plus.google.com/+XahLee/posts/A8FGj5BKGjv

Why After a Decade MathML Still Isn't Well Supported?

for current MathML status, see [MathML Forges On By Peter Krautzberger. At http://programming.oreilly.com/2013/11/mathml-forges-on.html , accessed on 2014-01-11 ]

why after a decade MathML still isn't well supported? Basically, because there is no demand. What about all the mathematicians and hard scientists? Well, in comparison to other things, these demands are minuscule, fringe upon the fringe.

Compare to the tech of video streaming, which is far more complex tech than math typesetting rendering tech, and we have YouTube and YouPorn and Vine and sundry more. When Apple ban'd Flash on mobile devices, porn industry came up with a solution overnight. That, is demand, measured meaningfully by money.

meanwhile, there's these open source programer hacker idiots and skumbags, who cling to various TeX or open source ideology while don't want to pay a beer. That's why, things don't move forward. There's no impetus.

The Google do no evil scumbag, on one hand is all for the good of humanity, meanwhile, don't do nothing to support MathML in its browser. Such a mega billion corp, can't spare just one dime for this? No.

and, suppose Google made robust MathML in Chrome browser. Do they get thanks, or more users? Statistically, that'd be 0.

the story of human animal skumbags. The idiots and the liers and the ideologists, boot strapping each other.

see also Tools to Display Math on Web

comment at https://plus.google.com/+XahLee/posts/Lc8kEiMdYbB

Math Typesetting, Mathematica, MathML (updated)

file name, to space or not to space

xah's rumination extempore, episode №201401111702

am forever troubled by the design issue of whether i should use space in file names.

in unix tradition, you shouldn't. So, i always used underscore. But, using space is so much more convenient. But, if you use space, all shell script that process file will be inconvenient, because you have to quote in a special way. And, if you forgot, woe be onto you.

so the question is, for your own files, should you stick with a rule to always stick with the alphanumeric hyphen underscore or freely use space?

'tis this decision to make, bothers me for years. At times, i'll go by always alphanumeric. Then next year, i thought tech really should advance forward, so i experiment by freely use space. Stop being so lazy; just how bad can quoting be? Then, the pain and inconvenience dealing with that, so i started to use underscore again…. back and forth. fsck unix, 'tis unix started this fsck.

but, ultimately, i think space is just better. Because, file name is supposed to be just whatever set of chars. The quoting inconvenience is the issue of your tool.

also, on a separate note, file name with space will win out, because the general public don't care. Normal people want space in file names. If your language, or you programer, find it inconvenient dealing with it, it's your problem.

comment at https://plus.google.com/+XahLee/posts/PHHANoEFiwh

meta level logic in programing

xah's rumination extempore! episode 20140111061607

here's a syntax/semantics issue i constantly ran into in recent years.

look at this page HTML5 Tags Complete List

notice at the top, the line: “Those marked this way are new in HTML5.”

that “this way” is marked with the same html/css as the rest. That way, it ensures consistency. Whevever the css changed, the page need not.

however, there is a logical issue. Namely, that mark up is now applied in 2 different contexts. It is meant to markup texts that are new html5 tags. But in that sentence, the word “this way” certainly isn't that. This creates a semantic inconsistency.

of course, to solve it, you have to use a different mark, then use variables or other means to ensure consistency. Essentially, you are going a meta level in some sense.

i haven't came up with a philosophical resolution for this.

but also note that, this isn't a practical issue. Most programers, never thought of it, and probably never occured to them.

this is more of a philosophical issue, or logic. It's kinda curious, and hard to explain. The way i described it above is only by side-effect. One interesting aspect is to actually come up with a proper, direct, description of this situation. Which, often also means understanding the heart of this issue. I kept thinking this has something to do with levels of logic, such as higher-order logic.


a look at a very different language, the Linden Scripting Language. Linden Scripting Language Tutorial: Particle System. See also Second Life, the Worst Hack in Universe

Linux Tutorial: Use 「lsof」 to Show Open Files (on its own page)

Python: Timing Functions with timeit

Clojure and Parallel Programing

to install Clojure, the best option is [2014-01-08 https://github.com/technomancy/leiningen ] (thx to [Dan Lentz https://plus.google.com/+danlentz/posts])

two great articles by Rich Hickey. (related to Guy Steele's talk on Parallel Programing)

Guy Steele Says: Don't Iterate, Recurse, and Get rid of cons! (minor update)

programing challenge. Constructing a Tree Given Its Edges

did you know that Scheme Lisp co-inventor Guy Steele's language, Fortress, uses Unicode brackets? Problems of Symbol Congestion in Computer Languages; ASCII Jam vs Unicode (updated)

Unicode: Brackets, Quotes «»「」【】《》 (updated. Now complete)

Python: Sets, Union, Intersection

Keyboards without Numeric Keypad (updated) The best quality/price ratio is probably the Cooler Master.

Corsair keyboard has new model, K70, Comes in Cherry MX {Red, Blue, Brown} mechanical switches of your choice. Corsair Keyboards Review (via [Marius Piedallu van Wyk https://plus.google.com/+Marius_Piedallu_van_Wyk/posts])

Logitech has a new mouse. Logitech G602 Wireless Gaming Mouse with 250 Hour Battery Life Logitech g602 Wireless Mouse

ROCCAT Mouse: Mouse with Full Linux Support

excellent symmetric gaming mouse, and excellent quality/price ratio. CM Storm Recon Mouse (updated)

the Logitech G9x Gaming Mouse is discontinued. Logitech Gaming Mouses Review

Python, Perl: One-Liner Loop Functional Style (updated)

What Language Does Google Facebook Twitter Paypal Wikipedia etc Use?

PayPal switched from Java to JavaScript/Node.js.

Linux: tmux Tutorial (very basic tutorial. If you never used it before)

Mac OS X File Resource Fork Changes

Mac OS X 10.7 (released in 2011) deprecated the command line syntax to access file resource fork. Before, you do ls -l filename/rsrc but that no longer works. The new syntax is ls -l filename/..namedfork/rsrc.

see Mac OS X Resource Fork Tips

thanks to [Marius Piedallu van Wyk https://plus.google.com/+Marius_Piedallu_van_Wyk/posts]

Mac OS X command line tips