New clear Objective-C

I have come here to chew bubblegum and write code ... and I'm all out of bubblegum.

Sunday, July 29, 2007

Above the deck



These guys love to camp out in the umbrella, on a semi-regular basis we get one and I try to take a half-decent picture but they are usually in a hard to get spot. This one was on the outside under a flap so I got a good reveal and close-up. He was bitching quite a lot after when I was trying to shoo him off. The focus is not the best but this is the best picture I got, taken from about a foot away.

Honestly, I'd rather it be a bird, they know when to leave, are less erratic and don't land on you.

Labels:

Monday, July 23, 2007

How to use chopsticks



1. 2. 3.

Labels:

Saturday, July 21, 2007

Apple Store Holyoke opening line



I had an 11am appointment in the area so I swung by the grand opening of the Apple Store in Holyoke, MA. This was the line at about 10:15 taken from the Starbucks. I got my iced latte and went on my way. Stopped by later at 12:45 and there was no line at all. Relatively small store, a lot of employees and a lot of security for the opening.

Good photo set of the store.

Tuesday, July 17, 2007

Under the deck



Every year we get a nest under our deck, I usually pull it down in the Fall when it has been abandoned and show the kids. In the meantime I leave it alone, but while walking around the yard with a camera the other day it dawned on me I could take a peek.

Credit where credit is due

Wincent Colaiuta:

But after closely studying Git I'm a little bit awestruck; Torvalds is a frickin' genius, a true visionary, and somehow managed to just "get it" and instantly, in a flash of insight, come up with "the solution" for version control.

Wincent then quotes a 2005 conversation between Linus and Braham Cohen to strenghten his point. Linus started using BitKeeper in 2002.

Linus Torvalds on Git:

"“BitKeeper was not only the first source control system that I ever felt was worth using at all, it was also the source control system that taught me why there's a point to them, and how you actually can do things. So Git in many ways, even though from a technical angle it is very very different from BitKeeper (which was another design goal, because I wanted to make it clear that it wasn't a BitKeeper clone), a lot of the flows we use with Git come directly from the flows we learned from BitKeeper.” - Linus Torvalds

The creator of BitKeeper, Larry McVoy on the history of BitKeeper and Larry's long history in the world of source code management.


Linus is a smart guy, but a flash of insight?

Sunday, July 15, 2007

Divergence

While Apple consolidates their hardware line from iPhones to Macs to Xserves on the same core set of Apple software technology based on OS X, Apple's software for Windows is suffering from a severe split-personality disorder.



QuickTime

The grandaddy of Apple's cross-platform technology, a quasi classic MacOS API on top of Windows. These days everything except the player window looks like a well behaved Windows citizen.

The main window is custom, standard Windows controls on the dialog panels, slightly funky menu.



iTunes

The stepchild of QuickTime, obviously based on the same cross-platform technology as QuickTime.

The main window is custom, standard Windows controls on the dialog panels, another different slightly funky menu.



Safari 3

What was originally an Objective-C app with a C++ framework was ported to Windows sitting on top of Apple's own CoreGraphics on Windows, Apple technology right down to the font rendering! The strange thing of course is that there is no sign of Objective-C, did they rewrite the Safari application in some new UI kit?

Everything is a custom (for Windows) Mac look, right down to the Preferences panel.



Apple Software Update

Looks like a native Windows app, Windows controls all the way through.



So we see Apple using three different platforms on Windows, the QuickTime originated platform for QT/iTunes, a new CoreGraphics/CF based one for Safari and native Windows controls for Software Update. While Apple pushes all the developers on the Mac towards Cocoa and new API's, Apple is not really following their own advice on Windows. Not to mention there is no sign of Objective-C anywhere.

The whole thing leaves more questions than answers. QuickTime on OS X is heading towards Objective-C, where is the QT SDK on Windows going? Is Safari a trial run for a new CoreGraphics based platform on Windows that QuickTime and iTunes will use ? Is it impossible to teach a Windows programmer Objective-C? Was it Colonel Mustard in the Conservatory with the Candlestick?

Wednesday, July 11, 2007

How to use chopsticks (again)

A lateral regression of the original How to use chopsticks







Labels:

Tuesday, July 10, 2007

How to use chopsticks



Got it?

The original How to use chopsticks

Labels:

Monday, July 09, 2007

Bushkill Falls, PA

When a place bills itself as "The Niagara of Pennsylvania" one is allowed to be skeptical. Perhaps that is part of the marketing plan, by overselling itself you expect it to be completely lame but are curious at the same time. So when you go there and it is not completely lame you have a good time.

We found ourselves near Bushkill Falls a few weeks ago, my wife had been there before and convinced me to make a day of it. I've been to Niagara and it is definitely no Niagara - it is a different kind of place, a series of man made trails and bridges that wind themselves over two relatively small rivers and a lot of waterfalls.

The story behind places like this fascinate me, some guy a hundred years ago finds the waterfalls and starts building a series of walkways, turns it into a tourist attraction and now his descendants run the place. It's not a government funded operation but the result of some young entrepreneur building on his vision of a tourist attraction and making it successful for decades to come. It seems so completely crazy to think about starting a business like that, some waterfalls? in what was the middle of nowhere? you're going to get people to visit? and pay to walk around? Brave person.

If you find yourself in the area I would definitely recommend it, good way to kill an afternoon hiking around the woods and water. It is probably even more dramatic after some serious rain or thaw.

Sunday, July 08, 2007

Apple Store ... Holyoke ???





(click on images for larger version)

While pushing my son around the Ingleside Mall in Holyoke, MA a couple months ago I glanced up from my trance of making sure his stroller did not run into anyone to see the black wall with the gray logo symbolic of an Apple Store being installed. I was honestly shocked and amazed to see this. The Ingleside is undergoing a much needed revival but it is still quite dated looking in large areas and has some pretty depressing stores, such as the bleak pet store which carries puppies and kittens despite the giant PETCO down the road, and the food court that needs to be flooded with Goo Gone. Things started to make a little more sense when I looked around to see a Starbucks going in down the way, opening a couple weeks before the Apple store, it must be a conspiracy, or definitely some sort of deal. (Check out the comment on this image of the Ginza store for more evidence of Apple and Starbucks in cahoots)

The closest Apple Store to me right now is 1hr 20 minutes away at a mall in Connecticut I rarely go to, my first pick if I had to go to an Apple Store would be Cambridge, MA because I can always use an excuse to go back to the place I called home for 10 years. The Apple Store in Holyoke will be a mere 40 minutes away along a route I regularly travel, better.

I don't even know why I am sort of happy to see it go in, a sign of progress perhaps, property values going up, the once depressing mall becoming more useful at a steady pace. Honestly, Apple probably could have bargained to get the whole city of Holyoke to clean up a bit before they put the store in.

I brought my camera today and stitched together the Starbucks/Apple cabal, despite having an insanely good coffee place nearby I probably will visit Starbucks and the Apple Store while killing time.

The dowside, or perhaps upside I suspect is that the small local Apple resellers will probably get crushed by the new store. I'm not sure if this is a bad thing as the last and only time I went to a local reseller was to check it out and get a spare battery for my MBP. I waited far too long for the cashier to stop chit chatting with a non-customer, they couldn't find the part number (despite the machine having been out over 6 months) and never ever called me back about it even though I placed an order for it on paper. So, screw them, welcome Apple Store.

Saturday, July 07, 2007

CGShading and PDF 1.4

The document Core Graphics Reference Collection states "Core Graphics technologies include Quartz 2D, the drawing API that implements a superset of the PDF 1.4 specification", which is in turn defined here: PDF Reference 1.4.

The public API for CGShading in Quartz 2D allows you to create two types of shadings, axial via CGShadingCreateAxial and radial via CGShadingCreateRadial.

Page 232 of the PDF 1.4 reference begins the discussion on shading where it goes on to define seven types of shadings, function based, axial, radial, free-form Gouraud-shaded triangle mesh, lattice-form Gouraud-shaded triangle mesh, Coons patch mesh and Tensor-product patch mesh.

Well, so much for Quartz 2D being a "superset" of PDF 1.4.

The public API for CGFunction allows you to create one type of function, a sampled function.

The PDF 1.4 specification defines 4 types of functions, sampled, exponential interpolation, stitching, and PostScript calculator.

At this point one could argue that the CGFunction API allows you to create any of the function types because you can code up the function however you want. While this does work in an interactive environment, once you print you are exclusively in the realm of sampled functions as the PDF generation can not magically turn your C function into a PDF function definition other than sampled.

The sampling rate of the CGFunction appears to be fixed, CoreGraphics calls your sampling function 4097 times regardless of how big or small the gradient is. 10 pixel wide gradient? 4097 times, 100,000 pixel wide gradient? 4097 times. In practice this isn't a big deal, the sampling rate is high enough to disguise any error, although far too high for most small gradients.

While the lack of the more sophisticated shading types seems reasonable for most applications, it does make it disingenuous to say that Quartz 2D is a superset of PDF 1.4.

The thing that disturbs me the most is that the CGFunction API uses a callback, the first three and definitely most popular function types are very easily represented without callbacks. One could argue that in order to do the PostScript calculator function type this would be most easily done with callbacks - but it is turned into a sampled function anyway, so what would be the point. The PDF function specifications are right there in the PDF specification, I don't know why Apple didn't use them.

Friday, July 06, 2007

Radial CGShading fun

While there is a bunch of other work going on in Cocotron, some of the results are more visually satisfying than others. One recent addition is radial shading. Here is an updated CGShading example running on Vista, showing off some of the themeing work too.



The CGShadingCreate example runs on Windows and Mac.



Whoops! Well, it works on the Mac most of the time (10.4.10 on a MBP).

(this is a bug in OS X)

Labels: