November 2010
11 posts
2 tags
Mail.app Script: Bottom Post
I’ve made peace with mostly top-posting my email replies in the name of efficiency.
But there are often times when I want to bottom-post my reply to address a specific section.
I finally broke down a wrote a script to automate the transformation of Mail.app’s top-post format to my preferred bottom-post format.
That is, it turns this:
|
-jwr
On Nov 30, 2010, at 1:13 AM,...
2 tags
Xcode Node.js User Scripts
Turns out you can use node.js for Xcode User Scripts.
For example, here’s a script that takes .h property declarations on the clipboard:
@property(retain) NSManagedObjectModel *model;
@property(retain) NSPersistentStoreCoordinator *coordinator;
@property(retain) NSPersistentStore *store;
@property(retain) NSManagedObjectContext *moc;
And outputs their .m...
Map Crowd Reduce
Map Crowd Reduce - There’s no place like ::1:
My latest open project is a “SETI-at-home-like infrastructure for massively distributed CPU-intensive jobs based on HTML5 WebWorkers and node.js for distributing tasks” (quote from Pedro Teixeira’s blog).
This was my second idea for node knockout. I thought it was pretty awesome, but realized it didn’t have a chance of winning....
Objects and Cores
Intel talks 1,000 cores:
Initial multicore chip architectures depended on a set of protocols that assures that each core has the same view of the system’s memory, a technique called cache coherency.
As more cores are added to chips, this approach becomes problematic insofar that “the protocol overhead per core grows with the number of cores, leading to a ‘coherency...
4 tags
JavaScript Performance Tip: Use Objects for Sets
A common operation is “does this list already have this item in it?”.
The obvious solution is to use arrays for the list of items and indexOf() as the detection method:
var flintstones = ['fred', 'wilma', 'pebbles'];
assert(flintstones.indexOf('wilma') !== -1);
assert(flintstones.indexOf('betty') === -1);
But if you’re doing a lot of lookups and your elements are unique,...
2 tags
XCPushPop
Xcode 3 and Interface Builder 3 don’t like it when you switch files out from underneath them, like what happens when you switch branches in git and mercurial.
Here’s a handy AppleScript that will remember and close all your open Xcode projects and IB documents. Run it again, and all your projects+docs will be reopened, ready again for action.
tell application "System Events"
if...
Hierarchical File Systems are Dead
Margo Seltzer and Nicholas Murphy:
As users have begun to interact with increasing amounts of data and are increasingly demanding search capability, such a simple hierarchical model has outlasted its usefulness.
It occurs to me that we’re putting applications first (and I include web sites in my definition of applications) simply because they number in the tens-to-hundreds. We can can...
1 tag
mogenerator 1.21
What’s New:
[NEW] Machine templates now include fetched properties by default. (Jonathan del Strother)
[NEW] Xmo’d: better support for --(machine|human|output)-dir model option path: now they can be full or relative to the model file. Xcode group and file references are no longer deleted/re-added with every save. (John Turnipseed)
[NEW] Xmo’d: --log-command model option....
October 2010
2 posts
Attention Surplus
Johann Hari:
I hunted it down online. A week later, the little white pills arrived in the post. Within a few hours of a 200mg dose, I found myself gliding into a state of long, deep concentration, able to read a book for six or seven hours at a time without looking up.
Little mentions like these make me wonder if I’m very abnormal. I have no problem reading a book all day long. In...
2 tags
Mac App Store
I’ve long wanted better application management on Mac OS X, so I applaud the Mac App Store. Application installation has always been a train-wreck on Mac OS X, but at least independent developers were able to make the application updating process reasonable enough thanks to Andy Matuschak’s Sparkle.
I’m also heartened that, unlike the iOS App Store, the Mac App Store is not the...
September 2010
3 posts
4 tags
Beautiful Cray-1 Architecture
Chris Fenton is cloning a cycle-accurate Cray-1A. In 1/10 scale. Awesome.
I was especially smitten with the Cray 1 Hardware Manual’s Computation Section architecture diagram:
I love the hand-drawn draftsman’s lines, use of pseudo-3D projection as a grouping construct and its rectangular dimensioning to graphically depict register capacities.
I’ve created similar...
3 tags
Make Content Editable Bookmarklet
While we’re on the subject of bookmarklets. here’s one that will make the current page content-editable:
Make Content Editable
Use it in good taste.
3 tags
Zap Colors (and Shadows)
I’ve long enjoyed Jesse Ruderman’s excellent Zap Colors bookmarklet to suppress annoying and just-plain-unreadable web page color schemes.
I’ve updated Jesse’s bookmarklet to also clear away text-shadow attributes, since usually they look even worse once you’ve zapped away their background.
To use, bookmark this link or drag it to your favorites bar:
Zap Colors
...
August 2010
5 posts
1 tag
mogenerator 1.20
What’s New:
[NEW] Xmo’d: model comments that start with -- are passed as args to mogenerator. This allows accessing command-line options such as --base-class. (David LeBer)
[NEW] Forward-declare transformable attribute class types. bug 11 (seanm)
[CHANGE] Generated accessors that return BOOLs now return NO instead of 0, avoiding LLVM Static Analyzer warnings. bug 8 (seanm)
...
3 tags
Xcode: View Variable As Binary Gotcha
I don’t want to tell you how many hours I just spent debugging based on the fact I didn’t immediately realize Xcode’s debugger shows you the logical (big-endian) binary representation of variables, not the their in-memory (little-endian) representation.
1 tag
Pear Note 2.0
I’ve mentioned before that Pear Note is an App I Love.
Pear Note 2.0 just shipped with a UI overhaul, web sharing and playback speed control. I just gave it a whirl and it seems even slicker than before.
Recommended.
1 tag
App Store "Try Before You Buy"
Mark Gurman:
Today Apple added a new section dedicated to promoting free applications on the App Store. One of the subsections of this new feature is “Try Before You Buy.” This section features many of the popular “free” or “lite” editions of apps, but the section title is what makes this all interesting.
Apple willfully ignored 25+ years of commercial...
2 tags
iPad Retina Display
Jason Snell / @jsnell:
Lots of people saying they wish they had Retina Display on iPad. Obviously iOS 4 won’t do that. :-) But I don’t mind. iPad display’s fine.
OK, the iPad’s screen is 1024x768 @ 130dpi. Physical dimensions work out to 7.88”x5.91”.
Those same dimensions at 326 ppi would result in 2568x1926 pixels — more than my current 30”...
July 2010
11 posts
1 tag
Nope
Expanded from a tweet:
undefined
nil, NIL, Nil
null, NULL
0, NUL
false, FALSE, NO, kCFBooleanFalse
None
'', "", @""
(), [], {}, //
-1
U?(CHAR|SHRT|INT|LONG|LONGLONG)_(MIN|MAX)
U?INT(8|16|32|64)_(MIN|MAX)
NSNull, NSNotFound, NSInteger(Min|Max), NSUIntegerMax
(FLT|DBL)_(MIN|MAX)
0.0, 0.0f, NAN, INFINITY
Asking the reasoning and/or history behind each of these may be a good interview question.
...
OAuthConsumer on GitHub
I extracted mostly-Jon-Crosby’s Obj-C 2 OAuth implementation into its own GitHub project and rolled in my various fixes.
Patches welcome.