Xah Programing Blog Archive 2014-02
Linux: Change Sound Level by Command
Unicode: Punctuations • ✓ ™ (updated)
Unicode: Geometric Shapes 🔴🟥🔺 (updated)
Myth of QWERTY vs Dvorak Layout (minor update)
Emoticons on Social Network: Facebook vs Sina Weibo
Unicode: Emoji 😄 (updated)
Linux: Terminal Control Sequence Keys (minor update)
Facebook created a new lang: hacklang. Already deployed in large scale by Facebook. Basically, it's PHP with optional type system. Added to bottom: Proliferation of Programing Languages
the best PC form keyboard this Logitech G710+ Keyboard (updated)
for all you button needs. Programable Keypads (updated)
more glorious photos. IBM Personal Computer, model 5150 Keyboard, 1981, where the term “PC” came from. See its weird Return key. Updated at Control Key and Capslock Key Positions
Esrille New Keyboard (M-Type and TRON) from Japan new pre-production version is out.
added a IBM Model M 1985 keyboard:
TRON Operating System (minor update)
OOP Dot Notation, Dot Before Data or After? (minor update)
The Idiocy of Python's Function Parameter Specification (minor update)
How Linux Desktop Sucks?
we know it sucks. But how it sucks?
in Mac or Microsoft Windows, you restart your machine and say you went bed. When you wake, you press a key to wake your minotor, then you login.
in Linux, your monitor is bright and staring at you. Apparently, the sleep daemon doesn't kick in until your login.
see Is Linux Desktop Ready for Mom and Pop?
Cygwin Essential Install List (updated)
HTML + CSS + JavaScript = Garbage
〔To Wash It All Away By James Mickens. At https://www.usenix.org/system/files/1403_02-08_mickens.pdf , accessed on 2014-03-11〕
Create Math APL Keyboard Layout (minor update)
Linux: Get System Info (minor update)
Control Key and Capslock Key Positions ([Michael Lockhart https://plus.google.com/+MichaelLockhart/posts] added many old keyboard info, see comment at bottom.)
JavaScript in OCaml?
in 2006, JavaScript inventor Brendan Eich https://brendaneich.com/ said the JavaScript spec would be implemented in ocaml. (See: http://lambda-the-ultimate.org/node/1784) Anyone know the aftermath?
comment at
https://plus.google.com/+XahLee/posts/jHuWkZbrZBj
JavaScript Spec as Formal Language
having a blast reading the JavaScript spec. (ECMAScript Language Specification - ECMA-262 Edition 5.1) Just occurred to me it's possible to turn ECMAScript spec into a formal language. Big project though. But easier than say Python or Java .
you see, there are hundreds pages of English verbosity. And quite imprecise and open to interpretation. So, the desire is to turn it into symbolic logic. More specifically, formal language. That is, a sequence of symbols and transformation rules, that fully specify JavaScript.
comment at https://plus.google.com/+XahLee/posts/jHuWkZbrZBj
Access Control List in Linux
i've read that Linux supports Microsoft's (superior) Access Control List file security system. But never really see how, as my linux is still rwx stuff. Today, i learned, it's actually a addon package you have to install, not part of kernel.
now knowing this, i think ACL is probably a second rate citizen, not sure it'll work well, or anybody uses it at all.
btw, Mac OS X also supports ACL. I haven't looked into. Probably works well there just because it's commercial.
to understand bitcoin, is first of all be able to “mine” it. That's my intention of writing a tutorial.
apparently, the best way to match images is to check the color map. This is my guess from seeing the behavior of Google's Image search. When you search a image that's rare or not on the web, you get results that's just images of similar color map.
https://plus.google.com/+XahLee/posts/Jo7Y9VRPEQF
Github Mascot: Octocat in Many Guises (lots new images)
spent the past half year on JavaScript. Lots goodies. Xah JavaScript Tutorial. Subscribe my JavaScript stuff at blog.xml
learned of Asciidoc. Better than markdown
there's a another variation of gaming keypad. Razer Tartarus. See bottom: Razer Orbweaver Keypad
updates
updated at Does Mechanical Keyboard Reduce Risk of Repetitive Strain Injury?
Esrille New Keyboard 2014
One cannot cease be amazed by the number of new keyboard coming out since 2010.
Python: Closure in Python 2 (updated)
Cat Keyboard
so many keyboard innovation in recent years.
there's Truly Ergonomic, then there's Ergodox, then Jesse Vincent's Heart ♥ Keyboard, Butterfly Keyboard and Phil's Atreus , but there's also a Russian guy who created “catboard”.
Python Indentation Syntax Terminology: “Off-Side Rule” (minor update)
discovered today that the keyboard designer Jesse Vincent is a well-known perl programer. See updated: Keyboard Love ∞: Jesse Vincent's Keyboard Design Evolution ⌨
How to combine 2 images using ImageMagick?
ImageMagick Tutorial (updated)
Jesse Vincent's latest version, the butterfly keyboard.
AutoHotkey: Useful Scripts (old goodie. repost.)
A very practical tip. I get asked often. how to set F8 to Switch to {Firefox, Emacs, Terminal}
John Cook, the mathematician and programer, has a new blog about symbols. See: http://www.johndcook.com/symbols/
btw, he's also got daily tweet service for many math topics. See: http://www.johndcook.com/twitter/index.html
i share much of his interests.
see also: Unicode Search 🔎
my obsession with keyboard and mouse is making me slowly analyzing all input devices out there. For today's fruit, see: Razer Ouroboros Wireless Gaming Mouse
2-Piece Split Keyboards (minor update)
Git Branching Tutorial. Easy and practical. Hardcore command line. No directed-graph garbage talk.
Wireless Router Tip: Do Broadcast SSID, Turn off WPS
Should you broadcast SSID?
It has absolutely 0 effect on security.
should you turn off WPS?
yes, you should turn off WPS. Because, it has security flaw. Some router has “fixed” it by adding a lock-down period to mitigate this security flaw, but still.
References
- 〔Wi-Fi Security – The Rise and Fall of WPS By Brad Slavin. At http://www.netstumbler.com/2013/01/18/wi-fi-security-the-rise-and-fall-of-wps/ , accessed on 2014-02-17〕
- 〔Hands-on: hacking WiFi Protected Setup with Reaver By Sean Gallagher. At http://arstechnica.com/business/2012/01/hands-on-hacking-wifi-protected-setup-with-reaver/ , accessed on 2014-02-17〕
- Wi-Fi Protected Setup
comment at https://plus.google.com/+XahLee/posts/jVNcwznax5e
Microsoft's live.com Email Wiped My Emails
logged in to Microsoft's live.com email service today, only to find that all my email there are gone. Apparently, they did this in 2013-07 when merging with hotmail.
apparently, when they did the merge, they probably sent out a email warning in advance, but i haven't been using it so i didn't see it. And, after the merge, hotmail emails are intact, live.com emails are killed, because it's new, something like that.
it's hard to search for this, but i found a few forum messages about it. e.g.
- http://answers.microsoft.com/en-us/windowslive/forum/livemail-email/all-my-emails-in-windows-live-mail-have-been/c7fbdff2-48c4-4b3a-8373-97cec546a115?msgId=d1f755ca-2a0f-4782-9bea-b04f6d2dfe3e
- http://ths.gardenweb.com/forums/load/kitchentable/msg0716354923173.html?22
i thought i was gonna give post 2010 Microsoft stuff a try. Never again.
comment at https://plus.google.com/+XahLee/posts/T9JkNNBZYqo
understand Python decorator in 6 lines
all hearts ☙ ♡ ♥ ❣ ❤ ❥ ❦ ❧ ⺖ ⺗ ⼼ 🂱 🂲 🂳 🂴 🂵 🂶 🂷 🂸 🂹 🂺 🂻 🂼 🂽 🂾 💑 💓 💔 💕 💖 💗 💘 💙 💚 💛 💜 💝 💞 💟 😍 😻 🏩 💌 Unicode Search: Find Unicode Symbols
Unix X11 xmodmap Tutorial
Linux. my first use xmodmap is around 1996, when using unix/X11 (Solaris) for the first time, and i need dvorak layout.
back then, web do exists ❗
so i “googled” and found this MIT hacker setup dvorakKeymap.txt which i've used and works.
(google didn't exist, nor the concept of search engine. I probably found it from some FAQ, which is like today's Wikipedia)
but today, i finally actually read xmodmap man page in detail for the first time. Wow, that's nearly 2 decades. It's quite simple actually.
in the picture, you see my keyboard with F13 F14 etc keys. But on X11, the F keys after F12 has keysym of XF86Tools XF86Launch1 XF86Launch2 etc for some reason. F13 is XF86Tools.
One of them, the F13 XF86Tool, doesn't work. The key works in emacs, as well shows well in xev properly, but in (Ubuntu) xfce X11 window manager, if you set that key to something (such as max window), it has no effect, but using F14 or other works. Still no idea why.
using xmodmap, i was able to set XF86Tool to normal F13, then i can map F13 to commands i want. See: Linux: xmodmap Tutorial .
- Linux: Swap Control Alt Keys, xmodmap
- Linux: Set System Keyboard Layout ⌨
- Linux: Keyboard Software Guide
Python: Make System Call (full rewrite)
Kilo vs Kibi, Mega vs Mibi (updated)
Linux: Show Directory Size: du (minor update)
Understanding Python's module, package, namespace (major update.)
Python: List Modules, List Loaded Modules (updated)
Ubuntu Linux Python pydoc coredump
in year of our load 2014, when in Ubuntu Linux, pydoc modules
coredumps, and Ubuntu is busy making mobile and cloud.
(this is Ubuntu 12.04) This bug has been around for at least 6 months.
btw, it's dumped at /var/crash/
btw, pseudo-solution is sudo apt-get install python3
, pydoc3 modules
the best Ergonomic Keyboards (minor update)
Python Poetry: the __main__ Stanza
Perl: How to Write a Module (much revised)
Does Increasing Mouse Polling Rate Matter? Added to How to Choose a Gaming Mouse?
Python: Split Line by Regex (oldie. updated)
Python: Get Dir Path, Absolute Path, …
Logitech G700s Mouse (updated with my thumb buttons settings)
Node.js Documentation Problems (on its own page)
JavaScript Context Dependent Semantics: p in o
Linux: Reset Terminal, Clear Screen History
Node.js Dot Notation as Namespace Mechanism
Unicode: Keyboard Symbols ⌘ ↵ ⌫ (updated)
The Evolution of Laptop Keyboards
Fonts for Unicode 6 Emoticons (2010) (updated)
Mac and Windows File Conversion (old essay)
keyboard for emacs fans. Shortcut-S, Photoshop Keyboard
Mouse vs Keyboard: Is Mouse Bad for Programer?
Lit Wakefield argued in the comment, saying that keyboard is more efficient. See his comment at bottom. He reasons, that “vimium”, “pentadactyl” (which are vi-like bindings), can be more efficient than mouse.
good exposition. But i think that's just false.
let's say, on a web page there are 10 links, scattered around. And, i need to click them, in specific order. Am sure mouse is faster than vimium.
Also, here comes the question of effort to learn and ease of using. It's often possible, to create a system, using a comparatively naturally less efficient input device, but the system is such a design it takes 1 year to learn/master, then after this 1 year training, he who uses this inferior input device will be more efficient in operation than someone using a mouse the first week. Then, do you still say that inferior device is more efficient? One analogous example of this is input system of Chinese. There are lots of them, and the ones requires a lot training are in general more efficient than the brainless phonetic system using english alphabets (pinyin). Similar can be said of stenographic system vs normal qwerty typing.
Grep Replacecements in Perl, Python, Ruby
ack
, Perl. http://beyondgrep.com/rak
, Ruby http://rak.rubyforge.org/grin
, Python https://pypi.python.org/pypi/grin
why they exist? because the unix dot file fscking fsck fsckup.
MySQL Workbench. http://www.mysql.com/products/workbench/ (seems a great tool. I haven't tried yet. Am kinda a stickler to command line only, but am rather open to GUI's many advantages)
see also: Linux: MySQL Basics (incomplete)
Python: HTTP POST Using Library “requests”
Python: Reading and Parsing JSON
Python MySQL libs: MySQLdb and PyMySQL
Python has 2 interface lib for MySQL: MySQLdb and PyMySQL. (as far as i learned) The MySQLdb is the workhorse, involving C drivers. PyMySQL is pure python, with advantage of simpler installation and easy to integrate in any OS.
PyMySQL and MySQLdb provide the same functionality - they are both database connectors. The difference is in the implementation where MySQLdb is a C extension and PyMySQL is pure Python.
There are a few reasons to try PyMySQL:
- it might be easier to get running on some systems
- it works with PyPy
- it can be “greened” and works with gevent
- The proper way to use it with Django is to import it and tell it to impersonate MySQLdb in your top-level file, usually manage.py. Put the following code at the very top of your manage.py (or whatever file you call when starting your server):
try: import pymysql pymysql.install_as_MySQLdb() except ImportError: pass
MySQLdb, is a C extension module that has a reputation of being difficult to compile, especially if you're on a Mac. Additionally, end-users need to wait for new binaries to be compiled for each new release of Python, and MySQLdb will never run on Jython, IronPython, or PyPy (without something like cpyext or IronClad). We also maintain 100% compatibility between Python 2 and Python 3, so all advancements made on the 2.x trunk will be immediately available on Python 3.
PyMySQL is a pure-Python MySQL client library. The goal of PyMySQL is to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython.
Python MySQLdb home page At http://mysql-python.sourceforge.net
Python: Get Environment Variable
Perl: Get Environment Variable (on its own page)
git: How to uncommit last commit?
updated Git: Frequently Asked Questions
Git: Setting Up git on bitbucket
Mac OS X Names: Jaguar, Tiger, Mavericks, Cheese Ball
Mac OS X still doesn't support windows auto-raise. Suck❗ Linux: Mouse Hover to Raise Window
Logitech G700/G700s Mouse (on its own page)
Regression Testing?
in software, there's this term “Regression Testing”, coming into being in past few years. Regression thy mom's ass. Xah's edict: if ur software needs testing, u r a idiot.
what society overwhelmingly asks for is snake oil. Of course, the snake oil has the most impressive names — otherwise you would be selling nothing — like “Structured Analysis and Design”, “Software Engineering”, “Maturity Models”, “Management Information Systems”, “Integrated Project Support Environments” “Object Orientation” and “Business Process Re-engineering” (the latter three being known as IPSE, OO and BPR, respectively). — Edsger W Dijkstra (1930 to 2002), in EWD 1175: The strengths of the academic enterprise
my statement has sugar topping, but there are 2 levels.
(1) software need no testing, but provably correct. This is along the line of EWD's train of thought, which i subscribe to.
(2) in today's software, we are not there yet, or perhaps can never be, given industrial and social causes. However, today's software testing, in particular those Agile fucks, are here, because 60% programers are idiots, don't know what they are doing. And, this is caused by social reasons.
discuss https://plus.google.com/+XahLee/posts/HGuwpG16NJW
- eXtreme Programing and Agile Voodoo
- Lisp vs Perl Syntax, the Cult Problem
- Why Software Suck
- UNIX Philosophy, Fast Food the UNIX way
- Software Engineering Voodoo
think am going to get this one. Logitech G602 Wireless Gaming Mouse
XML is not S-Expressions (now properly formatted)