Posts

Showing posts from March 4, 2012

Emacs Tip: Set Line Number to Start at 0

If you want line number to start at 0, put this in your emacs init file: (setq linum-format (lambda (line) (propertize (number-to-string (1- line)) 'face 'linum))) For detail about linum-mode feature, see: New Features in Emacs 23.Setting line number to start at 0 is useful because some editors do that. See: bug#4274

Emacs Package Repository: MELPA

For Emacs Package System, there is another package repository melpa.milkbox.net. Am not sure what's its distinctive features from other repo such as Marmalade. You might try it. Let me know.MELPA is written by Donald Ephraim Curtis (home page milkbox.net)(melpa is suggested by Ozan Sener from Jon Snader's blog.)A Guide on Emacs Package System

blogger UI change causes traffic surge?

Image
xahlee blogger traffic 2012-03-09I stopped blogging in Jan 28th, and started in Feb 29th, and changed my blogger interface from a statc template to blogger's new dynamic template on March 5th.For reasons unknown to me, my blogger traffic is about 8 times more starting on March 5th.Is it due to the dynamic UI?Dynamic Views: seven new ways to share your blog with the world2011-09-27 By A Googler. @ Source buzz.blogger.com

web design: gray text idiocies continued

Image
web design idiocies continuedarstechnica screenshot, 2012-03-09. Can you read those orange texts?Things get worse:Do you find the text easy to read?read more at http://xahlee.org/js/web_design_gray_on_white.html

Programing: Are int, float, long, double, Side-Effects of Computer Engineering?

Xah Lee wrote: Programing: Why Idiomatic Programing Are Bad. Quote:… One easy way to measure it is whether a programer can read and understand a program without having to delve into its idiosyncrasies. …Chris Angelico wrote:Neither the behavior of ints nor the behavior of IEEE floating point is a “quirk” or an “idiosyncracy”. …They are computer engineering by-products. Are quirks and idiosyncracies. Check out a advanced lang such as Mathematica. There, one can learn how the mathematical concept of integer or real number are implemented in a computer language, without lots by-products of comp engineering as in vast majority of langs (all those that chalks up to some IEEEEEEE. (which, sadly, includes C, C++, perl, python, lisp, and almost all. (Common/Scheme lisp idiots speak of the jargon “number tower” instead IEEEE.) (part of the reason almost all langs stick to some IEEEEEEEE stuff is because it's kinda standard, and everyone understand it, in the sense that unix RFC (aka really…

emacs vs vi power drill

Image

What's “closure” in Programing Language?

Perm URL with updates: http://xahlee.org/UnixResource_dir/writ/closure.htmlClosure means a few things.In non-programing contexts, it means something is “closed”, or, a sense of completeness. For example: “I'm returning to my hometown for a sense of closure.”.In math, algebra, it means a property of a algebraic structure, namely: a function with input from elements of the set, whose result is always also a element in the set. (i.e. the set is closed under this operation) For example, it's common to hear: “the addition operation is closed over integers.”. It means, adding 2 integers results in a integer. Division, for example, is not closed under integers. That is, diving 2 integers may result in something that is not a integer. e.g. fraction.In programing, it means a mechanism/feature in a language such that a function/subroutine can maintain a state. (in a clean way. e.g. without using global var)A function/subroutine that maintains states using the above feature.and, of cours…

Web Design 2012: Minimal Windows Width of Popular Sites

Perm URL with updates: http://xahlee.org/js/web_design_minimum_width.htmlQuite annoyed that Google in past month assume your window size must be quite wide.Meaning: the page is designed to assume a minimal display width as optimal. For example, if your window is not that wide, a horizontal scrollbar shows up.Here's some minimal sizes for each site.Gmail = 994 (mininum); 1290 (no horizontal scroll bar)g+ = 994 (mininum). 1080 for nav bar to float.Twitter = 900 (mininum); (990 to show all items in nav bar)Google Reader = 952Facebook = 1014apple.com = 1014google.com = 1014microsoft.com = 1000Yahoo! = 1014amazon = 1033DISQUS = 1180Here's sites that used a flow approach.Wikipedia = flowhootsuite = flowWeb Design: Fixed-Layout vs Flowed-LayoutWeb Design: Say No to Gray Text on White BackgroundWeb Design: Should Hyperlinks Have Underline?Web Design: Survey of Tab Style 2006

A Guide on Emacs Package System

Image
Emacs package system lets you auto-update and manage emacs packages. It lets you easily see packages available, update to latest version, install/remove packages. So you don't have to manually track what's installed, each package's home page, whether there's new version, etc.It is bundled with emacs 24 (currently in beta as of 2012-03-05). You can wait for it, Or, you can just install it now and use it. (it wouldn't be a issue when you switch to emacs 24)Emacs “list-packages” screenshotread more at A Guide on Emacs Package SystemWhat's Emacs Custom System and Should You Use It?Emacs: How to Associate a File with a Major Mode?Organize Your “dot emacs” Init File in 5 MinutesThe Best Redo Mode for Emacs

Xah Emacs/Elisp Tutorial Update 2012-03-07

New version of my emacs tutorial ready.If you've bought it before, please just email to xah@xahlee.org with subject “emacs tutorial upgrade”.If you haven't bought it, you can get it for just $10. See: Buy Xah Emacs Tutorial. As far as i know it's more complete and detailed tutorial than any emacs book, printed or not, especially the elisp section.Also, you can subscribe my emacs blog from g+, facebook, twitter, or Google Reader. See: Xah Lee Feeds.Thank you for support! and thanks to those of you who have made comments or helped spread the word on social networks. Also, much thanks to Jon Snader (jcs) (irreal.org) who made many private corrections and suggestions.

CSS Text Alignment and Justification

logical song

Image

Billy Idol - Sweet Sixteen

Image
“Billy Idol - Sweet Sixteen” amazonNote here, it's sweet 16, not sweet 18, 21. Nor sweet 30, 40.SIXTEEN. This is when, girls have just became sexual for a couple years. As to a peach that become ripe.Also note, sweet 16 refers to females, not males. Males, is never sweet, at 16, 26, 36, or 46. Males, are sweet when there's money and power.for lyrics, see: http://xahlee.org/music/sweet_sixteen.html.ABBA - Dancing QueenMickey Avalon - My Dick (Song) & Jane FondaLittle Red Riding HoodMichael Jackson - Billie JeanAnya Marina - Whatever You Like (Gossip Girl)再会吧!十七岁 (Goodbye, Seventeen)

blogger layout update: do you like it?

so, i updated the blogger appearance, using now the fashionable web2/javascript/ajax based dynamic style.mouse over the top line to see several interactive layouts.mouse over the black line on right edge to see the archive, subscribe button, etc.do you like the new look?

In Emacs 24: Any Elisp Script Using copy-directory is now Broken

in emacs 24, there's this major backward-incompatable change ** `copy-directory' now copies the source directory as a subdirectory of the target directory, if the latter is an existing directory. The new optional arg COPY-CONTENTS, if non-nil, makes the function copy the contents directly into a pre-existing target directory. this means, all existing elisp scripts will break. (it broke mine)basically, it's trying to follow the behavior of unix “cp” command. There are 2 problems:① this is a fundamental change on a language function. It will break any emacs lisp script that uses “copy-directory”.② the behavior of unix “cp” is actually worse. Emacs's original behavior is more logical and predictable. (See: Idiocy Of Unix Copy Command.)here's a workaround: (if (>= emacs-major-version 24) (if (file-exists-p toDir) (copy-directory fromDir (concat toDir "/../")) (copy-directory fromDir toDir) ) (copy-directory …

Lulzsec Got Bursted, Leader Betrayed Team

Image
Perm URL with updates: http://xahlee.org/Periodic_dosage_dir/lulzsec_bursted_leader_betrayal.htmlSo, the lulzsec got bursted. The entire gang of ~6.It turns out, the leader got bursted by FBI, and then since secretly worked for FBI for several months to betray the whole, so he can reduce his jail time.EXCLUSIVE: Infamous international hacking group LulzSec brought down by own leader2012-03-06 By Written Jana Winterpublished. @ Source www.foxnews.comSee also: Sabu (hacktivist), Topiary (hacktivist), LulzSec.Computer Hacking: Lulz Security Farewell NoteAnonymous vs Google: the Origin & Culture of AnonymousWikileaks, Bank of America, Anonymous, US Government, Espionage2011-08-07 Anonymous Hacked Syrian Military Site

Chinese language articles

Chinese language related articles now has a index, at: Index to Chinese Language Articles.Also, be sure to follow/subscribe Wordy English @ http://wordy-english.blogspot.com/.If you use twitter, or g+, you can follow there too, see: http://xahlee.org/subscribe.html

Emacs 24: Spell-Checking on Windows is 25 Times Faster!

Just discovered something incredible. For emacs on Windows, calling flyspell-buffer usually takes 5 seconds for a small file (e.g. 8k sized).But in emacs 24, it is now less than a second!Was there a change in emacs 24 that effected this or am i smoking something?Here's a exact timing, on a 80k HTML file:emacs 23.2.1 on Windows (with Cygwin aspell): 80 secondsemacs 24.0.93 on Windows (with Cygwin aspell): 3 secondsthe release notes (aka emacs NEWS) didn't mention anything about spell, but has the following: ** The default value of redisplay-dont-pause is now t This makes Emacs feel more responsive to editing commands that arrive at high rate, e.g. if you lean on some key, because stopping redisplay in the middle (when this variable is nil) forces more expensive updates later on, and Emacs appears to be unable to keep up. however, setting “redisplay-dont-pause” to t, didn't help in emacs 23.

Parallel Programing Problem: asciify-string

here's a interesting parallel programing problem.the task is to change this function so it's parallelable. (defunasciify-string (inputStr) "Make Unicode string into equivalent ASCII ones." (setq inputStr (replace-regexp-in-string "á\\|à\\|â\\|ä""a" inputStr)) (setq inputStr (replace-regexp-in-string "é\\|è\\|ê\\|ë""e" inputStr)) (setq inputStr (replace-regexp-in-string "í\\|ì\\|î\\|ï""i" inputStr)) (setq inputStr (replace-regexp-in-string "ó\\|ò\\|ô\\|ö""o" inputStr)) (setq inputStr (replace-regexp-in-string "ú\\|ù\\|û\\|ü""u" inputStr)) inputStr ) for detail, see: Parallel Programing Problem: asciify-string.

The Best Redo Mode for Emacs

There are a few packages for redo. Of the ones i've used are:〔redo.el〕 by Kyle E. Jones, 1997.〔redo+.el〕original by Kyle, updated by S Irie, 2008.〔undo-tree.el〕 Toby Cubitt 2009-.The redo.el works ok, but occasionally it corrupts your undo… meaning that you know there's more undo/redo but wasn't able to get to it. This happens perhaps once a month.The redo+.el is supposed to update/modernize the code. Unfortunately, i didn't have luck with it. These Kyle based redo modes are ~200 lines of elisp, each.read more at http://xahlee.org/emacs/emacs_best_redo_mode.html

Firefox: How to Unhide/Disable the Auto-Disappearance of Forward Button

Image
Firefox 10 decided to auto hide the Forward button when there's no forward.Firefox 10 Forward button autohide screenshotsVery annoying. Because, as you navigate among the pages, the movement of these icons is distracting.there doesn't seem to be a built-in way to disable this auto-hide. But, one work around is to set the icons to be small. Right click on a empty area in the tool bar, then choose 〖Customize…〗. Then check mark 〖Use Small Icons〗.Reference: Source Firefox 10 release notes.

Camille Paglia on Lady Gaga

Image
Perm URL with updates: http://xahlee.org/Periodic_dosage_dir/t2/camille_paglia_on_lady_gaga.htmlOMFG, every time i hear Camille Paglia talk, i get excited. Her intellectualism, is like a high-voltage electric charge. It made me feel life is worth living.listen to her commentary about Lady Gaga.what is SEXY? Camille Paglia is.Camille Paglia on Lady Gaga.The Brazilian star she mentioned is Daniela Mercury.Camille Paglia: Modern Sex GoddessSexy Women: Katie Couric, Camille Paglia, Jane HamsherWhy I'm not a proud supporter of FeminismWhat is Gender Feminism?a Exhibition of Political Correctness and Feminism Prowess

Magic Polyhedrons

Image
My favorite type of physical puzzles are the Rubik-type puzzles called Magic Polyhedrons. These puzzles screams: “group theory” and “combinatorics”!for lots more, see Magic Polyhedrons.

Web Design: Say No to Gray Text on White Background

Image
Perm URL with updates: http://xahlee.org/js/web_design_gray_on_white.htmli dunno wtf is going on with web design crowd, but more and more idiots have websites that's hard to read. Such as using gray text on white background.example:web design: gray text on white background.Black on Gray!Web Design: Fixed-Layout vs Flowed-LayoutWeb Design: Should Hyperlinks Have Underline?Website Tabs Style

Programing: LISP is Not Functional!

Perm URL with updates: http://xahlee.org/comp/lisp_non-functional.htmlDear lispers, brace yourself, stinging damnation is coming forthwith!the more i learn about Common Lisp, the more i think it's one fuckedup soup. (setf, rotatef, are recent examples)also, the more i code in lisp (elisp), the more i find it non-functional.lots, lots, of mutations built-in in the lang in a way that forces you to be non-functional. Quick 1 minute typing:• destructive sort.• setq setq setq.• tons of global vars, not just for emacs environment such as buffer, mode states, etc, which are arguably necessary. But, for things like “match-string”.• lisp's list, of cons, is one fucking DAMNATION. Along with it comes rampant use of pop, push. Any non-trivial coding in lisp is fucking like perl now, except that dealing with list and nested list in perl is actually much more easier than in lisp.there's a good solution to lisp's non-functional ways.BAN lispers from using list or cons. Everything sh…