Underlining Characters in a ToolTip

My product, a toolbar for Outlook Express, uses tooltips to display keyboard shortcuts. For some localization work, I needed to display an underlined character within a tooltip.

The only hint I could find was a reference to .Net tooltips.

Apparently, in both .Net and Win32 tooltips, a single ampersand will be stripped, a double ampersand will cause the next character to be underlined, and three ampersands will display a single ampersand.

Input     Displayed
&B B
&&B B
&&&B &B

Note that this will be affected if the TTS_NOPREFIX flag is set, which prevents ampersands from being stripped.

Posted in Technology, Win32 | Leave a comment

Tartine Bakery in San Francisco

B, T, and I stopped at Tartine Bakery after “Beer Croquet” (which, due to a lack of a croquet set, became merely “Beer” in Dolores Park). I had the bread pudding and a mocha, and both were excellent. The bread pudding had a healthy dose of very tasty fruit in it, and the mocha was extremely well made, not too sweet.

However, as a single eater, I should have gotten the cup of bread pudding rather than the bowl. Two hours of beer plus a huge bowl of bread and sugar equals an amazing stomach ache…


View Larger Map

Posted in Food | Leave a comment

Worst Spam Ever

It’s not even really spam. I assume it’s an attempt to validate random email addresses by analyzing bounces.

Worst Spam Ever

Posted in Funny, Internet | Leave a comment

Entertainment Center Power Consumption

I used my Kill A Watt to measure the power consumption of various items in my entertainment center.

PVR

Antec case, Biotstar TF-7050M2 motherboard, Hauppauge tuners, 2.5″ Hitachi drive.

  • 80 watts peak at bootup
  • 65 watts nominal

Dell 2001FP 20.1″ LCD monitor

(not normally part of my entertainment center, but I was using it to reconfigure the PVR’s BIOS, so it was in the general area)

  • Monitor off: 1 watt
  • Monitor asleep: 3 watts
  • Monitor active: ?? watts

XBox 360

  • Off: 3 watts
  • Starting up: 160 watts
  • Loading GTA IV: 155 watts
  • In-game: 188 – 195 watts

Samsung 32″ CRT television

  • Off: 3 watts
  • Startup: 483 watts (momentary)
  • On: 92 watts
Posted in Electronics | Leave a comment

SSH Key Generation and Conversion With OpenSSH

Key Generation

Generate a DSA key:

ssh-keygen -t dsa

This will generate an RFC 4716-formatted key file similar to the following:

-----BEGIN DSA PRIVATE KEY-----
MIIBuwIBAAKBgQDijfpmyXBZpnq8EhEhSxeJz7fNxIlWYD6t7bviDZMARh8mLCr2
bug2J1K+Rl4qoLQJ7zRGlytwQ2krTCmvVahOjy9m/QW5936rCyVS19PRdJMEEMSN
vLQaMtpKbnHp0z8Xs/X1CkDmxThOlvRVjiObdd0U9eELLoo5VHauVHmufwIVAO7j
l4bxgVXeX09WJcyOXAUauNXHAoGAF20ESXgTvbbdxDECa2tfTi/j1/+emNV/+zuR
aq6xms/K0piZhMlkK3BD9PgHhXfqZuRT/Z9b8ja3nR34H2KL3UInCNV6kSq6h+MD
MLJnNQG4wADLYw3p5Tzz/hUwtfqpZ/9e7FpBdgfooS274GgPKTG8BFRiudIztPpK
4GueicoCgYEAy8hllDrFzQUqFG0kMe8r3dOFDjMQHf6ITttmAiScwEPg+a5D++Sq
bj42vkKSNgaYHc+Z8QPgerPehIkBde6wx0ukq0a8IXy8F86IasXz3wzotPeJsdKi
mynQKzhSm9Jzbk/SK/yh5NGhJzz1VmHsg+ir/qReguMHfqDGCI4kSFYCFDJKXQ4h
MteJHSlu62RrGwInRBOh
-----END DSA PRIVATE KEY-----

An accompanying, OpenSSH-formatted public key file should also be generated under the same file name with a .pub suffix. It should appear similar to the following:

ssh-dss AAAAB3NzaC1kc3MAAACBAOKN+mbJcFmmerwSESFLF4nPt83EiVZgPq3t
u+INkwBGHyYsKvZu6DYnUr5GXiqgtAnvNEaXK3BDaStMKa9VqE6PL2b9Bbn3fqsL
JVLX09F0kwQQxI28tBoy2kpucenTPxez9fUKQObFOE6W9FWOI5t13RT14QsuijlU
dq5Uea5/AAAAFQDu45eG8YFV3l9PViXMjlwFGrjVxwAAAIAXbQRJeBO9tt3EMQJr
a19OL+PX/56Y1X/7O5FqrrGaz8rSmJmEyWQrcEP0+AeFd+pm5FP9n1vyNredHfgf
YovdQicI1XqRKrqH4wMwsmc1AbjAAMtjDenlPPP+FTC1+qln/17sWkF2B+ihLbvg
aA8pMbwEVGK50jO0+krga56JygAAAIEAy8hllDrFzQUqFG0kMe8r3dOFDjMQHf6I
TttmAiScwEPg+a5D++Sqbj42vkKSNgaYHc+Z8QPgerPehIkBde6wx0ukq0a8IXy8
F86IasXz3wzotPeJsdKimynQKzhSm9Jzbk/SK/yh5NGhJzz1VmHsg+ir/qReguMH
fqDGCI4kSFY= user@hostname

Export Public Key in RFC 4716 Format

Given a private key, export its public key:

ssh-keygen -e -f private_key

This will generate a RFC 4716 output similar to the following:

---- BEGIN SSH2 PUBLIC KEY ----
Comment: "1024-bit DSA, converted from OpenSSH by user@hostname"
AAAAB3NzaC1kc3MAAACBAOKN+mbJcFmmerwSESFLF4nPt83EiVZgPq3tu+INkwBGHyYsKv
Zu6DYnUr5GXiqgtAnvNEaXK3BDaStMKa9VqE6PL2b9Bbn3fqsLJVLX09F0kwQQxI28tBoy
2kpucenTPxez9fUKQObFOE6W9FWOI5t13RT14QsuijlUdq5Uea5/AAAAFQDu45eG8YFV3l
9PViXMjlwFGrjVxwAAAIAXbQRJeBO9tt3EMQJra19OL+PX/56Y1X/7O5FqrrGaz8rSmJmE
yWQrcEP0+AeFd+pm5FP9n1vyNredHfgfYovdQicI1XqRKrqH4wMwsmc1AbjAAMtjDenlPP
P+FTC1+qln/17sWkF2B+ihLbvgaA8pMbwEVGK50jO0+krga56JygAAAIEAy8hllDrFzQUq
FG0kMe8r3dOFDjMQHf6ITttmAiScwEPg+a5D++Sqbj42vkKSNgaYHc+Z8QPgerPehIkBde
6wx0ukq0a8IXy8F86IasXz3wzotPeJsdKimynQKzhSm9Jzbk/SK/yh5NGhJzz1VmHsg+ir
/qReguMHfqDGCI4kSFY=
---- END SSH2 PUBLIC KEY ----

Convert Public RFC 4716 to Public OpenSSH Format

Convert the exported public key from RFC 4716 format to OpenSSH format (for use in an authorized_keys file, for example):

ssh-keygen -i -f public_key

This will generate OpenSSH-formatted output similar to the following:

ssh-dss AAAAB3NzaC1kc3MAAACBAOKN+mbJcFmmerwSESFLF4nPt83EiVZgPq3t
u+INkwBGHyYsKvZu6DYnUr5GXiqgtAnvNEaXK3BDaStMKa9VqE6PL2b9Bbn3fqsL
JVLX09F0kwQQxI28tBoy2kpucenTPxez9fUKQObFOE6W9FWOI5t13RT14QsuijlU
dq5Uea5/AAAAFQDu45eG8YFV3l9PViXMjlwFGrjVxwAAAIAXbQRJeBO9tt3EMQJr
a19OL+PX/56Y1X/7O5FqrrGaz8rSmJmEyWQrcEP0+AeFd+pm5FP9n1vyNredHfgf
YovdQicI1XqRKrqH4wMwsmc1AbjAAMtjDenlPPP+FTC1+qln/17sWkF2B+ihLbvg
aA8pMbwEVGK50jO0+krga56JygAAAIEAy8hllDrFzQUqFG0kMe8r3dOFDjMQHf6I
TttmAiScwEPg+a5D++Sqbj42vkKSNgaYHc+Z8QPgerPehIkBde6wx0ukq0a8IXy8
F86IasXz3wzotPeJsdKimynQKzhSm9Jzbk/SK/yh5NGhJzz1VmHsg+ir/qReguMH
fqDGCI4kSFY=
Posted in Cryptography, Technology | Leave a comment

Compiling X264 on Ubuntu

I noticed that HandBrakeCLI displayed this message:

x264 [info]: using cpu capabilities: none!

I thought that, perhaps, I could gain some performance by recompiling x264 directly for my AMD dual-core, 64-bit CPU. It turned out to be quite a task.

gpac

Get gpac (check the project’s download page for the latest version):

wget http://downloads.sourceforge.net/gpac/gpac-0.4.4.tar.gz

Unpack gpac:

tar xvzf gpac-0.4.4.tar.gz
cd gpac

make configuration script executable:

chmod u+x configure

Configure:

./configure

Compile:

make

X264

Install subversion:

sudo apt-get install subversion

Install yasm:

sudo apt-get install yasm

Retrieve x264:

cd ..
svn co svn://svn.videolan.org/x264/trunk x264
cd x264

Copy in gpac headers:

cp -R ../gpac/include/gpac .

Configure x264 and build:

./configure --enable-mp4-output --enable-shared --extra-ldflags=-L../gpac/bin/gcc
make
Posted in Technology | Tagged , , , , , , , , , | Leave a comment

Yay for Ft. Lauderdale Airport

Free, open wireless. Not like lousy Dallas airport, which only has T-Mobile Hotspots ($$$).

Posted in Travel | Leave a comment

Edirol MA-15D ‘Micro Monitor’ Speakers

A random YouTube video reminded me of one of the most disappointing product experiences I’ve ever had.

A few years back, my employer gave us each $500 to spend on office improvements, since we completed a project well under schedule. Since I like to listen to music while I code, and I’m picky about my audio, my first thought was to a good quality speaker setup.

I began researching the topic online. Unfortunately, it seems like most online reviews of these sorts of speakers are written by people with no audio experience beyond the pair that came with their Dells. I’m no fan of typical “audiophile” hocus-pocus reviews, but the online reviews I saw failed to mention noise levels, frequency response, or any other meaningful points of comparison.

In the end, I settled for what was touted as the best value in the ‘Micro Monitor’ world, the Edirol MA-15D. I ordered from MusiciansFriend.com, since they had the best price and a decent return policy.

I was extremely disappointed to find that the sound quality was quite miserable. First, the background hiss was intolerable. I don’t know if other people simply don’t notice it, or if they don’t realize it shouldn’t be there. I plugged the speakers into several audio sources to verify that the hiss was, in fact, from the Edirol’s built-in amplifier. Even with no source plugged in at all, the hiss was exactly the same.

Additionally, they distorted quite easily, and there was no transparency to the sound. Overall, they just seemed like very low-grade PC speakers. A step up from those crappy Dell pod speakers, but honestly not by much.

Luckily, MusiciansFriend.com had a good return policy. I sent the awful Edirols back, and ordered a pair of NHT SuperZero XU speakers, and began scouring Craigslist for a small amplifier. Ultimately, I found a small Rotel amplifier for around $150, which has provided me with fantastic sound for several years.

Posted in Technology | Tagged , , , , , , , , , | Leave a comment

Console Replacement for Windows

The Windows Console is an abomination. In this modern word of mice, cut and paste, and fast video output, it’s slow, painful to use, and ugly.

As it turns out, there’s an Open Source project called, appropriately enough, Console. This project aims to address these long-standing shortcomings of the Windows console.

SourceForge Console application screenshot

Great Things

  • Proper selection without having to go to the System menu and select ‘Mark’
  • Tabs!
  • Tab title updates with name of running executable
  • Customization of the UI: toggle tabs, status bar, menu bar, tool bar
  • Supports copy on select. This will be familiar if you use PuTTY. It means selected text is automatically copied to the clipboard.

Not-So-Great Things

  • Tab title isn’t customizable
  • Colors cannot be set on a per-tab basis
  • Context menu contains a duplicate of the full Window menu, even though you likely only want the Edit menu contents

Overall, I’m very impressed with the status of the project, and I look forward to contributing to it!

Posted in Technology | Tagged , , , , , , , | Leave a comment

Windows Vista UAC Goofiness

Windows Vista UAC is not always a predictable beast.

Today I found out that if an executable doesn’t set level="asInvoker" in its manifest, UAC confirmation will kick in if any of the following substrings appear in the filename:

  • setup
  • install
  • update

A digital signature does not affect this behavior.

Besides adding “asInvoker” to the manifest, another workaround is to rename the executable to remove the trigger word. For example, renaming MyProductUpdater.exe to MyProductRenewal.exe will (for now) bypass the UAC logic.

Note that this in no way bypasses the protections of UAC. Functions which perform some task which requires UAC-approval will simply fail. This will only be useful if you have an update tool which only updates user-owned resources, since that doesn’t require UAC-approval.

Posted in Technology, Win32 | Tagged , , , , , , , | Leave a comment