2011-12-10

Mickey Avalon - Jane Fonda

see here instead: http://xahlee.org/music/my_dick.html

2011-12-08

How to choose a keyboard with good function keys

bad function keys-2
Worst example of function keys. ① Continuous row, no group-gap. ② hard-to-press cheap buttons.
keyboard function keys
Good Function Keys. Quality standard key. Grouped so it's easy to hit the correct key without sight.

See explanation at Computer Keyboard: What Are F1 … F12 Keys Used For? Increase Productivity Using Function Keys

Fixing Emacs's Scratch Buffer

Emacs's scratch buffer has lots of problems. This is a controversial issue, because the scratch buffer is one of those things that serves as a identity of emacs. Any criticism on it is like attacking emacs.

But i tell you, dear readers, frankly and directly, this is a emacs cult problem and i've wrote about often. (See: Emacs Undo & Emacs Cult ProblemEmacs Idolization: Have You Read the Emacs Manual From Cover to Cover?)

For a detailed description of scratch buffer problems, see: Emacs: Problems of the Scratch Buffer.

If you are a user of ErgoEmacs Keybinding, the problem is already fixed for you. Simply press 【Ctrl+n】 and new scratch will be created for you, and when you close a modified unsaved buffer, it'll prompt you for save.

In ErgoEmacs keybinding, it's implemented by 2 commands: {new-empty-buffer, close-current-buffer}. The “new-empty-buffer” simply creates a new buffer, titled “untitled”, “untitled<2>”, etc. The code for “close-current-buffer” is a bit more involved. It kills the current buffer, but check if it is modified, but also, add the closed file into a list, so that people can re-open the last closed file, much like web browser's 【Ctrl+Shift+t】. The key is the same. The key to close current file is also the browser standard 【Ctrl+w】.

If you really want to stick with GNU emacs's keys, but want these convenient functions, you can download and copy/modify the code from ErgoEmacs keybinding. Or, J V Toups provided a implementation for persistent scratch buffer. See:

English: animalistic cries

today's Wordy English over at http://wordy-english.blogspot.com/: animalistic cries!

  • horses neigh
  • donkeys bray
  • bulls snort
  • hogs grunt
  • goats bleat
  • lions roar
  • wolves howl
  • cats meow and purr
  • dogs growl and bark
  • puppies yelp

can you think of more? and what do human animals do?

See: http://xahlee.org/PageTwo_dir/Vocabulary_dir/danlu_sance.html.

Python vs Lisp: comp.lang newsgroup spittle

On 2011-12-04, Eduardo Costa asked in comp.lang.lisp:

I pose the questions below out of sheer curiosity, not to cause outbursts of indignation. That said, here are my questions.

… I noticed that many LISP programmers and universities are switching to Python, even to teach AI. For instance, Norvig and the people at MIT replaced Scheme with Python. My own experience with Python was dismaying. The language is much slower than SBCL. There is no tail call optimization. No macros.  Then, my first question is ... Why Python?

Xah Lee wrote:

… python has more readible syntax, more modern computer language concepts, and more robust libraries. These qualities in turn made it popular.

Tim Bradshaw wrote:

Yet you still post here [comp.lang.lisp]: why?

i don't like python, and i prefer emacs lisp. The primary reason is that python is not functional, especially with python 3. The python community is full of fanatics with their drivels. In that respect, it's not unlike Common Lisp community and Scheme lisp community.

See also:

Xah

2011-12-07

Alexandra Wallace Incident: Asians in UCLA

There's this video on youtube bitching about Asians in UCLA.

Alexandra Wallace bitching on Asians

Parody

Now, the Parodies!

Alexandra Wallace parody by AfricanoBoiShow.

for more and my comment, see http://xahlee.org/funny/asians_in_ucla.html

ASUS graphics card

ASUS GTX570 DirectCU II GPU
“ASUS GTX570 DirectCU II graphics card” amazon

read more at http://xahlee.org/mswin/PC_graphics_card.html

My Life is Reading Encyclopedias

newly generated: Links to Wikipedia from XahLee.org.

6304 links to Wikipedia articles. About 1/4 of my wake time in my life is spent reading encyclopedias. See also:

Logitech Wireless Gaming Mouse G700

logitech g700 mouse 1-s logitech g700 mouse 2-s logitech g700 mouse 3-s
“Logitech Wireless Gaming Mouse G700” amazon

This is top-of-the-line model. Features:

  • Wireless! with charger.
  • 13 programable buttons!
  • Scroll wheel can be set to notched or smooth.
  • On-board memory. (5 profiles for storage of settings)
  • Instant sensitivity (DPI) change.
  • Penny sized USB plug.

This one is comparable to Microsoft SideWinder X8 mouse. I consider the G700 better, because: • 6 more programable buttons. • On-board memory. • Scroll wheel can be set to notched or smooth.

reviews of more Logitech gaming mouses at http://xahlee.org/kbd/logitech_gaming_mouse.html

singer in concert as hologram!

Hatsune Miku on car
Hatsune Miku painted on a car. img src

Here's her concert, in Tokyo, Japan.

“Hatsune Miku - World is Mine Live in Tokyo, Japan”

read more, at http://xahlee.org/arts/Hatsune_Miku.html

2011-12-06

Emacs: Convert Image Files and Change Size in Dired

I want a command, so that i can convert all jpg files to png or any other format, for all marked files in dired. Also, same for scaling images.

Solution

(defun scale-image (fileList scalePercentage)
  "Create a scaled jpg version of images of marked files in dired.
The new names have “-s” appended before the file name extension.
Requires ImageMagick shell tool."
  (interactive
   (list (dired-get-marked-files) (read-from-minibuffer "scale percentage:")))
  (require 'dired)

  (mapc
     (lambda (ξf)
       (let ( newName cmdStr )
         (setq newName (concat (file-name-sans-extension ξf) "-s" ".jpg") )
         (while (file-exists-p newName)
           (setq newName (concat (file-name-sans-extension newName) "-s" (file-name-extension newName t))) )

         ;; relative paths used to get around Windows/Cygwin path remapping problem
         (setq cmdStr (concat "convert -scale " scalePercentage "% -quality 85% " (file-relative-name ξf) " " (file-relative-name newName)) )
         (shell-command cmdStr)
         ))
     fileList ))
(defun 2jpg (fileList)
  "Create a jpg version of images of marked files in dired.
Requires ImageMagick shell tool.
"
  (interactive (list (dired-get-marked-files) ))
  (require 'dired)

  (mapc
     (lambda (ξf)
       (let ( newName cmdStr )
         (setq newName (concat (file-name-sans-extension ξf) ".jpg") )
         (while (file-exists-p newName)
           (setq newName (concat (file-name-sans-extension newName) "-2" (file-name-extension newName t))) )

         ;; relative paths used to get around Windows/Cygwin path remapping problem
         (setq cmdStr (concat "convert " (file-relative-name ξf) " " (file-relative-name newName)) )

         ;; (async-shell-command cmdStr)
         (shell-command cmdStr)
         ))
     fileList ))

For detail, see http://xahlee.org/emacs/emacs_dired_convert_images.html

Art: anime girl stepping out of screen!

anime girl coming out of screen
Hatsune Miku coming out of screen.

The original source might be: Source www.pixiv.net.

Thanks to Gwern Branwen for help.

Microsoft Discontinued SideWinder Gaming Mouse X8

Microsoft sidewinder x8 mouse 2
Microsoft sidewinder x8 mouse. amazon

It looks like Microsoft has discontinued its SideWinder Gaming mouse X8. It's quite a pity. This mouse was just introduced in 2009, with several advanced technologies. • Charger with magnetic connector. • Wireless. • Blue laser tracking. • Tilt scroll wheel. • 4000 DPI. For review, see: Microsoft SideWinder Gaming Mouses Review.

According to online rumors, Microsoft discontinued it not because of poor sale, but rather, too much competition from many companies that are dedicated to gaming devices. It appears that Microsoft has discontinued the entire SideWinder brand. (i wasn't able to confirm this 100%) Some of the models such as SideWinder X8 mouse are no longer listed on Microsoft's site, but they still sell some other models of gaming keyboard and mouse.

2011-12-05

Visual Art: Crocodile sex codex

crocodile sex codex-s
See: Artwork: Crocodile Sex Codex.

What's the Ugly Bump at the End of Computer USB Cables

In your computer mouse cable, or USB device or monitor cable, often there's one big ugly chunk of cylinder somewhere in the cable. What's that big ugly cylinder for?

Cable end-s
USB cable Bump. img src

Answer: It's a electronic component called Ferrite bead. It's used to suppress high frequency noise in electronic circuits. This is needed because cables that are not Shielded can also act as antenna and broadcasting device, creating inteference.

Why Apple's computer doesn't have such ugly bump? I guess because either Apple uses shielded cables, or the component is moved to inside the computer.

Thanks to Aaron Coakley for answer.

2011-12-04

Differences Between Crocodile and Alligator

gavial vs aligator vs crocodile
Left to right: gavial, alligator, crocodile. img src

Excerpt from Crocodilia:

While alligators (and caimans) are often confused with crocodiles, they belong to two quite separate taxonomic families.

The most obvious external differences are visible in the head — alligators and caimans have wider and shorter heads, and a more U-shaped than V-shaped snout. The alligator's upper jaw is wider than its lower jaw, and the teeth in the lower jaw fit into small depressions in the upper jaw. The upper and lower jaws of the crocodiles are the same width, and teeth in the lower jaw fall along the edge or outside the upper jaw when the mouth is closed. When the crocodile's mouth is closed, the large fourth tooth in the lower jaw fits into a constriction in the upper jaw. For hard-to-distinguish specimens, the protruding tooth is the most reliable feature to define a species. However, in captivity, alligators and caimans may show jaw deformities which result in lower teeth protruding.

Alligators lack the jagged fringe which appears on the hind legs and feet of the crocodile and have the toes of the hind feet webbed, not more than halfway to the tips. Alligators strongly prefer freshwater, while crocodiles can better tolerate seawater due to specialized glands for filtering out salt. However, both can survive in either.

Both species of alligator also tend to be darker in color than crocodiles — often nearly black — but color is very dependent on water quality. Algae-laden waters produce greener skin, while tannic acid from overhanging trees can produce often darker skin.

When cleaning alligator pools, some zookeepers can tread on alligators without eliciting a response, though crocodiles almost invariably react aggressively and are for the most part more aggressive in their natural habitat.

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

humor: Mac vs PC

Mac vs PC
Mac vs PC

See also:

Internet Self-Portraits by Gender

internet self-portraits by gender
Internet Self-Portraits by Gender

See also: Postures of Female and Male.

art: She Cuts Thru My Heart

she cut thru my heart klamstwo
by Joseph Wierenga. “She Cuts thru My Heart”

See also: