Showing posts from July 24, 2011

Emacs: How to Associate a File with a Major Mode

Perm url with updates: How to Associate a File with a Major Mode?Xah Lee, 2008-07, 2011-07-29This page tells you how emacs determine what major mode to load when you open a file, and how you can change the setup.Note that when you install a new package, some has the file association setting code within the package, while others ask you to put a few lines in your emacs init file instead.How Emacs Determines Which Major Mode to LoadEmacs determines what mode to activate by the following mechanisms, in order. If a match is found, the process stops.Look for a special emacs-specific syntax in the file. For example: if first line in the file contains -*- mode: xyz-*-, emacs will load “xyz-mode”. This is from a general mechanism for emacs to load elisp variables. (See: (info "(emacs) File Variables").) This has the top priority, but this mechanism is not the usual way for programing language files to associate with…

Perl, Unicode, Unicode 6 Fonts

Perl, Unicode, Unicode 6 Fonts3 Bleeding-edge perl articles on unicode.Perl Unicode Essentials (2011-07-26) By Tom Christiansen. @ training.perl.comUnicode in Perl Regexes (2011-07-26) By Tom Christiansen. @ training.perl.comUnicode Support Shootout: The Good, The Bad, & the (mostly) Ugly (2011-07-26) By Tom Christiansen. @ training.perl.comAccording to one of the article above, at least one of them is inspired from this stackoverflow question: Why does modern Perl avoid UTF-8 by default?Source stackoverflow.comAlso, checkoutUnicode Fonts for Ancient Scripts By George Douros. @ contain font for some unicode 6 glyphs and lots of others that won't be in normal so-called unicode fonts. For example and explanation of some of these glyphs, see: Unicode 6 Emoticons. For overall best unicode fonts, see: Best Fonts for Unicode.2011-07-29 Thanks to Andrew Kirkpatrick.Unicode in Perl & PythonUnicode Support in Ruby, Perl, Python, javascript, Java, Emac…

Portishead - Machine Gun (Song)

Perm url with updates: - Machine Gun (Song)Xah Lee, 2011-07-29A fantastic song by Portishead: Machine Gun. “Portishead - Machine Gun”It is industrial. I saw a saviour a saviour come my way I thought I'd see it at the cold light of day but now I realise that I'm Only for me if only I could see You turn myself to me and recognise the poison in my heart there is no other place no one else I face remedy, we'll agree, is how I feel here in my reflecting What more can I say? for I am guilty for the voice that I obey too scared to sacrifice a choice chosen for me if only I could see You turn myself to me recognise the poison in my heart there is no other place no one else I face The remedy, to agree, is how I feel Portishead - The Rip & RoadsPortishead - Wandering StarsPortishead - Small (song)Portishead - Glory BoxMono - Slimcea Girl

Google Logo Boobs

Perm url with updates: Logo BoobsXah Lee, 2011-07-29Google Boobs?Original source unknown. If you know the original, or background info, please comment. Are they Google employees? Am thinking the guy on the right looks like Vic Gundotra. Vic Gundotra photos on g+Firefox Logo BoobsGoogle Ice Cream; Can Google Be Trusted?Apple iPad, CensorshipMicrosoft Linux Ad

Emacs Tip for YASnippet: Expand Input with Hyphen

Perm url with updates: YASnippet Tip: Expand Whole hyphenated-word as InputXah Lee, 2011-07-29Emacs Tip for YASnippet: Expand Whole hyphenated-word as InputIn YASNippet, you can define your own templates. For example: bsnp▮ ⇓ (buffer-substring-no-properties START▮ END) But sometimes your word contains a hyphen, but upon expansion, it uses only part of the word as input. For example, you want: buffer-substring▮ ⇓ (buffer-substring START▮ END) But you get: buffer-substring▮ ⇓ buffer-(substring STRING▮ FROM &optional TO) How to fix this?Put the following in your init file:;; 2011-07-29 yasnippet. Make the “yas/minor-mode”'s expansion behavior to take input word including hyphen. (setq yas/key-syntaxes '("w_""w_.""^ ")) ; default is '("w" "w_" "w_." "^ ") as of 2011-07-29 Thanks to João Távora. Source g…

Girl of Split Tongue

Perm url with updates: of Split TongueXah Lee, 2011-07-28“Split tongue tricks- new and improved” (dropaheart37) Body and Mind Modification

emacs list-non-matching-lines

You know about the following functions?list-matching-linesdelete-matching-linesdelete-non-matching-linesHow aboutlist-matching-lines-all-bufferslist-non-matching-lineslist-matching-lines-no-regexsplit-buffer-by-matching-linesSee update: List Matching Lines and Delete Matching Lines in Emacs for detail.

Eating Live Squid

Perm url with updates: Live SquidXah Lee, 2011-07-28A very creepy video. “Dancing squid bowl dish in Hakodate” (richayanami) After watching that, the question from commentators is whether the squid is alive thus “cruelty to animal”. Now, watch the following video. The question becomes moot.“How To Eat Live Squid” (MichaelDola)Effect of MethShoes (Kelly song)Condom AdWrong Hole Song

Emacs Lisp: Chinese character Reference Linkify

Perm url with updates: Lisp: Chinese Character Reference LinkifyXah Lee, 2011-07-27Another quick elisp that enhance my productivity 10-fold!Problem I write many blogs. In one of the blog , i often need to create links to several dictionaries. For example, if the cursor is on the Chinese char 魂, then pressing a button i want it to become this: <divclass="cdict"> <ahref="魂">Wiktionary 魂</a> ◇ <ahref="|en|魂">Google 魂</a> ◇ <ahref=";characterInput=魂">history 魂</a> </div> Which appears in browser like this:Wiktionary 魂Google 魂history 魂 SolutionI've already wrote ~20 elisp functions like this the past years. (See: Emacs Lisp Power! Transform Text Under Cursor.) So, today's problem …

A Interloper in alt.usage.english Theater

ok. There's fancyman, old hats, interloper, Nero fiddling, waffly, miasma, and the you know their meanings, allusions, connotations, etymology? For my own good, i produced:A Interloper in alt.usage.english TheaterParticularly interesting is the etymology of waffle. There doesn't seem to be a sure answer. Also, miasma is a good one to dig up. Nero fiddling to history. And the Gipper for American slang.

How to Download All Your Emails in Gmail?

Perm url with updates: to Download All Your Emails in Gmail?Xah Lee, 2011-07-25For those who fear of Google killing your Gmail account, do this:• Go to your Gmail. Click the options (gears icon) on upper right. Choose the 〖Forwarding and POP/IMAG〗 link at top.• In the 〖IMAP Access〗 section, choose 〖Enable IMAP〗.• Now, download Mozilla Thunderbird, at Install it. Start it.• Type in your name, Gmail, and Google password. e.g. name: xah lee email: password: your Gmail password • Now, Thunderbird will start to download all your emails and store on your local computer. Starting with your inbox.• In Thunderbird, click the 〖All Mail〗 folder on the left pane, then Thunderbird will start to download all emails in that folder too. Do this if you have other folders.• Now, you can read or write email either from a web browser or Thunderbird. When you delete a email from either, it…

Robot Dance & B-boying Dance (Breakdancing) Videos

Perm url with updates: Dance & B-boying Dance (Breakdancing) VideosXah Lee, 2011-07-25Various nice dance videos.Robot DanceRobot (dance)“LOUDER|DUBSTEP”. DUBSTEP, The dancers are (in order) {Marquese “nonstop” Scott, Julius “iglide” Chisolm, Cyrus “glitch” Spencer}. Videography by Jason Locklear. Song name “DJ Fresh - Louder (Doctor P & Flux Pavilion Remix)” above, the dance starts at 00:50.~2001B-boying DanceThe acrobatics here is amazing. “Extreme Crew B-Boying” Wikipedia has extensive detail. B-boying.Ballet: How Do Ballet Dancers Dance on Tiptoe?Freestyle BMX (Bicycle Acrobat)Pole Dancing and Chinese Pole (video)

Emacs: Jump to Previous Marked Position

Emacs: Jump to Previous Marked PositionOften, you need to go to a previous position in a buffer. For example, you are editing a big source code that's few hundred lines. You want to look at some function's definition, but then you want to return to the current position.Emacs has a buffer mark ring and global mark ring that records mark positions and lets you jump to it.Press 【Ctrl+SpaceCtrl+Space】 to push current position into mark ring.Press 【Ctrl+uCtrl+Space】 to go back to previous position in current buffer.Press 【Ctrl+xCtrl+Space】 (“pop-global-mark”) to go back previous position that may not be the current buffer.(info "(emacs) Mark Ring")(info "(emacs) Global Mark Ring")

Abomination of Simplified Chinese Characters 灾=災

Abomination of Simplified Chinese CharactersThis is a abomination of simplified chinese characters: 兽=獸獸 etymology.According to, that's one-off simplifications. (i.e. idiosyncratic, just for that particular char.)灾=災灾災災 etymology.康熙字典 災The following two chars that i also had a hard time understanding, but their simplification are based on phonetics.认=認認 etymology达=達達 etymologySee also: 简体/繁體 字表 (Simplified/Traditional Chinese Characters List)Thanks to Lew Perin (babelcarp).

Why Does HTML5 Kill the ‹big› Tag?

Why Does HTML5 Kill the ‹big› Tag?Am quite annoyed that HTML5 axed the <big> tag, yet it retained the <small> tag. How idiotic.Instead of using “big”, i supposed that you are supposed to use “em” or “strong” or “b”. But that doesn't cut it. “big” carries a sematic that's not one of emphasis, strong (e.g. warning), or bold. If you are going to argue that html should be used for semantic markup, then html5 shouldn't have “b”, “i”, “u”.I need to use big for several reasons. One is for some unicode symbols and chinese chars. Ι want the char to be larger so user can see the detail of such complex glyph. For example:鬍 ☫ ☬ ⚜ ☸ ☠ ❇ ❈ ❄ ❅ ❆ ✿ ❀ ❁ ✾ (more example at: Dingbats and Cultural Symbols in Unicode简体/繁體 字表 (Simplified/Traditional Chinese Characters List)) Another reason is that sometimes i want to make a title larger, but semantically i don't want it to be a header such as {h1, h2, h3}. For example, in a index page that lists articles, i want to make …