Posts

Showing posts from May 20, 2012

A Tech Geeker Dogma: Swapping Capslock Ctrl

Perm URL with updates: http://xahlee.org/kbd/emacs_keyboard_capslock_ctrl_rant_2012-05-26.html…The Caps Lock position for Ctrl is actually not bad. Excellent design in fact. For example, of the 3 keyboard designs i admire, one of them is “Truly Ergonomic” (TE). See: Ergonomic Keyboards Gallery.on TE, it actually put Shift key on the Caps Lock position, on both sides of the keyboard! What a fantastic, great, thoughtful, design.Question: Why are you against the Capslock position then? Answer: it's because the tech-geeking fuckheads.There are certain class of programers, a subculture, who pride themselves around the term hacker. These people, collectively loosely have certain way or habit and thought pattern, and a subset of them are loud-mouthers on some issues (such as our Thad Floryan fellow here, who, every time would sting me about Caps Lock/Ctrl switch when i write about keyboard. Which, is perfectly fine, just don't blame me for my equally reasonable responses.)The hacker …

functional programing in bash complexity graph

Image

Emacs Video Demo: forward-sexp beginning-of-defun …

Image
David Capello demonstrates great use of {forward-sexp, backward-sexp, beginning-of-defun, end-of-defun} for coding languages with C-like syntax.A video so funny and so educational you can't refuse! Love the music. Click on the CC to turn on English subtitle.〈Comandos de programación básicos de Emacs (forward-sexp, beginning-of-defun)〉David uses a customized version of ErgoEmacs keybinding. Code and layout here: http://dacap.com.ar/programming/keyboard-layout/ErgoEmacs Keybinding also got a major update. Lots changes. Check it out and let me know what you think. svn checkout http://ergoemacs.googlecode.com/svn/trunk/ergoemacs/ergoemacs-keybindings ergoemacs-read-only

war of the worlds: chrome vs firefox

Image

Google Picasa keyboard shortcuts

Perm URL with updates: http://xahlee.org/kbd/picasa_picture_viewer_keys.htmlThis page is a complete list of Google Picasa Picture Viewer keyboard shortcuts.KeyAction【=】 or 【↑】Zoom in【-】 or 【↓】Zoom out【PageUp】Zoom in 4 ×【PageDown】Zoom out to previous【Enter】Toggle fullscreen【Space】Toggle backgroundMouse WheelZoom or prev/next picture. (set in Configuration)【Ctrl+MouseWheel】Zoom【1】Toggle 100% zoom【Ctrl+r】Rotate the image clockwise【Ctrl+Shift+r】Rotate counter-clockwiseKeyAction【←】 or 【j】Previous image【→】 or 【k】Next image【⌦ Delete】Delete image (to trash)KeyAction【c】Preference/Configuration【e】Edit in PicasaKeyAction【b】Blog【m】Mail photo【u】Upload【Ctrl+u】image uploadKeyAction【8】 or 【Ctrl+8】Toggle star【Esc】QuitPicasa Pains: Using Picasa Web as Backup; Sync All FoldersHow to View Comments in JPEG, PNG, MP3 files?List of Great Software for Windows and MacLinux: Great Image Viewer ApplicationsList of Great Software for Windows and MacImageMagick/GraphicsMagick Tutorial

The Roadmap to Completely Replace Emacs's Key System

Image
Perm URL with updates: http://xahlee.org/emacs/emacs_keybinding_redesign.htmlThis post discusses a systematic way to replace emacs's one thousand keys.Voice version of the blog at:“roadmap to emacs key replacement”The following is a text version.massive update on the ergonomic keybinding.Source code.google.comsvn checkout http://ergoemacs.googlecode.com/svn/trunk/ergoemacs/ergoemacs-keybindings ergoemacs-read-onlyErgoEmacs Keybinding homepageIt's dev version. Probably has bugs. More change coming in following days or weeks.made few discoveries about keyboarding habit and health this week. Don't know where to begin… but i'll just start to ramble here. You can read on or just get the files there any try it. Read the history file there. More change will be done in next few days.Ok, following will be rambling. (in the following, i'l use QWERTY notation. even though i use Dvorak.)My left hand is fucked. emacs. Wasn't sure what's causing it. Now i know. It's …

高级程序员装逼指南 (Zhuangbility Manual)

Perm URL with updates: http://xahlee.org/lit/Zhuangbility_Manual.html前言最近网上出了一个《程序员装逼指南》,觉得这个东西其实图样图森破然后在下跟微博上的一些程序大牛讨论了一下如何装逼,深有感触程序员嘛,外行人看起来已经是不可理解的奇怪生物了,自然也没必要跟他们再装逼所以呢,如何对其他程序员装逼就是一门很有学问的事了于是乎在下手痒写了个《高级程序员装逼指南》,请大家指正编程语言千万千万千万千万不要说自己是Java/C#/C++程序员尽量学一些奇怪的语言,python已经有烂大街的趋势了,写写还是可以,装逼是用不上了Lisp和Erlang都是装逼的好语言当然你要是号称会Haskell就更牛逼了,实在不会也没关系,发发跟Haskell有关的状态别人也很装了没事儿还可以在论坛里喷喷Java/C++有哪些缺点可是,如果对方先发制人说他出了一种奇怪的语言名字怎么办?你可以微笑地说,你可知道天下语言皆出自Lisp和Smalltalk?保准对方愣住3秒钟操作系统首先,妥妥儿的不能用Win,麻瓜才用Win呢Linux嘛,ubuntu也差了点儿,现在不少人已经用Arch了懂行儿的人都知道,gentoo和LFS才是真正的装逼利器啊自己编译神马的,这逼还真不是人人都能装的再深入的话,你要是用Lisp Machine工作,就近乎神了编辑器作为一个IDE去死团成员,我承认很大程度上我只是在装逼纯文本编辑器才是你最终的归宿Vim是标配,但是只有Emacs才能称得上是神器“伪装成操作系统的编辑器”并非浪得虚名当然,想要装逼装得好的话,你还需要学习它的配置语言Emacs Lisp博客在CSDN/ITeye/cnblogs这种地方写技术博客确实比在人人上写技术博客好多了但是你要知道,大牛们都是有自己的个人网站的而且,一个共同点是,他们的网站都是自己写的html(没有css)并且界面十分难看整个网站散发着一种“我这的文章都很牛所以界面什么的都不重要”的气质例如这个:http://xahlee.org/index.html 其它我习惯称不会写代码的人为“麻瓜”,你也可以有你自己的称呼不要写Linux/Unix,正确而专业的写法是*nix手边不要放技术书籍,即使要摆一两本书也要那种自己打印的全英文的手册或者用铅笔在纸上写代码也是个不错的…

Cat, Eagle, Fox, in Unalaska, Alaska

Image
Perm URL with updates: http://xahlee.org/funny/cat_eagle_fox.html“An eagle, a fox and my cat all getting along fine on my porch (without the warping in it)” “4 19 2010 Two Eagles, A Fox and My Cats on My Porch Not Getting Along!” “March 22, 2012 George Defends His Breakfast From the Fox” “2009 Mr. Brown Fox, Mr. & Mrs. Eagle and my Cats” “Mr and Mrs Eagle and George on my Porch” She has lots other videos. She lives in Unalaska, AlaskaFunny Video: Cat Teasing DogFunny Cat PicsHumor: Dead Squid Walking, Eat It! (Video)Humor Video: Comedian Fredryk PhoxHumor: Liam Show: Shoes (Kelly song)Sexual Humor: Wrong Hole Song

Prime Number Test by Regex

voice blog: prime_number_test_by_regex_2012-05-20.ogathe perl code is this: perl -wle 'print "Prime" if (1 x shift) !~ /^1?$|^(11+?)\1+$/' ‹number› How it works: given a number, say 7. Generate a string of 7 same chars, say "bbbbbbb". Then, use regex to test if repetition of 2 chars "bb" matches the string completely. If not, try 3 chars "bbb", then 4, etc.The interesting thing is to put this into a single regex. The key regex is ^(bb+?)\1+$.Perl tricks by NEIL KANDALGAONKAR2012-05-20 By Neil Kandalgaonkar. @ Source montreal.pm.org

Two Robbery Prank Videos

Image

HTML5 Audio Tag Example

Perm URL with updates: http://xahlee.org/js/html5_audio.htmlThis page shows you how to embed audio using HTML5's “audio” tags.Here's a example of embeded audio. <audiosrc="i/Bach_WTC1_1_Martha_Goldstein.ogg" controls></audio> Here's what your browser shows.Bach's Well-tempered Clavier, Book I, prelude 1.Raw file: Bach_WTC1_1_Martha_Goldstein.ogg.As of 2011-06-24, it works in Firefox 3.6.12, Chrome 7.0, Opera 10.63. (all on Windows)As of 2012-05-19, it does not work in Safari 5.0.5, IE 9. (probably due to the ogg format.)HTML5 Audio Tag AttributesFollowing are optional attributes.AttributePossible ValuesCommentpreloadnone, metadata, auto◇controls◇Does not take any valueautoplay◇Does not take any valueloop◇Does not take any valueNote that the attributes {controls, autoplay, loop} do not take any value. Their existence or non-existence defines the behavior. It is incorrect to add a ="true" or ="false" in them. This type of attribu…