Being a Mac OS X, Python and Cocoa fan, I decided to combine all three and try out PyObjC in Leopard. It's all built in so I found a tutorial on Apple Developer Connection that goes through a very simple app. The problem is it is outdated. Interface Builder and even XCode are updated and the screens are different.
I followed the tutorial as well as I could and ended up with the following error:
2007-12-15 00:23:53.175 pyave2[21268:10b] Unknown class `Averager' in nib file, using `NSObject' instead.
2007-12-15 00:23:53.203 pyave2[21268:10b] Cocoa Bindings: Error accessing value for key path numbersInput of object (from bound object with object ID 375 in Nib named MainMenu.nib): [ valueForUndefinedKey:]: this class is not key value coding-compliant for the key numbersInput.
2007-12-15 00:23:53.204 pyave2[21268:10b] Cocoa Bindings: Error accessing value for key path calculatedMedian of object (from bound object with object ID 383 in Nib named MainMenu.nib): [ valueForUndefinedKey:]: this class is not key value coding-compliant for the key calculatedMedian.
2007-12-15 00:23:53.205 pyave2[21268:10b] Cocoa Bindings: Error accessing value for key path calculatedMean of object (from bound object with object ID 381 in Nib named MainMenu.nib): [ valueForUndefinedKey:]: this class is not key value coding-compliant for the key calculatedMean.
Notice the Unknown class `Averager` in nib file?
That's our problem. The Python Class has not been imported. I opened up the generated *AppDelegate.py file and added the import and it worked!
Here's what my pyave2AppDelegate.py file looks like:
#
# pyave2AppDelegate.py
# pyave2
#
# Created by tbye on 12/12/07.
# Copyright __MyCompanyName__ 2007. All rights reserved.
#
from Foundation import *
from AppKit import *
import Averager
class pyave2AppDelegate(NSObject):
def applicationDidFinishLaunching_(self, sender):
NSLog("Application did finish launching.")
If there's enough interest I'll break out Skitch and completely rewrite an updated version of the this tutorial with XCode3 and the latest Interface Builder.
It's sort of sad to see CompUSA closing... and then again, I think back on the last, man... I'd say at least a dozen trips I've made in there...
... haven't bought a thing.
It's crazy but the sticker shock is so incredible, that I just lose my tech appetite. I know that I've learned to control my impulse buying habits the past decade of my life. CompUSA pricing doesn't even start to tempt me.
I do regret the loss, but I don't believe they made many efforts to compete. Case in point... The last few times I've gone into Barnes and Noble... a bricks and mortar with formidable online competition... I've walked out with items I could've bought cheaper online, but I like what Barnes and Noble does. I like what they provide. I think they compete well. Their biggest problem is they are a 15 minute drive to reach their nearest location (in fact I'm smack dab in the middle between 2).
It's extremely maddening to think about the IT supplier options I'll be left with. All you folks within an hour of a Fry's can tape yourself to the ceiling.
So some of the work I did yesterday ended up being throw away code. That's okay though because I had goals and I learned a bit more about how ReL has this thing setup and PHP as well.
If you login and check out blog management and moderate the comments on one of your posts you'll see that no longer are you presented with delete links per comment. You get a check box. There is a master toggle... to turn on/off all checkboxes for comments. This makes it easy to clean out spam.. until I figure a way to get some of the comment spam filters installed.
So the mass delete all comments has gone out the door and the new system is in place. It worked well... the one day it was installed... hehehe.
Also, when you delete comments you return to the delete comments page. You used to go back to blog management.
I really dig what I ended up with.
Still a few things eating at me though...
The dead add comment link that appears after you've added a comment. Nuke the link altogether?
UPDATEAlter comments and add a spot for IP address collection... so spammers can be blocked once they've used an address (block?). This could be more bandage talk.It's in there just waiting to be populated!
I'd like to put IDs and classes on all elements in the entry template to allow for full customization. A better idea might be to allow folks to build their own template given a few vars and go hog wild. Include in other sites? Dare to dream I suppose.
Anyway, you all know it could be years before I get a Blogotomy coding bug again, so ask now or hold your peace until next time.
I couldn't think of any better names... but... this has been on my list for a long time.
I've added links to the bottom of everybody's blogs that will go forward and backward 10 entries. If you try and go further back than 0 then you just get 0. If you try and go back a billion entries, you get no entries.
Anyway, I hope someone besides me finds this remotely useful. There are times when I want to go back in time and see what I've written in the past.
I'm taking suggestions on features while I'm working this weekend. If you've been itching for something... it's a good time to ask.
I suck at PHP, so it's probably somewhat hax0r, but in your blog management screens under moderating comments you can now nuke all comments for a given article.
Tonight I'll work on allowing you to select multiple comments to nuke as well.
Each December I take a long hard look at my vacation days that are about to go *POOF*. I get to roll over 5 days, or 5+1(per year of employment) or something like that. But about 2 weeks goes buh-bye. Frankly, for most of engineering, there's no such thing as a good time to take a vacation. I have to take the week off for Beaver, Utah, the trip to Hades with all the in-laws... (which is totally unfair. I have more and more fun there each year.) But other than that it is kiss off the days off.
I do make meager attempts in December to stash in days off... which usually means add additional days to work from home.
So in my attempts to actually enjoy my time off this year, I've made a shortish list of goals I wish to accomplish by year's end... well through the holidays anyway.
One of those goals is to fix up our comments system here. I seem to get spam bombed from time to time, so I'll be looking at reinforcing some checks. Depending on how ambitious I get here's a breakdown in order of importance, that I'll be following:
Nuke all comments for a given entry
Checkboxes in management to allow you to individually select comments for deletion
turn off comments for an entry
turn on moderate comments for an entry
turn off anonymous comments(entry, account)
More than enough to keep me busy.
There is one hangup though. Blogotomy is ancient in beta years... How much effort should I really be putting into this?
I'm interested to hear about your thoughts on personal blogs, and whether or not you see Blogotomy as worth the effort anymore.
Note: I'm not interested in your porn links and pharmaceutical ads. Spammers are terrorists.
Loren brought his laptop by to show me Hulu today.
They've got their work cut out for them. But hey... we were there once... no... on second thought I think we skipped where they're at right now. That was 3 years ago so I forget the details.
My ISP has graciously granted me my own network block of addresses and that means I have to move off of my old addresses. While I never anticipate downtime, there is always a chance.
If you notice a loss of service at Blogotomy, please email me at tbye[removethispart]@tbye.com.