Wednesday, August 22, 2007

Grapher, Part II

It also seems you can write:

\int_0^1 dx (something)

Also weird.

Grapher is cool, but

For the LIFE of me, I couldn't figure out how to make it perform an integral. I tried adding dx, and then ∂x, but nothing worked.

It's because the program expects the integral to have the same syntax as the summation. So, rather than (TeX notation)

\int_0^1 x dx

You are supposed to write:

\int_{x=0}^1 x

Hopefully, this will be helpful to anyone looking how to do some fanciness with Grapher.

SoC is over!

So quickly... Oh well. You'll see the new applescript system in Adium come version 1.2... Now we just need to merge the changes...

Monday, August 13, 2007

Status Symbols

Adium 1.1 is out. Get it here

Also, AS support has been further updated (to be released in 1.2). You can now access your saved statuses (status "Hi" of application "Adium") and set various accounts to them. You can do quite a bit with them, and I'm very proud.

Tuesday, July 31, 2007

Send

You can now send messages to other people using applescript. Here's a remarkably useful script:

tell app "Adium"
if not exists chats whose contacts contain contact "applmak" then
make new chat with contacts {contact "applmak"} with new chat window
end
tell first chat whose contacts contain contact "applmak"
send message "Hi, Matt!"
end
end

Sunday, July 29, 2007

Effective chat contents

A common request for Adium's AS support is to add a way to get at the contents of a chat. Adium doesn't actually keep track of this. So, it turns out to be a hard problem.

The trick turns out to be reading from the chat logs. But this can be rather slow, as a chat may be very long. So, boredzo is writing an NSEnumerator subclass for me that will parse the logs. That way, I can effeciently traverse them, without taking too much time. That means that 'get message 342 of chat 1' will take longer than 'get message 1 of chat 1', but that's what will need to happen, I guess.

Monday, July 23, 2007

More status changes

You an now query for the status of an account. The result of this query is an enumerated value: available/away/invisible/offline

tell app "Adium"
  tell account 1
    if (get status type) is available
      beep
    end
  end
end

Status Changes

You can now tell any account to 'go online/offline/away/invisible'. That's nifty.

Sunday, July 22, 2007

Not dead...

Just not very good at regular writings. Journals and the like.

I've updated Adium to get rid of this nasty bug that occurs when you tried to close a window programmatically. As it turns out, it's very possible that something in addTabItem (in AIMessageWindow(Controller?) is broken. The delegate isn't getting the required message. A [self _reloadContainedChats] did the trick, but it's just a quick fix, and not a real solution to the problem.

Monday, July 16, 2007

make new chat with new chat window

With help from boredzo, I just added the ability to create chats, without that nasty security hole of before.

Code Reviews

I had my first code review with Adium. Wow! It was a killer. I, in one moment, realized both how amazingly useful and powerful reviews are, and yet how incredibly embarassing they can be.

Oh well. It's a learning experience, right? 

Wednesday, July 11, 2007

Warscrewdriver

Warhammer is not my game. I prefer a good MMORPG to it, but I'm absolutely fascinated by the strategy.

My friend Ailaros, being a man of firm, steady hands and quick wit, has composed 22 (so far) battle reports of his most recent forays into the world of 40k.

Here's number 22

I don't get it.

I am regularly surprised the more I learn about my life and the world I live in. There are many opposing forces that and pushing and pulling at me to get me to think or behave in a certain way.

Take Ann Coulter. I heard about her the first time when a student at St. Olaf. Now, my school isn't exactly liberalism embodied, but the Republican student group's decision to invite her in the spring of 2005 certainly caused quite a stir. Ann had this reputation of being inflammatory and intentionally doing harm to people to press her own agenda. I didn't attend the lecture, but what makes me remember her visit was how the Republicans gloated that they were slowly breaking the liberal bias of the school and that Ann Coulter represented the new way of conducting political business. She gave her speech to a hundred or two students and left.

While I finished school and did a year of corporate work, Ann was busy writing (this, updating this, and writing her columns) and giving innumerable speeches around the country (to students, especially). And I didn't hear about any of that until quite recently, when Ann got into a spat with Elizabeth Edwards on Hardball with Chris Matthews (which I have never watched. Anyone who plays 'hardball' probably isn't going to be someone worth talking to for long, I suspect).

In order to tell you why these are two different ethical codes at war, I will need to abstract them. There are two possible interpretations, I think, which I'll outline here.

One: Ann has been repeatedly harassed for her political views and outspoken nature. Elizabeth's request for defense is another in a series of requests for Ann to go away (as evidenced by the numerous newspapers that have pulled Ann's column, and the advertisers that have pulled adverts from Ann's website). Her only way of resisting such repression is to act even MORE outspoken. The attack on John Edwards is a way for Ann to get her message heard in the face of large obstacles.

Two: Ann while normally debating political views, has gone too far by attacking John Edwards personally, and his wife tries the most direct and civil way to proceed against such an attacker, by asking Ann personally in public (where she couldn't back down). Ann refuses.

In order to see the ethical involved, I will rewrite each interpretation in a more abstract fashion.

One': Person A wants to change society. Part of society doesn't want that change and tries to stop A. In response, A tries louder tactics.

Two': Person B wants someone to stop harming someone she loves. Person B asks the offender to stop . The offender refuses.

In this abstraction it's clear that interpretation One' as a positive feedback loop. As long as the part of society can stop Person A, Person A will get louder, which will make that part of society try harder to stop her, which will make her try to be louder in return. If Person A cannot change society using simple talking, or by insults (louder), the inevitable step is that she will use violence (loudest). This is the logic followed by any group repressed by someone else (the Viet Cong, the insurgents of Iraq, early Americans, early Communists of China, etc.). In cases where words fail, weapons are the next resort of such people, and bloodshed follows.

Now, I don't mean to say that Ann will pick up a rifle any time soon and rid the world of liberals or whatnot. Rather, symbolically, if such attacks intensify, then someone will be hurt beyond repair. Either, she will lose, at which point, she will no longer be a fiery pundit, or she will win, at which point those directly opposing her will suffer. The only way I see of avoiding this is if one or the other group intentionally lets go of the fight, knowing that fighting it out would be worse than having the other person win.

Compounding that though, is that the other people don't see this as an arms race. Interpretation Two' strikes me as rather like what the Bible says about dealing with a problematic church member. It instructs the offended to talk to the person itself, and if they refuse to reconcile to then talk to the church body, and continuing up in levels of magnitude until he has nowhere to go. Then his only chance is to forgive that person, and move on. This kind of attitude is designed not to inflame, but instead to commune. It's the exact opposite of an arms race, and is instead about making a community work. In this regard, Elizabeth's choice to use this tactic against Ann is wise, and thoughtful.

Given these new interpretations of the event, it should be easy to see the pull of these two doctrines on little old me. Ann wants me to rise, armed, to her cause, while Elizabeth wants me to try to resolve our differences. This is what I was always taught is the difference between the Republicans and the Democrats, and I think this example embodies it here.

Monday, July 9, 2007

AppleScript Unit Testing Framework

I've written a basic unit testing framework, written entirely in AppleScript, in order to test those unit tests I've been generating for Adium. It's so simple that it hardly merits mentioning, but it's just so useful. I'll see if I can figure out a way to put in online so others can dissect it.

Friday, July 6, 2007

Contacts

You can make new chats, along with chat windows. This is a very good things, and I'm really happy that I've finally done it!

Next up, running the unit tests...

Tuesday, July 3, 2007

Another day, another check in

I've checked in my code after what seems an eternity.

make uses AICreateCommand.
• You can make chats, though you can't actually see them, yet.
• You can disconnect accounts... connecting is proving to be trickier.

Friday, June 29, 2007

In Cape Cod

I'm in Cape Cod, which I've just realized, is named after a fish.

It was a long drive.

Anywho, I've totally mastered NSCreateCommand now, with my new fixes, and shouldn't have much trouble finishing my previous problems with AIAccount.

Now, I'm on to trying to make a chat, which involves making a chat window... We'll see how that goes...

Tuesday, June 26, 2007

Plan for today...

• Figure out if it's worth trying to override performDefaultImplementation for AICreateCommand to try to get rid of that stupid default alloc'ing behavior.

Yes, it is. The trick is to use a private API method to get the implementing class name. Here's the final code block (edit: while the previous code was nice, the new code is actually useful):

- (id)performDefaultImplementation
{
#warning This uses a Private API
NSScriptClassDescription *newObjectDescription = [self createClassDescription];
Class createdClass = NSClassFromString([newObjectDescription implementationClassName]);

id target = [self subjectsSpecifier]; //handy method from Dustin Voss on applescript-implementors

id r;
if ([target respondsToSelector:@selector(makeScriptingObjectOfClass:withParameters:)])
{
//this can do the insert, based on the parameters, methinks.
r = [target makeScriptingObjectOfClass:createdClass withParameters:[self resolvedKeyDictionary]];
}
else
r = [super performDefaultImplementation];

if ([r isKindOfClass:[NSScriptObjectSpecifier class]])
return r;

return [r objectSpecifier];
}
- (id)subjectsSpecifier
{
NSAppleEventDescriptor *subjDesc = [[self appleEvent] attributeDescriptorForKeyword: 'subj'];
NSScriptObjectSpecifier *subjSpec = [NSScriptObjectSpecifier _objectSpecifierFromDescriptor: subjDesc inCommandConstructionContext: nil];
return [subjSpec objectsByEvaluatingSpecifier];
}

My friend Matt...

...is sitting next to me, and is trying to comprehend blogging. I can't quite figure out how to explain it to him.

Any suggestions?

Monday, June 25, 2007

Done!

I completed my tasks for today. The feature list now covers most of the features that the sdef does. Now that I've sent out a request for comments, I expect that many more ideas will come my way.

Plan 1

• Finish Adium's Unit Tests, viewable at http://trac.adiumx.com/wiki/FixAndExpandAppleScriptSupport
• Post blog report when done on Adium's blog.
• Send email to adium-devl, with information about the unit tests.

Sunday, June 24, 2007

First Note!

Well, this is my Hello, World! of the blogging world, and my first ever blog post. It's not nearly as momentous as it sounds.

This blog will stand as a listing of what I'm doing in the way of projects... I'll be sure to include helpful information about coding, especially in AppleScript.

I look forward to hearing your comments!