Tuesday, September 29, 2009

The Perfect Alepin

I think everyone has their own version of the perfect application to store all of those information tidbits. The time before last when I went looking for mine, I picked Alepin. Since it has been sold and hasn't been updated, I had to pick another (Journler), but I still miss the good parts of Alepin. It's easy to dream while your product is in update limbo, so here's my sorted list of enhancements to make Alepin perfect.

  1. Spotlight support. This is a deal-breaker for me. Without Spotlight, I have to launch an application to find my memory. With Spotlight, I just search from the menubar and find any tidbit in any application (with a Spotlight importer).
    • QuickLook makes filtering Spotlight results just that much easier.
  2. I want per-page tags, preferably OpenMeta tags. I suppose the new developers would have to worry about which file systems don't support extended attributes (like Dropbox, SMB mounts ...) so I guess Alepin needs a hidden file for that, making it less clean. Or a warning "Tagging only supported on ..." but that doesn't catch a Finder copy that causes data loss. So they need duplicate tagging, OpenMeta where supported and a per-document-bundle hidden plist. And a method to sync those as needed.
  3. I always wished for the internal structure to match hierarchy, meaning "Show Package Contents" in the Finder would have the same nested folders as Alepin's display, because then I could duplicate page names (Hotels in both the Asheville and Wilmington folders in Travel.alpn), and because then the "recoverability" if an Alepin doc gets corrupt is essentially perfect. All cases were my own fault and easily recovered, but I have had my Alepin documents get corrupted.
    • This could go interesting places, in that Alepin becomes a browser to a folder of RTFD, especially if metadata like tags goes on the file and the safety file can be re-created from the component documents.
    • Add in textutil's ability to convert to rtfd ... this could go many places. I haven't thought this all the way through, especially since it's not how I would use Alepin. I'm happy with its Import and Export (to nested folders that aren't in its internal hierarchy!).
  4. Fix bug where editing a internal component rtfd (using "Show Package Contents" or found because of my tweakings for Spotlight) with TextEdit would cause the whole document.alpn to be corrupt on next launch. Since it showed up in a search, a proper Spotlight importer would help here too; but Alepin would need to be able to open an Alepin document in context to fix it well.
  5. Fix bug where password-protecting an Alepin document on one Mac, copying (well, bbouncer-approved rsync-ing) that document to another Mac and trying to open it would show the corrupt message. Yeah, apparently I can corrupt documents like nobody's business.

I love(d) Alepin, but I need to be able to find and use what I've stored, in a format with easy recoverability from corruption, with solid import and export choices, preferably document-based. I tried (and bought) Circus Ponies, but since then I bought and am using Journler instead because it just feels easier.

Sunday, September 27, 2009

I Miss My Boys

I have an "All Hands" meeting tomorrow, so I just drove home from the coast. I left my boys with Daddy so they could enjoy more time at the coast, another boat ride, maybe play on a sandy beach. I cannot possibly explain how hard it was to leave them behind. The hormonal sense of bereavement was excruciating. I think what I learned is that I can't possibly get divorced. I have no reason to (thank goodness! we all love Daddy!), but even if I did, I couldn't bear to leave my children on a regular basis. It was brutal. For some reason I can go to work in the morning, but this "optional" trip when I came home a day earlier is rough. I wonder if it's because Cale nursed right before I left so all of my "mom hormones" are up.

Wednesday, September 23, 2009

LeapFrog is afraid of beer

Really! The educational company LeapFrog is afraid of beer! I was trying to figure out why neither of us could enter Cale's name in Karston's new Leapster2 (he played with Nadia's in July and picked it up easily). Finally I found the answer from the company, and the example was very helpful ... can't have ALEX because it contains ALE, so that explains why we can't have CALE too. Their workaround works, too. And it got me out of the endless loop of the doggone thing asking me to enter a profile name but not accepting it! We were sure it was a bug, but it really is a "child protection feature" *argh*! In their defense, they are using "a popular third-party filter" and they did document the problem. Another non-bug: you can only delete a name when all three name slots are filled.

Karston's been playing with it for less than a day so far, but he loves it. (And he loved Nadia's all that weekend.) I think it's a flexible (since spanning ages 4-8 covers a lot of changes), expandable (SD slot) learning toy.

Tuesday, September 22, 2009

Root Beer Pancakes

I made a half-batch of Root Beer Pancakes this weekend, with 1/4 cup of mashed banana as the egg substitute. The report is that the griddle needs to be hotter for these pancakes, to get the yummy crispy edges and to avoid a gooey center. Since my root beer was going flat, I added 1/4 teaspoon of baking powder. Cale had to have one as soon as he saw pancakes, and he had to do a lot of blowing. He definitely understands that hot foods need blowing!

1 cup root beer

1/4 cup puréed banana

mix together

2/3 cup all-purpose flour

1/3 cup white wheat flour

1/4 tsp baking powder if the root beer is flat

sift into wet stuff, then stir together without overbeating

This makes a thin batter that needs to be on a hotter griddle than most pancakes. Then it makes somewhat thin pancakes with tasty crispy edges and soft middle. The root beer flavor came through (as did the baking powder, barely), so I need to adjust it for perfection ... like maybe using regular beer that isn't flat so I can skip the baking powder.

Monday, September 21, 2009

Stevia In The Raw: I should've known better

I decided to try stevia as a sugar substitue, just to see. I bought a small box of Stevia In The Raw to see how it tasted. The problem with most artificial sweeteners, all except Splenda so far as I know, taste like rotten lemons to me. Not just not sweet, but sour gone bad! Yuck! Well, Stevia in the Raw, and presumably all stevia, hits another one of my taste bud quirks: I strongly dislike the taste of anise, the flavoring of black licorise. We had anise plants when I was growing up (it looks like dill, and like dill, grows like a weed), and even the plant and seeds smelled fake to me. Anise just strikes my tongue as wrong, fake, weird, icky sweet. So if I had read the box that says they've removed the licorise aftertaste, I would have known that it's not possible to remove enough of that aftertaste for me.

Luckily, since I dislike throwing away food, the taste is masked in my granola. I use two packets of Stevia in the Raw instead of six Tablespoons of brown sugar. With the other yummy flavors and three cups of oats, I don't taste licorice. So I can use it up, and not do that again.

Friday, September 18, 2009

What I Learned Today

It's a little thing that comes from trying to wing it and not having a reference book, but I learned that Javascript's setTimeout is a delay before the command the relevant command, not after. For some reason I wanted it to be the sort of timeout that means to bail out of starting that process if you don't complete it within the time interval. It's not. It means run that command after a delay of this many milliseconds which is a different creature entirely.

setTimeout(thatCommand, this)


Once again, the local "co-op" grocery store (yes, the one that's usually about $1 per item more expensive than Whole Foods for the things I get) is cheaper than the presumably cheap grocery store. Years ago, Mary and I compared Quaker Oats from Food Lion to bulk oats from Weaver Street, and WS was about half the cost per pound. This time I compared the per-pound prices of dry roasted peanuts and walnuts: $2.98 and $5.24 at Wal-Mart, $2.49 and $4.99 at Weaver Street. So don't assume too much ...

Wednesday, September 16, 2009

Not an Intruder

So yesterday evening, hubby tells me that a house down the street was broken into last week during the day. I was just playing with Cale in the living room when I heard some thumps from the other end of the house. Whoops! Time to investigate! Since I was on the side of the house with all the doors, I wasn't too alarmed since it would be hard to get in my house right now without me noticing. But, ah, it was still time to investigate heavy mystery thumps. It turns out that Cale had turned on Roomba who is quite creative at getting stuck in unusual places. Roomba can escape the normal obstacles, but in this case had rather noisily climbed inside the sturdy metal circular base of the nursing rocking chair ... a regular Roomba prison!

Opt-out of Time-Warner/RoadRunner's DNS Hijacking

I am opposed to ISP DNS Hijacking for many reasons (DNS needs to be trustworthy, DNS needs to follow the RFC standard and return "Not Found" as specified especially since my browser would then tack on ".com" for me, I already pay TWRR more money for less bandwidth than most other developed nations so I resent this standards-breaking monetization), but luckily today I found the opt-out page. Thankfully it's easier and less intrusive than Comcast's opt-out.

A bright spot on a rainy day!

I was about to use the hosts file, like this tip. The bazooka approach would be to download this impressive ad-blocking hosts file and add http://ww23.rr.com/ to it.

Tuesday, September 15, 2009

Debugging Expect programs

So far, the best way to debug Expect programs seems to be to append " -d" the #! line. The output is confusingly verbose, but if I work through it one glob at a time, I can usually figure out what's going on.

Right now, it's that it's matching too early. So I think sleep 5 may be the needed breather.

PBworks migration

It was a good ride while it lasted (I was an early adopter), but it was time to move off the PBworks (formerly pbwiki) boat. My site was hard to read on my iPod touch, and the new 2.0 migration took away my ability to edit from my touch. I do most of my "personal" web browsing from my touch while Cale is nursing, but I don't do it often enough to want to pay for that feature. (I'm not fond of the 2.0 look either. I prefer simple. I think I'll be happy, possibly happier, with jottit, simpler than a wiki, and wikidot, so customizable and lovely page tags with a flying tag cloud, instead.) I decided that a lot of what I had in pbwiki didn't need to be online, so I decided to move it to Journler. I wish it were Alepin, but I want tags and Spotlight.

First I downloaded all of my files from my site (fill in your workspace name). I noticed that the zip file preserved the file modification times! Bonus!

I didn't like how Journler imported HTML (as an attachment to an otherwise-empty entry), though, so I decided to convert to RTF instead. I was sure it had to be easy on OS X, so after discarding non-simple Google results, I found textutil! Score!

I opened Terminal, and changed to the directory of my HTML files.

textutil -convert rtf *.html

mkdir rtfdir

mv *.rtf rtfdir

That was a nice start, but I lost the timestamps! I was sure I could keep those, and I know touch modifies timestamps ...

cd rtfdir

for filebase in $(ls *.rtf | sed 's/\.rtf$//g'); do touch -r ../$filebase.html $filebase.rtf ; done

Now to import into Journler ... no problem: my data are in the entry (not attached to it), and the timestamps are preserved as creation date! Not a bad piece of command-line tomfoolery to get exactly what I wanted without touching each file by hand. I like textutil!

Don't get me wrong: I think PBworks is a great service, and I don't think anything bad about it. But I know what features I want, and it was time for me to move on for my needs.

Tuesday, September 8, 2009

Anthony Bourdain Told Me So

I went to a nice Italian restaurant for lunch today. I told myself I had to order something other than my usual (rut) this time, and I reminded myself that I've always enjoyed the weekly specials. So when I saw the tuna panino on the weekly specials menu, I ordered it. To be honest, what drew me in was the toppings: arugula and roasted red peppers, one with a kick and the other with the mellow. I love those!

Anthony Bourdain says never to order fish on Monday. Since yesterday was the Labor Day holiday, today is a virtual Monday. And I ordered fish. And I've been going to the bathroom roughly once every other hour ever since lunch. I can hear the I told you so, and if I had remembered the virtual Monday-ness, I wouldn't've done it.

Come to think of it, it's been years since I've been happy with my food order when I've told myself to order something different before I saw the menu. Maybe the lesson is not to fight the rut: if the menu tempts me away from The Usual, I should branch out, but otherwise ... might be safer to play it safe. And I always order taco salad at Mexican restaurants because I want the largest pile of lettuce. (I love salad, mostly for the greens.) Last time I made myself branch out at a Mexican restaurant, I really missed the tall stack of fresh vegetables to lighten the meal.

Friday, September 4, 2009

Little Mysteries

Some days have little mysteries.

I was happy to learn the bash trick ${0##*/} to skip using basename (don't need to add dependencies), and once I learned more about bash substring removal, it made perfect sense. $0 (or ${0}) is the script name, as called, often with leading directory information. You need curly braces for substring removal, so start with ${0}. Use # for stingy prefix matching (the smallest match from the start of the variable), and ## for greedy prefix matching (the largest match). So ##*/ is the largest match of any character than ends with a slash. Since / is the directory separator, that greedy match removes all leading directories from the script name ... same as basename, but should be faster.

OK, so I feel like I've learned something! A small trick, but it weans me from excessive sed and awk too.

Yesterday's neat trick was shoving all of my command-line arguments into an array. Why an array? I kept losing the quotes around a string with spaces (user comment) with unexpected script results. This is why I test my scripts! So I don't have to worry about shift eating the script input, I'm in the habit of storing that input in a variable for safe-keeping; I'm now tinkering with an array for that purpose. (Yes, the implicit shift of getopts can be overridden with OPTIND=1, but $ARGS is immune to other tactics like set too.)

# save the args


# or put the args into an array, space-preserving

typeset -a ARGARRAY=("$@")

The ARGARRAY is great: although I lose the quotes from the command line, the user comment is a single element in the array so it's safe as long as I quote that variable when I use it. But back on the bash string replacement track: using the command-line input argument array, I quickly noticed that the flags starting with a dash (hyphen) disturb some string matching routines. So since I know about greedy string matching now, I thought this should work:

typeset -a UNDASHEDARGARRAY("${@##-}")

It doesn't work. It still doesn't work when I escape the hyphen UDAA=("${@##\-}"); either way, the result is just the same as the stingy removal of UDAA=("${@#\-}"): just the first dash goes away. Phooey.

The only approach I've found that works is to use the substring removal twice in a row.

typeset -a UDAA=("${@##\-}")

UDAA=("${UDAA[@]##\-}") (also works with single octothorpes instead of pairs)

What also works is the overkill of removing all hyphens, leading or trailing or internal, with either

typeset -a ONE=("${@//-}") TWO=("${@//-/}")

However, internal hyphens don't mess up string matching, and might be significant. One or two leading dashes indicate a flag, an option to the command; any other dashes might be useful.

So my little bash mystery today is why these two arrays are the same with --long-flags:

typeset -a FIRST=("${@#-}") SECOND=("${@##-}")

I don't like these mysteries, but I know when it's time to get back to work. I have a work-around, so I'll use it.

UPDATE 14:09: looked at the strip_leading_zero2 () example function in the Advanced Bash-Scripting Guide to strip possible leading zero(s), and came up with a dash-prefix-stripper that works in one operation:

shopt -s extglob

typeset -a UNDASHEDARGARRAY=("${@##+(-)}")

I'll ponder that one, and check extglob before set then unset it after.

Thursday, September 3, 2009

September = Fall

I didn't know the weather was watching the calendar, but just as soon as the calendar flipped over to September, the weather turned into Fall. Usually summer has a long tail, Indian Summer, maybe a fall snap and then summer comes back for a few weeks ... but this looks like Fall is sticking around.

I love fall weather (early fall weather while it's still reasonably warm), but it's always so poignant since I know that cold winter weather is just around the corner. However, winter isn't as much of a drag in our house with a pretty view (I didn't know home location could make that much difference!) and with two kids enjoying it so much!