Archive for the 'Macintosh' Category

Illuminate is in the wild

andy on Apr 6th 2011

I officially released Illuminate today. If you’ve ever had difficulty finding a window, or just regularly have a ton of them open, or Exposé just isn’t cutting it for you, you should definitely give the free 30-day trial a try.

If you’d like to know more about Illuminate, you can always visit the product page or read the press release.

Filed in Fortunate Bear,Illuminate,Macintosh | No responses yet

Illuminate Beta Program

andy on Jan 11th 2011

Update: I’m no longer able to take any more people into the beta program at this time. Thanks for your interest!


If you’re anything like me you have a lot of windows open at any one time. I usually have an ungodly number of Safari and Xcode windows open full of research and code. The problem is I often lose track of which window is where, and have difficulty getting to the window I want. The respective windows menus at this point are at an unwieldy length and Exposé just shows me such tiny thumbnails that I can’t tell if that one’s the header file I’m looking for or the latest Penny Arcade.

It was for this reason I wrote Illuminate. Sometimes I can recognize the window by sight, but I only want to see a reasonably number of them at a time. Sometimes I know the window name and I just want to go directly there. Other times I don’t remember either, just a key phrase I know appears in the window. Illuminate can handle all of these cases for me.

Illuminate is now in a “closed” beta. If you love trying out new software and giving constructive feedback, please sign up at the Fortunate Bear website. Edit: The beta is currently full.

Filed in Fortunate Bear,Illuminate,Macintosh | No responses yet

The Fortunate Bear FAQ

andy on Jan 5th 2011

As some of the more astute readers might have noticed, the sidebar and about page of this blog have changed to remove references to Order N and their products and services. You might be wondering what that’s all about. I’ve decided to answer your potential questions in FAQ format, in order to sound more pretentious.

So what’s the deal with Order N?

They’re still around, successful, and offering custom development services for the Mac and iOS platforms. However, I sold my shares in the company back in October and I’m no longer part of Order N.

What do you do now?

Mainly sit around in my underwear, playing solitaire.

…uh, anything else?

Sometimes I pet my cats, Luna and Pasha.

Alright, I guess we’re done here.

Wait, before you go, let me tell you about my new company.

You could’ve mentioned that earlier.

And miss out on all the interesting tidbits about Mac indie life?

Anyway, so you have a new company?

Yep, still shiny and everything.

…anything you want to say about it?

Yeah, it’s going to be awesome, sweet, sick, and possibly jivetastic, if that’s still a word.

I’m not sure that was ever a word. What’s the company going to do?

Be awesome. Gonna have our own tree fort and everything. See:

Klubhouse.jpg

It’s like Panic’s Founder’s Room, only cooler. I’m also working on the official company super secret handshake, but I can’t think of anything after “patty cake, patty cake, baker’s man.”

Wow, there’s so many things wrong with that, I don’t know where to begin. But I see the company name appears to “Fortunate Bear.” Where does the name come from?

Insomnia induced delirium, and possibly the sheer jivetasticness of myself.

Really?

No, I just randomly matched up adjectives and nouns until I found one I liked the sound of, and my wife wouldn’t divorce me over.

Is Fortunate Bear going to be a software company or what?

Oh, right, software. Yes, software will be involved in the process. I’m not much for playing solitaire with real cards. It’s the reason why the iPad is so magical.

Is the whole FAQ going to be this way? Because there’s a netiquette FAQ I could be hosting.

Alright, fine. Fortunate Bear is a software company focused on creating Mac and iOS apps to sell under the Fortunate Bear brand. I am the sole owner.

What about contracting/freelancing?

I might have to do some in the early years of Fortunate Bear, but it will be kept a bear minimum (see what I did there?) and phased out as soon as possible. I am not currently available for contracting. I’m focusing on building my own products.

What can you tell me about the products you’re working on?

I’m working on a Mac app for window management. It’s like Exposé except it doesn’t suck. I’ll be announcing a beta for it soon.

What about Hearts Attack?

I bought the source and rights for Hearts Attack from Order N. I’m renaming it, adding a few features, and changing the way it will generate money. I’m hoping to release it soon, but not until I get my Mac app out.

How can I get more information about Fortunate Bear and its products?

This blog will continue to be the main place I write and make announcements. However, I have a placeholder site for Fortunate Bear. You can sign up for the company newsletter to get announcements about products as well as tips and tricks after the products are released. There’s also an official Fortunate Bear Twitter account you can follow.

Anything else you want to add?

It’s gonna be jivetastic.

Please shut up.

Filed in Career,iPhone,Macintosh,Order N | One response so far

Compiling OpenCL Kernels with Xcode

andy on Dec 17th 2009

The talk I’m working on for NSConference 2010 involves a decent amount of OpenCL kernel code. Originally, I thought I would develop the kernel code the same way I develop Core Image kernel code: build the kernel in Quartz Composer and then copy paste the code into Xcode when I got it working.

Unfortunately, I’ve not had much luck with Quartz Composer in way of meaningful compiler errors. Sometimes it returns good errors, sometimes inscrutable ones.

Quartz Composer

Composer: Wait, wait, I remember this… it’s COBOL, right?

 

However, I’ve found debugging OpenCL kernels to be much easier thanks to the invention of a function I like to call “printf.” If you run your kernel on the CPU, then you can print out values just like in C. With debugging solved, I just needed to figure out how to find compiler errors without having to run my code.

Unlike Core Image, OpenCL actually requires you to compile your kernel code explicitly before using it. The API’s required to do this will return nice compiler error messages and everything. The obvious thing to do would be wrap up these API’s in a command line tool and invoke the tool from Xcode, which is what I did.

The Code

You can download the Xcode project for clc, the OpenCL Compiler here. It requires Mac OS X 10.6 Snow Leopard and the associated Xcode tools. To install, just build the project and copy the resulting binary into your path somewhere. I used ~/bin.

Most of the code is self explanatory, with the possible exception of the output. Unlike most compilers, clc doesn’t output object code because the host and runtime CPU/GPU’s could easily be different. It could simply copy the source code as is for the output, but that was a little too obvious for my tastes. Instead clc compresses the source code and stuffs it into a binary plist. It has the slight benefit of potentially being smaller on disk, and making your source code negligibly less accessible to prying eyes, if you’re into that sort of thing.

There are definite possibilities for improvement. For example, there could be an option to encrypt the source code to be more “secure.” Or it could store the binary code generated by the host machine in the output on the chance that the host and runtime machines have the same hardware.

Setting up Xcode

To use clc, you’ll need to set up a build rule in your app’s target settings to run all OpenCL source files through it. Selecting the menu item Project > Edit Active Target, and then selecting the Rules tab, should land you here:

TargetSettings.png

Add another rule, set it to process OpenCL source files using a Custom script. For the custom script enter:

~/bin/clc ${INPUT_FILE_PATH} -o ${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Contents/Resources/${INPUT_FILE_BASE}.clar

Finally, you’ll need to tell Xcode where you’re putting the output file, which is:

${TARGET_BUILD_DIR}/${PRODUCT_NAME}.app/Contents/Resources/${INPUT_FILE_BASE}.clar

By default, Xcode won’t put OpenCL source files (.cl) into the target, meaning they won’t get compiled. For each of your OpenCL source files
you’ll need to explicitly add them to your target. There are several ways to do this, but the easiest is probably selecting all of them, and doing a Get Info (File > Get Info). Switch to the Targets tab and check the target they should be compiled into.

Runtime Code

At runtime, it’s pretty easy to retrieve the original OpenCL source code using the + (NSString *) openCLSourceWithData:(NSData *)data error:(NSError **)error; method on ONOpenCLArchive. However, there are a couple of convenience methods on NSBundle that makes retrieving the kernel easier. For example:

#import "ONOpenCLArchive.h"

NSString *kernelSource = [[NSBundle mainBundle] openCLResource:@"MyKernel"];

That’s pretty much all there is to it.

Conclusion

Although not ground breaking, this little tool has certainly been helpful to me by finding compiler errors at compile time instead of runtime. Hopefully it will be useful to other people as well.

Filed in Macintosh,Programming | One response so far

NSConference 2010 Quiz

andy on Dec 15th 2009

For the uninformed, NSConference is a Mac developer’s conference put on by Scotty “The Scottster” Scott and his faithful sidekick, Tim “The Faithful Sidekick” Isted. They’re kind of the Batman and Robin of the Mac programming conference world, but have a slightly lower probability of bat-gassing you than the real dynamic duo.

This year they aren’t content with bringing conference justice to only the UK, so they’re branching out to the good ‘ole U.S. of A. by way of Atlanta, GA. To help you decide which conference you should attend, US or Europe, I’ve prepared the following quiz:

  1. What is your opinion of Seattle?

    1. It’s nice, but isn’t nearly rainy or dreary enough.
    2. I like their coffee.
    3. The residents have too many teeth.
  2. Describe your driving habits

    1. I like to drive on the left side of the road.
    2. I like to drive on both sides of the road.
    3. I like to merge right six lanes without signaling while going 147 mph on the off ramp and giving the finger with both hands in my black Camaro.
  3. The pinnacle of human achievement is…

    1. Afternoon tea
    2. Sliced bread
    3. Hee Haw

Scoring: Give yourself -1 points for any 1 answer, 0 points for any 2 answer, and 1 point for any 3 answer.

If you scored is less than zero, you should attend NSConference Europe; if greater than zero, NSConference USA. If you scored exactly zero, you are truly a cultured individual and should attend both.

Personally, I’ll be attending both, and not just because of peer pressure and insightful quizzes. I’ll be presenting a talk on how to implement a watercolor brush using Core Image and OpenCL and maybe some duct tape. If you enjoy the graphics articles that I post here, you’ll probably enjoy my presentation. If not, I hear Steve “I’m Batman” Scott does a mean Adam West impression.

Filed in iPhone,Macintosh,Programming | One response so far

Bad Behavior has blocked 334 access attempts in the last 7 days.