Archive for February, 2009

Fixing CorePlot’s CPPlotRange Core Animation Type Encoding

Monday, February 23rd, 2009

CorePlot.jpg

A few days ago, I started working on Issue #2 for CorePlot. I worked on this for quite a while trying to get the NSDecimal ivars on the CPCartesianPlotSpace to encode properly in Core Animation, but to no avail. The things I read on Google are basically that if it's not an object that conforms to the NSCoder protocol, then the data type has to be understood by Core Animation. That means it has to be a CG-prefaced data type. Fair enough.

The problem manifests itself as a run-time error message like:

2009-02-11 13:49:39.126 CPTestApp[26427:10b] unhandled property type encoding: 
`{_CPPlotRange="location"{?
="_exponent"b8"_length"b4"_isNegative"b1"_isCompact"b1"_reserved"b18"_mantissa"[8S]}
"length"{?="_exponent"b8"_length"b4"_isNegative"b1"_isCompact"b1"_reserved"b18"
_mantissa"[8S]}}'
2009-02-11 13:49:39.128 CPTestApp[26427:10b] unhandled property type encoding: 
`{_CPPlotRange="location"{?
="_exponent"b8"_length"b4"_isNegative"b1"_isCompact"b1"_reserved"b18"_mantissa"[8S]}
"length
"{?="_exponent"b8"_length"b4"_isNegative"b1"_isCompact"b1"_reserved"b18"
_mantissa"[8S]}}'

I talked to Drew about this and told him that the only way I could see to fix it was to either drop the precision on the CPPlotRange by using CPDoubles or to update the CPPlotRange to a full-blown class with instance variables that are (NSDecimalNumber *). These guys implement the NSCoder protocol, and with a little extra logic, the new CPPlotRange can fit into the codebase nicely.

So that's what I did. It was a blast. I then checked it in and sent Drew an email and updated the issue on Google groups. I asked Drew for comments on the code, and we'll see if he thinks I went overboard on the comments (I didn't), or if there's something he thinks I should have done and didn't do.

All in all - very exciting.

MacVim Snapshot 43 is Out

Saturday, February 21st, 2009

MacVim.jpg

The mailing list alerted me that MacVim Snapshot 43 is out and while the changes aren't earth-shaking, there are new icons, and there are gains in the way the forking is done so as to improve the startup time of the windows. Not bad at all.

I have to say, it's nice to have this reliable tool on my machine as I'm moving from one job to another. It's a constant companion.

Making Cocoa and CoreGraphics Play Nice Together

Friday, February 20th, 2009

xcode.jpg

I was doing a little work on the CorePlot code today - trying to get rid of a bug that's in the running of the test app, and likely to be in all applications based on the CorePlot framework. It has to do with the fact that CoreAnimation is checking the ivars of the subclasses and making sure they are encodable in it's scheme of things. Not that it's necessary, but maybe it is internally.

In any case, I was remembering this article where there's a simple compile-time definition for the framework that forces the Cocoa and CoreGraphics datatypes to be interchangeable. This would have been really nice, but it's not for the more complex data structures like NSDecimal, which is the problem I'm having at the moment.

However, this is really something to hold onto as it's bound to come up several times in the project, and I wanted to be able to put my finger on it quickly.

Building the Latest CPTestApp in the CorePlot Project

Friday, February 20th, 2009

CorePlot.jpg

Well... I'm stumped. I had been working on a few things for the unit testing framework yesterday, and today I wanted to look at this problem that had been reported on the Google Code site. Basically, there's a build problem, and I wanted to track it down.

First thing: build the code and reproduce the issue. It builds fine - I can't see the error, but when I run it within Xcode, I get the following on the Console:

    [Session started at 2009-02-20 12:05:37 -0600.]
    dyld: Library not loaded: @loader_path/../Frameworks/CorePlot.framework/Versions/
        A/CorePlot
    Referenced from: /Users/drbob/Developer/core-plot/examples/CPTestApp/build/Debug/
        CPTestApp.app/Contents/MacOS/CPTestApp
    Reason: image not found

  The Debugger has exited due to signal 5 (SIGTRAP).The Debugger has exited due to
      signal 5 (SIGTRAP).

OK, this should be easy - it's got to be that the CorePlot.framework isn't properly in the project and that's what's missing. So I looked into that. But it's there. Just where it should be. Then I dug into the built CPTestApp.app wrapper and right where it's supposed to be is the framework! I'm stumped.

I looked at the project settings... nothing popped out at me. I cleared the Xcode project file and reloaded it from the repo... no difference. I even did what I thought should have been done and added in the CorePlot.framework to the Linked Frameworks 'folder' in the project, and still nothing.

I'm blown away! So I finally shot an email to the mailing list and we'll see if we can't find out what's up. I'm really stumped. It used to work!

UPDATE: HA! I got it figured out. First, the path for the library is encoded into the Framework - not in the app using the framework. OK, now that I knew that, I started looking at the CorePlot Framework build parameters. I noticed the one that I was looking for in the Deployment section:

Target 201CCorePlot201D Info

Originally, the Installation Directory was set to:

  @loader_path/../Frameworks

and that was what was being set in the dynamic library, and compiled into the app's executable. What I needed to change was the path to:

  @loader_path/../Resources/Frameworks

and then it was able to find the framework and run.

OK, this wasn't obvious in the least. I Googled this guy and came up with nothing other than the fact that the name was in the shared library - which I had remembered as soon as I was reading the post. So, at least now, I can see the error, and hopefully get a handle on it.

UPDATE: Drew commented that he had changed the @loader_path to @executable_path a while back, but that there may have been issues in the merge that was done to get the testing code working. So I emailed back that he's free to change it back and I'll just pick up the right version in the next 'svn update'. Sounds good to me. Glad to see I wasn't totally missing it.

[2/21] UPDATE: Barry pointed out that @loader_path is the right value - but the project was not configured to copy the framework into the right location. So he fixed that. It builds fine now.

Adium 1.3.3 is Out

Friday, February 20th, 2009

Adium.jpg

I learned that Adium 1.3.3 was out this morning, but oddly enough, the built-in updater wasn't able to update from 1.3.2 to 1.3.3. I'm not sure if this is a server-side issue with the upgrade package, or that the Sparkle updater wasn't working in the 1.3.2 release. Not sure, but I have 1.3.3 now, and it's got a bunch of updates.

It's interesting that it's got Facebook connectivity, as we've been going through a bit of that at the house these days. I'll be interesting to see how that integrates. Should be fun.

Did a Little Work on CorePlot Test Cases

Thursday, February 19th, 2009

CorePlot.jpg

I'm trying to see how an Open Source plotting package for Cocoa on Mac OS X goes. It started a few weeks ago, and I think it's the right thing to do as it's the kind of thing I've wanted to have for the Mac for ages, and being a part of it almost guarantees that I'll understand it well enough to make use of it. So I'm trying my hand at this kind of thing.

Today I looked at the new testing framework someone put in. I can see the value of automated testing but I also see the problems. Today it was sloppy includes, poor test writing and missing test data. They were fixed easily enough, but it brings to mind the problems I see in automated testing in the first place: What do you really test?

I'm all for testing the public APIs of classes. That's what the class is supposed to do, and how it's supposed to do it. But private methods are another thing. I think that's asking for a ton of grief. If the method is useful enough, and important enough to test, then maybe it should be in the public API. If it's not that important, then testing the public API should exercise the private implementation details.

The guy that threw this test frame together didn't share my ideas. He's got compiler warnings testing private methods, and I just think that's not right - from several points of view. First, the testing, and then the compiler warnings. There just shouldn't be any. Period. It's so easy to remove these, and they are there for a reason - you're making a mistake. Maybe not a big one, but it's a mistake, and you need to stop right now and fix it.

Given that this is open source, it's not going to get fixed unless I fix it, but that's OK too. I don't mind being in that role for this project. It's interesting and the outcome is something I've wanted for a long time. We'll just have to roll with the punches and see where it goes.

The Start of My Last Ten Days – T minus 10

Thursday, February 19th, 2009

cubeLifeView.gif

Well... today starts the first of my last ten days here at the Shop. It's an interesting time - seeing who is chosen to step up and take over pieces of the work I've spent seven and a half years building. It's surprising, and at the same time, about the only choices they can make.

As for me, I'm trying to get done all that I can - given the limited time I have. I can't work on projects that aren't going to be done, it'd be better for me to spend time getting things moved off to other people. But there are a few things I can do, and I'm ticking them off as quickly as I can.

But there's no doubt about it. I'm in the coasting/dispensing phase. I've written up a ton of stuff, people now need to read it and then come back with questions for me. I'm sure it'll get busy, but that's OK, I knew it'd happen.

It's an odd feeling. Anxious... a little nervous... but it's something that it just a part of the job. I'll get through it.

GraphicConverter 6.4 is Out

Thursday, February 19th, 2009

GraphicConverter.jpg

Years ago when I was just getting back into the Mac scene, I needed something to mess with images for a few web sites I was building. I looked, and certainly couldn't afford Photoshop, and the likes of Acorn and Pixelmator weren't yet out. The low-priced landscape seemed to be dominated by GraphicConverter. Now it's at 6.4 and there are a ton of new features.

I don't use GraphicConverter as much as I used to, but it's something I'll always have because of it's place in getting me back into the Mac scene so nicely. Plus, it's just a great overall tool for graphics manipulation.

I Accepted an Offer from Chicago Trading Company

Wednesday, February 18th, 2009

cubeLifeView.gif

Well... I got a call today from Jeff H. at CTC, and the offer he presented was just too good to pass up. I accepted (verbally) on the phone, and he was thrilled. So was I. He's sending the paperwork out today and I should get it tomorrow. I'll do what's necessary to formally accept the offer once I get it, but that's simply a formality.

I've got a new job!

I was chatting with a few friends about it, and they encouraged me to let my current manager know today, as opposed to tomorrow morning with a formal letter. There's no reason to wait, and it gives them the evening to come to terms with it and begin the planning of what to do on my last ten days. Looking at it that way, I had to see the logic. So I told him.

Interestingly, his first words were: "You're kidding me, right?"

Nope.

We talked about what might have lead to this decision. He's been aware that I haven't been happy for the last several months, and it hasn't come as a complete surprise to him. Still... there's a lot of stuff that needs to be transitioned, and it's going to be up to him to decide how to do it. At this point, I'm answering questions and doing what they want, but I seriously doubt if they are going to be having me do any new work because I can't possible finish it in ten days.

Still... who knows.

More importantly, I'm moving on. It's been long overdue. Jeremy left nearly three years ago, and back then I didn't think I'd last the year. I lasted three. That's a lot of staying power. Troy left 9 months ago, and that was really the final blow. I knew I needed to get out. Thankfully, the position at CTC could not be a better fit. I'm excited about what's ahead, and understandably a little nervous.

Wow.

Horrible Reality TV: Solitary 3.0

Wednesday, February 18th, 2009

TV.jpg

I was watching an episode of Solitary 3.0 this weekend, and I have to say that reality TV has hit a brand new low for me. I mean, I can see that some reality TV is just trash from the word 'go', but this seemed like it might have had a shred of interesting content in that it could have been done in a format where people were really stressed, and really was the equivalent of solitary confinement.

But no... this is just individual achievement. Better to call it "Everyone for Themselves". There's no extended period of silence. No sensory deprivation. No real psychological stress put on these folks... they get to smell crappy things, sit on painful seats, do stupid drinking games with Root Beer... it's constant games. Not like any solitary any prisoner ever faced.

In the end, I realize that they can't really hurt someone for fear of a lawsuit. But they could have made it a lot more interesting. I can't imagine I'll ever watch again.