Xah Programing Blog Archive 2012-09
spiffy new perl and python logo.
Emacs Lisp Puzzle: Defining a Temp Inner Function Insider a Function
See: Xah Emacs Blog
FTP vs HTTP, curl vs wget
FTP is dead. But i thought of looking up. Then, i found a series of great tech tips by the author of curl, Daniel Stenberg.
- FTP vs HTTP By Daniel Stenberg. @ http://daniel.haxx.se/docs/ftp-vs-http.html
- curl vs wget By Daniel Stenberg. @ http://daniel.haxx.se/docs/curl-vs-wget.html
One of his article is curl vs wget. I've had a look of that issue. From users perspective, the difference is that wget lets you grab whole site “recursively”, while curl is just for one single file (or multiple URL by a pattern). But basically, curl can't be used to download a entire site, unless you know all the page's URL. For this reason, i tend to just use wget. Curl is great for download porn pics though, for example,
curl -O http://example.org/somedir/girl[01-20].jpg. But today there's so much porn it's not even worth your time to download a whole set.
Gimp Autocrop vs Zealous Crop
PHP has a “nowdoc” now. It's same as “heredoc”, but vars are not interpreted. New in v5.3.0. See: PHP: String Syntax, Heredoc.
updated: Python: Convert File's Encoding
git says: i no unstand unicode
Seems both svn and git don't understand Unicode in
git add . git commit -m"♥" git log
commit 5b886b1f5ea6a22d30ab66d2e2c93f8f21920e23 Author: Xah Lee <firstname.lastname@example.org> Date: Mon Sep 24 03:43:30 2012 -0700 â™¥
for svn, it's forgivable, because it's written in the 1990s. But for git? Does Linus still live in ASCII land?
O, the unix pestilence is still strong with us. —Shakespeare
PS It turn out this works fine on Linux. Not on Windows by default (using Cygwin, without dipping into all the encoding setup.) Thanks to Yuri Khan.
So, ok, i failed in blaming unix, but now i can make a proper blame on software engineering complexity. The question is, why this isn't working on Windows by default? because incompetence of Microsoft? Because linux/Windows impedance because Windows default to UTF-16 and linux UTF-8? Or, it could be that Windows Console is incompetent, doesn't support Unicode well. Or, maybe because Cygwin being semi-incompetent, either didn't have proper encoding setup by default or made a bad choice? Let's spend a few hours to find out. Viva software engineering!
This is RMS doppelganger in parallel universe: the Philosophy of F￼ck Sh�t Stack (humor; music video)
just discovered that the classic Microsoft Natural Elite keyboard seem no longer being manufactured, and now you are stuck with Microsoft Natural Ergonomic Keyboard 4000, with its unusable stiff spacebar.
Just 3 months ago, it's still selling on amazon new for about $30. When a item is no longer available, you can see its price rise up fast. Right now, on amazon it's going for $60 to $90. Am pretty sure it'll go over hundred.
The Microsoft Trackball Explorer was selling for $500! Looking at amazon now, a used is $225 and a new is $498. See: Best Trackballs 2016.
added to Hacker Cult
See also: vim Basics.
Updated: Python: List Comprehension
how to write hello world in 3 thousand lines = Java.
How to find the command name of a GUI app?
How to launch GUI app from terminal?
see updated: Linux GUI Apps, Command Line Names
a new git host, GitCafe, based in China, just opened this month. Check it out http://gitcafe.com/
my account is http://gitcafe.com/xahlee, currently nothing there yet.
what's the worst article on monad you've read? Constructive Criticism Anyone?
shit. just realized i bad mouthed a article on monad few days ago, but now realized its written by a supportive friend (whose programing skill i highly respect).
this pains me. marketing and relationship is always a problem for me. (and by nature i really don't care much for “friends” (the concept of it, philosophy of its nature, and just my personal nature (aka mild schizoid)))
most people don't criticize. They are brought up that way. For example, the saying goes: if you don't have nice things to say, don't say it.
from some perspective, this is motivated by selfishness. Because, when you criticize, you will not be liked, which is disadvantageous to you. (it reduces your chance of getting supporters, and ferment enemies quick. (i'm sometimes known as a “troll”, and i know there are a few people who will always attack me whenever they see my name mentioned, even though i've never interacted with them.))
but some form of criticism still occur, in some nice, “constructive”, form. (often by sugar coating praises and appreciation first) That's how most people strive for when they really need to say something negative. (the idiotic zeitgeist term for this on the net is “constructive criticism welcome”.)
the problem with me is that i want to say it in the most negative, non-constructive, confrontational way. And in some perspective, that is the job of writers, artists. But i do it too much. The ratio of value/offensiveness is getting low.
Discovered xz compression. See: Linux Compression How-to: tar gzip bzip2 xz 7zip rar zip
spent a couple hours and wrote this: Linux: Most Frequently Used Shell Commands. Let me know if i missed anything.
- Unicode in Python
- Perl: Unicode Tutorial 🐪
a decade old rant. I smell history. The Unix Pestilence: Shells
Updated: learn PHP in one day
Geek Humor: 0099FF Blue
updated: Unicode Keyboard Symbols ⌘ ⏎ ⇥ ⌫ ☾ ⎋
Meet Kurt Schwehr
if you are a python coder, Kurt Schwehr's blog is worth subscribing to. http://schwehr.org/blog/. (Kurt Schwehr is a geologist, computer scientist, and currently a GIS Data Engineer for Oceans at Google, and also teaches at University of New Hampshire.)
was doing some writing about python new tech, and i recall there's Puppet (software), and checking on wikipedia realized it's written in Ruby, but i recall Google is using it but i thought it's python… and i vaguely recall Kurt wrote a blog about it. So i tried to search Kurt's post about it… Finally, i put kurt's blog on my google reader. Long overdue. Worth regular reading.
I met Kurt first when he commented on my emacs or programing blog about last year. Then we connected on g+. Learned that he works for Google and teaches Python, and his work as a ocean geologist and affiliations with NASA or JPL.
Looking at Kurt's blog… he's been blogging since 2003! Average from 10 to 80 post per month! Lots of it is using python to do geology work. Real work with real code, as opposed to many blogs about python tutorial, technicalities, or software engineering philosophies. For the intellectual programers out there, his blog is a gold mine.
important personal event: YouTube = Porn Fodder? and Larry Sanger Reported me to FBI
updated images: The Unix Pestilence
Xah Code Edict of the Day:
Never manually insert line breaks for display purposes. F￼CK all coding/documentation conventions. Break the 80-char per line of the 1970s that came from punch cards. —Xah Lee,