Math: Symmetry, Flatland, by Ian Stewart

A new book. 〔Symmetry: A Very Short Introduction By Ian Stewart. amazon

It cited my work: Discontinuous Groups of Rotation and Translation in the Plane. ☺

Ian Stewart is a well-known mathematician. He has written many books introducing interesting math to the laymen. Including:

  • Flatterland: Like Flatland, Only More So By Ian Stewart. amazon
  • The Annotated Flatland: A Romance of Many Dimensions By Ian Stewart. @ amazon

You can also read Flatland here: FLATLAND: A Romance of Many Dimensions

There's also a Chinese translation: 神奇的二维国 (Flatland)


Linux, Audio Problem, pulseaudio

in Linux, if audio doesn't work, you can try

pulseaudio -k # kill it

then wait few seconds for it to die. You can check by

pgrep -l pulseaudio

then, start pulseaudio again.

pulseaudio --start # start it again

To start the sound level control panel, do:

setsid pavucontrol # start sound level control panel

now, if your desktop dock volume shows gray, you might need to restart it.

# restart xfce dock
pkill xfce4-panel
setsid xfce4-panel

The Linux audio problem is caused by the kernel having problem with several popular Logitech webcam. In my case, its Logitech HD Webcam C310 amazon

In your syslog, tail -f /var/log/syslog, you get flooded by this message:

kernel: [ 1438.563209] 3:3:4: cannot set freq 48000 to ep 0x86
kernel: [ 1438.563976] 3:3:4: cannot set freq 48000 to ep 0x86
kernel: [ 1438.565348] 3:3:4: cannot set freq 48000 to ep 0x86

The solution is just to unplug that webcam.

You can see bug report here. https://bugzilla.kernel.org/show_bug.cgi?id=44281


Philosophy, Extreme Utilitarianism on the Dead

Perm URL with updates: http://xahlee.org/Periodic_dosage_dir/pd.html


just got a idea. We need to create a society, where dead is regarded irrelevant, period.

no eulogies, no hating or admiring of the dead (such as Hitler, Lincon, past heroes, kings, great artists, anything)

the gist of the theory is some aspect of extreme utilitarianism.

i got this inspiration now because someone's twitting about people hating some dead guy, as taught in school. e.g. you spit on some bastard's grave, who have done your country wrong. And such act, and the emotion associated with it, is a waste of time.

so far, without further research/thinking, i think that MOST of acts, behaviors, emotions, in relation to the dead, is a futile, useless, one. It is somewhat similar to admiring God.

also, i guess the above might probably be already covered, ⁖ as a idea by some philosophy or movement in some region or history…

What's HTTP Etag?

Perm URL with updates: http://xahlee.info/js/http_etag.html

Here a quote from Wikipedia HTTP ETag:

An ETag or entity tag, is part of HTTP, the protocol for the World Wide Web. It is one of several mechanisms that HTTP provides for web cache validation, and which allows a client to make conditional requests. This allows caches to be more efficient, and saves bandwidth, as a web server does not need to send a full response if the content has not changed.

An ETag is an opaque identifier assigned by a web server to a specific version of a resource found at a URL.

The use of ETags in the HTTP header is optional. The method by which ETags are generated has never been specified at any time in the HTTP specification.

here's a sample HTTP header:

◆HEAD http://xahlee.info/

200 OK
Connection: close
Date: Thu, 27 Jun 2013 04:34:23 GMT
Accept-Ranges: bytes
ETag: "d0dc0093-2393-4dfed7ff74f80"
Server: Apache
Content-Length: 9107
Content-Type: text/html; charset=utf-8
Last-Modified: Mon, 24 Jun 2013 21:57:34 GMT
Client-Date: Thu, 27 Jun 2013 04:34:23 GMT
Client-Response-Num: 1
X-Pad: avoid browser bug

here's another example, querying Google.

◆ HEAD http://google.com/

200 OK
Cache-Control: private, max-age=0
Connection: close
Date: Thu, 27 Jun 2013 04:27:23 GMT
Server: gws
Content-Type: text/html; charset=ISO-8859-1
Expires: -1
Client-Date: Thu, 27 Jun 2013 04:27:23 GMT
Client-Response-Num: 1
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Set-Cookie: PREF=ID=9dc114ba5ab05743:FF=0:TM=1372307243:LM=1372307243:S=3t1GefOPQpI5FjdG; expires=Sat, 27-Jun-2015 04:27:23 GMT; path=/; domain=.google.com
Set-Cookie: NID=67=esaPZnzLc7uJW1MKobIJoRbtq_1ESpvwkaGEGJppG7hRti4B39-wpxmAA-rWpju2ajhmSNEncos17GKSMpiX_mGtbWPAqh9FBi0-8eEkKjnEtGTKo8PAKUQO9prWCQHB; expires=Fri, 27-Dec-2013 04:27:23 GMT; path=/; domain=.google.com; HttpOnly
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block

encryption: What's Perfect Forward Secrecy?

Perm URL with updates: http://xahlee.info/comp/perfect_forward_secrecy.html

due to the Edward Snowden and NSA fiasco of recent, there's something called Perfect forward secrecy going around.

here's what it means. When you are using Public Key Cryptography (PKC), such as HTTPS protocol, you have public key and private key. For example, when you buy something on Amazon, its public key is in your browser, and its server has its private key.

The point here is that, once the secret key is lost, all is lost. If NSA have saved all your encrypted traffic for years, they may one day ask/get Amazon's secret key, and your life's history is a open book.

Now, PKC with Perfect Forward Secrecy (PFS) doesn't have this problem. Here's a excerpt from Wikipedia:

In an authenticated key-agreement protocol that uses public key cryptography, perfect forward secrecy (or PFS) is the property that ensures that a session key derived from a set of long-term public and private keys will not be compromised if one of the (long-term) private keys is compromised in the future.

… For PFS to exist, the key used to protect transmission of data must not be used to derive any additional keys, ….

however, looks like nobody is using PFS (not any of the banks, etc), except Google in Gmail and perhaps a few others. See these two nice article:

  • Perfect Forward Secrecy can block the NSA from secure web pages, but no one uses it By Michael Horowitz. @ blogs.computerworld.com…
  • The price to pay for perfect-forward secrecy By Nikos Mavrogiannopoulos. @ nmav.gnutls.org…

Note, encryption is extremely complicated business. The above is a very simplified explanation.

For a basic intro, see: Intro to Public-key Cryptography for Sys Admin; What's HTTPS, SSH, SSL, TLS, AES, SHA-1, MD5, ….


Python: Compute Exact Fractions

# -*- coding: utf-8 -*-

import fractions

print( fractions.Fraction(5,100)) # 1/20
print( fractions.Fraction(4,100)) # 1/25
print( fractions.Fraction(3,100)) # 3/100
print( fractions.Fraction(2,100)) # 1/50

Note that Mathematica had this feature, transparently, since 1990.

In Mathematica, any exact number are computed exactly. Number without a decimal dot are exact.


Silly Unicode Name Change: CENTER → CENTRE

Silly Unicode Name Change: CENTER → CENTRE

Unicode: Dingbats, Cultural Symbols (updated)

in Unicode, the name of the character is changed from OPEN CENTER ASTERISK to OPEN CENTRE ASTERISK. What's the technical reason they make such a silly change? Poltical reason?