Posts

Showing posts from November 28, 2010

Time Mag, Julian Assange, video

Image
Perm url with updates: http://xahlee.org/Periodic_dosage_dir/US_diplomatic_cables_leak.htmlTime Mag cover 2010-12-13 Julian Assange 〈TIME's Julian Assange Interview: Full Transcript/Audio〉 (2010-12-01) Source www.time.comA very interesting video: 〈WikiLeaks's Julian Assange Reviews TIME's Top 10 Leaks〉 Source www.time.com.See also: Julian Assange Raped Women?

what emacs/lisp tutorial you like to see?

Last poll results:There's no emacs cookbook or elisp cookbook on the market. If i write a emacs book (published in printed form), are you likely to buy it?Yes, if it's good. 41 (70%)No, am not likely to spend money on emacs/elisp book. 14 (24%)N/A. I don't use emacs... 3 (5%)Total votes: 58 This week's poll:For emacs tutorial, what would you like to see more?1. More howto about GNU Emacs's bundled features and modes.2. More tutorial about installing/use 3rd party modes and packages.3. More tutorial on elisp programing for text manipulation.4. More tutorial on writing modes (working with fonts, buffers, keys, menu, frames/windows, syntax highlight, shell IO...).In the past i pretty much just wrote what i personally learned or need to do. I'm not sure so far which particular area i'm missing that people wish to see. In the above choices, basically the latter are more difficult, especially number 4.«1. More howto about GNU Emacs's bundled features and mode…

Hilarry Clinton: goto jail!

According one of the US Diplomatic Cables Leak, US Secretary of State Hillary Clinton has ordered espionage on UN officials.Here's a Gardian article: 〈US diplomats spied on UN leadership〉 (2010-11-28) By Robert Booth and Julian Borger, guardian.co.uk. At: Source www.guardian.co.ukA classified directive which appears to blur the line between diplomacy and spying was issued to US diplomats under Hillary Clinton's name in July 2009, demanding forensic technical details about the communications systems used by top UN officials, including passwords and personal encryption keys used in private and commercial networks for official communications.It called for detailed biometric information "on key UN officials, to include undersecretaries, heads of specialised agencies and their chief advisers, top SYG [secretary general] aides, heads of peace operations and political field missions, including force commanders" as well as intelligence on Ban's "management and decis…

Emacs Lisp: writing a url-linkify

Perm url with updates: http://xahlee.org/emacs/elisp_html-linkify.htmlEmacs Lisp: writing a url-linkifyXah Lee, 2010-12-03This page is a little lisp tutorial. A example on writing a function that transform the text under cursor on the fly. If you are not familiar with elisp, see: Emacs Lisp Basics.ProblemI need to write a elisp command, so that, when pressing a button, the url under cursor, such as: http://some.example.com/xyz.html becomes this: <aclass="sorc"href="http://some.example.com/xyz.html"title="accessed:2010-12-03">Source some.example.com</a> And pressing another button, the link become this: <aclass="sorcdd"href="#"title="accessed:2010-12-03; defunct:2010-12-03; http://some.example.com/xyz.html">Source some.example.com</a> DetailIn writing blogs, often you need to cite links. The links may be other blogs, news sites, or some random site. Many such url are ephemeral. They exst today, but may …

Emacs Lisp: Replace String Based On File Name

Perm url with updates: http://xahlee.org/emacs/nav-bar.htmlEmacs Lisp: Replace String Based On File NameXah Lee, 2006-11-29This page is emacs lisp lesson on a real-world task. It show how emacs lisp is used in creating HTML navigational bar for a online book. Specifically, we need to insert proper text to each file for a set of files. You should be familiar with Elisp Language Basics.The ProblemSummaryI want to insert the “Next Chapter”, “Previous Chapter” links to a series of HTML files that are chapters of a book.This lesson essentially teaches you how to do a regex pattern replace by a function that return text based on the current file's name.DetailI have a lot of books in HTML form. Usually, the file names have this pattern: “chap1.html”, “chap2.html”, “chap3.html”... etc.Each file is a chapter of a book. And in each file, I need to place a navigation bar, so that there's a Next Chapter and Previous Chapter links at the bottom of each page.Normally, this can be done by w…

Proliferation of Computing Languages

Perm url with updates: http://xahlee.org/UnixResource_dir/writ/new_langs.htmlProliferation of Computing LanguagesXah Lee, 2008-07, 2008-11, 2010-01-26There is a proliferation of computer languages today like never before. In this page, i list some of them. In the following, i try to list some of the langs that are created after 2000, or become very active after 2000. Lisp family or similar:Mathematica. Computer algebra system background. Used mostly for math and research in science community.newLISP. Lisp scripting style. Verdant community of new generation of hobbyist programers.Arc. Paul Graham squeezing juice out of his celebrity status.Qi. Common Lisp added with modern functional lang features. Primarily academic and language research.Clojure. A new lisp dialect on Java platform. Poised as the next industrial lisp, but faces serious competition with other JVM based langs such as Scalar, Groovy.Scheme, notably PLT Scheme. Used mostly for teaching.(Dead. Dylan. Apple's re-invent…

what do programers do all day?

What Do Programers Do All Day?In the past few years, i've been wondering why software engineering is so cumbersome and time consuming. Usually, something that's conceptually trivial, something you think can be done in 10 minutes, ends up hours. In the past few years, i tried to write a account of it whenever this happened to me. See these essays:A Exhibition Of Tech Geekers Incompetence: Emacs whitespace-modeA Emacs Frustration (blogger package)Emacs Spell Checker ProblemsA Record of Frustration in IT IndustryHunspell Path PainThe Complexity And Tedium of Software EngineeringMac OS X SSH Session DisconnectionGraphics Programing PainsSoftware Dependency Complexity: Fink, UnisonURL Percent Encoding and UnicodeURL Percent Encoding and Ampersand CharAutoHotkey Path Problem; Windows Shortcut PathUnix zip Utility Problem(and it is quite time consuming to document this experience. Each essay above usually takes 4 hours to write.)In all the above cases, they are typically about instal…

Emacs Lisp Date Time Formats

Perm url with updates: http://xahlee.org/emacs/elisp_datetime.htmlEmacs Lisp Date Time FormatsXah Lee, 2010-11-29A little emacs lisp tips on working with date time.ISO 8601 FormatElisp provides a very convenient function “format-time-string” for printing data time. For example, you can write a command to print date in the yyyy-mm-dd format using 「(insert (format-time-string "%Y-%m-%d"))」. Here's the full code: (defuninsert-date () "Insert current date yyyy-mm-dd." (interactive) (when (region-active-p) (delete-region (region-beginning) (region-end) ) ) (insert (format-time-string "%Y-%m-%d")) ) The “region-active-p” may be new in emacs 23. For emacs 22, use 「(and transient-mark-mode mark-active)」.In many web tech spec (e.g. Atom Webfeed Format), a full ISO 8601 format is required, like this: 「2010-11-28T13:55Z」. You can code it like this: (defuninsert-date-time () "Insert current date-time string in full ISO 8601 format. Examp…

Unix zip Utility Path Problem

Perm url with updates: http://xahlee.org/comp/unix_zip_problem.htmlUnix zip Utility Path ProblemXah Lee, 2010-11-30This page describes a problem with unix's zip utility that's related to the problem of unix's environment variable.Unix has a command line zip utility to compress files and folders. Very convenient. For example, suppose you want to archive this folder: 〔c:/Users/xah/ErgoEmacs_Source/〕. All you have to do is “cd” to the parent folder 〔c:/Users/xah/〕, then type 「zip -r ErgoEmacs_Source.zip ErgoEmacs_Source」. A archive file named “ErgoEmacs_Source.zip” will be created.But suppose you need to call “zip” in a program. I know the dir i want to archive, and i know the dir i want the archived output to be.Suppose in your program, you have: zip -r "c:/Users/xah/output/ErgoEmacs_Source.zip""c:/Users/xah/ErgoEmacs_Source"This will create the archive, however, there's a problem. In the archive, it records the full path of each file. So, when user t…

CSS hack: multiple background and borders to create icons

Image
Nicolas Gallagher created a interesting, extreme, css hack. See: 〈Pure CSS GUI icons〉 (2010-11-16) By Nicolas Gallagher. At nicolasgallagher.com.Nicolas Gallagher's no-images css icons. He created some 80+ icons. No images are used whatsoever, not even in css file. They are done by combining layers of several border, background. Each layer is specifically positioned, z-indexed, and with width and height spec, then using css3 features of rotating or oherwise transform them. The final result is the icon you see. A very advanced hack.Though, hack they are. In practice, it's much better to use Unicode characters (See: Computing Symbols in Unicode) or images. (more than half of the icons he created doesn't exist as Unicode chars.)To help me understand how he did it, i copied and reduced and created a much simpler file with just 2 icons. See: CSS Hack to Create Icons.To understand it, you'll at least need to understand:CSS Position: static, relative, fixed, absolute, Examples

US Diplomatic Cables Leak

Image
Perm url with updates: http://xahlee.org/Periodic_dosage_dir/US_diplomatic_cables_leak.htmlWikileak: US Diplomatic Cables LeakXah Lee, 2010-11-29, 2010-12-08Big news: United States diplomatic cables leak. Quote:The United States diplomatic cables leak is the ongoing public release of 251,287 documents, detailing correspondence between the U.S. State Department and U.S. embassies around the world. The documents were obtained by WikiLeaks and distributed to five major newspapers under embargo, with the first set of 220 cables published on 28 November 2010.[1][2][3] The release includes approximately 100,000 documents labelled "confidential" on the classification scale and around 15,000 documents at the higher level "secret", but none marked "top secret". Most of the documents focus on diplomatic relations between the U.S. and Middle East states.[4] WikiLeaks plans on releasing the entirety of the cables in phases over several months.[2]Also of interest, is …

Madman tank rampage

Image
Madman drives a self-built, modified-to-armored bulldozer on a destruction rampage. He's Marvin Heemeyer. Madman drives a stolen tank thru street. He's Shawn Nelson. See also: Unabomber Manifesto (Industrial Society and its Future).

Plants vs Zombie; Thoughts on Strategy and Game Formulation

Image
Perm url with updates: http://xahlee.org/math/plants_vs_zombie.htmlPlants vs Zombie; Thoughts on Strategy and Game FormulationXah Lee, 2010-11-28Plants vs. Zombiesamazon is a very popular game.plants vs zombie last boss. The game, according to Wikipedia, is a type of game called Tower defense. As you can see in the video, each type of plant has particular properties, such as shield level, energy level, fire power, and position etc. Same for zombies. If you watched the video, you might wonder what's the optimal strategy, given the number of incoming zombies, their type, and position.This aspect is similar to many games, for example Second Life's Tech Warfare, and lots other video games. In a sense, hundreds or thousands of these video games arbitrarily creates a math optimization problem.If you are the designer of the game, you also might wonder what's the optimal strategy. In fact, if you are math oriented, you might start with a formalization of the math core of the game. …

Principia Mathematica

Perm url with updates: http://xahlee.org/math/principia_mathematica.htmlPrincipia MathematicaXah Lee, 2010-11-28Interesting article:〈100 Years Since Principia Mathematica〉 (2010-11-25) By Stephen Wolfram. At: blog.stephenwolfram.comI learned the book Principia Mathematica (PM) in about 1991, as a college student. At the time my math isn't good enough for the prospect of reading it. In early 2000s, i'm ready to read the book, always wanted to, but never did. In fact never saw a single page of the book. Though, today, i don't think the book is worth a detailed reading even if you specialize in math logic. Rather, as a required acquaintance.Here's some explanation of the notation used.〈The Notation in Principia Mathematica〉 (2004-08-19) By Bernard Linsky. At: plato.stanford.eduIt seems, to read the book and have some basic understanding would require at least a year full time. (assuming you already understand the basics of logic and some history of math foundation.)《Princ…

google propaganda, html5

20thingsilearned.com. A fancily designed website, that is a kinda educational article for the general public that teaches them what is the web and web technologies, together with some opinions mixed in. A sorta propaganda, from Google. However, it demonstrates what html5 can do.The site seems to be created sometimes this month (2010-11) (or, opened to public), and it's just about 20 pages of content, but the site's already ranked 21k in the world. (See: alexa.com.) For context, my site xahlee.org is ranked world's 68k, and has about 8k daily visitors. A quick estimate seems to indicate the site gets 286k visitors per day.See also: HTML6, Your HTML/XML Simplified.Why Does Google Give SEO Advice?Google's 「rel="nofollow"」 RuleGoogle Blogger Porn Content PolicyGoogle Sidewiki BlockGoogle Ice Cream; Can Google Be Trusted?Google Problems and Alternative Search Engines