Wednesday, July 27, 2011

Open letter re: error in my post

I sent this letter to a friend, but others might find it interesting. [Elided name for privacy -- the letter starts ...] Hi!

Thanks again for (verbally) informing me that I misspelled Brandenburg in a post.

As George Soros (left-wing hedge fund owner and subsequent philanthropist) says, learning we have made a specific mistake causes joy and hope, because this knowledge is an opportunity to improve future outcomes. :)

It's been a while (I know) but I have corrected the post -- indeed, thanks!

With warm regards,
Mark D. Blackwell

Copyright (c) 2011 Mark D. Blackwell.

Brandenburg 5 in Bach-Lehman tuning

The following is a re-post.

Please click to listen before reading further. Today, w/s Brandenburg MIDI turned up a top-page (Google) result, the fifth Brandenburg concerto, in D major, ('[o]ne of the lushest and most thrilling pieces ever written'--quotations are from Wikipedia), by (Johann Sebastian) Bach, 'now regarded as the supreme composer of the Baroque [period, and] one of the greatest of all time', produced by Alan Kennington, moderately, clearly and with great unity on a (single) MIDI instrument, the harpsichord.

According to the artist, '[T]he performer needs to be able to bring out the music comprehensibly. When the music is at the right speed, it resonates in the listener. It generates a kind of excitement and pleasure... I believe that Baroque composers wanted their audience to feel pleasure... Bach was more interested in giving gentle pleasure[,] rather than a sudden rush of breathless excitement.'

For this very purpose I adjusted its tuning to Bach- Lehman 1722 temperament using Scala, whose 'motto is INVENIT ET PERFICIT which means, "it finds and perfects"'. The result? My friend M agrees that this is a:

much more beautiful, second movement (Affettuoso), in B minor.

For this, it is essential to use some good wave-table MIDI synthesizer software like Microsoft GS Wavetable SW Synth which is based on Roland wavetables.

The Creative SoundBlaster SoundFont Synth and the QuickTime Music Synthesizer (at least on PC's) somehow blot out temperaments' emotional content, and they make this listening comparison meaningless.

For comparison, the original:

equal-tempered version

I predict you shall be uncomfortable with it, now. As my friend M said, it seems 'like a terribly out of tune MIDI file'. Now we know it wasn't the MIDI system's fault.

Also available are the

first and third

movements (both Allegro) fully adjusted to Bach- Lehman 1722 tuning.

(I have emailed Alan U. Kennington, Ph.D., and he granted permission for this use. His website states, 'All original material on the web site is Copyright (C) 1999-2009, Alan U. Kennington. Permission is hereby granted for non-commercial reproduction of small portions of this material under the Artistic Licence, provided that this copyright notice is attached.')

Copyright (c) 2010 Mark D. Blackwell.

Monday, July 25, 2011

Prevent accidental drag and drop on touchpad laptops in Windows Explorer, howto

For convenience on many laptops, the touchpad functions like (left) clicking a mouse. However, in Windows Explorer, a classic problem occurs. We can drag and drop folders by mistake into other folders--they can get lost that way, or mess up our carefully organized tree.

The solution is a distance, a threshold, before accepting a drag (of a clicked mouse). We don't want natural hand jitter (visible at small resolutions) or accidental motion (while clicking) to be interpreted as a request to drag graphical objects around. This problem is well known--and Windows has such a threshold. However, their default is 4 pixels!

Some people's jitter is greater than others' (viz. Parkinson's disease); the default may be way too small to avoid the problem for touchpads, too.

Using 40 pixels as the threshold, I first move past two folders (or files) in Windows Explorer. Then before releasing the mouse, I pull it back to wherever I want, even to the adjacent folder.

There are two settings: horizontal and vertical. I set both the same--the horizontal is important, too, to prevent inadvertent mouse drags.

HKEY_CURRENT_USER\Control Panel\Desktop
DragHeight = "40"
DragWidth = "40"

Restart the computer for the change to take effect.

This setting allows windows also to be dragged conveniently. Drag a centimeter (half an inch) then back to your new, desired, fine location. The feeling is like a momentary slow response.

If you wish, you can use Microsoft's TweakUI (a free-of-charge Windows XP download) to set these.

You might enjoy playing with click-lock (on the mouse) for this problem, though it changes the user interface in a deep way, globally.

I wonder if someone in the leadership structure of Microsoft might be big enough to admit--to themselves--they are continuing a mistake (whether small or important) that occurred some time in the past but was correct at one time, the mistake caused by an increase in monitor resolution (as others have said), and respond to some users' cries for help by changing this 4-pixel default? Because the key difficulty is in admitting a mistake. Already they have enabled us to change our setting; it's merely avoiding a redecision about the default which is causing a problem in the wider world.

The current state on this issue seems one of drifting inertia and big-company self-insulation. (Some of their attitude about it is visible on their Developer Network.)

Disable Drag And Drop In Windows Explorer? (from Scot's Newsletter's Forum, editor of ComputerWorld)
Stop Windows copying files accidentally when Ctrl-click selecting (How-To Geek: more)
Prevent folder moving (see R. McCarty's answer)
Click lock (see S. Goodkin's answer)

Copyright (c) 2011 Mark D. Blackwell.

Saturday, July 23, 2011

Installing Leo (Outlining Editor) on Windows, howto

An introduction to Leo

Looking at text editors recently, I found a recommendation for Leo ('Leonine Editor with Outlines', developed by Edward K. Ream).

The (free) programmer's text editor and outliner (see Joe Orr's slideshow, or w/s Leo tutorial) improves software project readability, excitingly -- but it's not only for programmers. Leo is a feature-rich, productivity-increasing tool.

Using outlining is a fresh approach for the world of Literate Programming. It resolves the awkwardness, but easily fulfills the essence: it provides more readability, along with program code colocation with additional explanations, which helps prevent obsolescence.

To start, all you have to do (A) is enter an idea about any section of your text and (B) incrementally develop (in Leo) an outline of your ideas, referring to sections of the text.

Programmers need only (A) enter an idea about any (freely-chosen) section of their source code (e.g., its purpose) and (B) incrementally develop (in Leo) an outline of thoughts, referring to sections of the code.

Additions you make, no matter how few, are a kind of Easy Literate Programming.

Even while using Leo, no other team members will feel impacted, even if they edit the same source files without it. In no way does it hide the project source files inside its own folders or files, and it's compatible with version control systems, such as Git.

How can Leo accomplish this? Leo in a Nutshell explains. Ream's view is worth reading also, on Slashdot.

Leo is fairly mature and ready for use, long having had a 'small but extremely loyal group of users'[1] in addition to the developer's personal use. Its architecture is extensible by scripting; upwards of 75 interesting plugins have been written. It has borrowed much from Emacs. Some of its voluminous documentation seems obsolete (however) or merely implementation-oriented.

Presumably all Leo needs to know about the languages (even if obscure) used on your project is the syntax of how to form block- and single-line comments.

Leo opens a file by default (normally ~/.leo/workbook.leo, even on Windows) so if you want you can use it as a personal outlining planner.


Leo's outlines have cloneable nodes (and subtrees), and therefore multiple views. This might be a simple idea; I'll give you two examples.

For any given bug, a tree of relevant files can be collected (and cloned) and focused on without distraction. In the bug tree, as you edit those files, the ordinary hierarchy of files is being updated also (but not by special software). Since the nodes are cloned, you are editing the same files, not merely in essence but in actuality.

Insofar as you make notes briefly while puzzling out a problem or solving a bug, naturally they are entered right there in the place provided: in the bug's file tree (or associated with it). Afterward, you collapse the bug's tree, left behind to help explain the solved bug to future readers (developers) whenever they might need it -- Easy Literate Programming.

To explain something special to developers (readers) of the project, any files or folders (even sections of files) can be clone-arranged into a new tree structure (regardless of the layout of a project's filesystem).

In particular, if you have written about several cross-cutting (e.g., aspect-oriented) concerns (say, a, b and c), or wish to explain them to other developers, then it's good to clone-arrange the relevant files (unless that's all the files) into trees belonging to those concerns, though the files actually reside elsewhere in the project's main organizational filesystem folders (say, w, x, y and z).

It's an alternative to tagged filesystems in a way, but with explanations that grow organically -- it naturally produces a kind of manual, with an outlined table of contents.

Here's how to install Leo on Windows XP in detail (for the non Python-familiar) the way I did, using some installation instructions (or a fuller version) on the website as a basis:

Leo prerequisites

Leo requires Python 3 (or 2). Download and install minimally the latest Python-3 for Windows from Python's official website--I used 'python-3.2.1.msi'--to 'C:\progra\Python32'.

For Python, and Register Extensions, Tcl/Tk and Utility Scripts, pick 'Will be installed on local hard drive'. For Documentation and Test Suite, pick 'Entire feature will be unavailable'.

Download and install minimally the latest binary package for Windows containing QT-4, the 'cross-platform application and UI framework' and Python bindings, PyQT-4 from its developer's website; I used 'PyQt-Py3.2-x86-gpl-4.8.4-1.exe'.

Leo requires 'Qt runtime'. To ease uninstalling later, select 'Start Menu shortcuts'. Unselect everything else, including Documentation, Examples, QScintilla and the developer tools Developer, Qt, and SIP.

When PyQt asks you to specify a 'Python installation folder', give the same folder as above, 'C:\progra\Python32'; the library goes there, in a subfolder.

Installing Leo

Download and install the latest one-click installer for Windows (.exe) of Leo from its download page or possibly here. Click where it says, 'Looking for the latest version'. I used 'LeoSetup-4.9-final-a.exe'.

Leo may complain, 'Python not found,' but that's okay; we'll tell it later.

Leave selected 'Leo', '.leo File Association' and 'Leo Start Menu' and click Next. For 'Destination Folder', give 'C:\progra\Leo-4.9-final' or the equivalent. For Python Folder, give the same folder as above, 'C:\progra\Python32'. Keeping the default Start Menu folder, 'Leo', click Install and Finish.

Open a command line window with Win+ R and go to the Leo program directory with 'cd \progra\leo*'. Type It should say something like, 'is Python 3: True', and a little while later (possibly a window) will ask you for, 'an id that identifies you uniquely'. After that, Leo's graphical window should pop up.

From now on, you should be able to start Leo using the Windows Start menu.

Improving usability of Leo

With any folder menu in Windows Explorer, do Tools-Folder Options. Pick the File Types tab; move down and select the row that contains LEO in the Extensions column. Click the Advanced button; uncheck 'Confirm open after download'. Under Actions, make sure 'open' is selected and click the Edit button. Uncheck 'Use DDE' and into the box, 'Application used to perform action', paste:

C:\progra\Python32\pythonw.exe C:\progra\Leo-4.9-final\ "%1"

and click OK. (Double-quotes fix file and folder names that have embedded spaces, e.g. as you know, 'My Documents'.) Click OK again.

Now if you click any Leo file, an instance should be loaded to edit it.

The best documentation to read first is available by means of Menu-Help-Open quickstart.leo.

[1]Leo (Text editors wiki)

Further introduction

o Leo

Why I love Leo (Dan Rahmel)
What makes Leo special
Manual introduction
Blogpost: Using Leo as a personal information manager (PIM) (J.Tauber)
Leo (text editor) (Wikipedia)
Ream's thoughts on Joe Orr's slideshow
Leo website slideshow
Introductory tutorial

o Solved by Leo

Outliners, trees and meshes (Scott Rosenberg, author of Dreaming in Code, etc.)
Outlines and meshes (Taking Note, an anonymous blog)

o Background: Outliners

Outliners then and now (Scott Rosenberg)
MORE outliner (retrospective/review,
MORE, dinosaur (retrospective/review, Matt Neuburg)

o Background: Literate Programming

LP (Ward Cunningham wiki)
Software design for engineers and scientists (J.A. Robinson, GoogleBooks from w/s literate programming editor)
LP (PyLit website)
Lightweight LP with example (J.W.Shipman)
LP Workshop (Mac program)
LP is a terrible idea (Matt Giuca)
LP, why? (Bart Childs)
LP to enhance agile methods (Vreda Pieterse: publications)

o Related, vaguely

Tabulator: RDF semantic web browser (Tim Berners-Lee)
Bacon on instruments of the mind (Taking Note)

For more information

o On Leo

All about Leo
More Leo resources
Joe Orr's Leo resource page
Installing Leo on Windows (Matt Wilkie)
Develop in Haskell with Leo

o General

Outliner editor family (Text editors wiki)
Outliners: comparison (Mark Wieczorek)
XP/agile universe (conferences)

Copyright (c) 2011 Mark D. Blackwell.

Monday, July 11, 2011

Unfamiliar Windows keyboard shortcuts

I like to open folders sometimes in a new window, sometimes the same window. It's difficult to right-click my particular computer mouse. Also, generally I prefer keyboard shortcuts.

First I tried using Microsoft Windows Explorer's option which always opens a new window; soon I was frustrated, closing the many windows. (See Windows Explorer-Menu-Tools-Folder Options-General-Browse Folders.)

To open the other view (folder or explorer) in a new window, I was motivated to find a shortcut: either with the keyboard or a left mouse click. Some research found many that were unfamiliar and quite useful.

Here are my select keyboard and mouse shortcuts for Windows XP and later. You might not know all of them--I think you will find at least one excitingly useful!

App = Application key (AKA Menu key, context menu key)
Win = Windows key (AKA Flag key, Meta key, MOD4, Start key, Super key, Windows logo key, WinKey)

Alt+ Esc: Cycle programs in starting order
Alt+ F6: Cycle windows of active program
Alt+ PrintScreen: Capture program window (paste into Paint)
Alt+ Shift+ Esc: Cycle programs in starting order, backward
Alt+ Spacebar M Arrow: Move active window
Alt+ Spacebar S Arrow: Resize active window
App: Show context menu
Ctrl+ Shift+ Esc: Task manager
F6: Cycle screen elements (e.g., in SeaMonkey, go to address bar)
Win: Show start menu
Win+ Break: Show system properties
Win+ D: Show desktop (toggle)
Win+ E: Explore My Computer
Win+ L: Lock/logon screen (switch user)
Win+ M: Minimize all windows
Win+ R: Run
Win+ Shift+ M: Undo minimize all windows (also undo show desktop)
Win+ Shift+ Tab Enter: Cycle programs in taskbar, backward
Win+ Tab Enter: Cycle programs in taskbar
Win+ U: Utility manager (accessibility)
(Shift+ F10: same as App)

Command-line window:
Alt+ Spacebar E K (make selection) Enter: Select text
Alt+ Spacebar E L Arrow: Scroll
Alt+ Spacebar E P: Paste text

Alt+ Double-click: Show properties (single folder or file)
Alt+ Enter: Show properties (multiple folders & files)
Enter: Open single selection in folder view (or last-selected)
Shift+ Enter: Explore single selection (or last-selected)
(App O: same as Enter; App X: same as Shift+ Enter)

Multi-document program:
Ctrl+ F4: Close active document

... Icon of non-maximized document:
Double-click: Close

Windows Explorer (file chooser in other programs):
Alt+ Double-click: Show properties (of single folder or file; except explore-view navigation pane)
Alt+ Enter: Show properties (multiple folders & files)
Alt F W Enter: Create new folder
Alt V E O: Show navigation pane (toggle)
Ctrl+ Keypad '+': Fit columns
F4: Show folder trail (toggle)
Shift+ Click: Select from top to pointer

Finally, to avoid right-clicking, here are the shortcuts I was looking for:

... In explore view:
App O: New folder-view window(s)
Enter: Change to single selection; explore (some of) multiple selection in new windows
(App X, Click Shift+ Double-click: same as Enter)

... In folder view:
Ctrl+ Enter: Open single (or some of multiple) selection in new window(s)
Enter: Change to first-selected
Shift+ Enter: Explore in new window(s)
(App X, Click Shift+ Double-click: same as Shift+ Enter)