Archive for the 'geeky' Category

RegCreateKeyEx on 64-bit windows

Thursday, August 18th, 2011

From the you learn something new every day department:

I wasted all kinds of time this morning fruitlessly searching my computer’s registry for the subkey my app was creating. Long story short: win32 API RegCreateKeyEx() behaves differently when running on a 64-bit OS. Specifically, it locates your specified subkey under a Wow6432Node subkey under the standard toplevel subkeys [SOFTWARE etc].

For instance, code which specifies:

HKLM\SOFTWARE\ACME\myApp

when run on 64-bit Windows would end up with the subkey:

HKLM\SOFTWARE\Wow6432Node\ACME\myApp

[wow indeed] Guess I’ve got a little research ahead of me.

wasn’t born to follow

Saturday, August 13th, 2011

janice kim

Janice Kim (3P) presented this interesting configuration during one of her recent lectures at last week’s 2011 US Go Congress. According to Kim, most typical go games can be simplified to this basic division of the board into quadrants. She then uses this snapshot of the game to illustrate what happens when one player approaches on the second line towards the opponent’s territory, and the opponent blocks. Repeated four times, the player who initiates the approach moves takes the lead by 4. However, if the opponent does not blindly follow by responding to each move but instead takes a move of his own, the game remains even.

Nice illustration Janice!

nail repair tip

Saturday, July 16th, 2011

As a guitar player, I use my fingernails as little string pickers (I finger pick rather than strum with a plastic pick). So when I split my right thumbnail going through airport security, the result was that I couldn’t use my thumb for playing guitar. This is a major problem if I want to play.

I mentioned my torn thumbnail to my guitar teacher in an email, and he replied:

‘You can just cut up a tea bag and place it over the crack as a patch and then super glue on top.’

Long story short: I tried it and voila — it works! I just played a little Bach using all my picking fingers. Cool tip, thanks to JW.

android text file editors mini-review

Sunday, June 26th, 2011

text icon I keep notes in text files on computers. Lots of them. Since I will be taking my android phone with me to Europe tomorrow, I copied my travel notes file to my phone and then realized there was no built-in text file reader.

I searched the market for ‘text reader’ and found an app called CoolReader which listed tons of ebook formats as well as good old text. I downloaded and installed it, browsed to the folder with my file, and CoolReader displayed zero files in that folder. Zero, zip, nada, none. Perhaps files need special name formats for this brain-dead app. I don’t want apps to dictate what to name my files.

Uninstall and back to the market.

Next I found an app called ‘Text Edit’. This was less ambitious, it didn’t claim to read every ebook format under the sun but was intended for simple text files, which was just what I needed. As a bonus it lets you edit as well. Download, install. Browse to folder, click my file, open. I can scroll through the whole file instantly. Nirvana. I review my file several times during the course of the day, and it makes me smile.

The next day, I checked out the configurable settings for Text Edit. There’s one that enables auto-recognition of urls and phone numbers that sounded useful, so I checked it and returned to my open file. Strangely, the app hung and I had to force it closed. I relaunched it and it hung immediately. I rebooted my phone, relaunched and it hung again.

Looks like a bug in the app. Sometimes I would report this to the author and try to work with him/her to fix it. But I’m leaving the country tomorrow so no time for that. Uninstall.

Browsing the market I found an app called Jota Text Editor. It claims to support large files. Download, install, launch. Browse to folder, open file, looks good. I’m not messing with the settings (Jota calls them ‘Preferences’) until after my trip — better safe than sorry!

So for now, Jota is my text edit app. Time to get packing!

small greasemonkey script

Monday, May 30th, 2011

I got tired of unchecking ‘keep me logged in’ on Facebook’s login screen, and ‘keep me signed in’ on Goodreads’s signin screen. So I wrote this extremely simple greasemonkey script to do it for me:


/ ==UserScript==
// @name doNotStayLoggedIn
// @author frank brown 30-may-2011
// @description Deselect 'keep me logged in' in facebook & goodreads websites
// ==/UserScript==

var elem = document.getElementById("persistent"); // handle facebook:
if (elem != null) {
elem.innerHTML=0;
}
else {
elem = document.getElementById("remember_me"); // handle goodreads:
if (elem != null) { elem.checked=false; }
}

mklnk updated

Monday, May 23rd, 2011

After 10 years, I finally fixed the ‘/desk=all’ bug in the mklnk utility. All things come to those who wait. Download version 1.6 from the Bamboo Utilities page.

at&t: hands off t-mobile

Thursday, May 12th, 2011

As a T-mobile customer and android developer, I am opposed to AT&T’s proposed gobble of my phone service provider. The main reason, aside from my general anti-monopolistic bent, is from my perspective of an android developer.

While developing my app, I deployed numerous versions to my phone in order to test them on real hardware. I tried to test it on as many different models as possible to assure maximum compatibility. When I tried copying it to a coworker’s phone (an AT&T customer), I discovered that AT&T prohibits loading apps onto their customer’s phones unless the apps are downloaded from the android market.

Clearly I wasn’t going to post my app onto the market until it was finished. Thus, my coworker was unable to help test my app. T-mobile didn’t care who I recruited as testers; AT&T was all about denying their customers that opportunity.

T-mobile 1, AT&T 0. But if and when AT&T gobbles up T-mobile, will policies such as this be changed? All bets be off.

the good, the bad and the mpg

Tuesday, March 29th, 2011

My friend A has reached her final week of preparing for a National Board Certification for teachers. One of the requirements is to submit some videos. She asked for help editing and burning the videos to DVD. I confidently agreed, since I’d found iMovie and iDVD on my Mac pretty easy to use when creating amateur videos before.

Ha.

The video files she gave me were AVI. iMovie won’t import AVI. Luckily, she brought her camera and I was able to import two of the clips directly from the camera. Preparing them for iDVD was simple, if time consuming. Disc one of two was complete.

Unfortunately the clips for the second disc weren’t on the camera, so I asked a coworker with lots of AV experience for advice. He suggested using ffmpeg to convert the AVI to MPEG-2, the standard DVD video format, then edit that in iMovie. I installed ffmpeg on my Ubuntu 10.04 machine and used it to generate the mpg file. The resolution was so bad I couldn’t use it, but my coworker performed the same conversion on his Ubuntu 10.10 machine and that one was perfect.

I copied the mpg to my Mac and discovered (surprise) that the dastardly duo iMovie and iDVD won’t import mpg files either! Drat, foiled again! Apple hates open formats, I keep forgetting.

Googling ‘imovie mpg import’ listed several third-party apps for conversion, but they all wanted money for their software. Bah, humbug, I’m only converting one clip for a friend and she’s a poor teacher.

So I fired up my Fedora laptop and googled ‘linux mpg dvd burn’ and quickly found a post describing how to do it using freely available open source tools.

The first tool is dvdauthor, which I used to create the DVD file structure from the mpg file. Then I used mkisofs to create an ISO image from the file structure.

The final step was burning a DVD from the ISO using good old K3b.

It’s not fancy, there’s no menu and I couldn’t edit it but the video plays perfectly in our DVD player. S delivered the discs to A and mission was (finally) accomplished.

earth, canon & ubuntu

Sunday, February 27th, 2011

1. I first heard Earth (Dylan Carlson’s band) when their CD A Beaurocratic Desire For Extra-Capsular Extraction was playing in Everyday Music on Capitol Hill. I had to ask the girl behind the counter what it was. I was intrigued even more upon learning that Carlson was a friend of Kurt Cobain’s from Olympia, and that the band was local.

Then a couple of months later my physical therapist mentioned he was a fan, and I decided to buy their recordings. I got The Bees Made Honey in the Lion’s Skull because the title and cover art is so cool.

Well, to an old fart like me this band basically sounds like heavy metal Eno. Slow, heavy riffs repeated endlessly. Nice ambiance, but not on my top ten list. OTOH they’re playing a new CD release gig at the Tractor on Thursday, and I’m sorely tempted — I bet they’re killer live!

If you do like this sort of thing, I suggest checking out Sunn O))) who do the same thing but are way more panoramic and less typical.

2. I wanted to scan one of Earth’s CD inserts and clip the band’s logo for illustrating this blog post, but couldn’t because my scanner is a Canon Pixma MP990 aka ‘piece of crap’. Anyone considering this multifunction printer/scanner/copier, beware! The only thing it does well is scan. But, if the printer runs low on ink, it won’t scan! Which is the height of stupidity because you don’t need ink for scanning. The paper feed mechanism the printer uses jams more often than not, and even when miraculously it doesn’t jam, it takes forever to print. Grrrr.

3. The server hosting this blog was running Ubuntu Server 6.06 LTS until a few hours ago, when I upgraded it to 8.04 LTS. Support for version 6.06 runs out in April so I got in gear, gritted my teeth and upgraded the distro. Happily, it took less than two hours and I had no major problems (YMMV). I figured jumping two major versions was safer than going all the way to 10.04 LTS in one leap. This should make it easier to upgrade Apache2, PHP, etc.

sfd mobile hits the market

Wednesday, February 16th, 2011

splash screen I just published my first app in the android market: SFD Mobile. Since I work for the Seattle Fire Department, this was a natural idea for an app. Thanks to data.seattle.gov for making it possible.

Since it’s my first real app in droid-space, I’m very curious how folks like it and what they think. Of course it’s only of interest to Seattleites and/or fire buffs.

I certainly learned a lot of J stuff writing it, mainly JSON and Java. I’m looking forward to writing future apps, after our next home improvement project is complete.

Surprisingly, the Android Market category list does not include ‘public safety’ or even ‘government’ so I chose, pseudo-randomly, to tag my app ‘travel’.