Showing posts from October 9, 2011

Art of Audrey Kawasaki


programing language with BEGIN END; Google Dart

2011-10-15 Any programing language, that uses keywoards like BEGIN END instead of any [({brackets})] , is a fuckedup language.2011-10-10 so, Google introduced a new language, Dart. Q: What's Dart in a nutshell? A: Javascript with Java syntax.

taxidermy high heels

dove taxidermy high heels. Original source seems to be

Emacs Lisp, Perl, Python: Building a Multiplication Table

So, i was reading Jon Snader (aka jcs)'s blog @, which lead me to watch a video of so-called VimGolf, but using emacs:VimGolf in Emacs e003: Multiplication Table (2011-07) By Tim Visher. @ Source vimeo.comThe task is to generate a multiplication table like this: 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3 6 9 12 15 18 21 24 27 30 4 8 12 16 20 24 28 32 36 40 5 10 15 20 25 30 35 40 45 50 6 12 18 24 30 36 42 48 54 60 7 14 21 28 35 42 49 56 63 70 8 16 24 32 40 48 56 64 72 80 9 18 27 36 45 54 63 72 81 90 10 20 30 40 50 60 70 80 90 100 I thought this is interesting.For this particular problem, i thought the most simple and practical way is just to use a programing language to spit it out. So i quickly wrote this: (let (x i ) (setq x 1 ) (while (< x 10) (setq i 1 ) (while (< i 10) (insert (format "%2d " (* x i))) (setq …

Emacs Lisp Exercise of the Day: extract-url

Emacs Lisp Exercise of the Day: extract-urlHere's a fun exercise: write a command “extract-url” that will extract all url in a text selection and put them in a buffer.For example, suppose you have this text: <div>1, <ahref="iraq_pixra2.html">2</a>, <ahref="">Idiom</a>, <ahref="iraq_pixra3.html">3</a></div> After calling the command, you'll get in a separate buffer this text, one url per line: iraq_pixra2.html iraq_pixra3.html You can assume that the url will always be in href="…". For extra bonus, also extract URL enclosed in single quotes: href='…'. The extracted URLs must be in the order they apppear.I'll post a solution tomorrow.

Stephen Wolfram: The Background and Vision of Mathematica

“Stephen Wolfram: The Background and Vision of Mathematica”Notes on A New Kind of Science

functional language lambda logo tour

PLT Scheme's logo, ~1996.Updated: A Lambda Logo Tour

emacs lisp: replace-digits-by-subscript solutions

Perm url with updates: Lisp Exercise: replace-digits-by-subscript, 2011-10-13, 2011-10-19Here's a interesting elisp coding exercise. I have this elisp functon: (defunreplace-digits-by-subscript (string) "Replace digits by Unicode subscript characters in STRING. For example, 「103 and 42」 ⇒ 「₁₀₃ and ₄₂」." (let ((myStr string)) (setq myStr (replace-regexp-in-string "0""₀" myStr)) (setq myStr (replace-regexp-in-string "1""₁" myStr)) (setq myStr (replace-regexp-in-string "2""₂" myStr)) (setq myStr (replace-regexp-in-string "3""₃" myStr)) (setq myStr (replace-regexp-in-string "4""₄" myStr)) (setq myStr (replace-regexp-in-string "5""₅" myStr)) (setq myStr (replace-regexp-in-string "6""₆" myStr)) (setq myStr (replace-regexp-in-string "7&…

Steve Yegge's Google Platforms Rant

this article is starting to circulate wildly. It's related to google, amazon, microsoft, tech start ups, engineering, vision.〈Steve Yegge's Google Platforms Rant〉 @ Yegge is a programer at Google, well-known to public due to his blog. The article is his opinion and criticism about how Google is not a platform and how it should be.By the way, for you programers out there, Yegge is a well-known emacs and lisp fan from his infamous blog. His articles tend to be verbose and meandering and long, but always very thoughtful. He is also a expert at Java, Javascript, perl, python, ruby, lisp, among others. Of his emacs work, he has implemented a advanced javascript mode called “js2-mode”, which features real-time syntax validation. It's about 10k elisp lines, which includes a javascript parser. He has also written, a separate but abandoned project, called “ejacs”, which is a javascript interpreter implemented in emac…

Emacs Lisp Quiz: replace-digits-by-subscript

Emacs Lisp Quiz: replace-digits-by-subscriptHere's a interesting question. I have this elisp functon: (defunreplace-digits-by-subscript (string) "Replace digits by Unicode subscript characters in STRING. For example, 「103 and 42」 ⇒ 「₁₀₃ and ₄₂」." (let ((myStr string)) (setq myStr (replace-regexp-in-string "0""₀" myStr)) (setq myStr (replace-regexp-in-string "1""₁" myStr)) (setq myStr (replace-regexp-in-string "2""₂" myStr)) (setq myStr (replace-regexp-in-string "3""₃" myStr)) (setq myStr (replace-regexp-in-string "4""₄" myStr)) (setq myStr (replace-regexp-in-string "5""₅" myStr)) (setq myStr (replace-regexp-in-string "6""₆" myStr)) (setq myStr (replace-regexp-in-string "7""₇" myStr)) (setq myStr (replace-regexp-in-string "8""₈" myStr)) (setq myStr (re…

Semantics of Symbols: Use of Unicode Subscript Digit Characters

Found a new use of unicode subscript characters. These: {₀ ₁ ₂ ₃ ₄ ₅ ₆ ₇ ₈ ₉}. In many of my web articles, they are devided into several pages. For example, titled: “Algorithmic Mathematical Art (page 1)”, and the second page would be titled “Algorithmic Mathematical Art (page 2)”, etc. I find those “(page 1)” etc too verbose and distracting. Now i just use subscripts. Like this:Algorithmic Mathematical Art ₁Algorithmic Mathematical Art ₂Algorithmic Mathematical Art ₃Am not completely satisfied. I think i should add a subscript "p" there too, like these: {ₚ₁ ₚ₂ ₚ₃}, so it makes the semantics more unique. With just subscript digits, it's still too syntactically ambiguous, because subscript of digits could appear in lots other places for different purposes. But for now, i'll let it be.For more articles about semantics of symbols, see:HTML Entities, Ampersand, Unicode, SemanticsSyntax Semantics Design: Use of Unicode Ellipsis Symbol vs Dot Dot DotSyntax Design: Use of …

The Musical Qualities of Languages

Microsoft Arc Touch Mouse

Perm url with updates: Arc Touch MouseXah Lee, 2011-10-12Microsoft's got a new mouse, the Microsoft Arc Touch Mouse. Here's a video of its designer Young Kim introducing it:Young Kim introducing the mouse in a interview.Infomercial of Young Kim speaking on the design.Review by Zollotech“Microsoft Arc Touch Mouse” amazonNow, let's philosophize about it the Xah Way. First of all, it's a portal mouse. That means, it's not the most comfortable, ergonomic, mouse. It's not for professional heavy-duty 8-hours-per-day gaming, 3D modeling, image editing.Being a portable mouse, its attraction is limited, because, if you are on the go, you may not need a mouse at all. For example: ① You don't carry a mouse at all. The trackpad does fine for the occasional 1 or 2 hours use of a computer. ② These days, many will do fine with a tablet computer such as iPad amazon. With a tablet, you just touch the screen, you don'…

Writing Style: Logic and Phraseme

A Story of Web Tech Politics: The Evolution of Javascript's Script Tag

Yesterday, i removed all type="text/javascript" on my site. That is: <scripttype="text/javascript"> becomes <script> This is a story of political chaos of the web.In the beginning of time, a time of Netscape kingdom, ~1996, it was just <SCRIPT>. Then, with Microsoft's meddling, with JScript and VBScript, it became language="JavaScript" or language="JScript". By ~1999, a entity called W3C emerged, over-peering correctness on earth, it declared that the attribute should be type="text/javascript", and is required. However, in practice, both the “language” and “type” are always optional, and no browser's parser actually give a flying fuck about it. Then, around ~2007, the standard body changed its mind and thought that the type really should be type="application/javascript" or type="application/ecmascript". (See: Internet media type) Nobody in their right mind ever used that. Then, in our glori…

Epiphany In a Dream: Seat as Inverted Ass

Epiphany In a Dream: Seat as Inverted AssHad a weird dream. Hard to remember the details, but the gist is that it's a epiphany about a elegant description of a idea that's a mix of linguistics and art, and was said (or written) by someone, that i need to blog about it with reference.Here i'll try to describe what i remember. You know that human ass is padded by muscle for sitting? Seats, leather seats, are in some sense its inverse. That is, a padded surface of skin. (think of bar stool) That's the epiphany part. Then, this was mentioned somewhere, i forgot where, but described in such a elegant way that shows some linguistic elegance and the gist of the idea.while lucid dreaming near waking, i vividly recall i need to write it down and blog about it because it's such a gem, but then i was debating whether i should, because at the time the whole thing is crystal clear, and that this idea seems well known. But then i was trying hard to go over it again, get the deta…

Embedding Computer Language Source Code on Web Pages

Semantic Web: Emerging Practice of Including Language Name in Embedding Computer Language Source Code on Web PagesThere's a new practice since HTML5 about embedding computer language source code on web pages.Normally, you just use “pre”, like this: <pre> x = 5 print x </pre> However, there's no indication of what language it is. Indicating a language is desired because search engines and other tools can get that info and process it accordingly (such as syntax coloring tool). (this is the idea of semantic web.)So, it appears, there's this practice of introducing the language info, by embedding a “code” tag with “class” set to “language-‹name›”. Like this: <pre> <codeclass="language-python"> x = 5 print x </code> </pre> However, there's no standardized string for the language string.Reference: The code element @ Source dev.w3.orgOverall, this practice seems ad-hoc and questionable, but a mob-standard might be better than none…

update: javascript tutorial