2014-11-20

clojure problem: string not in core

string manipulation is the most important element in modern programing. This is the first thing you teach to beginners, about any language.

But with clojrue, it's not core part of the language. You need to load it as a lib, or, go use Java's string stuff.

Try to tell that to beginner. You either face the immense complexity of clojure namespace , or the immense complexity of dealing with a entire complexity bag the interoperation with Java.

PS: actually, just prefix the namespace. ⁖ (clojure.string/upper-case "xyz").

2014-11-19

One Weird Annoyance About Clojure: Java

one annoying thing about Clojure is that it runs on Java Virtual Machine. Clojure is actually a so-called hosted language, and this is by spec. (and JavaScript is a hosted language too. 〔➤ JavaScript Tutorial: Understand JavaScript in Depth〕).

This practically means is that, Clojure isn't a “fixed” language. For example, when it's running on JVM, its regex is Java syntax, its string functions are Java language's string methods. When it runs in JavaScript world (as ClojureScript do), its regex is JavaScript's regex. 〔➤ JavaScript Regex Syntax

But, that's not all. The MOST annoying thing is that, you actually need to know a lot about stinking Java in order to do any real world work with Clojure. (don't let any hacker type fanatics tell you otherwise) You need to know Java class/object system, its package system, its namespace scheme, Java Virtual Machine system, its compilation cycle, its tools and achive files. Even the official Clojure documentation, outright simply say things like “returns a Java xyz object.” with no further explanation, in lots of places.

it is not to be taken lightly, that when you learn Clojure, you actally need to gradually understand a lot about Java ecosystem too.

but at least, thank god, it's a lisp that has industrial value, and is a Java replacement.

2014-11-18

show/edit zip file content in emacs

there's a patch for opening zip files in emacs. When opening a zip archive of a single file, emacs now can display its content (and you can edit it)

See: 〈bug#1702: [PATCH]: feature request: correctly display single file zip archive〉 at

It's going to be in emacs 25.x. Thanks to Matthew Leach for the patch.

2014-11-15

clojure parser instaparse, and excellency of clojure docs

A clojure parser lib, instaparse: https://github.com/Engelberg/instaparse, seems to be the topnotch parser. Instaparse is written by Mark Engelberg.

It has excellent tutorial too. Clear, to the point.

so far i've seen, clojure community's doc is top-notch. The official documentation is excellent. The lib/build manager Leiningen's documentation is excellent. 〔➤ Clojure Leiningen Tutorial〕And now the instaparse documentation is excellent.

it appears, a language's community pretty much follows the style of its leader. In this case, it's Rich Hickey. You can see Hickey's writings, his documentation style, in several essays titled “Reference Documentation” at http://clojure.org/documentation. They are, concise, to the point.

meanwhile, python's documentation are pretentious garbage, following Guido's style. Here's a typical one: Python, Lambda, Guido: is Language Design Just Solving Puzzles?.

and perl's drivels are derived from Larry Wall's drivel. Here's a sample: Perl Documentation: the Key to Perl

for much more, see programing doc idiocies collection

2014-10-23

most popular pages on xahlee.info

  1. JavaScript: Get Elements by ID, Tag, Name, Class, CSS Selector
  2. Unicode Arrows → ⇒ ⇄ ↑ ↩ ⤢ ↱ ↷ ↻ ► ☛
  3. The Idiocy of Happy Hacking Keyboard
  4. JavaScript Tutorial: Understanding JavaScript in Depth
  5. CSS: Line Wrap Tutorial
  6. Python: How to Read & Parse JSON
  7. Python: Get Dir Path, File Name Part, File Name Extension, Absolute Path, Check File Existence …
  8. Unicode: Keyboard Symbols ⌘ ⏎ ↹ ⌫ ❖ ⇞ ⇟
  9. Unicode: Brackets & Quotation «» 「」 【】 《》
  10. Truly Ergonomic Keyboard Review
  11. Computer Keyboards, Layouts, Hotkeys, Macros, RSI ⌨
  12. Visual Dictionary of Special Plane Curves
  13. Keyboards without Numeric Keypad
  14. Keyboard Layouts Fight! Dvorak, Colemak, Workman, NEO, Bépo, …
  15. Simple & Useful AutoHotkey Scripts
  16. ∑ Xah Code
  17. Why LD_LIBRARY_PATH is bad
  18. List of HTML Self-Closing Tags
  19. Laptop Keyboards, No More Page Up/Down for You!
  20. Emoticons on Social Network: Facebook, Twitter, Sina Weibo
  21. HTML Framset Tutorial
  22. JavaScript: How to Change CSS
  23. HTML Frameset Index
  24. Unicode Characters ☢ ☯ ☭ ∑ ∞ ♀ ♂ ♥
  25. Difference Between Apple & PC keyboards
  26. HTML Frameset References
  27. HTML Split Windows; Frameset Example
  28. Geometry: Gallery of Surfaces
  29. Java Tutorial: The “extend” Keyword
  30. OCaml Tutorial by Example
  31. Ergonomic Keyboards Reviews: How to Chose a Ergonomic Keyboard
  32. Apple Computer Keyboards Gallery & Review
  33. Microsoft Natural Ergonomic Keyboard 4000 (review)
  34. AutoHotkey Key Syntax
  35. Pure CSS Table
  36. Mac OS X Resource Fork and Command Line Tips
  37. Equiangular Spiral
  38. Guide to Computer Keyboard Key Switch Mechanisms
  39. HTML Split Windows; Frameset Example
  40. JavaScript Floating Box Following Scroll
  41. Unicode Emoticons, Faces 😃 😄 😱 😸 👸 👽 👍
  42. HTML Split Windows; Frameset Example
  43. http://xahlee.info/smart/ReportMain.htm
  44. Java Tutorial: The Power Function
  45. Ergodox Keyboard Review
  46. Using PowerShell to Manage Environment Variables
  47. Xah's Programing Blog
  48. Python: System Call Tutorial
  49. Great software for Tilings, Patterns, Symmetry
  50. Visual Dictionary of CSS

2014-10-22

where to download emacs 24.4 for Microsoft Windows

many are asking where to download emacs 24.4 for Microsoft Windows

you can get it here:

http://emacsbinw64.sourceforge.net/ prepared by Chris Zheng

also linked from my site here Which Emacs to Download for Windows and Mac?

2014-10-20

Truly Ergonomic Keyboard: new models

Truly Ergonomic Computer Keyboard-227 2014-10-20
Truly Ergonomic Keyboard

there's new model of the Truly Ergonomic Keyboard

they are switching from Cherry MX switch to Kailh keyboard switch. Kailh keyboard switch is just Cherry MX clones, made by a company in China. see http://deskthority.net/wiki/Kaihua_PG1511_series. I'm guessing it's not that much different from CHERRY MX.

looks like quite a few keyboards are using the Kailh switch. Supposedly, the Cherry MX has supply problems.

they also have some other minor changes. The ⇧ Shift key is now in conventional position. Ctrl is now at conventional keyboard's Caps Lock position. vim & emacs hackers overjoy! The HYPHEN-MINUS - and LOW LINE _ key are now in the middle, replacing the Tab ↹ there. The Tab ↹ is moved to the upper left corner. And upper right corner has a duplicated ⌫ Backspace key.

Overall, the key layout changes are now more conventional. People really don't wantto change habit. The new layout makes it easier for people to adopt.

2014-10-16

new monitor after 6 years

My monitor died this morning. The power won't come on. After some searching, i assume it's old or fried capicator problem.

VIZIO E241i-B1 tv monitor 2014
“VIZIO E241i-B1 24-Inch 1080p 60Hz Smart LED HDTV” amazon

as emergency measure, asked my roommate to drive me to Walmart and got this.

it's really a monitor designed for TV.

Vizio turned out to be a US company founded by Chinese in California in 2002, and it's popular for selling TV screens.

For me, it's a upgrade. My old served me good 6 years. It was LG L227WTG, 22″, 1680×1050. Not LED. 〔➤ Why I'm Switching from Mac to Windows

now it's 1920×1080 and 24″ and LED.

it's got what's called Smart TV

for my record, here's spec

VIZIO E241i-B1 monitor/tv Spec

Video

    Screen Size24″
    Screen Size (Diag.)23.54″
    Backlight TypeRazor LED
    Resolution1920×1080 (1080p)
    Effective Refresh Rate60 Hz
    Aspect Ratio16:9
    Viewable Angle (H/V)170°/160°
    Number of Colors16.7 Million
    OSD LanguageEnglish, Spanish, French

Audio

    Speakers/Power Output2W × 2
    DTS StudioSound™Yes
    DTS TruSurroundYes, HD
    DTS TruVolume™Yes

Inputs

    HDMI Ports1 (back)
    Component1 (back)
    Composite1 (back)
    Tuner1 (back)
    Ethernet1 (back)
    USB Ports1 (back)
    PC1 (back)

Outputs

    Analog Audio Out1 (back)

Multimedia Features

    VIA (VIZIO Internet Apps)Yes, VIZIO Internet Apps Plus®
    MusicYes
    PhotoYes
    VideoYes

Additional Features

    Built-in Wi-FiYes, 802.11b /g /n
    Remote ControlXRT112

Energy Savings
Energy Guide

    Energy ComplianceENERGY STAR® 6.0
    Power Consumption25.7W (Avg.)
    Standby Power Consumption<1W

Wall Mount Specifications

    Mount Pattern100mm × 100mm
    Screw SizeM4
    Screw Length10mm

Size and Weight

    Product with Stand Dimensions21.55″W × 14.55″H × 4.39″D
    Product with Stand Weight7.05 lbs
    Product without Stand Dimensions21.55″W × 13.80″H × 2.11″D
    Product without Stand Weight6.83 lbs
    Product Packaging Dimensions24.53″W × 16.38″H × 4.25″D
    Product Packaging Weight9.92 lbs

rule of conduct of a 4chan philosopher

in hacker discussion, there's one thing i despise the most. If you know something, say it loud, swear, insult, that's all fine. If you don't know something, but insist and put on a air, that is the MOST mfkg despicable in my book.

i often post random rants and stuff on computing in social networks. The seriousness of it is made plain in the writing style. When in discussion, you try to put on a air on something that you are idiotic of, be prepared for my wrath. (and btw, usually one has too go out of his way to invoke that. So, you don't need to worry.)

also, typically my posts are on programing topics but is not a technical issue that has a straight-forward answer. To illustrate, consider the question “how does y work in lang x”. Vast majority of coders knew this for some x. You and i can goto stackoverflow and get 100% satisfaction. But rather, i usually post subject about, syntax design, semantics, idioms, engineering practice. The discussion quality can be measured thru scientific methods. ⁖ knowledge of history of the subject, depth of logical analysis, or even creative writing. It is never “my experience is this and thus the world should be this” fuck. Example of such are fanatics of the Common Lisper macro is god fk, closure rules fk, array index should be 0 fk, gnu emacs keybinding fk, you must swap capslock/control fk, programing idioms fk.

twitter spambots talking to themselfs

twitter spambots chat 2014-10-16
looks like spam bots mentioning my name are talking to themselfs now, on twitter.

Web Spam, Scam, Blackhat SEO Collection

computer language: mixed list & hashtable

these days, some lang has array/list and hashtable mixed into one. It is popularized by php.

php started that way probably due to a hack. The lang doesn't have arrays, but what it calls array is a mix of hashtable. When used like array, the keys are automatically filled with 0, 1, 2, etc. 〔➤ PHP: Array Basics

JavaScript is a different story, but also hack and incompetence. It did NOT intent to have mixed array/hashtable, but rather, in order to be simple, it's array is implemented as hashtable (which is its object), so it pretent to be array. 〔➤ JavaScript: Understanding JavaScript Array〕.

nobody liked these, because they are even less than a design decision. The JavaScript here is simply fk'd up.

though, i heard lua is also mixed array/hashtable. Anyone know if it's really good?

2014-10-12

Google Chrome to Replace Gtk+ with Its Own Aura

old news from . Announcement by Elliot Glaysher at https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/Zpu9801pPRc. Quote:

We aim to launch the Aura graphics stack on Linux in M35. Aura is a cross-platform graphics system, and the Aura frontend will replace the current GTK+ frontend.

discussion on reddit http://www.reddit.com/r/linux/comments/207zr3/google_to_replace_gtk_with_its_own_aura_in_chrome/

Google Chrome to Kill Plugin

netscape back in 1990s created a plugin API architecture, called NPAPI. That's what allows you to have (Macromedia) Flash, Apple's QuickTime (for video), display MathML, use Java applets, and hundreds of others. Now, Google is killing it, and pulling it out of Google Chrome.

This means, no more Java Applets. By the way, the Flash bundled with Google Chrome isn't using NPAPI.

Google cites security reasons for killing NPAPI.

Saying Goodbye to Our Old Friend NPAPI By Google. @ http://blog.chromium.org/2013/09/saying-goodbye-to-our-old-friend-npapi.html

some discussion on chromium-dev here: https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/xEbgvWE7wMk

2014-10-09

Do Not Use Dart or CoffeeScript

Do not use Dart or CoffeeScript. Just use plain JavaScript. If you must use something fancy, use TypeScript.

Dart is basically JavaScript with Java syntax & semantics. Java is bad. Goole do it because Google can't divorce Java.

CoffeeScript is no good because it's a layer of complexity, with ad-hoc syntax, and benefit isn't big enough. It will never be standard.

TypeScript is acceptable, because it's JavaScript compatible, with benefit of type system (math foundation❕),not hacker whims of idioms & styles & patterns & OOP crud.

see also What do Microsoft, Apple, Mozilla, say about Dart?

2014-10-06

Poetry in Chinese vs English

月不圆花不好… 浮云散明月照人来,团圆美满今朝最。清浅池塘鸳鸯戏水,红裳翠盖并蒂莲开。双双对对恩恩爱爱,这园风儿向着好花吹。柔情蜜意满人间。🎶 周璇 ⭐〈月圆花好〉 🎶

Poetry in Chinese, is far deeper than English can possibly ever go. Chinese language,… here's a brief random Xah Edu Corner brief: Chinese language, is such that, not going with formality n all, but for ya American monolinguists to get a sense of Chinese, u can think of stringing together similar words that are on the ballpark of your meaning. And that's how Chinese is. In a sense, every phrase is a idiom. Note the word Every. So, when you study Chinese, you are actually study history. Chinese lang, is rather terrible for any science or engineering work. But for poetry, a english saying is that poetry is like honey, but in Chinese, it's like honey injected directly into your bloodstream.

2014-10-05

JavaScript Web Development = No Documentation Hell

Heavy work on JavaScript tutorial in past month again. Hope you like it. Xah JavaScript Tutorial.

there are lots JavaScript tutorials or blogs out there. Typically, they are either too basic, covering the syntax and not much else, often misleading info. Or, they are far advanced, blogging about latest ecma standard news or new libraries & frameworks for those who worked with JavaScript professionally for years.

JavaScript is not like emacs lisp, where there is a nice juicy reference manual. JavaScript doesn't have any documentation (there's the spec〔ECMAScript Language Specification - ECMA-262 Edition 5.1〕, but written for implementers). Worse is that to write web apps, the DOM & BOM, again has no readable documentation. (BOM is entirely not documented)〔JavaScript: Browser's Window Object, What's Browser Object Model (BOM), Document Object Model (DOM)〕I hope my JavaScript tutorial gives a good help.

for web development tips & tricks, subscribe Xah's Web Dev Blog. Thanks.

2014-10-02

browser extension development explained: Google vs Firefox

for Google Chrome, you go to their tutorial, in 20 min, you know how to write one, how to pack it, and have a good overview of the API. Pure JavaScript HTML CSS.

for Firefox, there are meta-guide old and new on mozilla blogs, then there are 3 frameworks, one requires to download a SDK that runs python that it asks you to run its random bin/activate fk bash script with instruction about how to untar a tarball, and one is “bootstrap” fk, and another is XUL fk, each fk has their own introduction page, with one thousand links & jargons & guides &warnings & preface & idioms guides. In 1 hour, u still dunno a thing about it.

completely replace emacs one thousand keys, part 2.5

a few months ago, i started to design a keybinding set that completely replaces the entire emacs 1k+ keybinding.

i've been using it for a few months now. I want to publish it nicely, but just haven't got to it.

so, am just pushing it out as its current state, here: https://github.com/xahlee/xah_emacs_init/blob/master/xah_emacs_keybinding.el

again, i'm pushing out in its current chaotic state, hoping some keyboard hackers will pick it up, in case i never do.

to use it, you need:

  • is a emacs lisp hacker.
  • is a keyboard fanatic.
  • it is currently for dvorak. so, if you are not using dvorak, you'll need to remap yourself.
  • the code is not nicely packaged up into a lunchbox. (but, it's not complicated neither. it's very simple)

here's a bit detail to help along:

there are 2 types of command: fast-repeat command and none-fast-repeat command.

the fast-repeat commands are moving cursor, delete characters, etc, where it makes sense to hold down a key and have it repeat. Typically, in emacs, there are 20 to 30 fast-repeat commands.

vast majority of emacs commands are non-fast-repeat. e.g. open file, switch buffer, dired, shell, calc, …

fast-repeat commands you need a single key or key chord.

fast-repeat commands are also the most frequently used commands, every second or few seconds.

ergoemacs-mode, is a package that solved the fast-repeat commands. (ergoemacs-mode also has a system for non-fast-repeat commands, but isn't designed from the ground up. It's based on converting emacs C-x to non-chord key sequences.)

xah fly keys Mode is my new package that deal with fast-repeat commands. The key choices are mostly compatible with ergoemacs-mode. The major difference is that this is a modal input system, like vi.

that leaves the non-fast-repeat commands, which is basically all commands of emacs C-x keys.

so, the news is, i've now designed a set for this. The key map choice is based on frequency of the command and ease of key position.

If you find a GNU emacs command that by default has a key but is not covered here, it's a bug. (actually, it's 98% complete. there are about 100 commands with keys that is rarely used. (you can see them near the end of the file, as commented out lines. i wasn't sure what/where to do with them yet))

this is new because it's the first time i completely designed entire emacs keys for public use. Before, i was simply using my own keys without regard to other people's use.

for stories leading to this, see

addendum: the keys are merged into xah fly keys Mode

2014-10-01

xah rumination extempore. hatred of idiots

i've spent significant part of my life arguing with idiots. Mostly, the hacker type of programer idiots. When in argument, most of the time, i know what they are talking about, they dunno what am talking about. That is the thing.

when did this start to happen? i think it's around year 2000. Before that, one could consider i'm a learner. A eager one. Read all the stuff i can get my hands on. Have lots questions. Often frustrated by those who don't know what am asking.

after 2000, when i'm master of perl and unix tech, servers, networking stuff, i started to lash out at the hacker idiots. That's when, people started to call me a troll.

i introspect a lot. that is to say, to a degree that's considered pathological. (it's one of the characteristics of schizoid personality) So, on this issue, i've considered, to extremes, from whether i'm a idiot, or they are, or, what exactly is happening, why does it happen. Like, a deep analysis, of all facts and facets.

i do have some conclusions. It happens because, mostly it's a personality induced thing. That is, my personality. More concretely, unable to chichat, smooth things out, say things in a agreeable manner. But, the other thing is, excuse me for saying so, most these people are idiots. No, rather, i'm a bit ahead, like, 10 years ahead the time, as sometime that's said to some mad scientists. (of course, by saying this myself in a unashamed public way, i win more enemies and ridicule. that's ok.)

you know? you read a lot of things. No, i read a lot of things. Not just programing or math stuff, but psychology, sociology. And one of the most fascinating to me is brain washing, marketing, propaganda, influence, kinda things. Or, leadership. That fascinates me. You see? you can be a great mathematician or scientist or programer, but if you are a leader, you raise a army at your heels, willing to do whatever you want them to do. (as cult leaders, or to a lesser degree politicians) There are tons of books on these topics. One thing common in these thread, is that if you want to lead, to influence people, to negotiate, to be a smooth operator, get people to believe you, trust you (as con man is good at)… that one thing, is to not offend, and from there you can lead, or trick people, that they become your followers.

you have to follow the way people think, and smoothly go from there. persuade them, handhold them — lead them.

but that's something am not sure i want to do. That's the bottom of it. Somethings in life is not a matter of decision or choice. If you are born a harlot, you are likely to be a harlot.

harlot

Emacs Lisp: Change Current Word to Wikipedia Link

(defun xhm-word-to-wikipedia-linkify ()
  "Make the current word or text selection into a Wikipedia link.

For Example: 「Emacs」 ⇒ 「<a href=\"http://en.wikipedia.org/wiki/Emacs\">Emacs</a>」"
  (interactive)
  (let (linkText bds p0 p1 p2 wikiTerm resultStr)

    (if (region-active-p)
        (progn
          (setq p1 (region-beginning))
          (setq p2 (region-end)))
      (progn
        (setq p0 (point))
        (skip-chars-backward "^ \t\n")
        (setq p1 (point))
        (goto-char p0)
        (skip-chars-forward "^ \t\n")
        (setq p2 (point))))

    (setq linkText (buffer-substring-no-properties p1 p2))
    (setq wikiTerm (replace-regexp-in-string " " "_" linkText))
    (setq resultStr (concat "<a href=\"http://en.wikipedia.org/wiki/" wikiTerm "\">" linkText "</a>"))
    (delete-region p1 p2)
    (insert resultStr)))

in Emacs: Xah HTML Mode

this and Emacs: Xah Emacs Lisp Mode i use heavily daily. The xah-html-mode is older, and few times more code and functions. But it's rather chaotic. the xah-elisp-mode is more clean.

2014-09-26

on the realism of space battle of Star War vs Star Trek

the most realistic space battle is depicted in Star Wars, where massive ships loom large by inertia, plasma bolts fly like raining swords, and the giant explosion only possible in outer space. On the other hand, Star Trek is not realistic in just about every way. The oddly shaped ships are not space-dynamic, and teleportation has unsolved philosophical issues, the aliens are humans with horns, and silly evasive maneuver, wrap-drive, time travel, holodeck, lol, figment of desire of scifi nerds.

2014-09-24

Knowledge is Power my Hindquarters

they say, knowledge is power. But that's humanity speaking. Take you, for example. Suppose you study math, and is god at it. What's your fate? You'll be a professor at some university, at best. A javascript web monkey will make more than you. Say, you are top of the game, you won prestigious math awards. Thy power will be below a joe blow at Google, who have better car than thee.

lets put superhuman powers in you. Say, you not only is a genius of math, but is a master of world history, politics, humanities, sciences, arts, equivalent to say 10 university degrees. Well, there are quite a lot people like that. Ever seen the Jeopardy show? they are house wifes or mob toilets at McDonalds.

2014-09-23

geek + hack = geekhack, on keyboard & keybinding

these days, when seeing so so many whizbang ergonomic mechanical keyboard out there, now i'm more daring in thinking that any keyboard that's traditional PC shape is idiocy of the idiocy.

have you seen geekhack or deskthority? There, is where keyboard creatures live… drilling down every detail on keyboard, makers history, electronic schemas, molding of key plastics, key cap shape design schemas, with a million photos and drawing boards.

yesterday i was reading this http://geekhack.org/index.php?topic=62444.0

though, typical of hackers, usually they are lame on keybinding. In fact, you don't find much info about keybinding layout anywhere on the web. All you EVER hear about keybinding, is emacs vs vi, and Swap Caps Lock and Control.

in my study of keyboarding, one surprise is that, a programer typically type more keybinding than letter input 〔➤ Emacs's Command Frequency Statistics

So, this means, Qwerty vs Dvorak vs Colemak vs NEO… key layout is less important for programers. It's the command keybinding layout that whacks your hand.

thanks to Jon Snader for inspiration.

A Old Friend, on the Run for 14 Years, Captured by FBI

Perm URL with updates: http://xahlee.org/Periodic_dosage_dir/Neil_Stammer_arrested_by_FBI.html

something personal just happened. In 1986, in Montreal, when is was 16 and a street juggler, i met this guy, named Andrew Allen (who later changed name to Neil Stammer). He is a renowned world-class juggler, holding some world records in juggling. He is a street guy, wandered about from country to country, speak and read/write several languages, including Chinese and Old English (and German, French...).

i know him only briefly for about a year, but we are somewhat very close. But i left Montreal Canada in 1989 (when i was 21), and we haven't been in contact.

about a decade ago (around 2001 or about), i discovered from juggling forums, that he's been arrested and charged for pedophilia related things.

I recall, he is a nice guy, and when he was with me, he… (i rather not say), but we haven't had sex (of any sort), nor did he forced or anything in any way. (i am not gay, but he is bisexual.)

And right now, while reading news about FBI's new face recognition software, i ran into this article. Apparently, he's just been captured last month.


Here's the mirror of FBI's page, in case it goes away in the future.

Long-Time Fugitive Captured: Juggler Was on the Run for 14 Years By FBI. @ http://www.fbi.gov/news/stories/2014/august/long-time-fugitive-neil-stammer-captured/long-time-fugitive-neil-stammer-captured

Long-Time Fugitive Captured

Juggler Was on the Run for 14 Years

Neil Stammer captured poster screenshot

08/12/14

How do you catch a fugitive who has been on the run for 14 years, has traveled extensively overseas, speaks a dozen languages, and could be anywhere in the world?

The answer to that question, as Special Agent Russ Wilson learned, is a lot of hard work — and a little bit of luck.

Neil Stammer, a talented juggler with an international reputation, was recently arrested in Nepal and returned to New Mexico to face child sex abuse charges. The events that led to his capture are a testament to good investigative work and strong partnerships, and also to the strength of the FBI's fugitive publicity program.

Here's how the case unfolded:

Stammer, who once owned a New Mexico magic shop, was arrested in 1999 on multiple state charges including child sex abuse and kidnapping. He was released on bond but never showed up for his arraignment. New Mexico issued a state arrest warrant in May 2000; a federal fugitive charge was filed a month later, which allowed the FBI to become involved in the case.

Stammer, who was 32 years old when he went on the run, told investigators that he began juggling as a teenager to make money, and he was good at it. Before his 1999 arrest, he had lived in Europe as a street performer and had learned a variety of languages. At the time of his disappearance, it was reported that Stammer could read or speak about a dozen of them.

Given his overseas travel experience and his language skills, the juggler could have been hiding anywhere in the world. With few credible leads, the case against Stammer went cold. Nepal Locator Map

Fast forward to January 2014. Special Agent Russ Wilson had just been assigned the job of fugitive coordinator in our Albuquerque Division — the person responsible for helping to catch the region's bank robbers, murderers, sex offenders, and other criminals who had fled rather than face the charges against them.

“In addition to the current fugitives, I had a stack of old cases,” Wilson said, “and Stammer's stood out.” Working with our Office of Public Affairs, a new wanted poster for Stammer was posted on FBI.gov in hopes of generating tips.

At about the same time, a special agent with the Diplomatic Security Service (DSS) — a branch of the U.S. Department of State whose mission includes protecting U.S. Embassies and maintaining the integrity of U.S. visa and passport travel documents — was testing new facial recognition software designed to uncover passport fraud. On a whim, the agent decided to use the software on FBI wanted posters. When he came upon Stammer's poster online, a curious thing happened: Stammer's face matched a person whose passport photo carried a different name.

Suspecting fraud, the agent contacted the Bureau. The tip soon led Wilson to Nepal, where Stammer was living under the name Kevin Hodges and regularly visiting the U.S. Embassy there to renew his tourist visa.

“He was very comfortable in Nepal,” Wilson said. “My impression was that he never thought he would be discovered.” Stammer had been living in Nepal for years, teaching English and other languages to students hoping to gain entrance into U.S. universities.

Although Nepal and the U.S. have no formal extradition agreement, the Nepalese government cooperated with our efforts to bring Stammer to justice. “We had tremendous assistance from DSS, the State Department, and the government of Nepal,” Wilson said. “It was a huge team effort with a great outcome.”


Fugitive Neil Stammer in Custody By Frank Fisher, Fbi Albuquerque. @ http://www.fbi.gov/albuquerque/press-releases/2014/fugitive-neil-stammer-in-custody

Fugitive Neil Stammer in Custody

FBI Albuquerque July 19, 2014

Public Affairs Specialist Frank Fisher (505) 889-1438

Neil Stammer, a former Albuquerque resident wanted by the FBI since 2000 on a charge of unlawful flight to avoid prosecution, has been returned to the United States following his arrest in Nepal.

Special agents from the FBI and the U.S. State Department's Bureau of Diplomatic Security (DS) escorted Stammer from Nepal to Albuquerque International Sunport on a flight that arrived Saturday afternoon (July 19, 2014).

An arrest warrant had been issued for Stammer on May 15, 2000, in New Mexico, for failure to appear for arraignment on multiple charges including sex abuse charges and kidnapping.

On June 9, 2000, a federal arrest warrant was issued for Stammer by the United States District Court, District of New Mexico, for the charge of unlawful flight to avoid prosecution.

DS special agents assigned as Assistant Regional Security Officer-Investigators (ARSO-Is) at the U.S. Embassies in London and Kathmandu, Nepal, identified Stammer using investigative photos from FBI files. Working with the State Department's Bureau of Consular Affairs and Nepali authorities, these agents determined that Stammer had entered Nepal using a fraudulent passport and assisted in locating him.

Stammer, 47, had been working in Nepal under a different name for approximately eight years.

“This is a great example of multiple government agencies and nations working together to capture a fugitive wanted for allegedly preying on children,” said Carol K. Lee, Special Agent in Charge of the Albuquerque FBI Division. “I want to thank the government of Nepal for its excellent cooperation, as well as the Bureau of Diplomatic Security, units of the FBI, the U.S. Attorney's Office, the Second Judicial District Attorney's Office, and the Albuquerque Police Department.”

“With over 100 specially trained passport and visa fraud investigators in more than 65 countries around the world, Diplomatic Security works with our international and federal law enforcement partners to bring fugitives like Stammer home to face justice,” said Barry Moore, DS's Deputy Assistant Secretary for Domestic Operations.

Upon arrival, Stammer was turned over to local authorities to face state charges.

“We are pleased to work with the FBI and the Albuquerque Police Department in the apprehension of Mr. Stammer,” said District Attorney Kari Brandenburg. “His extradition to New Mexico means that the state and the alleged victims will finally have their day in court. We have been able to locate each of the alleged victims. We will continue to work with them and, in the end, hope to bring them some measure of justice.”

“The Albuquerque Police Department is grateful for the hard work and perseverance of our federal law enforcement partners and the government of Nepal in locating this extremely dangerous fugitive,” said Police Chief Gorden Eden, Jr. “We can only hope that during his time as a fugitive that he did not commit similar terrible crimes on others.”

2014-09-21

list comprehension, python, semantics & syntax, and the hacker idiocies

Guido wants to remove {lambda, map, reduce} in python. He wants us to use list comprehension exclusively. see Lambda in Python 3000.

if you don't know what list comprehension is, see Python Tutorial: List Comprehension

list comprehension is no good. see Computer Language Design: What's List Comprehension and Why is It Harmful?

still, the python hacker idts defend it by “its faster”. In which, python compiler idcy comes forward to defend python language idcy, like a snake eating its tail.

however, there's one important semantic advantage of list comprehension. That is, using expressions to build complicated list. The advantage is seen especially with multiple variables (⁖ nested array n levels deep, each level has different number of nodes.). This would be nested map, which is cumbersome. This is also why, Mathematica has the Table[] construct http://reference.wolfram.com/language/ref/Table.html, which is a functional form of list comprehension. (in Common Lisp, the analogous is its loop. However, only Mathematica's syntax is functional. Python and Common Lisp loop syntax are imperative warts on drugs.)

by the way, idts will start to talk about list comprehension as analogous to math's set comprehension and stuff. U no unstand.

math's set comprehension notation is a idiocy, first of all. see:

or Google search for “calculational proof” by Dijkstra or others, or “calculational math”.

secondly, programing language's list comprehension has nothing to do with math's set notation, unless you are talking about purely declarative functional languages or proof system language that actually have some form of “comprehension”, such as coq or HOL, see:

by the way also, “list comprehension” is one of those fuzzy thing. Any lang that has a weird loop syntax can claim to have “list comprehension”. So, on pages such as Wikipedia, you have one hundred languages all trying to demo its list comprehension. Like, “regardless how idtc i am, also ran is my very advanced feature the list comprehension, witness.”.

2014-09-19

xah's rumination extempore: on bike sheding problem

xah's rumination extempore: on bike sheding problem

(xah's rumination extempore is when i type as fast as i can, you rip the incumbent fruit)

there's a problem called bike shed problem. that is, people tend to spend dispproportional time on trivial stuff.

the story is roughly this: nuclear power plant has lots decisions to make, but the problem most people spend time and argue about, is the design and size of the parking lot. Because it's a issue everyone can understand and have a opinion. (you can Wikipedia for detail)

this is quite interesting. worth a laugh. but it's also true. (is it scientifically true? as can this be verified or already confirmed in social science? i don't doubt it's true, but that's another topic)

so, it's quite a interesting issue. am thinking, how to classify, or address, this? like, first of all, is it a problem? if so, how can we solve it? has this problem plaque humanity throughout? like, you'd want overall view of the issue, exam its validy, degree of seriousness, its nature, and finally if there's a solution, if needed at all.

ok, but there's other similar things. Such as white female problem. I forgot what's the proper phrase, but basically, whenever some date rape or kidnap happens in USA, when it's a cute girl, the whole nation gets involved. While, much worse happens daily to black girls, or guys, everyday.

the bike shade also happens in programing. Mostly idiots argue about syntax. (i'll have to add a personal touch here: freshmen thinks syntax is most important, because that's what they see. After they graduate, they become sopho-morons, realizing that semantics is more important, because that's what computes. The ultimate sage will tell you, syntax is most important, because that's what language is. All the rest is side effect.)

ok, after thinking about these for about 20 min, i think i have a conclusion. The thing is that, human animals, and their thoughts and activities, are a process. For example, do you actually plan your life and try to optimize what you do according to a goal? WHAT is your goal? Strickly speaking, none of us had any goal, and there's no ultimate meaning of life. We live, and do things, as we go. We might have a goal today, short term or long term, such as get a degree, or open a business, or be better at something, etc, but it's not set in stone, changes, and different for everyone.

if, for example, for some reason all of us has a definite goal, of making the world a better place, as absolute, else we'll die within a year, then, bike sheding and lots other problems will be resolved, automatically. Unfortunately, no god's gonna effectively tell us that. So, even if we realize there's bike sheding problem, but so what? that's part of life. Gossipe, watch tv, go to bars, fool around, or whatever, have fun, they said. That's what we do.

so, in conclusion, the bike sheding problem isn't exactly a concrete problem. It is as problem like watching tv is a problem, or wasting time in general. It is simply a phenomenon of human behavior, human nature.

2014-09-18

Linus's new keyboard: CM Storm

so, Linus got a new keyboard, and it's Cooler Master Storm.

Cooler Master Storm QuickFire Rapid Keyboard SGK-4000-GKCL1-US
Cooler Master Storm QuickFire Rapid Keyboard

See https://plus.google.com/+XahLee/posts/Tted66P1qy2

what's the best coding style?

Emacs: Tabs, Space, Indentation Setup#comment-1595298993

any coding style guide or concern should be ban'd. The only valid coding style advice is when it makes a algorithmic difference. Anything else, is hacker idiocy (to the extreme), and language idiocy, and the downward spiral and dead habit.

like keyboard & keybinding, the best hope is waiting for death to take care of the problem. (as Steve Jobs and Douglas Crockford said.)

the only tool allowed for formatting related coding style, is one where you press a button and the entire file or directory is reformatted. (golang does it). Anything else, such as paredit, or most “lints”, is hacker idiocy.

the most idiotic programers, are the hacker types. The types that read hackernews, reddit, stackoverflow, (and graddaddy slashdot) etc everyday, and don't hesitate to tell you what you should do, about idioms & styles.

the worst language, is a language that has lots of tricks & idioms. Perl is the dad, but went out of juice. Now Python. Ruby is designed to be sans coding style, but idiots create a style guide nevertheless.

2014-09-15

programing pains and idiocy: trim whitespace

in emacs, there's a command that trim whitespace. But, wouldn't it be great if when a file is saved, the command auto runs? But then, when working in a team, if you do that, and commit, people will frown upon, as consequences of diff and log all become spurious. Thus, born is various whitespace clean packages, that trim only if the file before edit is whitespace clean, or trim only on the lines you edited.

it's, like, becoming, idioticer and idioticer.

there are several problems here. The core is the most idiotic concept, that code are based on lines of 70 chars or so, which originated from punch cards, and insisted by unix C idiots, and glorified by hacker idiots about style guides and style guide checkers banana.

spurious software complexity that spun out of nowhere. Like, these days, you spend most of the time on the side things of coding. Time to learn the tools, work around the tools, follow new rules due to tools.

Programing Language Syntax Soup

2014-09-13

HTML 5: no need for “type="text/css"” attribute in “style” element

when using the “style” tag in HTML page, you can omit the type="text/css" part. Just write <style>…</style>.

does linux tiling window really suck? a challenge

a coder i respect highly, Yuri Khan, commented on my article about tiling windows.

i know at least that Yuri is expert at python and JavaScript, and also a master of keyboard config, like myself. He has commented on my blogs for over a year, and that's how i know. Often, i learn something from him, either something technical in a language, or history, Russian programing keyboard or typing issues, etc.

sometimes we disagree. He loves python, i hate python.

anyway, he commented on my tiling windows rant on how he finds it useful. (as a lot hackers do. I despise tiling windows, as i despise most hacker's love, such as the The Idiocy of Happy Hacking Keyboard)

i updated my tiling windows article, to include a alternative workflow, and i challenge anyone to use it for a week, and see if they still find tiling window or workspace useful.

here: Why Tiling Window Manager Sucks (xmonad, ratpoison, dwm, …)

if you don't know how to set the keys, just ask me by leaving a comment there.

plane curves, java applet obsolete, need JavaScript

just remembered, that i had a dream few days ago, that the plane curves website at St Andrews University (Scotland) http://www-history.mcs.st-and.ac.uk/Curves/Curves.html converted their Java curve applet to modern JavaScript. Which is something i've been planning to do for my Visual Dictionary of Special Plane Curves site.

my old rival beats me!

crackpot letters


crackpot letters



John Baez's sample of crackpot letters he received.

see https://plus.google.com/+XahLee/posts/Ej2giAWZXwK

now and then i receive them too, i guess because i've been desperate to sell how smart i am on my websites for almost 2 decades now.

it's kinda strange and interesting that there are these people around. Sometimes you wonder if they are sincere or hoaxing, but apparently at least many of them are, as one can easily read tons of literature about UFOs and occult and conspiracy theories. (you can read Wikipedia for days on it.)

i'm a logical person. So, sometimes i give a hard try to read what they have to say, thinking that i'll have a solid analysis of the situation. But, basically it's just bizarre and doesn't make sense. Try to read what John posted and you'll see.

sometimes, some of these people are my readers or fan. So, that puts me in a awkward situation. If i show any hint of displeasure or disbelief, then perhaps i'd jeopardize a supporter.

some of these involves God, some psychology stuff.

one of the instance is when around 2001, a angle-trisector contacted me, and eventually met me in person, several times, he always treat for lunch, and paid me to help him publish his work. I end up doing some drawing for him. This is the most concrete crank that i actually came to know.

because i mostly write about programing that offends the hacker types of coders, i'm considered a crank by some. Though, think most of them are not serious.

However, there are a few who have become Xah Haters, who would take any opportunity to diss me online, when my name is mentioned. They would say i'm a idiot or dismiss my writings, in general bad mouth me. Usually, i've never ever responded to them. That usually made their behavior worse. (by the way, human nature is sometimes too predicable. As soon as i responded to them in some nice way, they go away. But, i pretty much NEVER.)

but, on the other hand, in the programing community, my maverick style also attracted a few that have crazy ideas. We'd communicate thru email, but then, i start to realize they have some strange ideas they want to tell me about or tries to get me involved. Psychology stuff, or religious, or …. It's really hard to describe. And, often they are secretive as well. I always prefer real name, and meet face to face or voice chat. But, typical hacker types are not even willing to disclose real name. So, it's nearly impossible to actually communicate with these guys for real. For example, some believe deeply in buddism... (no, it's not just that, but as i said it's hard to describe.) Then, there are one who believes in some kinda psycho therapy or something like that…

actually, a lot people in emacs community is pretty out there. I think it's because emacs and rms himself attracts very weird types.

but anyhow, i think in some philosophy aspect this is not too weird. Because, when you think about it, it's quite amazing that any 2 person can communicate at all about complex ideas. For example, let's say 2 animals, let's say 2 cats or a cat and dog. They can communicate anger, fear, submission, etc. How does the cat know what the dog is thinking? Easy, because the dog can't think of much of anything, except anger, happy, aggressive, passive, etc.

But for humans animals, we can communicate complex political ideas, philosophy problems, size of the universe, physics, mathematics, history, future. And in philosophy, at core is the mind body problem, free will problem, consciousness problem. I guess what am saying is that, the concept of thought is elusive, how can one possibly quantify possible human thoughts or beliefs (like a somewhat systematic thought set). Even some accomplished mathematicians, such as Godel, believes in ghosts and stuff.

2014-09-11

a typical todo list for part of my day

go thru this, make sure all latest articles are scheduled to tweet
Xah's Programing Blog
http://xahlee.info/comp/blog.html

go thru this, make sure all latest articles are scheduled to tweet
Xah's Web Dev Blog
http://xahlee.info/js/blog.html

• add new linux keyboard articles to
http://xahlee.info/kbd/keyboarding.html
at linux section.

• on this page
Linux: How to Swap Caps Lock & Escape Keys?
http://xahlee.info/kbd/linux_make_capslock_esc_key.html
make the capslock without kbd tag, in the question section

• review this pgae
Command Line Tool to View Comments in Image Files
http://xahlee.info/img/metadata_in_image_files.html

• clean up, create archive for
http://wordyenglish.com/lit/blog.html
and
Xah Emacs Blog
http://ergoemacs.org/emacs/blog.html

• schedule one tweet from
http://wordyenglish.com/lit/blog.html

2014-09-10

what switch mechanism does Space-cadet Keyboard use?

i learn that, the Symbolics lisp machine's Space-cadet Keyboard uses Honeywell Hall Effect key switch, which is the highest quality key switch.

space-cadet keyboard 5
Space-cadet Keyboard

According to: http://deskthority.net/wiki/Honeywell_Hall_Effect:

Introduced in 1968, Micro Switch (a division of Honeywell) adapted their Hall effect switch technology to work in keyboards. These switches are among the highest quality ever produced by any keyboard switch company, with reliability being paramount to their design. For increased reliability, there are both 3 pin and 4 pin designs of the switch. The 4 pin are +5, GND and dual open-collector outputs, allowing wired-or of the X, Y keyboard matrix. These switches are naturally bounce-free!

The patent itself originates from 1969, but the design is aesthetically very different from the produced switches.

The Honeywell Hall Effect switch is most famous on some Symbolics keyboards, as well as the Space-cadet keyboard.

Keyfeel: Smooth linear switch, makes Cherry MX Black switches feel like they have sandpaper on the stems.

thanks to Yuriy Pitometsu

2014-07-25

tablet friendly website, responsive design, css3

my website is now tablet friendly. More specifically, in portrait mode, the side bar doesn't show.
here's a sample page. 〈Xah CSS Tutorial〉 http://xahlee.info/js/css_index.html

for this to happen, it's very simple. See:
〈CSS: Media Query (Responsive Design)〉
http://xahlee.info/js/css_media_query.html

however, took me about 5 hours. Why O Why? that's how things are. We are not talking about old browsers or Internet Explorer 8. I'm designing only for “real modern” browsers. But, still, the pain won't go away. Why my paragraph width got shrinked on this modern Motorola Xoom super Android cynogenmod browser? Then, download Google Chrome browser, seems to work there. Then, try to find a way to determine just what browser is that one running in cynogenmod. Then, try CSS variations, then, try to read the spec. Then, try CSS variations, then, try to read the spec, more carefully. Then, rub ya gloss. Then, rub ya eyes. Why O Why this isn't expect. You know what i mean?

2014-07-24

GLONASS (Russian: ГЛОНАСС, IPA: [ɡlɐˈnas]; Глобальная навигационная спутниковая система), acronym for “Globalnaya navigatsionnaya sputnikovaya sistema” or “Global Navigation Satellite System”, is a space-based satellite navigation system operated by the Russian Aerospace Defence Forces. It provides an alternative to Global Positioning System (GPS) and is the only alternative navigational system in operation with global coverage and of comparable precision.

2014-02-20

What's the Use of the ▤ Menu/App Key?

Perm URL with updates: http://xahlee.info/kbd/whats_the_use_of_the_menu_app_key.html

the ▤ Menu key is just fantastic. Now, in Firefox, you can press 【▤ Menu c】 to copy, and 【▤ Menu p】 to paste. Also works in terminal, desktop (file manager) to rename, etc.

this is particularly nice when your keyboard has a nice positioned ▤ Menu key. For me, on the Truly Ergonomic Keyboard, that's the left space bar.

or, you can make your Caps Lock to be the ▤ Menu key.

and, of course, in my emacs setup, some 90% of my commands calls are all assigned to a key sequence, starting with the ▤ Menu key. 〔☛ Ergoemacs-vi Mode

2014-02-07

Can you install Linux on Chromebook

am looking to buy a laptop.

Apple's out, because the price/meat ratio is about 3 times higher than competitors.

so, that leaves Chromebook and normal Windows laptop.

first question about Chromebook is, can i install full Linux? am not much interested in ChromeOS. Am gonna use this for dev, python ruby database, html, javascript, node.js etc.

Can you install Linux on Chromebook?

yes, but not the normal way.

You have to go thru unsupported hackery process such as turn on developer mode, which adds 10 secs to boot time, then other hackery process to get going. Or, another option is booting up with Chrome OS and run Linux on top, again, not good.

you can read about the complexities here:

Running linux on Chromebook, tech detail https://wiki.archlinux.org/index.php/Chromebook

Horror stories of running linux on chromebook. After a ChromeOS update, your Linux is screwed. Good luck recovering your data. October 19th, 2013. http://ubuntuforums.org/showthread.php?t=2181898

Asus X200CA-HCL1104G 11.6 inch Touch Screen Laptop (Windows 8, 4GB Memory, 320GB Hard Drive, Black) amazon

Acer C720 Chromebook (11.6-Inch, Haswell micro-architecture, 2GB) amazon

2014-01-17

emacs's “describe-” commands

emacs's “describe-” commands

emacs has describe-function command, and many other that starts with “describe-”. They are in general giving you help or info.

by default, there are 2 keys to invoke them, 【F1】 or 【Ctrl+h】. ⁖

  • describe-function → 【Ctrl+h f
  • describe-function → 【F1 f

〔☛ Emacs Keys Overview: How's Emacs Keys Organized?

here's my own usage, ordered roughly in frequency of use. (with my own keys, plus a few of my own commands)

hourly:

<menu> h f      describe-function
<menu> h k      describe-key
<menu> h 3      man
<menu> h 9      lookup-word-definition
<menu> h 8      lookup-wikipedia
<menu> h 7      lookup-google

daily:

<menu> h 4      elisp-index-search
<menu> h c      describe-char
<menu> h m      xah-describe-major-mode
<menu> h v      describe-variable
<menu> h e      view-echo-area-messages

monthly:

<menu> h a      apropos-command
<menu> h l      view-lossage
<menu> h s      describe-syntax
<menu> h 0      lookup-all-dictionaries

yearly:

<menu> h C      describe-coding-system
<menu> h F      Info-goto-emacs-command-node
<menu> h I      Info-goto-emacs-key-command-node
<menu> h L      describe-language-environment
<menu> h S      info-lookup-symbol
<menu> h b      describe-bindings
<menu> h d      apropos-documentation
<menu> h i      info
<menu> h n      view-emacs-news
<menu> h p      finder-by-keyword
<menu> h r      info-emacs-manual
<menu> h w      where-is

if you are new to emacs, here's some emacs terms explanation:

  • point → cursor position (beginning of file is 1)
  • frame → window
  • window → a pane/frame, as in split window
  • buffer → a opened file, or working area like “tab”.
  • mark → a cursor position, that begin text selection.
  • region → text selection
  • transient mark mode → a preference setting, to have text selection highlighted
  • cua-mode → a preference setting, to have standard copy/cut/paste/undo keys

if you want my elisp commands:

The 【▤ Menu】 key is chosen because it's a easy starting key, right under thumb on the Truly Ergonomic Keyboard. See Ergoemacs-vi Mode

2014-01-09

JavaScript: never use 「delete」 to remove element in array

Note: splice is the general way to add/remove elements. You should never use 「delete」 to remove elements in a array, because that creates a sparse array.

// example of how delete creates a sparse array
var aa = ["a", "b", "c"];
delete aa[1];
console.log(aa);                // [ 'a', , 'c' ]
console.log(aa.length);         // 3

see JavaScript Array Methods

2014-01-06

where is socket.io client library at?

decidedly frustrated with socket.io.js.

let me detail the issues.

first, there's no clear indication what it's supposed to be. Sure, it's clear it's a lib on top of WebSocket protocol, with added feature that if browser doesn't support WebSocket, it'll automatically use other means (aka transports) such going thru Flash, XMLHttpRequest, hidden iframe, etc.

but, Does it require Node.js? There's a server and client part. How are they related?

the home page is extremely simple, but those simple examples hide a confuse ball. Nowhere it tells you it's relation to Node.js, or how server/client are related, or independent. And its FAQ, or its github pages, don't say neither. (instead, it has one hundred other links, none of which answers)

Answer: socket.io is 2 JavaScript libs, socket server and socket client. But also, it is a protocol, on top of WebSocket. So, other langs can implement it too without using Node.js or JavaScript.

Answer: socket.io has socket server lib and socket client lib parts, and can be used independently. The socket server lib depends on Node.js (obviously), but the socket client lib do not necessarily need Node.js, but can use Node.js. That is, If your web server that uses the socket client is also running on Node.js. (for example, you have 2 servers, A and B. A is running Node and is the socket server. B is running Apache on another domain name and needs to talk to server A. So, B is your socket client, and you can use socket.io.js the client lib part. But if A and B are the same domain/server, then things are simpler. The socket client can load the same file the socket server is using (thus is using Node.js).)

Now, the first thing to do is actually to get it. The doc says: npm install socket.io -g. That gets you ≈600 files.

you see, all i need now is a socket client. As with most js lib, typically it's just a minimized file. How do i know which of the 600 files is it? Note that these 600 files includes README, build files, and also includes other libs such as Redis database interface, etc. It's essentially the same as from git. Hello?? why would i need npm install if i can just git clone the source code? npm is suppose to be a package manager, not giving me the source code junks.

the home page shows real beautiful simple examples, such as:

<script src="/socket.io/socket.io.js"></script>
<script>
  var socket = io.connect('http://localhost');
  socket.on('news', function (data) {
    console.log(data);
    socket.emit('my other event', { my: 'data' });
  });
</script>

but there's no such dir as “socket.io”? If you do a simple Google Search “Where is the socket.io client library?” You find several hits on StackOverflow. Clearly, lots people are confused. SO's answers isn't very good neither.

Answer: again, there are 2 libs, one for socket server and one for socket client, and can be used independently.

For socket server part, you need Node.js, of course. And, the file is: 〔/node_modules/socket.io/lib/socket.io.js〕

for the socket client part, if it is running on the same server as the socket server, you an also load that same file, because that file will somehow find the client.

but, if your socket client is not using Node.js, then, the client file you need to load is this:

<script src="http://example.com/node_modules/socket.io/node_modules/socket.io-client/dist/socket.io.min.js"></script>

just exactly which of the 600 files are the minimally required for server and or client? i haven't found out yet.

at this point, i'm dithering whether to ditch socket.io, and just use WebSocket in plain old JavaScript.

sometimes i wonder, why software industry is such a hell? the guy who wrote socket.io.js, clearly is a smart guy, and expert at js and Node.js. And, his lib API is quite simple. Just a handful of functions. As his examples on his home page shows. And, i've seen his writings. Typically, programers don't know how to write, such as unix man page idiots or python idiots or perl. But, this guy knows how to write well.

So, why is such a simple API socket.io home page have so confusing doc?

is it not clear, first thing people need to do is load the file? and you didn't specify which file?

also, no where on the home page says: Documentation or Manual. You have to grok, and eventually something like a API doc is in the description page of the github page.

no where says that the client/server libs are separate projects. (yes, the client part actually has its own github repo. The server lib seems to include the client repo in its repo.)

is it not clear, when people follow your npm install socket.io example, they get 600 files, and none has the dir you showed in your simple examples on your home page?

i'm a beginner of Node.js. If something is incorrect, or if you know some answer, please comment. Thanks.

2014-01-05

mixed Chinese and English writing and punctuation

当写英中混合时,发现,英中标点符号混杂,没办法讲定规。要不就一率用英文式或一率用中文式。

When writing mixed Chinese and English, i realized that, it's hard to have a uniform rule for using English punctuation or Chinese punctuation. Perhaps, a solution is then to always use English punctuation, or all Chinese punctuation.

2014-01-02

emacs moving to git, we hope!

ground-breaking news. It seems, emacs repo would move to git in the near future.

thanks to, the controversial head Eric S Raymond. See the thread here: http://lists.gnu.org/archive/html/emacs-devel/2014-01/msg00005.html

every time i dip into emacs dev list, it pains me to see the utter inefficiency and arguments there. Everybody argues. Argue, and argue, philosophy waxing, and argue, and you see one hundred weird utterly stupid wild ideas (excuse me) on everything, from dinosaurs of the 1980s insisting their ways, to clueless FSF fanatics who haven't wrote a single line of code but is gung-ho about emacs. In between is every cock who think only he knows how things should be, meanwhile, those who have written respected software or contributed tons of elisp, are treated just like nobody — a complete egalitarian dystopia.

emacs, sucks the weirdos of the world. Count me in.

On this, we must also thank John Wiegley, who daringly and humbly pushed for git 9 months ago. See http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00776.html

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 and Command Line Tips

thanks to Marius Piedallu van Wyk

linux: show files opened by apps

some quick tips about viewing files associated with process.

  • lsof -h → show a short help file
  • lsof fpath → show all associated with file fpath
  • lsof -i → list files associated with internet (⁖ browser process)
  • lsof -u name → login/uid
  • lsof -p pid → pid. 123,^456
  • lsof +d dir → by dir path dir
  • lsof +D dir → by dir path dir, also show all dir's children
  • lsof -c cmd → show files opened by command whose name starts with cmd