Macintosh, Favorite Software, Project, Journal, UnixMay 22, 2008 9:58 pm

I use certain “boilerplate” text in all of my scripts for work. I use the same toolsets with the same setup in different combinations with different filtering, but getting started is always the same. So far, I’ve been happiest with Idea Knot, but I’ve always wanted to that flexibility in a format I could easily share with others.

So yesterday I started looking for a JavaScript, XML, or PHP way to display external files selectively. I did not find an easy PHP approach with Google. I found an XML merge that I thought would be easiest to configure although a little harder for others to use, but it didn’t work for me. I probably didn’t configure my input XML files properly, although they passed xmllint. I have ideas on what to tweak to get it to work, but I decided instead to maximize my time and move on to what would be easier for everyone (myself included!) to use: JavaScript. I found an excellent tutorial on including other files on a web page, with an example. There’s another example that converts the other file before displaying it. Very cool! So I whipped up a quick variant using my files, and what do you know?: it worked! Since I have no experience with JavaScript, I’m allowed to be surprised that it was easy. I even understand what the code does! Very nice.

On the first pass, I found how to do this with JavaScript with all of the boilerplate contained in JavaScript variables, but that made the monolithic web page so very large. Also, I do update my boilerplate as I learn new tricks and add new toolsets, and updating a monolithic page is tedious to say the least. So that’s when I started looking for a way move from inline variables to external files to store my code building blocks. I feel good about using good code that I understand, and storing my information in multiple external files that will be easy to maintain.

Building the code generation page and moving from Idea Know to external files will take me a while, but at least now I have all of the components needed. This will be a useful tool to share at work!

Project, FunnyFebruary 29, 2008 3:01 pm

Too much fun! Create your South Park avatar! Or Simpsonize yourself! Or (trivia) use the online X-Face converter.

, , ,

Macintosh, Favorite Software, ProjectNovember 12, 2007 9:52 pm

When we were in Wisconsin, I saw Windows Media Center in action. Mind you, I’m not tempted by Windows, and I don’t have the hardware to hook my TV to my Mac. (Actually, I may, if a certain creative idea works.) But if I were to feel tempted, lifehacker mentioned iTheater, and it looks very similar, only it’s free software that runs on a Mac. I can’t wait to see the plugins! (I’ll need to compare it to CenterStage, though.)

,

Tips, Project, UnixJune 19, 2007 12:59 pm

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.

,

Macintosh, Tips, Project, Journal, UnixJune 13, 2007 1:52 pm

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.

,

Macintosh, Favorite Software, Project, JournalJune 11, 2007 10:16 am

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.
    • find ~/Documents -name "*.alpn" -exec mdimport -f {} \;
    • 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.

,

Favorite Software, Project, JournalJune 2, 2007 7:06 am

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!

,

Project, Journal, CarMarch 3, 2007 3:33 pm

I think we’ve finished the test drive phase of this wagon car quest! The short list was Audi A6 or allroad from last time, Volkswagon Passat GLX, or Mercedes E-class. Today we drove the 2007 “Package 2″ (no longer called GLX) Passat wagon, and a 1999 Mercedes E320 wagon. It’s hard to fit in two test drives before Karston’s naptime, but we did it in large part because we don’t have as many questions about Mercedes since we’ve had so many over the years. I have two, my mother had one, Daddy has had two (one current), and his parents have had two (one current). We’ve seen a number of Mercedes, we know what to expect, so we had a short test drive just before Karston passed out for his nap.

What’s funny about my short list (Audi, Passat, Mercedes) is that it’s the same short list a friend of mine had shopping for a small sporty luxury car. (Well, and the list is all German.) The Mercedes won that toss, too. So we’re leaning towards Mercedes for familiarity as well as its ability to be the finalist for everyone else too. I know Mercedes no longer has their legendary reliability going for them so those cars won’t hold their value as well, but if I know that when I buy it, I won’t be disappointed either.

The Passat had a harder ride than I expected; I wanted the air shocks right away. However, I didn’t get car sick in the second row, so it’s not that bad either. Reliability, safety, comfort, all check. Fuel economy 26/31 is quite nice on the 4-cylinder, although I would also want to try a 6-cylinder (without AWD). The price of a new Passat isn’t bad when you remember it’s on a list with Audi and Mercedes (that I would buy used).

The Mercedes was just what I expected. This particular car was missing the second-row head rests and appeared to have some electrical issues (I couldn’t get the seat back to recline at first although I’m very familiar with the controls, and Daddy couldn’t get the sunroof to open even though he’s very familiar with that button as well). I was surprised that the ride on a 4Matic was so similar to a RWD Mercedes, but that was the only (pleasant!) surprise. The only detail that was not exactly as I expected is that the gear shifter felt flimsier than I expect, the shifting didn’t feel solid. However, it was so familiar … mmm … and a nice upgrade from the same model but 20 years old that I already have! So any wagon on the short list will do, but I’m leaning towards replacing a Mercedes wagon with, no surprise, a Mercedes wagon.


,

Project, Journal, CarFebruary 24, 2007 3:30 pm

After a discouraging start, we found a car we liked! We took a 2001 Audi quattro allroad for a test drive. It has great handling! We were surprised that an all-wheel-drive car would be that smooth, but Audi did start that a long time ago (early 80s? late 70s?) and apparently they got it right. The power, while not necessary, was very smooth and impressive. Comfort, check. Safety, check. Reliability (my favorite mechanic recommended an Audi wagon to me, and he drives one himself), check. Very encouraging!

The down side is the fuel economy. Economy drops for AWD, but also for the ride height (I hope the EPA measured at the highest height so that I could get better mileage by dropping the car). But we found a newer wagon we like!

We also managed to knock some other contenders off the short list. Volvo is off the list based on reliability and service. My friend Heather bought a brand new Volvo, and she was driving down the highway on a pretty day with the sun roof open a short time (3 to 6 months?) later when the sun roof shattered. Luckily she had the sun roof open so she didn’t get badly pelted, but that’s not cool. She was right next to a Volvo dealership, so she pulled in for service. New car, it’s under warranty, even if she bought it at a dealership 45 miles away (she was visiting, and about that far from home; I am assuming she bought it closer to home though). The Volvo dealership gave her so much trouble, assuming that she did something to break it (”It was open, and I was driving; how am I going to break the sun roof when I’m nowhere near it?) that she traded it in for a Mercedes as soon as she got it back from that repair. And she’s been happy with the Benz ever since. We had thought a Saturn wagon might be a contender, but they don’t make wagons right now, and the older ones have an appalling safety rating, so Saturn is off the list based on safety. The list shrinks! But has one serious contender!

,

Project, Journal, CarFebruary 20, 2007 4:25 pm

As noted before, our current station wagon needs rear shock absorbers. The shocks are $1000 in parts, and aren’t the only repair needed. And it will still be a 20-year-old wagon when we’re done. That means it’s probably time to upgrade. So last weekend, we did online research about wagons. What we want is comfortable, safe, and reliable, with reasonable fuel economy. We want to be able to put the kayak on top, the dog in the back, and of course the kid in the car seat in the second row. Once I pointed out that we could put the kayak on top of a mini-van if we had step stools, that unfortunately opened up the field even more. Ugh! So many choices!

It took all day Saturday, but we were able to narrow the field. We took a Toyota Sienna XLE for a test drive, and it was awful! It had the poor handling and serious lack of comfort of an old pickup truck! (Zero for comfort.) This was a high-end model just shipped the dealership, and it had exposed flashing (sharp! dangerous for pipsqueaks!) and one of the second-row seats wasn’t even latched to the floor. (Zero for safety.) All of the nicer accents stopped behind the driver, and everything else was cheap-looking plastic. We were very comfortable saying that we would never buy it. Ever. Even for free. My old wagon’s much better than that!

We talked to several people, and it sounds like Toyota quality took a nose dive some time in the last four years. Toyotas at least four years old are pretty good cars! Newer … not so much. In fact, Toyota has more outstanding recalls right now than any other car manufacturer. I think in their rush to be the #1 car manufacturer, they forgot the good features that made them such a good #2.

Since the Suzuki dealership was next door, we also took a Suzuki XL7 for a test drive. The seats were very comfortable, the ride was decent (still a little truck-like), and the fit-and-finish were acceptable. Much better than the Toyota, but not what we’re looking for.

Discouraging start to car replacement. But hey, I can always get this old wagon back in good shape!

,