Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Sunday, May 31, 2009

Heilbrunn Timeline of Art History

Here’s a nifty timeline of art history, extracted from the Metropolitan Museum of Art. ∎

Timeline

Friday, May 29, 2009

[Programming] Nano/Pico Text Editor

For occasional editing of remote files, Nano/Pico is actually not too shabby. I like the syntax coloring, the modelessness (unlike vi), and the always-visible help at the bottom:

Nano text editor

Now, for larger editing tasks, I like to pull out my big guns. ∎

Wednesday, May 27, 2009

Focus and Ignore Lists

Good harvardbusiness.org post on Two Lists You Should Look at Every Morning:

Make two lists:

  • List 1: Your Focus List (the road ahead).  What are you trying to achieve?  What makes you happy?  What's important to you?  Design your time around those things.  Because time is your one limited resource and no matter how hard you try you can't work 25/8.
  • List 2: Your Ignore List (the distractions). To succeed in using your time wisely, you have to ask the equally important but often avoided complementary questions: what are you willing not to achieve?  What doesn't make you happy?  What's not important to you?  What gets in the way?

Some people already have the first list.  Very few have the second.

I definitely need to start making an ignore list. Whenever I catch myself in a time sink of questionable value, I’m going to enter it into my Focus & Ignore Lists entry in KeyNote.

What’s on your Focus List / Ignore List? 

[Programming] Getting to know your editor's transpose-letter, transpose-word, and transpose-line functionality

Does your text editor have transpose-letter, transpose-word, and transpose-line functionality? If so, it’s worth learning the keyboard shortcuts for them. On my editor, jEdit, I have assigned these to C-t C-tC-t C-w, and C-t C-l. On Emacs they are C-tM-tC-x C-t.

This is one of the tips in Steve Yegge's article Effective Emacs. For non-Emacs users, it’s an interesting exercise to translate the tips to your own editor. Other tips include:
  • delete previous word
  • forward/reverse incremental search
  • repeating commands n times
  • splitting/unsplitting windows
  • reapplying line wrapping to a paragraph
  • rectangle editing 

Monday, May 25, 2009

[Programming] Command-line tool for finding frequent substrings

Hiroki Arimura has written a nifty tool called wasa that you can use to find the most frequent substrings in a text file. (It’s implemented using a suffix array.) I modified it to have an -xc option for displaying the counts.

I was pretty excited about this at first because I thought it would solve the problem of summarizing log files by finding frequent substrings. But alas, it outputs too much noise to be useful.

For example, given the following logfile,
May 14 13:26:13 kenya sshd[41244]: Invalid user louis from 85.21.206.18
May 14 13:26:16 kenya sshd[41246]: Invalid user louis from 85.21.206.18
May 15 04:00:58 kenya sshd[50672]: Did not receive identification string from 61.152.157.166
May 15 04:04:04 kenya sshd[50699]: Invalid user test from 61.152.157.166
May 15 04:04:06 kenya sshd[50701]: Invalid user test from 61.152.157.166
May 15 04:04:08 kenya sshd[50705]: Invalid user test from 61.152.157.166

The most frequent substrings are as follows:
prompt> wasa -xc -m 1 c:\junk\foo.log | sort -nr
6 sshd
6 may
6 kenya sshd
6 from
5 user
5 invalid user
4 may 15 04
4 from 61
4 61
4 166
4 157
4 152
4 15 04
4 04
3 user test from 61
3 test from 61
3 invalid user test from 61
2 user louis from 85
2 may 14 13
2 louis from 85
2 invalid user louis from 85
2 from 85
2 85
2 26
2 21
2 206
2 18
2 14 13
2 13

It finds interesting substrings (“invalid user” and “invalid user louis from 85”) but it finds a lot of uninteresting substrings as well.

Ah well. Interesting tool nonetheless. ∎

85-year-old wisdom

Found on a blog post by 85-year-old blogger Dorothy Vining (quoting Regina Brett):
20. When it comes to going after what you love in life, don’t take no for an answer.
22. Overprepare, then go with the flow.
26. Frame every so-called disaster with these words: “In five years, will this matter”
32. Your job won’t take care of you when you are sick. Your friends will. Stay in touch.
39. Get outside every day. Miracles are waiting everywhere.
I definitely need to do that last one! ∎

Saturday, May 23, 2009

Halmos (tombstone) marker for symbolizing the end of a blog post.

You know how magazine articles often have a black square at the end of the article? It's called a halmos (or tombstone) and is used at the end of magazine articles and mathematical proofs. You can use it for your own blog posts as well—just copy the halmos at the end of this post. ∎

Two books that I'm excited about reading: A Little History of the World, and The Story of Art

There are a couple of books that I’m excited about delving into.

cover The first is E.H. Gombrich’s A Little History of the World. Written for younger readers, it’s a history of the world beginning with the Heidelberg Jaw (600,000 years ago) and ending with the collapse of Communism (18 years ago). You’ve got to hear this excerpt from the audiobook. It sounds like it came out of a fairy tale, and it will make you want to check it out. Alas, my local library does not have the audiobook, but it does have the book. Check out the table of contents on Amazon to see what’s inside.

cover The other book that I’m looking forward to is the one that the same author is famous for: The Story of Art. It’s the history of art from cave paintings of bison (17,000 years ago) to Jackson Pollock’s One (60 years ago).

Check out the preface and you’ll see why I’m excited about reading it:

This book is intended for all who feel in need of some first orientation in a strange and fascinating field. It may serve to show newcomers the lie of the land without confusing them with details; to enable them to bring some intelligible order into the wealth of names, periods and styles which crowd the pages of more ambitious works, and so to equip them for consulting more specialized books. In writing it I thought first and foremost of readers in their teens who had just discovered the world of art for themselves. But I never believed that books for young people should differ from books for adults except for the fact that they must reckon with the most exacting class of critics, critics who are quick to detect and resent any trace of pretentious jargon or bogus sentiment. I know from experience that these are the vices which may render people suspicious of all writing on art for the rest of their lives. I have striven sincerely to avoid these pitfalls and to use plain language even at the risk of sounding casual or unprofessional.

Other good points:
  • The illustrations are large (often taking up a whole page) and in color.
  • The illustrations are placed near the text that discusses them.
  • Every work discussed has an accompanying illustration.
Most of the Amazon reviews are for the smaller paperback, but I’m not sure if it has 443 color illustrations like the larger hardcover. ↴

E.H. Gombrich’s The Story of Art

E.H. Gombrich’s The Story of Art

Foldout from E.H. Gombrich’s The Story of Art

Nifty foldout of Pollock’s One. ∎

Complete Works of Shakespeare for $1

w00t! This is proof that you can buy the 1700-page complete works of Shakespeare, in the best edition (Bevington), for $1 (shipping is about $3–6 to US/Canada). I love the Internets.

If you want a copy, there are several used ones floating about. Go to bookfinder.com and search for Author: Bevington, Title: Shakespeare. ∎

Bevington Shakespeare, 4th ed, in packaging

Bevington Shakespeare, 4th ed

Cost of a used Bevington's Shakespeare: $1

Thursday, May 21, 2009

[Windows] TCC/LE—an alternative to Command Prompt

TCC LE

I'm trying out a free cmd.exe alternative called TCC/LE. It's basically the same thing as cmd.exe, with some nifty extras:

  • Highlight text using Shift with the arrow keys/Ctrl/Home/End. Double-click to highlight a word. Typing will replace the highlighted text.
  • Ctrl-Y copies highlighted text to the clipboard; Ctrl-V pastes.
  • PgUp shows a popup window with your command history. To do a partial search, enter a few characters before pressing PgUp. You can also press ↑ to cycle through previous commands (partial-search works here too).
  • If you're in the middle of typing something, but need to run another command first, Ctrl-K saves what you've typed so far to your command history. Run the other command, then press ↑ twice to retrieve the first command.
  • F1 shows help for the first word (Ctrl-F1 for the current word)
  • To scroll the window, use Alt with ↑/↓/PgUp/PgDn/Home/End/
  • Ctrl-Tab shows a popup window for filename completion. Use Tab/Shift-Tab (or F9/F8) to cycle back and forth through filename completion. F12 repeats the completed filename; F10 adds the next completed filename.
  • F3 copies the previous command, starting at the current cursor position
  • Commands can be aliased to function keys (e.g., you can assign Shift-F5 to dir /w)
  • F6 (or Ctrl-PgUp) shows the Directory History window (see screenshot above).
  • You can assign colors to file extensions shown by the dir command. Type option to access this and other preferences.
  • tee sends standard input to both standard output and a file
  • y sends standard input and a file to standard output
  • log stores your commands in a file
  • memory shows memory statistics
  • tasklist shows a list of running tasks
  • dirs displays the current directory stack. Useful in conjunction with Scott Hanselman's pushd/popd-prompt.
  • Ctrl-0Ctrl-1Ctrl-2, …, Ctrl-9 will copy the nth item from the previous command line
  • beep plays a beep. Try: beep asteriskbeep exclamationbeep handbeep questionbeep okbeep 440 4  600 2  1040 6
Also see CodingHorror's article on Windows Command Prompt customization.

Wednesday, May 20, 2009

Using proper “curly quotes” instead of "straight quotes"

In Thinking With Type p. 164, Ellen Lupton issues this typographic call to action:

Incorrectly used prime marks must be routed out and destroyed.

So for breaks in thought: instead of --, use — (em-dash).

For numbers: instead of 1977-2007, use 1997–2007 (en-dash).

Instead of "hatch marks", use “quotation marks”.

Instead of 'prime marks', use ‘single quotation marks’. Use this also for apostrophes (Jon’s).

Instead of ..., use … (ellipsis).

Below is an AutoHotKey script that Windows users can use to insert this punctuation easily into any program. Adjust to taste:
^!-::—
^-::–
^"::“
!"::”
!+'::”
^'::‘
!'::’
^!.::…

This produces the following keyboard shortcuts, which can be used in any program:

em dashCtrl Alt -
en dashCtrl -
left quotation markCtrl "
right quotation markAlt "
left single quotation markCtrl '
right single quotation markAlt '
ellipsisCtrl Alt .

Wednesday, May 13, 2009

Tip: Set secondary clock to GMT

Great tip for programmers and pilots: if you have a secondary clock on your watch, set it to GMT. We often need the current time in GMT, so why not make it easily accessible?

Saturday, May 09, 2009

Binary tree of depth 17

This is pretty (and instructive). It's a binary tree of depth 17. This tree has 131,072 leaves (217).

pagerank

Woz on the Apple IIc

Just came across this description of the Apple IIc in Steve Wozniak's iWoz:
This was the small Apple II—a really small one—as small as today's laptops except you had to plug it into a wall. I thought it was just a beautiful computer, my favorite one to this day. I really think it was one of the best projects ever done at Apple.
I have to agree—the IIc was a beautiful machine. Beautiful looking, and a lot of fun to use. Man, I miss the days of using it to write programs and to play games (The Coveted Mirror, Gemstone Warrior, Moon Patrol). I didn't even have a printer or modem, yet I still had a lot of fun using it.

Apple IIC Owner's Guide Apple //c Unboxing Apple //c Unboxing Apple //c Unboxing Apple IIc close Letter

Do you have fond memories of the Apple ][?

Dollar-Store Thermometer

One of the coolest things you can get at a dollar store is a thermometer. You can pick one up for a buck or two. Get to know your Celsius and Fahrenheit!

I've taped mine to my printer:
Thermometer, LaserJet 1018 Printer

How to attach extra pages or end papers to a book

If you like to mark up books with your own notes, you will sometimes find that the book doesn't have enough end papers for your notes. Here I describe a simple way to add pages to a book—either blank pages for notes, or printed pages with your own material. You can easily add pages to the end of the book or to the middle.

The first step is to make the new pages. To do this, simply fold a sheet of paper in half.

The second step is to create the hinge. This is a strip of paper that is folded in half. Apply glue to the top:
Step 2: Make a hinge out of paper, and apply glue to it

The third step is to attach the new pages to the hinge:
Step 3: Attach the new page to the hinge

The last step is to attach the hinge to the book. If necessary, use a ruler to shove in the hinge.
Step 4: Attach the hinge to the book

And voila, your book now has four new pages! Close the book and give the glue a few minutes to dry.

The photos above show printed-out pages, but this technique is also useful for attaching blank pages for handwritten notes.

As an aside, a Windows tool that I love is FinePrint. I used it to print the above pages in booklet format. You can also use FinePrint to do 2-up, 4-up, 8-up, and double-sided printing (on single-sided printers), and to preview, delete and rearrange pages before printing. It's a bit pricey ($50), but it's great.

Thursday, May 07, 2009

Notes on Plato's Alcibiades

Just finished reading my second dialogue of Plato. Here I will blog a few of my thoughts on it, mainly for my own benefit. It is likely of no interest to anyone else.

Alcibiades is 39 pages; I started a week ago, reading for an hour a day. Plato is definitely easier to understand than Aristotle – at least the one work by Aristotle that I read. I can do 5 pages an hour of Plato, compared to 1 page an hour of Aristotle.

In Alcibiades, Socrates tries to show the would-be politician Alcibiades that he is not ready, and that he needs Socrates's guidance. In short: to prosper, what is needed is virtue (justice and self-control) and someone in whom to study it (namely Socrates). The dialogue identifies this as the most important quality for the leader of a nation to possess.

In general the points were well argued (see summary at the end of this post). One argument that was weaker than the others was the one about whether just things are advantageous:
  1. Just things are admirable
  2. People who do what's admirable do things well
  3. People who do things well live successful lives
  4. People are successful because they have good things
  5. Good things are advantageous
  6. Therefore, just things are advantageous
Strictly speaking, one can easily think of people who are counterexamples to 2, 3, and 4. But perhaps one is not to expect mathematical precision from the dialogues.

But the other arguments are sound. From experience it rings true that people who "don't know but think they do know" are dangerous, that one cannot become an expert by simply keeping company with experts, and that the highest good is to "know thyself".

So I'm glad I read it. If I ever become a politician, I will strive for justice and make virtue my guide. And if I don't, I will still do the same.


Notes on Alcibiades 

Category: Normative ethics

Summary: To prosper, what is needed is virtue (justice and self-control) and someone in whom to study it.

Question: What is the most important quality for the leader of a nation to possess?

  • 558–560 Preliminaries
  • 560–564 The goal of politics is justice
  • 565-568 Alcibiades does not understand what is just
    • 568–569 In the Socratic method, the answerer is the one saying things
  • 569–570 Alcibiades does not understand what is advantageous
  • 570–573 Just things are advantageous
    • 570 He who can persuade a group can persuade an individual
    • 571 Just things are admirable
    • 571–572 Things are admirable insofar as they are good, and contemptible insofar as they are bad
    • 573 What is admirable is good
  • 574–575 Not knowing yet thinking one knows is dangerous
  • 576 Associating with experts is not sufficient for gaining understanding
  • 576–580 Self-cultivation is necessary for overcoming the enemies of the country
  • 581–585 Rebutting the idea that to be a good man one must be an adviser in friendship and agreement
  • 585–586 Not through cultivating what one has does one cultivate himself
  • 586–587 One must know himself in order to cultivate himself
  • 587–588 The soul is the man
  • 588–589 Know thyself means know thy soul
  • 589–590 Not through knowing what one has (trade, wealth, the body) does one know himself
  • 591–592 To know one's soul, one must look at the place of knowing and understanding in another soul
  • 592–595 To prosper, what is needed is not power but virtue (justice and self-control) and someone in whom to study it

Wednesday, May 06, 2009

Bargain Shakespeare

I can't speak highly enough of bookfinder.com, the used-book search service. I just found a copy of Bevington's Shakespeare (widely considered to be the best edition of Shakespeare for study) for $8 for the 4th edition (used), including shipping. Compare that with $77 for the 6th edition (new).

There are several more at around that price if you want a copy.

Sunday, May 03, 2009

Quotes from Steve Wozniak's "iWoz"

iWoz

I'm enjoying Steve Wozniak's book iWoz. I'll post interesting quotes here as I find them:
  • "You can't teach somebody two cognitive steps above from where you are—and knowing that helped me with my own children as well as with the fifth graders I taught later on. I kept telling them, like a mantra: One step at a time."
  • "My thinking is that a company is like a family, a community, where we all take care of each other. I never agreed with the normal thinking, where a company is more competition driven, and the poorest, youngest or most recently hired workers are always the first to go."