2010-12-09

Operation Payback & Low Orbit Ion Cannon

Discovered Operation Payback. A internet activist group. Recently, they launched attack on those who attacked Wikileak. (See: Wikileak: US Diplomatic Cables Leak.) They DDOS attacked sites of Visa, MasterandCard, Paypal, Amazon, and some government sites. In the past, they've attacked sites such as Recording Industry Association of America (RIAA), Motion Picture Association of America (MPAA), Warner Brothers, and also Scientology, etc. Typically, big organizations that cracks down on piracy networks. (See: Scientology and Falun Gong)

I don't support software piracy. (See: Pirate Bay, Open Source, Free Software, Copyright.) However, in this world, much of it is political struggle. For example, there are 2 politicians B and E. You don't really like B, but you think E is by far the most evil. B is your possible chance to prevent E becoming more powerful. So, in many circumstances, you have to support B. This is in fact how alliances work.

Also, orgs like the Operation Payback are made of individuals, like you and me, where each of us make decisions individually, as opposed to big organizations that are typically mindless power controlled by a few. In some sense, that's a essential ingredient to keep some power to people, a form of Grassroots movement.

The Operation Payback group is called Anonymous (group). They seem to have twitter account http://twitter.com/AnonOpsNet.

Also, i've always wondered how those DDOS attack gets their machines. I thought it's from viruses (trojan horses), whic got to people's machines from games or pirated software downloads, without user being aware. Today, i learned the answer. There's this tool LOIC (for Low Orbit Ion Cannon). Basically, it's a software application you can download, so that you can participate in a coordinated attack against big sites. (the “attack” basically just means visiting the site repeatedly to drive their server out of handling request capacity; this is knows as DDOS (Distributed Denial Of Service) attack) Of course, some DDOS attack are from rogue software (viruses; trojan horses) that hijacks user's machine without user knowning. But LOIC is the proper tool to carry out people's voices, in a meaningful and controlled way.

2010-12-08

Harem (Sarah Brightman)

Perm url with updates: http://xahlee.org/Periodic_dosage_dir/sanga_pemci/Harem_Sarah_Brightman.html

Harem (Sarah Brightman)

A great exotic song sung by Sarah Brightman.

Here's a fashion show “The Arabian 1002th Night Guo Pei Haute” using the song.

“The Arabian 1002th Night Guo Pei Haute”

Burning sands, winds of desire
Mirrored oasis reflect a burning fire
Within my heart, unwatered, feeding the flame
Welcoming you to my Harem

Sing for me a song of life's visage
Sing for me a tune of love's mirage

Deep desires, sleep untold
Whispers that echo the desert of my soul
I hold your Eastern promise close to my heart
Welcoming you to my Harem

Sing for me a song of life's visage
Sing for me a tune of love's mirage

Time is change, time's fool is man
None will escape the passing sands of time
I hold your Eastern promise close to my heart
Welcoming you to my Harem

Here's some pictures from the show.

Guo Pei 2

“The Arabian 1002th Night Guo Pei Haute”

Guo Pei 2 1

“The Arabian 1002th Night Guo Pei Haute”

Guo Pei 2 2

“The Arabian 1002th Night Guo Pei Haute”

Guo Pei 3 1

“The Arabian 1002th Night Guo Pei Haute”

Guo Pei 6 2

“The Arabian 1002th Night Guo Pei Haute”

Designing a Math Symbols Input System

Perm url with updates: http://xahlee.org/comp/design_math_symbol_input.html

Designing a Math Symbols Input System

Xah Lee, 2010-12-08

This article discuss some of my thoughts about the problem of a input system for entering math symbols and special characters.

In the past few years, i need to type math symbols a lot in emacs. In some hodgepodge way, i created several custom ways to enter special chars i need in emacs, such as: “” 【】〈 〉 「」 © • ◇ ◆ ★ × α θ λ ← → ⇒ ≠ ∞ etc. The system is hodgepodge, no-where consistent or comprehensive. In the back of my mind, i have this special char input system design problem, that someday i'll think about it and find a way that's efficient and comprehensive for inputing hundreds of special chars math in Unicode. When you need to type a lot special chars, there's a interface design issue, especially in emacs, because there are so many ways to do it.

AltGraph Key System vs Abbrev System

For example, first is simple method of using a modifer key (usually called AltGr) to insert special chars.

mac unicode char

Key maps from OS X's Keyboard Viewer (using a Dvorak Keyboard Layout), showing you what characters you can type using the option key. Those colored orange are prefix keys, allowing you to type combination characters such as “áéíóú”.

In this method, you press a key combination to insert a char. This is great solution if you just need a few chars that's frequently used. If you need more than say 50 chars, you need to add more modifier key combinations, it quickly become a problem of remembering which chars are what key. So, this method isn't good if you need to input a lot math for example, because there are few hundred of math symbols, and different people needs a slightly different set that's frequently used for them. (See: Math Symbols in UnicodeArrows in UnicodeMatching Brackets in Unicode)

(See also: Creating Keyboard Layout in Mac OS X.)

Other solution is to use abbreviation that becomes the char. For example, you type “alpha”, then press a hotkey, and it becomes “α”, and “inf” becomes “∞”, “>=” becomes “≥”, etc. While studying How Mathematica does Unicode?, i realized that this is the most practical, efficient, method, to input potentially large number of chars. Math symbols, and also common chars such as ‹ › « » ¢ € £ ¥ © ® ™ § ¶ † ‡ ※ ● ■ ◆ ↑ ↓ → ← ◀ ▶ ▲ ▼ etc. This way, instead of remembering some 100+ keys for the chars, you just type the name of the symbol, using full name or short abbrevs (1 to 5 chars). This is much easier to remember. Also, there's just one hotkey to remember.

When is Hotkey Pressed

The hotkey can be pressed first before you type the abbrev , or, it can be pressed after. Or, it can be completely eliminated by a automatic change.

For example of hotkey first, in emacs, you can press 【Ctrl+x 8】 then a abbrev to enter chars such as ¿¡¢£¥¤§®©ª «» ×÷¬ °±µ¶ ÀÁÂÃÄÅÆ Ç ÈÉÊË ÌÍÎÏ ÐÑ ÒÓÔÕÖ ØÙÚÛÜÝÞß àáâãäåæç èéêë ìíîï ðñòóôõö øùúûüýþÿ. (See: Emacs and Unicode Tips.)

In Mathematica, you press 【Esc abbrev Esc】 to insert a special char. (See: How Mathematica does Unicode?.)

For automatic abbrev, both emacs and Microsoft Word and many editors support that. For example, in Word, typing 「"something"」 automatically becomes 「“something”」 . The automatic change method is great, but the problem is that if you have hundreds of abbrevs, often some of them are common words too, which you do not want to automatically become a special char.

I decided that pressing a hotkey afterwards is the best option.

Changes to my Emacs Elisp Code

So, yesterday, i started to organize my several elisp code related to inputing special math symbols to a unified minor mode. For example, i had the following code that setsup a emacs hyper key to insert chars:

(global-set-key (kbd "H-y <up>") (lambda () (interactive) (insert "↑"))) ; up arrow
(global-set-key (kbd "H-y <down>") (lambda () (interactive) (insert "↓"))) ; down arrow
(global-set-key (kbd "H-y <left>") (lambda () (interactive) (insert "←"))) ; left arrow
(global-set-key (kbd "H-y <right>") (lambda () (interactive) (insert "→"))) ; right arrow
(global-set-key (kbd "H-y <kp-6>") (lambda () (interactive) (insert "⇒"))) ; RIGHTWARDS DOUBLE ARROW
(global-set-key (kbd "H-y <kp-add>") (lambda () (interactive) (insert "⊕"))) ; CIRCLED PLUS
(global-set-key (kbd "H-y *") (lambda () (interactive) (insert "⊗"))) ; CIRCLED TIMES
(global-set-key (kbd "H-y <kp-multiply>") (lambda () (interactive) (insert "×"))) ; MULTIPLICATION SIGN
(global-set-key (kbd "H-y <") (lambda () (interactive) (insert "≤"))) ; greater htan
(global-set-key (kbd "H-y >") (lambda () (interactive) (insert "≥"))) ; less than
(global-set-key (kbd "H-y Z") (lambda () (interactive) (insert "ℤ"))) ; integer
(global-set-key (kbd "H-y Q") (lambda () (interactive) (insert "ℚ"))) ; rational
(global-set-key (kbd "H-y R") (lambda () (interactive) (insert "ℝ"))) ; real
(global-set-key (kbd "H-y C") (lambda () (interactive) (insert "ℂ"))) ; complex
(global-set-key (kbd "H-y a") (lambda () (interactive) (insert "α"))) ; alpha
(global-set-key (kbd "H-y b") (lambda () (interactive) (insert "β"))) ; beta
(global-set-key (kbd "H-y g") (lambda () (interactive) (insert "γ"))) ; gamma
(global-set-key (kbd "H-y t") (lambda () (interactive) (insert "θ"))) ; theta
(global-set-key (kbd "H-y l") (lambda () (interactive) (insert "λ"))) ; lambda
(global-set-key (kbd "H-y p") (lambda () (interactive) (insert "π"))) ; pi
(global-set-key (kbd "H-y A") (lambda () (interactive) (insert "∀"))) ; FOR ALL
(global-set-key (kbd "H-y E") (lambda () (interactive) (insert "∃"))) ; THERE EXISTS
(global-set-key (kbd "H-y ^") (lambda () (interactive) (insert "∧"))) ; and
(global-set-key (kbd "H-y 6") (lambda () (interactive) (insert "∨"))) ; or
(global-set-key (kbd "H-y !") (lambda () (interactive) (insert "¬"))) ; not
(global-set-key (kbd "H-y =") (lambda () (interactive) (insert "≡"))) ; equivalent
(global-set-key (kbd "H-y +") (lambda () (interactive) (insert "≠"))) ; not equal
(global-set-key (kbd "H-*") (lambda () (interactive) (insert "°"))) ; degree

I also had Emacs Abbrev:

(define-abbrev-table 'global-abbrev-table '(
    ;; math/unicode symbols
    ("tin" "∈" nil 0)
    ("nin" "∉" nil 0)
    ("inf" "∞" nil 0)
    ("luv" "♥" nil 0)
    ("smly" "☺" nil 0)
    ;;...
)

Now they are all gone. In replacement is a emacs minor mode xmsi-math-symbols-input.el Emacs xmsi-mode for Math Symbols Input , which i'm still working on, to add all TeX/LaTex and HTML/XML char entities names.

Was this page useful? If so, please do donate $3, thank you donors!

wikileaks: how sexual harassment happen

The Wikileaks situation is getting out of hand. (See: Wikileak: US Diplomatic Cables Leak) In the past week, they got kicked out by amazon hosting, then paypal, then Mastercard, and Vista card, and the a Swiss bank closed their account. Due to gonvernment's political pressure, mostly from US government. Here's a detailed timeline of the attacks:

  • 〈Wikileaks under attack: the definitive timeline〉 (2010-12-16) By Charles Arthur. guardian.co.uk. At: Source www.guardian.co.uk

You can still donate, here: http://wikileaks.ch/support.html.

Also, you can help hosting the site, here: http://213.251.145.96/mirrors.html. There are currently over 1k mirror sites already.

I think Google and Free Software Foundation should step up to make a gesture for hosting.

The severity of this government and big org censorship, is kinda a revolution material. We, the people, should stand up against them.

Julian Assange Raped Women?

〈The Wikileaks sex files: How two one-night stands sparked a worldwide hunt for Julian Assange〉 (2010-12-07) By Richard Pendlebury. Source www.dailymail.co.uk.

Summary of the article: When Julian was visiting Stockholm, Sweden, two women admirers sought him out. (we'll call them Jessica and Sarah) Sarah offered her apartment for him to stay. Both had sex with him. Sarah created a party at her house the next morning for him. Jessica had a second sex the morning after. Few days later, the two women met, knew that each slept with him, then they started to visit police. The main accuser Jessica, wanted to know if there's a way to force Julian to take a HIV test, because no condom was used in their second sex. LOL.

2010-12-07

Manatee, a haskell environment

Andy Stewart, who wrote tens of elisp packages (see his site), started a new project on Haskell called Manatee. We voice chatted on skype for about 50 min on emacs and haskell and programing.

Manatee is a OS-like environment for Haskell hacking, currently running on top of linux and GTK+.

You can see many screenshots here: Source www.flickr.com. Or a video of screenshots at Source www.youtube.com.

Manatee home page at: http://hackage.haskell.org/package/manatee. Documentation at http://haskell.org/haskellwiki/Manatee.

2010-12-06

Opera browser hotkey idiocy

Discovered, that in Opera, to switch to next/prev tabs in a normal way, you have to press 【Ctrl+F6】 and【Ctrl+Shift+F6】. What a idiocy. (See: Opera Pain; Opera Browser Problems.) Or, in Opera 9.2 or before, press the 1 and 2 keys on the number pad. In Opera 9.5 or later, you have to Enable single-key shortcuts in the preference. (See: http://help.opera.com/Windows/10.63/en/keyboard.html.)

So, in AutoHotkey, i added these to be consistent with all my hotkeys for browsers. (the / and * on number pad to switch to prev/next tabs.)

;; Opera hotkeys
#IfWinActive ahk_class OperaWindowClass

; close window
$Pause::Send ^w

; prev tab
$NumpadDiv::Send ^+{F6}

; next tab
$NumpadMult::Send ^{F6}

See: AutoHotkey Basics and AutoHotkey Example Scripts.

Also, after several years of hearing Opera's stupid “mouse gestures”, today i took 5 min to read up what it is. See: http://help.opera.com/Windows/10.63/en/mouse.html. Rather idiotic.

Unicode in Mathematica

Perm url with updates: http://xahlee.org/math/mathematica_unicode.html

How Mathematica does Unicode?

Xah Lee, 2010-12-05

This page explains some tech detail about how Mathematica uses unicode. This article may not be 100% accurate. I'm putting it up for now after spending a few hours. Am tsill working on it. If you are a Mathematica expert, please comment or correct.

Mathematica supports unicode, but does not use Unicode when saving to file. (See: UNICODE Basics: What's Character Encoding, UTF-8, and All That?)

Mathematica (mma) files uses ascii only. (See: Mathematica Notebook Technology.)

How does it support unicode if it uses only ASCII?

Mathematica's Named characters 「\[Name]」

It has a set of special characters with the syntax 「\[name]」. For example:

GlyphSyntax
é\[EAcute]
É\[CapitalEAcute]
α\[Alpha]
Δ\[CapitalDelta]
\[CirclePlus]
\[Because]
\[Element]
\[Equivalent]
\[DoubleStruckCapitalR]

So, when you type 「\[Alpha]」 in mma, it is displayed as “α”. (All builtin symbols in mma starts with capital letter.)

You can think of them as html's “named character entities”. (See: Character Sets and Encoding in HTML.) There are about 900 named chars. For the complete list, see: Listing of Named Characters.

Many of the named chars are also in unicode, but not all. Similarly, many Math Symbols in Unicode are not in this list. Also, unicode's chinese chars, arabic alphabets etc, are not in mma's named chars.

Map Between Unicode and Named Chars

When you paste a unicode char into mma, there is a map that automatically interprete the unicode as one of the named char.

So, for example, if you paste “α” (GREEK SMALL LETTER ALPHA; “U+x3b1”), it automatically becomes Mathematica's 「\[Alpha]」, and displayed as “α”.

Syntax for Unicode Char 「\:nnnn」

For any unicode that's not one of mma's named char (such as chinese chars), their syntax is this: 「\:nnnn」, where the nnnn is unicode's 4 digit hexidecimal representation of the char. For example, the chinese char “水” (water), unicode hex is “6c34”, in mma is: 「\:6c34」.

The above roughly summarize how mma takes unicode as input.

Some Named Chars has Builtin Meaning

Of the named chars, many has special meaning in mma. For example, 「\[Pi]」 is automatically considered identical to the builtin symbol 「Pi」, which in Mma means mathematical constant. (So, if you type 「N[\[Pi]]」 or 「N[\:03c0]」, they are displayed as 「N[π]」 with meaning of 「N[Pi]」, and if you evaluate it, you get “3.14159”.). Here's some examples of special meaning named chars.

GlyphMma named charUnicode nameUnicode hexidecimalDefault Interpretation
\[GreaterEqual]GREATER-THAN OR EQUAL TO2265GreaterThan 「>=」
π\[Pi]GREEK SMALL LETTER PI03c0Pi
\[Infinity]INFINITY221eInfinity
\[Integral]INTEGRAL222bIntegrate
\[Intersection]N-ARY INTERSECTION22c2Union
\[Sum]N-ARY SUMMATION2211Sum
\[Sqrt]SQUARE ROOT221aSqrt
\[CirclePlus]CIRCLED PLUS2295CirclePlus

Note: it appears that it is possible to over-ride the default interpretation of named char to builtin symbol (function, constant), for all or some of the named char. (i haven't investigated on how yet.) See: MakeExpression.

http://reference.wolfram.com/mathematica/tutorial/Operators.html

Alias Shortcut for Named Chars

Some of the named char has one or more aliases for ease of input. For example, to enter α, you can type 【Esc a Esc】 or 【Esc alpha Esc】. Here's some examples:

GlyphCommon Alias
αa
πp
inf
<=
°deg
ΔD
el
->

See: http://reference.wolfram.com/mathematica/tutorial/Introduction-ListingOfNamedCharacters.html.

  • Characters that are alternatives to standard keyboard operators use these operators as their aliases (e.g. Esc -> Esc for , Esc && Esc for ∧).
  • Most single-letter aliases stand for Greek letters.
  • Capital-letter characters have aliases beginning with capital letters.
  • When there is ambiguity in the assignment of aliases, a space is inserted at the beginning of the alias for the less common character (e.g. Esc -> Esc for \[Rule] and Esc -> Esc for \[RightArrow]).
  • ! is inserted at the beginning of the alias for a Not character.
  • TeX aliases begin with a backslash \.
  • SGML aliases begin with an ampersand &.
  • User-defined aliases conventionally begin with a dot or comma.

See: Special Characters.

List of Named Char with Special Meanings

... work in progress

Inputing Special Chars

You can input a special character by:

  • Use one of the graphical palettes.
  • Copy the unicode char somewhere and pasting it in mma.
  • Type it like this: 「\[Name]」.
  • Type the Unicode hexadecimal like this: 「\:nnnn」
  • Type Esc, then the char's alias name, then Esc again.

... work in progress

See also: Wikipedia:LaTeX symbols

Was this page useful? If so, please do donate $3, thank you donors!

another anecdote of emacs power

Another anecdote on the power of emacs.

Today, i need to study how Mathematica treats unicode. (See: How Mathematica does Unicode?). In the process, i need to get a file of math unicode symbols. I have a page at Math Symbols in Unicode, but i need just the unicode symbols, not all other content.

So, simply copy the whole file content. Then, put that into a file, say 〔math_symbols_unicode.txt〕. Then, delete all asccii chars. This you can do by calling “query-replace-regexp”. (See: Find and Replace with Emacs) For the replace regex, use 「[[:ascii:]]」. For the replacement string, just press Enter for nothing. Then, press ! to replace all.

Now, i need a space between each symbol. This is a great job for Emacs keyboard macros. Type 【Ctrl+x (】 to start recording. Then type 【 space】. Then type 【Ctrl+x )】 to end recording. Then, type 【Ctrl+u 999】 (for repeating 999 times the next command), then type 【Alt+x call-last-kbd-macro】. Then, spaces are inserted between each chars.

Thanks to Lew Perin for a correction.

Aaron wrote to note that, to add a space between each char, it's simpler to actually do another query-replace-regexp. Use 「\(.\)」 for the find regex, and use 「\1 」 for the replacement string.

See also:

2010-12-05

Tools to Display Math on Web

Perm url with updates: http://xahlee.org/math/display_math_on_web.html

Tools to Display Math on Web

Xah Lee, 2010-04-13, 2010-12-04

Found 2 tools to write math for the web:

FireMath, a MathML Editor for Firefox

FireMath is a MathML editor as a Firefox plugin. Home at: firemath.info.

MathJax

MathJax. Home at: mathjax.org.

MathJax is an open-source JavaScript display engine for LaTeX and MathML that works in all modern browsers. It was designed with the goal of consolidating the recent advances in web technologies into a single, definitive, math-on-the-web platform supporting the major browsers and operating systems. It requires no setup on the part of the user (no plugins to downlaod or software to install), so the page author can write web documents that include mathematics and be confident that users will be able to view it naturally and easily. One simply includes MathJax and some mathematics in a web page, and MathJax does the rest.

MathJax uses web-based fonts (in those browsers that support it) to produce high-quality typesetting that scales and prints at full resolution (unlike mathematics included as images). MathJax can be used with screen readers, providing accessibility for the visually impaired. With MathJax, mathematics is text-based rather than image-based, and so it is available for search engines, meaning that your equations can be searchable, just like the text of your pages. MathJax allows page authors to write formulas using TeX and LaTeX notation, or MathML, a World Wide Web Constortium standard for representing mathematics in XML format. MathJax will even convert TeX notation into MathML, so that it can be rendered more quickly by those browsers that support MathML natively, or so that you can copy and past it into other programs.

Detexify

Detexify is a tool that lets you draw a math symbol and it shows you the code for LaTeX. The tool is created by Daniel Kirsch. At http://detexify.kirelabs.org/classify.html.

See also: Math Symbols in Unicode.

If you are a emacs user, you can set your emacs up so that any frequently used symbols can be entered by a single shortcut key, or a abbreviation. See: Emacs and Unicode Tips.

Mathematica

Of course, you can get Mathematica. Student or hobbyist can get it for ~$295. This would be the best option.

Mathematica home page at: wolfram.com.

For a example of its output, in PDF, HTML, MathML/XML, see: Math Typesetting, Mathematica, MathML.

Other

Rant

The technology to display math notation on the web browser, is really dismal. MathML is released in 1998. Now, it is over 10 years, but it is still not widely supported in web browsers. Authors need to invest huge amount of time experimenting with several solutions, and in most cases, requires knowledge of html, css, xml, MathML, javascript, TeX, to various degrees. One early solution is to resort to some tool turn math notations into images. This means, the browser needs to load a huge bunch of images, and the images are ugly, not scalable, cannot be copy and pasted. Images for math notation are still widely practiced today. Another solution in to require readers to download some special plug-in. Another solution is to simply discard the web and use PDF instead.

In the past 10 years, huge amount of web technologies have developed, from blogs to wikis to instant messaging to twitter to interactive road maps to online videos to voice and video chats, but when it comes to math, sadly, the situation is rather stagnant. This is, of course, because relatively very few people need it. Perhaps 0.01% of web users.

What Wikipedia Use?

Wikipedia, which is one of the largest math encyclopedia online, uses images mixed with some html. (See: Help:Displaying a formula) More specifically, it uses a home cooked markup “<math>«body»</math>”, where the “body” is a subset of simple LaTeX code, and on the fly it processed by Texvc to generate images with some html markup.

Was this page useful? If so, please do donate $3, thank you donors!