Corbin's Treehouse - Corbin Dunn, Santa Cruz, CA
Plug Bug
Treehouse
Photography
Videos
Projects
Unicycling
About

Archive for 2007

Unicycle ride


Louise and I did a short unicycle ride today. Well, 8:20 – 12:45pm, so not really short.

The route:

http://www.bikely.com/maps/bike-path/Corbin-s-House-Reservoir

Distance: 40.4 km

Ascend: 1323 m

Descend: 1751 m

Soft Gravel: 2 km

RTL Rating: 206

RTL == “Ride the Lobster”, a unicycle race we are planning to do next year:

http://www.ridethelobster.com/

…now, for tomorrow, another ride:

http://www.bikely.com/maps/bike-path/shel-to-rob-s-route

Distance: 66.7km

Ascend: 771

Descend: 764

Prev rating: 206

Soft Gravel: 15km

Total rating: 190

–corbin

Ride The Lobster - 00km International Unicycle Race - 16-20th June 2008 - Nova Scotia, Canada


Overriding shortcut keys in the NSOpenPanel or NSSavePanel


It recently came up where someone needed to override some of the default shortcut keys in the NSOpenPanel or NSSavePanel. This is quite trivial to do. First off, the “easy way” would be to add a hidden NSPopUpButton in an accessory view that has the appropriate shortcuts. However, that won’t override the defaults (ie: cmd-r == reveal in finder, cmd-i == finder info window, cmd-a == select all, etc). To override these, you would subclass the appropriate panel:

@interface MyOpenPanel : NSOpenPanel

@end

@implementation MyOpenPanel

– (BOOL)performKeyEquivalent:(NSEvent *)theEvent {

NSLog(@”…test”); // an example of where you would do your key testing

return [super performKeyEquivalent:theEvent];

}

@end

You would then use it via something like:

[MyOpenPanel openPanel]


Easy to do…


UniBar – version 3, SketchUp


I have been making custom unicycle handlebars (also known as “touring handles” or “touring handlebars”). They make the unicycle more comfortable when riding long distances. I’m hoping to make a write up on how I create them, but here are a few pictures, and more importantly, I did a design of it in SketchUp!

First, I took a series of pictures of the building process, and final handle for Louise: http://picasaweb.google.com/corbin.dunn/UnicyclesAndParts

Best of all, I did a *rough* outline of it in SketchUp. Here is the SketchUp picture, and download UniBar v3.zip


UniBar – version 3, SketchUp


I have been making custom unicycle handlebars (also known as “touring handles” or “touring handlebars”). They make the unicycle more comfortable when riding long distances. I’m hoping to make a write up on how I create them, but here are a few pictures, and more importantly, I did a design of it in SketchUp!

First, I took a series of pictures of the building process, and final handle for Louise: http://picasaweb.google.com/corbin.dunn/UnicyclesAndParts

Best of all, I did a *rough* outline of it in SketchUp. Here is the SketchUp picture, and download UniBar v3.zip


Flickr Photo Download: Bass with high ISO


High ISO. Red lights. Dark Room. Hard to take pictures. Cool effect.

3 Leg Torso.

Bass with high ISO


[From Flickr Photo Download: Bass with high ISO]


T-Rex electric “cars”


T-Rex came by apple yesterday and gave some rides in their new cars, due out in 2008. The cars are pretty cool, and they have an electric version which I rode in. It was pretty darn fast, and handled really well. Approximate specs: $60k (electric), $50k (gas), 150 mpc (miles per charge), 6? hour charge time (I may have remembered that wrong), moto license required. Not quite a tesla, but still pretty neat. I don’t know if they are worth the cost. At $60k they will be more of a luxury item. To hit the consumer market, then need to be *at least* three times less.

http://www.go-t-rex.com/


Halloween…a few pictures


Louise and I went out with Nate, Kristi and Pacos to downtown santa cruz. Here’s some pics:

Nate, Kristi and Pacos

Nate, Kristi and Pacos

Louise (frog girl) and Corbin (banana man)

Louise (frog girl) and Corbin (banana man)

Louise (frog girl) and Corbin (banana man)


Leopard: PhotoSearch demo app now live


PhotoSearch, a demo app I wrote for WWDC a few years ago, is now live:

http://developer.apple.com/samplecode/PhotoSearch/

It demonstrates some cool custom cell stuff that is only available on Leopard.


Instruments on Leopard: How to debug those random crashes in your Cocoa app


Update: Sept 9, 2009: Mac OS 10.6 Snow Leopard now has this feature built into Instruments! In Xcode, choose “Run -> Run with Performance Tool -> Zombies”, and repeat your steps that cause the crash. Easy as pie. Read on if you don’t have Snow Leopard…

Mac OS 10.5 Leopard has a great new developer app called Instruments.

It can easily be used to debug those “random crashers” in your application caused by too many -release or -autorelease calls. Let’s see how.

If you want to follow along, download this project: CrashTestDummy.zip

Open it up in Xcode.

The nib has two outlets in it: a basic NSObject called testObject and button setup to invoke the following code:

– (IBAction)buttonCrashTestAction:(id)sender {

// We are going to autorelease the testObject too many times..

[testObject autorelease];

}

So, we will hit the button a few times and we should get a crash. Compile the app with the Debug target. Start Instruments, and select the Object Allocations template:



Hit the purple “i” next to the instruments to bring up the inspector for it, and be sure to check “Record reference counts”, as seen below:





Cool. Click “Launch Executable” and select “Choose Executable”, and find CrashTestDummy.app from the built directory.





While you have the Open Panel up, add the environment variable NSZombieEnabled and set it to YES (sort of an optional step):




Hit Open, if you haven’t already done so.


Hit “Record” in instruments, which will start the app, and click the “Crash Test” button a few times until the app crashes.


Alright! Fire up Console.app and look for a line like this:



The important part is the address, 0x150d40, in this case.


In Instruments, move the mouse to the right of “All Allocations” and a little triangle appears:




Click on it to see all the allocations.

In the lower right hand corner of instruments click on the magnifying glass in the NSSearchField and select “Address”:



Type in your address, and you should see all allocations at that address:



Now, why so many? Well, addresses are reused. Chances are, the last allocation is your object, and sure enough, it is, since we know we are over releasing an NSObject instance. Click on that item, and you’ll see the history for it. Scroll to the bottom to see just the history for that NSObject:



Now! You should be able to figure out which release probably shouldn’t be there. We know it is #19 from our demo, but sometimes it isn’t that easy to figure out. Select #19’s row and then click the little gray arrow to next to its address (or whatever yours is), and then click on this button at the bottom of instruments to show the stack trace / extended detail:



You can then see when that “bad release” happened. Click on the thumb below for a full size screen shot of it.




Ahh! Way cool. Of course, this was a simple and easy test case.


Happy debugging :)


corbin


New Leopard user features – Open and Save Panels


Leopard, the new Mac OS 10.5, is out!

There are a lot of new features, but not everything is mentioned on the features page. Here are some of the cool “power user” features which you may not know about:

The Open and Save Panel (implemented in Cocoa, also known as the NSSavePanel and NSOpenPanel)

1. There is a new Icon View mode with options:

However, the way to change the icon size to be small (as seen above) isn’t obvious. Click and hold down on the icon view segmented cell and a popup will occur:

2. You can now insert items in the panel (and Finder) “side bar” by drag and dropping directly from the views (you couldn’t do this on Tiger!) You can also rearrange or remove items.

3. When you have an item selected, cmd-r will “reveal” it in Finder

4. When you have an item selected, cmd-i will give the Finder “info” window.

5. If you perform a search, you can save the search (just like in Finder). In addition, you can save it just for that application:

…and it appears in a special sidebar section for just that app (to remove it, drag it out):

That’s it for now. 5 new features not even included in the top 300!





(c) 2008-2017 Corbin Dunn

Corbin's Treehouse is powered by WordPress. Made on a Mac.

Subscribe to RSS feeds for entries and comments.

16 queries. 0.214 seconds.