The Crown Jewels

Er...somethin' like that.

Thursday, December 06, 2007

Introducing Logsessive

So I’ve been using iChat since it debuted, and had the automatic chat logging turned on for most of that. So every time I send or receive an IM, it gets saved for posterity (for better or for worse).

When iChat first started logging chats, it was only naming them with the name of the other person and an incrementing number- chats with me are “Dan Kuehling #2”, “Dan Kuehling #3”, and on. Later on, I think in one of the versions of iChat for Panther, Apple started adding date and time stamps to the chats- “Dan Kuehling on 2007-12-06 at 22:35”. Now, in Leopard, Apple’s finally decided to do the smart thing and sort all of these chats into dated folders, so all of the chats for a particular day are in a folder named something like “2007-12-06”.

Now that’s great, but the obsessive part of me noticed one problem here: The logs that iChat created before Leopard are still sitting there by the thousands, numbered logs alongside dated logs alongside Leopard’s chat folders.

It’s ugly. It’s messy. It’s stupid. THERE MUST BE ORDER!

I had to fix it.

So I’d been meaning to learn Ruby. It’s got some serious fans at PSIG, most notably the group’s young rock-star Victoria :-)

My task was clear- write a Ruby script to sort these free-floating logs into the folders. So I learned Ruby (or at least what Ruby I know now) the way I always do- Google enough to write a really, really simple little test (even just “Hello World” to start), then expand on it. Add string handling and regexes (which work GREAT in Ruby, by the way), filesystem access with the Dir and File classes, and Date handling. Before I knew it, I’d written a script that walked the ~/Documents/iChats directory, read the date out of the filename, created a directory based on that date (if it doesn’t already exist), and move the log in there. Then, after some work on how to get Mac OS X to give up the real creation date of a file (/usr/bin/mdls -name kMDItemFSCreationDate filename is the key), I got the numbered chat transcripts to take the plunge behind their dated counterparts.

So, without further ado, here’s my brilliant Ruby creation:

Logsessive

The name derives from the how excessive it looks to have all of those logs splayed across the iChats directory and the obsessive nature of wanting everything all neat and tidy. Logsessive!

It includes both the Ruby file and an easy GUI application created with Platypus, if you’re just as obsessive as I am but don’t want to look at the Ruby. (But please do!)

So, on the other side of this, I’ve come out of this really digging Ruby. After I finished Logsessive, I was looking around with other things to do with it.

Wednesday, November 28, 2007

iChatting: iPhone SDK Already?

A discussion that Dan Pourhadi and I had over iChat late last night.

This strikes me as the perfect way to get started blogging about my opinions and insights about what's going on with Apple without a lot of effort. Enjoy!

Dan Kuehling:
So the word floating around is that Apple's releasing the iPhone SDK to some lucky ducks early

Dan Pourhadi:
i heard
Dan Pourhadi:
februarys not too far away
Dan Pourhadi:
and joswiak is talking up the sdk like it's the second coming of christ

Dan Kuehling:
It is actually kind of a big thing- since the beginning, I always thought iPhone-as-platform would be huge

Dan Pourhadi:
of course
Dan Pourhadi:
i wrote a piece a whiles back about iphone not just being iphone, but being a whole new ... yeah platform
Dan Pourhadi:
cant remember the word i used
Dan Pourhadi:
whiles is actually a word

Dan Kuehling:
Heh
Dan Kuehling:
You know, I wonder
Dan Kuehling:
What the saturation (as a percentage of capable iPods) of iPod games is

Dan Pourhadi:
good question

Dan Kuehling:
Because I'd think that'd be a good lower bound for the acceptance of iPhone/ iPod touch apps
Dan Kuehling:
If they're sold through iTunes

Dan Pourhadi:
yeah

A few things:

The select "lucky ducks"? Almost certainly Apple's strategic partners- Google, Yahoo, Microsoft, and a very select few small Mac developers who are threatened with losing their heads if they speak a word of it to anyone.

Why didn't they do this before? Why the "Web apps are sweet" nonsense? I think there are a few reasons:
  1. Apple's dev tools probably sucked. I have to imagine that Apple's own tools for development on the iPhone were something cobbled together out of bubble gum and paper clips, just enough to get the stuff written and the iPhone shipped. Then, once 1.0 is out the door, they got the time to forge better tools that might be fit for 3rd party consumption.
  2. They couldn't figure out how to secure it. The iPhone, as it stands right now, runs everything as root. Yeah, really. Keeping an app in a sandbox that keeps it away from the GSM radio without wasting a ton of processor cycles and RAM on something like a Java virtual machine is a fairly tall order. I'm very curious to see what they've come up with for solving this problem. I would hope that it doesn't restrict hardware features unnecessarily ("No, you can't use the accelerometer! Not yours!")
  3. The hackers have done some really impressive stuff. Apple completely underestimated the drive and ingenuity of the iPhone hacker crowd. Just a few examples:
    • Navizon- GPS-like location via cell tower and WiFi hotspot mapping
    • TapTapRevolution- tap on the screen in time with your songs
    • Labyrinth- uses the accelerometer to guide a ball through a maze, like those wooden boxes we used to play with as kids
    Some pretty awesome stuff, really. The folks at Apple finally realized that the insanely clever folks working against them actually had something there.
By the way- looking back on Jobs's comment about rogue phone "taking down the AT&T west coast network", I sort of see what he means. Yes, you can install software on your Treos and whatnot, but if the iPhone hits an iPod-like level of popularity (and it certainly looks like it's going that way), malware for the iPhone will be a huge problem. And yes- hundreds of thousands of iPhones all set to dial a 1-900 phone sex number at the same time would certainly be capable of bringing down part of the AT&T network, and bring in lots of dough for the scammer, to boot.

Anyway, I can't wait for the iPhone SDK to show up and the iPhone software that's out there now to "go legit". Because I have to believe that what we've seen so far is only the beginning...

Saturday, November 10, 2007

Leopard presentation

Hey, folks. If you're here, it's probably because of my presentation at the NorthWest of Us today (2007-11-10). Though it was hard work, it was really worth it in the end.

Here's the Keynote '08 file of the presentation:
http://homepage.mac.com/macprince/leopard.zip

Here's the PDF:
http://homepage.mac.com/macprince/leopard.pdf

Sunday, May 27, 2007

Terror! (Or is that "Terr"?)

So, even further back, an entire blog ago, in fact, I hacked together a little PHP script to display your own version of the government's terror alert level. I had it up on Dan Pourhadi's site for a while, until he switched hosts or something and lost it. It sat in the Software Projects folder on my desktop, gathering virtual dust. About a week ago, I had been playing around with regexes and rediscovered this gem, and set about to rewriting it, basically from the ground up.

The changes:
  • 1 regular expression performed, instead of 2 in the best case, and 6 in the worst case.
  • file_get_contents instead of implode()-ing a file()
  • A simple switch() construct instead of a chain of if/elseifs with regexes
  • Optimized the order of the switch cases by sorting them by how likely they are to come up
So it's optimized quite a bit, and works wonderfully. Then, just today, I made a rather interesting discovery. Some time ago, Mivox used my code (with attribution!) to produce her own version with her own graphics, and used the GD library in PHP to allow the script to output an image directly. That allows you to reference the PHP script as the src of an img tag, instead of having to include the script.
I found that to be a fabulous idea, so after downloading Xcode Tools to compile GD to test it out, I implemented that change in my new version of the script. So:

Terror.php, Include Version
  • To be included using a PHP include()
  • Runs on a server with only a PHP installation
  • May be slightly faster
Terror.php, Image Version
  • To be referenced from an HTML img tag
  • Runs on a server with PHP and the GD image library installed
  • Much easier to reference, especially from outside
Instructions:
  1. Download the script of your choice
  2. Upload it to the desired location on your PHP-compatible server. Remember, the Image Version requires the GD library installed on your server
  3. In the same directory, upload PNG format images:
    1. severe.png
    2. high.png
    3. elevated.png
    4. guarded.png
    5. low.png
    6. (Image Version only) error.png
Then, just reference the script in your pages:
Include Version:
<?php include("terror.php"); ?>

Image Version:
<img src="terror.php">

As the comments in the scripts say, if you use the script on your site, please email me and let me know; my email address is in the comments.

In the near future, I may be posting a few image sets for use with these scripts, since I see that Mivox is a fan of the (incomplete) Dragon Tales set.

Saturday, May 26, 2007

AT&Tingular?

So, way way back, I posted about Cingular becoming AT&T again. Well, it's finally happening, and I still don't like it. There's no "AT&T Mobility" web site, just Cingular.com. The AT&T globe is popping up everywhere, but everything's still orange, not blue. One of my professors (Hi, Prof. Clark!) got a new KRZR with a Cingular logo on it from a "Cingular is now The New AT&T" store, with a SIM card that reports AT&T on the screen.

Wouldja just hurry up and switch it, AT&T? Nobody who doesn't remember the Ma Bell thing is going to hate you more for changing everything really quick, and those who do remember aren't going to hate you any less. No loss, that I can see.

(Yes, I'm still somewhat jaded about the "baby Bells forming together like Voltron" thing. But if they gave me an iPhone, I could be persuaded to forget...)

Clearing House

Behold, the group of old/useless CDs that were purged from my CD case:

21 22 in all.

Slowly, ever so slowly, I'm getting my stuff cleaned up and organized.

Friday, May 25, 2007

Every 5 Months...

...whether I need it or not.

Remember, no promises of regular updates were made.

So, what's been going on with me...

School: Plugging along, headed toward that I.T. degree. One more semester to go. Last semester was my first non-A grades at Roosevelt--2 Bs, in Network Design and Distributed Databases. I didn't try very hard in either one, and still pulled off the B. Nice.

Work: The lab aides are now part of the Educational Technology Resource Center (read: AV department), and the labs are basically no-man's land. ETRC is "don't know", and IT is "don't care". Nothing gets fixed, lab policies go out the door. But it's $8.24/hr to sit and surf on a fat pipe. So I'm staying where I am for now.

Girlfriend dumped me: Okay, so I really screwed up big time, but she won't even talk to me about what happened between us. If she's going to be that petty about it, I don't see what else I can do. It hurt like hell, don't get me wrong-- it still does. But if she can't get over her own...pride? self-importance? feelings for me? ...enough to talk to me like an adult just once, then I don't see why I should pound me head against the wall trying to get her back.

Grandma died: Not a huge surprise-- she was 81 years old and very sick. (Emphysema and lung cancer). Man, though, when they say you can't ever be ready for it, they're not wrong. The thing that's going to haunt me is the fear in my mom's voice when she screamed to me "Are they coming!?" (the paramedics) because she knew her mother was dying.

House still isn't sold: Downturn in the market means downturn in the market, no matter the real estate agent. I think that my mom should just sel the house for whatever she can get for it, take the hit and stop the ever-mounting credit card bills. She don't listen to me, though.

Yeah, that's basically been life. I haven't gone on a shooting spree or offed myself yet, so I figure things must be going okay.

I do post musings, at least daily, on my Twitter stream. I'm going to try to not let this blog fade out, but what happens kinda happens, y'know?

Wednesday, January 10, 2007

iPhoneiPhoneiPhoneiPhone!!!

So, we're all officially feeling the post-keynote RDF buzz, and for a damn good reason.
My thoughts, no particular order:
  • My overall reaction? "OMGOMGOMGIWANTONEIWANTONE!!!111eleventy"
  • This will entirely turn the smartphone market on its ear and turn them from executive toys to something that soccer moms carry. Nokia, Motorola, RIM and the like have the right to be scared.
  • Will I be able to turn off EDGE and use only Wi-Fi for data? Cingular's data fees are huge, especially in pay-per-use, and with Wi-Fi hotspots everywhere, I'll take the free option, thanks. (I suppose I can always call Cingular or hop on their account manager site and get rid of the pay-per-use data on my plan.)
  • What's the price if I won't/can't/don't lock myself in to another 2 years on Cingular? Some have said that it won't be available at any price without a 2 year contract, and others have wondered how Apple+Cingular will force a contract if the phone is purchased at the Apple Store. Maybe I'll get lucky and they'll decide that $499/$599 are the prices before the two year contract, and will come down to $299/$399 after the activation discount. It would make the iPhone more price-competitive with the other smartphones out there, but I wouldn't bet the farm on it.
  • I'm wondering how Visual Voicemail works, exactly. My theories:
    • The brute-force option is the iPhone gets the voicemail alert silently, secretly dials into the user's voicemail and records the message, then presents its own voicemail notification. However, that seems very hack-ish and lazy, and wouldn't require this deep level carrier integration that Apple's bragging about.
    • Another option, and the one I'm most dreading, is that it's data service-based. As in, the network pushes down voicemail messages as audio files over EDGE which are then stashed on the phone. Note my aversion to cellular data above. (Sub theory: This bit of data access is free as part of your iPhone's ordinary service plan?)
    • Yet another option is that they have some way using GSM only to random access your voicemail messages that doesn't use data, (IMO the best option) but how this would work is not something I've got figured out yet.
  • Lack of user-installable applications/widgets would indeed be a bummer, and may or may not be a deal-killer for me. I do, however, very much like Jon's theory on the matter, with one twist. The difference between widgets and applications in the context of the iPhone seems to be almost nil. The Stocks "widget" shown on the iPhone seems to be a straight port from the Dashboard version, and the Weather "widget" seems to only be modified to fit the screen better and allow for multiple locations. Remember that Dashboard widgets can embed Cocoa objects, allowing them much more power than simple HTML, CSS and JavaScript. (Heck, who knows how much of the iPhone interface is written as "widgets" as it is?) So Apple may, eventually, allow developers to write "widgetlications" (my term) for the iPhone, get them signed and put them on the iPhone one way or the other. In fact, the signing may or may not be required, if Apple's got Cingular in the corporate headlock that they seem to. In any event, I followed Jon's lead and filed a bug report, Radar 4918087. Here's what's inside, in case anyone wants to use it as the basis for their filing:
Title: Ability to Develop/Deploy Applications for iPhone
Summary:
Developers should be able to develop, code and deploy their own applications for the iPhone using Xcode. The iPhone's rich software environment and extensive hardware and communications capabilities open up a world of possibilities for third-party developers.

Notes:
see rdar://problem/4917169

Greatest Risk, Greatest Reward

I just learned about this fascinating little piece of Chicago television history.

This is one of those things that's amazing and creepy at the same time. Amazing that he was able to pull it off twice (the second time, uninterrupted by the station) and that he's never been caught. As for the creepy, well, just watch for yourself.

My hat's off to you, though, Max Headroom dude, wherever you are. Very cool trick, even if it was illegal.