A TextMate Bundle for Go
I’ve been meaning to have a look at Go for a couple days now, but only just got round to it. I’ve had a bunch of Ruby code to write, y’know?
I’ve been meaning to have a look at Go for a couple days now, but only just got round to it. I’ve had a bunch of Ruby code to write, y’know?
So I was just writing some code, and I refactored it a bit by putting a little chunk into a block, then calling that block in multiple places. Here’s the gist of the original declaration:
John Gruber has written another insightful article on the nature of the Mac vs. Windows (or perhaps one might say ‘generic PC’) markets.
Blocks are quite special constructs. The chief reason for this is the way that they are able to capture the lexical scope in which they were defined, keeping the values of variables defined on the stack preserved with them. While this is very powerful, it leads to some questions of memory management, and therefore some new rules to learn. To begin with, we’ll look at a block’s life-cycle.
So Amazon recently changed the terms of service for their Product Advertising API, which is in use in applications such as Delicious Library. This is (I believe) the API by which DL gets its book information, and through which it provides links to related items, reviews, etc.
I was expecting to have to wait until the release of Snow Leopard to write any of this small series of tutorials on using Blocks and the different paradigms you might want to learn as a result. I will still have to do so to really get involved with the actual capabilities of things like Grand Central Dispatch. However, since Landon Fuller / Plausible Labs released their port of the Blocks runtime to OS X 10.5 and iPhone OS 3.0, I can give you a heads-up on the things you can do with them, and on the new programming behaviours they allow you to implement.
The AQGlassButton
class is implemented using two CoreGraphics objects: a CGMutablePathRef
and a CGGradientRef
. The gradient defines the actual gloss appearance, while the path defines the shape of the button, and is used for both drawing its outline and for clipping the gradient when that is rendered.
This is a simple glass-effect UIButton
subclass, implemented entirely using CoreGraphics. It’s probably not up to the sort of fidelity you can get with a stretched image (and a good illustrator), but it should serve for a nice introduction to the relevant techniques: paths, gradients, and colors.
If you’re tired of using the pure-C API for accessing the system address book on iOS, this project will give you an Objective-C wrapper around that API.
Marco Arment, The upside of rejection
Bijan Sabet’s story of his first real job rejection:
I wonder what would have happened if NYNEX gave me that offer.
Sometimes rejection can be your best friend.
In my job searches, this has proven true.