Posts

Showing posts from December 30, 2007

Emacs lisp Lesson: Hash Table

Emacs lisp Lesson: Hash Table

Xah Lee, 2008-01

This page shows you how to use hash table in emacs lisp. If you don't know elisp, first take a gander at Emacs Lisp Basics.

(for HTML version with colors and links, see:
http://xahlee.org/emacs/elisp_hash_table.html
)

---------------------------------------------
What Are Hash Tables

Often, you need to have a list with elements being key-value pairs. For example, the key may be a person's name, and the value can be their age. Or, in a more complex case, the key can be the person's ID number, and the value can be a data of name, age, sex, phone number, address, etc. You might have thousands of such entries, and you want to be able to know that, given a ID, find out whether it exists in your data. You also want to be able to add or delete, modify entries in the data.

From a interface point of view, such a keyed list looks like this: “((key1 value1) (key2 value2) (key3 value3) ...)”. If you want to know a particular key exist, you can wri…

Lispers and Wikipedia

Lispers and Wikipedia

2007-12-27

[The following is posted to comp.lang.lisp newsgroup in a thread's tangent discussion on contributing to Wikipedia]

permanent link: http://xahlee.org/Periodic_dosage_dir/encyclopedia.html

Please people, by all means, add and edit to Wikipedia lisp related info!

I've been reading and editing Wikipedia like for 2 to 8 hours every damn day since about 2003-11. (mostly just reading in the past year) My website has over 3786 links to Wikipedia, and i basically read every article i've linked to. For each article i have linked, there are about 10 more articles i've read.

I read encyclopedias with greed like a leech sucking on blood since ~1992. And i can tell you, with my life's saving on the table, that Wikipedia today as it is in terms of quality and quantity, in depth and in breadth, and all things considered, is FAR beyond any 10 professional encyclopedias and or specialized encyclopedias and references and compendiums and annals COMBINED! (…

Graphics Programing Pains

Perm url with updates: http://xahlee.org/3d/graphics_programing_pain.htmlGraphics Programing PainsXah Lee, 2007-12-29, 2009-06[this essay is a rambling about programing GUI app and 3D geometry]I have a problem. I want to do 3D geometry visualization programing, but there is no appropriate tools. (see Requirements For A Visualization Software System For 2020) O, fuck the industry.GUI Programing PainI never had any experience writing a GUI application. (except web/HTML form based ones, which doesn't really count.) About 3 times in different years since 1997, i tried to learn GUI programing thru Java's Swing (Java). But each time i aborted rather even before getting a basic understanding of how to create a menu. Today is another try, and perhaps the furthest i've made. To make a empty window with a menu with no actions attached, requires some fucking 170 lines of java code, and tens of classes and objects with complex relationships. (sample code here:MenuLookDemo.java) So, …

wikipedia readings on evolutionary biology

2007-12-30

Excursion into evolutionary biology:


Mimicry↗
Fisherian runaway↗
Sexual selection↗
Evolutionary arms race↗
Sexual conflict↗
Sexy sons hypothesis↗
Coolidge effect↗
Red Queen's Hypothesis↗


A quote from the Sexual Selection article:

«Sexual selection is the theory proposed by Charles Darwin that states that the frequency of traits can increase or decrease depending on the attractiveness of the bearer. Biologists today distinguish between “male to male combat” (it is usually males who fight), “mate choice” (usually female choice of male mates) and “mate coercion” (forced mating). Traits selected for by male combat are called “weapons”, and traits selected by mate choice are called “ornaments”.»