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

Archive for January, 2006

Boxes. Woodworking. Making things.

Sunday, January 8th, 2006

In today’s modern day and age, making things seems to be a lost art. In junior high, and high school, I took a few woodshop classes. I’ve always enjoyed woodworking, and making things with my hands, so I want to get back into it. I’ve been slowly trying to acquire woodworking tools.


Box 01

I made the mistake of buying a cheap tablesaw ($100 on craigslist, but it had a $50 blade on it), and now I’m on the constant lookout for a good one. I refurbished my dad’s old radial arm saw, and I’m now using that to make pretty accurate miter cuts.

Here are a few pictures of the first box I made. It is a very simple miter cut box, with a slight rabbet on the top to allow the top to simply sit on it.

For sale: House in Maui, Wailuku, Hawaii. MLS 315702

Thursday, January 5th, 2006

If you are interested in having a house to stay at when you visit Maui, well, this one might be for you! A single family house with a detached “Ohana”/cottage. The Ohana currently is rented out ($800/month), and the front house can easily be rented or moved into. It is about 7 houses from the ocean. $569,000.

Visit the Maui MLS Listing for more information. I am the seller, and my dad is the listing broker. Call Stan at 808-667-2277.

Scaledimage.Aspx


Living room from the kitchen

Imgp1467

Imgp1470

Imgp1471

Imgp1472

Imgp1474

Imgp1475

Imgp1476

Imgp1477

Imgp1478

Imgp1480

Imgp1464

Imgp1455

Cocoa: Using NSPredicate and NSMetadataQuery

Thursday, January 5th, 2006

Hi Apple Cocoa developers. Here are some more tips and tricks for Cocoa development.

On Tiger, there is a new class called NSMetadataQuery that allows you to do some cool Spotlight searches. See the “Spotlighter” demo application included in /Developer/Examples/AppKit/Spotlighter.

Creating a predicate to get the search results that you want can be tricky, but alas, there is an easy way!

First, do a search inside of Finder that has the criteria you want. For example, below is a search for all images recently created:

Spotlightsearchexampleinfinder

Hit the save button and save it to your desktop. You can then show the info that Saved Search Query inside of Finder and see the Query it is using:

Searchqueryexample

You can also drag and drop it onto TextEdit to open up the file (it is just a simple XML plist). You can then extract the query via copy and paste:

(kMDItemContentTypeTree = ‘public.image’) && (kMDItemFSCreationDate >= $time.today(-7)) && (kMDItemContentType != com.apple.mail.emlx) && (kMDItemContentType != public.vcard)

So, you want to test this query be executing it from the command line. You should be able to do an “mdfind” and paste it after it, however, that won’t work! You must escape the $ with a slash since the shell interprets the slash as a file input.

You also have to quote the entire thing, as follows:

mdfind “(kMDItemContentTypeTree = 'public.image') &&
    (kMDItemFSCreationDate >= \$time.today(-7)) &&
    (kMDItemContentType != com.apple.mail.emlx) &&
    (kMDItemContentType != public.vcard)”

And, thus you can use it from a command prompt:

Commandpromptquerymdfind
(sorry for the ugly wrapping).

Okay — so, one would think they can paste this into a predicate and just use it as-is, right?

Well, no! The following would normally work:

[NSPredicate predicateWithFormat:@“kMDItemContentTypeTree = 'public.image' && (kMDItemFSCreationDate >= $time.today(-7)) && kMDItemContentType != 'com.apple.mail.emlx'”] ;

But a small bug prevents it from actually parsing the text due to the $time reference (it might even crash!). You must single quote the $time part to get it to work:

[NSPredicate predicateWithFormat:@“kMDItemContentTypeTree = 'public.image' && (kMDItemFSCreationDate >= '$time.today(-7)') && kMDItemContentType != 'com.apple.mail.emlx'”] ;

Then, it should all be okay!

Have fun. Happy programming. Long live MacOS.

Cocoa: Disappearing headers in CoreData generated TableViews

Thursday, January 5th, 2006

Apple Cocoa developers: Finally another blog entry for you!
Everyone else: You may want to skip this one…

It has come to my attention that some NSTableView instances created by dragging CoreData objects into Interface Builder will not work quite right. Specifically, if you add one more row from a case like this:

Core Data Tableview2

you will sometimes see the header disappear:

Core Data Tableview2A

Looking at the NSTableView in IB reveals that it has an offset frame location, which you cannot change:

Core Data Tableview Inib

The solution is to add an outlet to the NSTableView inside your controller and add a bit of code to correct the situation:

- (void)awakeFromNib {
   [tableView setFrameOrigin:NSZeroPoint];
}

This relates to MacOS 10.4 Tiger.


(c) 2008-2012 Corbin Dunn

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

Subscribe to RSS feeds for entries and comments.

14 queries. 0.766 seconds.


Fatal error: Call to undefined function akismet_counter() in /home/corbin_dunn/corbinstreehouse.com/blog/wp-content/themes/corbins-treehouse-white/footer.php on line 38