Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Thursday, March 29, 2007

jEdit cool feature: Setting the number of files in the Recent Files list

The jEdit text editor can do some amazing things. You can set the number of files to display in its Recent Files list (handy for FTP/SFTP). Here I've bumped it up from 20 to 120 files:

(Windows) $75 - Nib: Left-click, drag, right-click, double-click without using mouse buttons

I think I may actually shell out the $75 for the little software program called Nib, which automatically clicks the mouse for you. I've been trying it out for the past month, but only today discovered the gestures for right-click and double-click.

Amazingly, then, you can do left-clicks, drags, right-clicks, and double-clicks, without using any mouse buttons:

Left-click: Pause the mouse
Drag: Pause the mouse, then quickly move it
Right-click: Move the mouse to the right, then back
Left-click: Move the mouse to the left, then back

Here are the settings I'm using:



Incidentally, this lets me use my Logitech trackball with my *left* hand, since I no longer need the buttons:

images

Tuesday, March 27, 2007

153 Textures from IBM Tokyo Research Laboratory

Presenting... 153 tileable textures from IBM Tokyo Research Laboratory. I had used these for an open-source GIS called OpenJUMP a few years back - but they'd be equally useful for Twitter backgrounds, Ning backgrounds, desktop wallpaper, etc.

Monday, March 26, 2007

(Windows) EMSA Save My Work: Recording your recent keystrokes for emergency retrieval if your program crashes

I've been using a free program called EMSA Save My Work to record my keystrokes for emergency retrieval if, for example, the program I'm typing into seizes up and crashes. In fact, this is a not infrequent occurrence for me - when a program I'm using terminates, blanks out, shuts down, freezes, or dies, it's good to know that I can open up EMSA Save My Work to recover the inspired prose I'd just written.

(Windows) Trying out the Maxthon browser

Trying out the Maxthon 2.0beta browser (uses the IE7 rendering engine). It's actually pretty good, with various features that I've seen in Firefox plugins. Surprisingly Maxthon is more popular than Firefox in China.

A blog post with a good overview.

Scoble video demoing the browser.

Saturday, March 24, 2007

Jon's HTML/XML Indenter

Have you ever had a big chunk of messy HTML code that you wished were properly indented? I did, so I wrote a little JavaScript page to clean up the indenting. Presenting: Jon's HTML/XML Indenter.



This just uses a bit of JavaScript to properly indent whatever HTML you paste into the upper box.

Thursday, March 22, 2007

Automatically pushing the Submit button on the Firefox del.icio.us add-on's form (GreaseMonkey script)

If you use the Firefox del.icio.us extension, you might be annoyed with how it takes a few seconds to open a new window containing the form, which you're just going to press Submit on anyway.

I've written a GreaseMonkey script that will automatically press Submit for you: Auto-Submit del.icio.us Form script.

(Windows) SlickRun: Looks cool with a large font

One cool thing about SlickRun (Windows launcher) is that you can set the font and its size. Here I'm using Palatino Linotype, italic, 48pt.

SnagIt Capture

I got the idea from the Enso launcher, which also uses a large font, but isn't free. Also it requires you to hold down Caps Lock - quasimodes are great for a lot of things, but probably not for a launcher app.

In the screenshot above, I'm using YubNub to do a Google search for the word "amanuensis".

Saturday, March 17, 2007

Quote on creativity

As those who have studied creativity know, breakthroughs occur when focused, rational thought and activity are followed by a period of release. This is why we get up from our desks frustrated and exhausted, decide to shower and—bing!—there's the answer.

– Julia Cameron

Friday, March 16, 2007

(Windows) Sending voicemail via email: VoiceMailCompressor

This cool free program lets you record from your microphone and send it as an mp3 in an email. I'm not sure yet how best to make use of it - perhaps to add an audio dimension to my emails to friends.

http://www.snapfiles.com/get/voicemailcompressor.html

This program was mentioned by one of the commenters on LifeHacker.com

Thursday, March 15, 2007

An alternative Windows file explorer: 2xExplorer

Alas, there is not too much in the world of Windows freeware, so while we wait for the next big thing, let us content ourselves with 2xExplorer. I'd downloaded it in the past, but decided to give it a second look, seeing as it's highly recommended in various places, and in fact is on the Pricelessware 2007 list.

It's basically a Norton Commander-like utility - like Windows Explorer, but with two panels, an image-preview pane, and some niceties like optional single-click file/directory opening and bookmarks.

* * *

One other thing I'm trying is the Linky extension for Firefox. It lets you open all selected links in tabs. This has actually come in handy a few times this past week.

Wednesday, March 14, 2007

Trying out some adjustments to my daily routine

On the recommendation of my colleague Phil McCluskey, I am working through Julia Cameron's book on creativity, Vein of Gold. It has prompted me to make some changes to my schedule:
  • 7am - "Morning Pages" - 3 pages of writing whatever (stream-of-consciousness)
  • 8am - Walking ("Think about what you'd like more of, what you'd like less of, what would make you happier, which things make you glad.")
  • 9am - Work
  • ..........
  • ..........
  • Evening - feeds, correspondence, errands, books on personal development or related to my profession
  • 10:30pm - Prayer, reading of scripture
The three basic tools for creativity that Cameron recommends are: Morning Pages, daily walks ("seeking the muse"), and weekly "Artist Dates" (new experiences - watching a vintage film or attending an unusual lecture).

Books I'm reading

Here's an idea: Post on your blog the books you are reading, and a recent sentence from each.
  • Vein of Gold. "The book you are about to embark on is a pilgrimage, a journey of healing."
  • JavaScript: The Definitive Guide. "For example, to slide an image into place from the left, you increment the image's style.left property repeatedly until it reaches the desired position."
  • The Italic Way to Beautiful Handwriting. "WARNING! DANGER! If you miss _any_ of the important points in THIS lesson, all future practice of Italic will be wasted! of no value!"
  • PHP Cookbook. "However, if the header's mustUnderstand attribute is flagged as true, then the SOAPServer will issue a SOAP fault with a fault code of SOAP-ENV:MustUnderstand and a fault string of Header not understood."
  • War and Peace (via email). "'And me? Would you like to kiss me?' she whispered almost inaudibly, glancing up at him from under her brows, smiling, and almost crying from excitement."
  • CSS Mastery. "Another useful filter is known as the commented backslash hack."
  • The Life of Samuel Johnson (via email). "Though Mrs. Porter was double the age of Johnson, and her person and manner, as described to me by the late Mr. Garrick, were by no means pleasing to others, she must have had a superiority of understanding and talents, as she certainly inspired him with a more than ordinary passion."
  • Agile Software Development. "Subtypes must be substitutable for their base types. Barbara Liskov first wrote this principle in 1988."
  • Mastering Regular Expressions. "That is, what does s/(?=s\b)(?<=\bJeff)/'/g do? Turn the page to check your answer."

MS Script Editor - Surprisingly good JavaScript debugger

One good thing I will say about IE - the Microsoft Script Editor is actually a pretty good debugger (try to get Script Editor instead of Script Debugger, which is a bit buggy). I could almost say the same of Firebug, but unfortunately it seems to get the line numbers wrong - the lines it displays seem to be offset from the true lines by some amount (at least on the large JavaScript file I'm working on).

Firebug is super for debugging, but when it doesn't work, at least we have an alternative in MSE.

My favorite shortcut keys for Google Reader: Shift-N and Shift-A

Finally, Google Reader has shortcut keys for the way I read feeds:

Shift-N - next subscription
Shift-A - mark all as read

It also has a nifty heads-up display showing all the available commands. Just hit "?"

Tuesday, March 13, 2007

Reading code aloud

When reading a programming book, it can be tempting to skim the code examples. But they likely have some nuggets that are worth learning. The problem is that we don't like to read code written by other people - or at least it doesn't come naturally to us. What we need is a technique for rapid understanding of new code.

I propose reading the code aloud. Now, to make sure we don't get distracted by syntactic details, we can probably come up with some rules for what to omit. Consider this example from Martin's Agile Software Development:

#ifndef GEOMETRY_RAY_H
#define GEOMETRY_RAY_H

class Ray : public LinearObject
{
public:
Ray(const Point& p1, const Point&amp; p2);
virtual bool IsOn(const Point&) const;
};
#endif

I would read this aloud as follows:

class Ray, extends LinearObject
Ray p1, p2
IsOn Point, returns bool


So we have a first cut at a rule of thumb for things to skip:
  • start and end matter (e.g. ifndef, define, endif)
  • access modifiers (public, protected, private)
  • parameter types
We also see a couple of transliterations (text transformations):
  • in C++, read ":" as "extends"
  • in function declarations, read "[type] ..." as "... returns [type]"
A more enterprising reader of code could expand or revise these rules and we could have, say, 10 tips for reading code aloud, for maximum comprehension.

Thursday, March 08, 2007

Audio break-timer; 300 High-quality wav files; and Firefox DownThemAll extension

Break timers don't really work for me. Even the intelligent ones like RSIGuard, which try not to interrupt you when popping up break reminders, still manage to pop up while I am in the middle of some train of thought. "Argh! Close!"

So I'm trying out the free audio-based break reminder called SoundBreak. It plays a random wav file at the interval you specify (I'm going with 1 hour intervals). Because it plays a sound rather than pops up a window, it's less intrusive. That's the hope anyway.

SoundBreak comes with ten sounds to start you off, but it recommends (rightly) that you find more wavs "to prevent things from getting repetitive". After scouring the web a bit, I found a site with hundreds of good wav samples and loops: PlatinumLoops. Bill de hÓra says that Drum 'n Bass puts him in the programming zone - for people like him (and me) there are eight good drum 'n bass loops. Or imagine that you're working away on the computer, and you're notified that it's time to segue into a rest break by some nifty Seinfeld-segue-like slap-bass riffs. These sounds are super. I downloaded 303 of them.

Heh - it just happened to me right now. Out of the blue I started hearing ethereal ambient noises. Is that in one of my Firefox tabs? Did I click one of the wavs? Nope, it was the audio break-reminder, playing one of the random wavs. As you can see, it draws you out, ever gently out of whatever you are working on and back into the world, in which you can take your break. (Those particular wavs came from Milco Montagna's Loops Collection Vol. 1, released under a Creative Commons license.)

Downloading 303 wav files also gave me an opportunity to use the dtaOneClick feature of the Firefox DownThemAll extension. I had set it up to queue up downloads for all wavs on whatever page I dtaOneClick'd, so it made it easy to retrieve the wavs I wanted.

Wednesday, March 07, 2007

(Windows) Simple Exposé implementation using an AutoHotKey script

It took some fiddling, but I now have a kind of Exposé for windows using the free AutoHotKey macro utility. Basically, pressing a hotkey will right-click the taskbar and click Tile Windows Horizontally. Pressing another hotkey will right-click the taskbar and click Undo Tile:

screenshot

Actually it has one advantage over Exposé (though beauty isn't it): You can continue to work with windows in their miniaturized state. (And you can always use the Undo Tile hotkey to return them to the original positions).

Here's the script - you'll need to download AutoHotKey and adjust the hotkeys/x,y coordinates for your keyboard/monitor:

Browser_Home::
CoordMode, Mouse, Screen
MouseClick, right, 1260, 1196
Sleep, 100
CoordMode, Mouse, Relative
MouseClick, left, 1300, -95
Sleep, 100
return

Launch_Mail::
CoordMode, Mouse, Screen
MouseClick, right, 1260, 1196
Sleep, 100
CoordMode, Mouse, Relative
MouseClick, left, 1300, -49
Sleep, 100
return

(Windows) Flickr Notifier - the first RSS notifier that displays images

Have you ever wished you could track your friends' photostreams in real time? That as soon as your friends published photos, they would pop up on your desktop?



Presenting the Flickr Notifier. Actually it handles any RSS feed, not just Flickr RSS feeds. I believe this is the first RSS notifier that displays images.

Now you don't have to go to your feedreader to view your friends' photostreams - which may have too many photos to digest in one sitting. With this notifier, the pictures pop up on your desktop as shown above, in real time. So you can see what Nancy is baking, after she pulls it out of the oven. You can see what Paul's photo-of-the-day is, after he takes the snapshot.

This notifier is based on the open-source Java RSS Notifier project. It didn't show images, so I dove into the code and added them. Works fine for text feeds as well:




Download


Notes:
- Download the file, unzip it, and add rssnotifier.bat to your startup files
- I don't think it supports Atom (as a workaround, you can wrap your Atom feed in a FeedBurner SmartFeed)
- Fully configurable: height, width, feeds, etc.

Sunday, March 04, 2007

Monotype Corsiva bookmarklet

For fans of the Monotype Corsiva font, here's a bookmarklet that will change the font of the current webpage into Monotype Corsiva.

Monotype Corsiva

GlassMouse: the do-it-yourself paper-thin mouse

Imagine a computer mouse as thin as a sheet of glass. I'm going to show you how to make your very own GlassMouse using ordinary household items:



You'll need a regular mouse, a CD case, and some tape (or better yet, double-sided tape). Begin by unhinging the transparent portion of the CD case. Then affix it to the side of the mouse with tape:



To operate the GlassMouse, simply rest your fingers on its transparent panel and glide the GlassMouse in any direction. The GlassMouse supports a wide variety of finger positions - you can operate it with two fingers, an open palm, a closed fist - even with the back of your hand:



The great thing about the GlassMouse is that it avoids pronation - the unhealthy upward bending of the wrist that happens with most mice and trackballs. With the GlassMouse, you have total freedom to control the mouse using the hand position that's most comfortable to you.

DailyLit - a great idea - emailing you a page a day from the Great Books

I am so loving the DailyLit service, which emails you a page a day from books you choose. I cannot believe that I am actually reading the weighty tome War and Peace; and having begun, I cannot believe that I have gone so long without it. It has very little to do with war or peace - rather it is about romance, and drunken bets, and duels, and everything else that makes a soap opera addictive.

And today I received the first page of the Life of Johnson - another one of those classics whose dull book covers repel you from the bookstore aisle, yet contain fascinating and amusing stuff inside.

The 360 books in the DailyLit Classics section are called "classic" for a reason - it's because there's good, page-turning stuff inside.

Saturday, March 03, 2007

Proportional programming font: Monotype Corsiva

Two new things I'm trying:

* Quill Nib auto-clicking software (automatically clicks when your mouse stops moving). Steeply priced ($75) - I may be able to make do with its earlier freeware version (MouseTool) once my trial period expires. Seems a bit more responsive than RSIGuard's auto-clicker. Plus it has a gesture for dragging.

* New proportional programming font: Monotype Corsiva 30pt, available on many computers. Here it's shown with jEdit's Dessert theme:

Screenshot of Monotype Corsiva as programming font

Friday, March 02, 2007

(Windows) Treemap visualization of memory and CPU utilization

Panopticon Explorer is a free Windows tool for visualizing memory usage and CPU utilization. Memory usage is shown as a treemap: the more memory a process consumes, the bigger its box on the display. CPU utilization is shown with color: the more CPU, the redder the box.



Tips:
  • To see the memory/CPU display, go to Favorites > Shortcuts > My Processes
  • Turn off the menus and sidebars by clicking the icon at the lower-right corner
  • Save your configuration by clicking File > Save Workbook. You can then double-click the file and it will show the tool with the menus and sidebars removed, etc.