Making inspectors faster and a better for every object

March 26th, 2007 by Karsten

The BSInspectors have two flaws so far: they’re not as fast as they could/should be, and they only display those objects that have plugins in an informative way. The new release fixes both of the issues. The speed has been increased and the informations shown also increased.

The new version introduces a plugin classed BSGeneralInspector which shows every object as if it was a dictionary and lists its instance variables like keys. The plugin “only” displays the instance variables that are objects, native c data structures are not supported so far (I have no idea how to encode all the objects in a general way to provide them in the inspector window like i do with the objects).

The new release also provides improved speed for getting data from the target-app into Xcode. In previous versions the data was provided byte by byte resulting in an array of strings like:

	{@"12",@"15",@"53",@"-50"}

Parsing this is slow. To improve the speed I increased the number of bytes per word to 4 bytes (sizeof(long)). Then I changed the conversion of the strings to data objects from the gdb-plugin to my own implementation. Converting the strings into numbers is also done by a function that performs less checks than strtol does. The speed is much better now, but shark reports that most of the time is spend in converting the string to a UTF8 string. Does anyone know of a way to convert a NSString (or CFString) into a c-array of characters (a UTF8String or cstring, that doesn’t matter)? Currently I use CFStringGetCharactersPtr() and CFStringGetCharacters() but I think they’re both not perfect for this propose.

The UTF8 conversation may also take place when the gdb-output is parsed and converted into arrays of strings, but i can’t change this part of the story.

The tradeoff when using 4 byte strings is that the resulting data is always x*4 bytes long (data with 13 bytes converts to 16 bytes automatically). But as the required length of the data is known when requesting it, a subrange of the data is returned. Creating the subrange is much faster than converting strings to data, so this tradeoff should be ok.

HexEdit for Intel macs

March 14th, 2007 by Karsten

So when it comes to using a Hex editor, my favorite choice has always been HexEdit. It’s fast, works great, but has some flaws here and there. But anyway, I love this editor by heart. Now on my MacBook Pro I wanted to use a universal binary of that app. Thanks to the fine guys at kaintek there’s an already precompiled version of HexEdit for intel macs.

If you guys read this: could you please release the source-code, or fix the bug with the color scheme, it’s not saved, when it changes. But anyway thanks for the build!

Karsten

Japanese localizer for PDFKey Pro wanted found!

March 14th, 2007 by Michele

Thanks to Mark Gänsicke and his girlfriend 安藤順子 the next release of PDFKey Pro will include Japanese localization!

Creating Xcode Templates

March 13th, 2007 by Karsten

Creating templates for Xcode projects is not an everyday duty of developers. It’s quite tricky but can be really powerful. It is even possible to customize nib files!

I wanted to create a template for a BSInspectors plugin these days. My intention was to have most of the tedious work done by Xcode when the project is created, so that the developer can focus on writing the code for the plugin.

The first step before the template is created, is to create a sample project. The BSInspector plugin project has two targets, the inspector and the debug object. Both targets have one class each by default. They have a plist with all the settings and the targets build options are also set. That’s nothing special yet.

However, my idea of this plugin was, that the classes for each target are created automatically based on the project name. Creating a project named “Window” should result in a class called WindowInspector and a class called WindowDebugObject. The .m and .h files should be named accordingly of course.

To allow for such fancy stuff, the template has to be setup correctly, which will be described in the rest of this post.

Read the rest of this entry »

Growl Support in PDFKey Pro

March 12th, 2007 by Michele

As of version 3.4 PDFKey Pro supports Growl notification system. I was impressed about how easy it was to integrate it in my application. Kudos to the Growl developers for making such a cool framework!

Adding Inspectors to Xcode

March 7th, 2007 by Karsten

So last time I blogged about getting data from the target app into gdb. While I considered this to be the hard part of this project I figured that getting the data from gdb to Xcode is way harder. While I think nothing is impossible, I tried to get things running and finally succeeded.

Read the rest of this entry »

Another thought about piracy

February 22nd, 2007 by Karsten

[Update 1: the author has responded with a public letter to this issue and is planning to open the source code of his application]

[Update 2: my friend over at Yet Another Mac Dev Blog had a look behind the curtain with display eater check it out, it’s a very interesting read.]

[Update 3: the developer of Display Eater replied to this open letter over at Yet Another Mac Dev Blog: […]Version 1.85 was released three times. Version 1 had no deletion, version 2 had home folder deletion, and version 3 had display eater preferences deletion.[…]]

Today I wanted to make a screen-cast about the inspector I was talking about in the previous post. I tried out Display Eater and while I read about the features on the version-tracker site, I stepped over the comments for this application. These comments really scared the hell out of me and I was truly in doubt of the developers sanity. To make it short: this application will remove your home folder if you try to register it with a pirated serial number.

Read the rest of this entry »

improving debugging in OS X

February 15th, 2007 by Karsten

So the first thing i noticed when debugging Applications with Xcode is that there’s no GUI for inspecting objects. i mean, an array has some certain objects and printing all to the console is not very user-friendly, so let’s improve things a bit.

This problem really got me thinking why there’s no better way of displaying the data and i broke things down to the problem, that objects are located inside the target application. Gdb doesn’t have these objects for itself and neither does Xcode. I tried around a bit and came up with what i consider a good start to begin improving the debugging process in OS X.

Read the rest of this entry »

CuteClips 3

February 1st, 2007 by Karsten

Today i attended to a Leopard Tech-Talk and I’ve made a decision for CuteClips 3 based on that Tech-Talk: CuteClips 3 will be Leopard only!

Read the rest of this entry »

Freeware, Shareware and the value of software

January 5th, 2007 by Karsten

There have recently been a lot of discussions about the value of software and about things like MacHeist or MacZot, or other software-giveaway things. Something i’d like to talk about in this post is the value of freeware software and the time invested in it.

Read the rest of this entry »