Archive for July, 2008

Commenting Approach

I’m unhappy with the FriendFeed comment plugin. I’m not knocking its author: I think it’s the best that can be done with the current FF API. But it just doesn’t work well as the only way to comment on a post.

So I’ve integrated Disqus commenting. I think I like it better than the standard WP commenting format. I’ll just have to see how it goes. Right now, it’s set up so registered Disqus users can comment immediately; unregistered folks will be tossed into a moderation queue.

I understand that this is mostly academic, of course. I don’t expect to drive much discussion. But it’s still amusing to try out.

Comments off

Quick Note Regarding NSURLConnection and NTLM

As near as I can tell, NSURLConnection does not support NTLM authentication.

So, if you are considering implementing something using NSURLConnection: take a moment to make sure you will never talk to a server expecting you to authenticate via NTLM (which is IIS as near as I can tell) before you waste two evenings doing it.

That being said, NSURLConnection is really cool and I wish I could use it.

For my next trick, figure out how to do this with CFHTTPMessage, which does provide kCFHTTPAuthenticationSchemeNTLM for authentication.

*sigh*

Comments off

Accessing Instance Variables in ObjC

A few months ago, I spent a few days searching around to see if I could figure out how to determine the instance variables on a class in ObjC. I knew it was possible because Key-Value-Coding will do it if it can’t find the well-named accessor methods for a keypath. But all of my searching proved fruitless and I went with a different method of accomplishing my end goal.

Well, it looks like the answer has appeared in my feed reader on an entry from Matt Gallagher’s Cocoa With Love blog:Key Value Information.

I’ll just quote him (from the very end of his post):

Similarly, if you were interested in key value coding that may access instance variables directly, you could use class _getClassVariable to get any instance variables with the same name as the key.

The leading underscore on the method name indicates that it’s undocumented and internal to Apple’s implementation. So using it isn’t necessarily the smartest thing in the world. But sometimes, you’ve gotta do what you gotta do.

Now that I have a method name, I’ll probably resume my search for information on this technique and will obviously report any findings here.

Update: July 29, 2008

I did some poking around in the Objective-C 2.0 Runtime Reference and found the class_copyIvarList function which returns an array of Ivar types. Ivar is a struct containing fields for the ivar_name, ivar_type, and offset. Combined with object_getIvar, I think I would have been much closer to achieving my original goal.

I don’t know why I couldn’t find this before. I guess I was just looking in the wrong places.

Comments off

My other writings

Some friends/coworkers and I have a group blog, Ternary Operator. There’s not a lot there. I guess we don’t have many profound things to say. I’m okay with that.

I’ve written a few things over there in the past which are sort of the “final product” of the stuff here. This is my developer’s notebook and Ternary Operator is the finished product of the results of my explorations and mistakes. If that makes any sense. I’ll probably also do a little cross posting because I’m annoying like that.

Anyway. Link-wise, here’s some of the stuff I’ve already written:

And…er…That’s it. Like I said, there’s a distinct lack of profoundness. That shouldn’t be a big problem here, though, because I’m not interested in the profound. I’m interested in jotting things down as I learn them, detailing frustrations when the technology doesn’t work (or when the documentation makes me think the technology should work in a way that doesn’t mimic reality (or the documentation is just absent)). Basically, I expect this blog to just be more fun.

Comments off

First Post!!one

Hi. Welcome to my dev blog.

It seems common and reasonable for the first post on a blog to explain what’s going on, what the point of this is, and what you can expect. This strikes me as a good idea, so here goes.

My name is James and I’m a developer by day. And a developer by night, actually. Like many programmers, I’m very fortunate to have a job which is also my hobby and to get paid for doing something I’m passionate about (and would probably be doing any way).

Unfortunately, while I absolutely love my job, my duties there do not intersect 100% with my actual interests. So I do a lot of programming on the side on evenings and weekends (mostly poking around at new languages and APIs). This is a place for me to talk about what goes on during the evenings and weekends.

Since this is all just for fun, I tend to jump around from project to project and idea to idea (rarely finishing anything). If you’re interested only interested in some of it, you can use the tag cloud over there on the right to provide a basic filter. Also, since most of what I do is bog-standard coding, there’s not going to be a lot of content here. I don’t think “I made a method!” posts would add much to the Internet, so there’s not going to be a lot of content here. RSS is highly recommended (of course, anyone reading a dev blog probably already worships at the alter of twin gods RSS and ATOM. I’m sure I’m preaching to the choir).

A list of my current projects (and future project ideas!) is available.

Content wise, I expect there to be a lot of Objective-C, Cocoa, and Carbon discussion. I converted to being a Mac user a few years ago, but have only recently started attacking it from the dev side. It’s mostly what I work on at home these days. But who knows where things will go?

As for commenting…since this is a new venture, I’ve decided to try a little experiment and use FriendFeed for discussion. You’ll need an FF account (mine, by the way, is willia4), but you probably already do since the people who read dev blogs also tend to be early adopters. If this doesn’t working out, I’ll look at other options.

I don’t know how you found me, but thanks for reading. I’ll try to be interesting when I’m writing and silent when I’m not interesting. And I think this will be fun.

Comments off