Friday, June 22, 2007

PocketMod

Holy foldy, batman! I'm usually pretty handy at paper folding, but I had to watch the video for PocketMod four times before I could do it! Yowzah!

Tuesday, June 19, 2007

Cumulate Draw, Part 1

I've been trying to install Cumulate Draw for a while. The directions seemed deceptively simple. And, wouldn't you know, the problem was before the first step. In fact, before step 0! I noticed that I had a draw.war file while the examples were directories. Interesting! So I ran file draw.war and learned Zip archive data, at least v2.0 to extract. D'oh! Rename to draw.war.zip, unzip, and things look a lot more promising now! I'm still not there, but I have climbed the mountain that I didn't know was there.

The next step is to install Tomcat or some other Java Servlet Container.

Wednesday, June 13, 2007

Starting off with sqlite

I am crawling up to speed on SQLite. Luckily it's easy!

The really easy on-a-Mac-way to create a SQLite database is to use SqliteQuery (freeware). It uses sqlite3 already installed on a Mac, and it gives you a window to enter SQL commands. However, I quickly noticed that SqliteQuery converts everything to lowercase. So, in order to maintain case-sensitivity, I recreated my test database from the command line.

The command sqlite3 is in /usr/bin. That was in my path, so I just needed to give it the SQLite file.

sqlite3 ~/Documents/SQLite/Birthdays.sqlite

To see the table names,

sqlite> .tables ''

To see the existing structure,

sqlite> .schema birthdays

That gives me the SQL code to create the table. The data are

sqlite> .dump birthdays

I ran some awk reality checks, and converted between SQL dump and CSV with sed.

The key concept to sqlite3 today is that the commands that start with a dot (like .help and .quit) are sqlite-specific, while the rest is just SQL (commands that don't start with a dot and that must end with a semi-colon).

Other than creating tables and inserting values (you can see this SQL code when you use .dump table-name), the other useful SQL command is select * from table-name; to see what's in the table.

Monday, June 11, 2007

Alepin with Spotlight

Aha! It's liberating to know I don't have to write a Spotlight importer for Alepin. But being told something is impossible doesn't stop me from trying; I just don't get frustrated when it doesn't work.

This is a really easy two-step process.

  1. Add Alepin to the Rich Text mdimporter.
    1. Following this hint, I ran the mdimport -n -d1 command on an Alepin file to learn that it's type 'com.macchampion.alepin.alpn'.
    2. Run this command: open /System/Library/Spotlight/RichText.mdimporter/Contents/Info.plist to open the plist file with the Property List Editor. (It's a Developer application, so you will need to have installed the Developer Tools.)
    3. In Property List Editor, expand the only triangle (Root) and then the first triangles under that (CFBundleDocumentTypes, 0, LSItemContentTypes). Select the last item (mine was com.apple.webarchive) and hit the New Sibling button. That will fill in the next number and the same String class, and all you need to do is to enter com.macchampion.alepin.alpn, the type from the first step. Save. Quit.
  2. Force Spotlight to import Alepin notebooks.
    1. find ~/Documents -name "*.alpn" -exec mdimport -f {} \;
    2. That command runs finds anything within your Documents folder that ends with the file extension alpn. The mdimport command is Spotlight indexing, -f forces indexing even of what it would normally skip (and regular Spotlight indexing does skip my Alepin notebooks), and {} means on the results of the find command. Oh, and \; just signals the end of what find should execute on the results.

Now you won't get Spotlight indexing of RTFD attachments like pictures in your Alepin notebooks yet, but I'm sure you could do a forced import of those as well. You can list them with a command like find ~/Documents -name "*.alpn" -exec ls -R {} \; | grep -v "alpn\|DocumentInfo\|rtfd\|TXT.rtf\|^$" and then move on to the next idea based on those results.

Saturday, June 2, 2007

Mr. Wood

I didn't think Karston would learn that Mr. Wood was trouble until he was teenager or older. He woke up crying twice last night (yawn), so we changed his diaper to avoid a diaper leak since that's what crying usually means now. Both times I noticed that Mr. Wood had visited him recently, so he was pointing up (high chance of a leak) instead of down (only overflow leaks). So I think Karston knows Mr. Wood causes diaper leaks, and he knows he's too old for malfunctions like that, so he let us know.

Alepin mdimporter Quest

I haven't used Alepin as much since I started using Spotlight more. Off and on, I've been frustrating myself by trying to write a Spotlight importer for it. It's just a package of RTFD files! What could be easier? I thought perhaps I could piggyback on this hint and make the RichText importer do it, but that idea failed. Well, in the case of Spotlight Metadata importer vs file package of rtfd files, the user loses. The bundle is opaque to Spotlight indexing!

I do have an idea to try to get around this anyway because I'm that stubborn, but it'll need to be scripted not manual. In that case, while I'm at it, I should script adding tags to Alepin. That will make everything Spotlight happy. Or I might switch to Journler, but then everything (work and personal, two things I try to separate) have to go in the same folder. But it has Spotlight and tags, two things Alepin needs. And it's free for personal use, so I can dabble with it.

However, at least I know I have to resort to a hack instead of pounding my head against the "write your own mdimporter" wall. That should bring the frustration down on this project. And I think I hack this hack, so that cheers me up!

Friday, June 1, 2007

The Classic Slinky TV Commercial

For years, I've been searching for a classic Slinky TV commercial. I feel like the Internet has finally grown up, because this time, I found it!!! In fact, what's even more amazing, I found several versions in several places! Of course there's YouTube, but there's even the Slinky company itself!

After watching, I had to ask myself why I had been searching. Sometimes I forget why I'm climbing that mountain. However, this time I remembered why. I used to watch Ren & Stimpy with my friend Dan. That show was a real trailblazer in cartoon grossness! When we first watched the Tooth Beaver episode, Dan went to the bathroom to retch because it was just that gross. I was pretty disgusted too, but I was too busy laughing at him retching to have stomach problems of my own. Anyway, one day Dan called me out of the blue to ask if I knew where The Log Song came from. I said, Duh, Ren & Stimpy. I was told the correct answer was that The Log Song was ripping off The Slinky Song. We didn't have a TV most of the time that I was growing up, so I grew up on books. And Dan's guess was correct: I had never seen the Slinky commercial on TV, and I had never heard the jingle. The closest Dan could find for me years ago was another Slinky knock-off (R rated, though); it was pretty funny, but I wanted to see the original. And now, finally, I have!