December 2011
3 posts
1 tag
Klotzbach & Gray Discontinue December Hurricanes...
via Russ Roberts:
Two top U.S. hurricane forecasters, famous across Deep South hurricane country, are quitting the practice of making a seasonal forecast in December because it doesn’t work.
William Gray and Phil Klotzbach say a look back shows their past 20 years of forecasts had no predictive value.
I love the intellectual honesty this must have taken. I wish practitioners of software...
1 tag
mogenerator 1.24
What’s New:
[FIX] Was incorrectly using -mutableSetValueForKey: for ordered relationships instead of -mutableOrderedSetValueForKey:. bug 75 (Martin Schürrer)
[NEW] Now generates Mike Ash-style constant structures for attributes, relationships and fetched properties. This allows you to write code like [obj valueForKey:PersonMOAttributes.age]. Tip: you’ll need to enable ARC...
2 tags
Death and Resurrection of an SSD
Summary: SSDs live fast, die young, and pretend to be OK even while they’re dying. Don’t use one without awesome backups.
And sometimes, they come back from the dead.
※ ※ ※
On November 30 2010, I received my first SSD: a 240 GB OWC Mercury Extreme Pro.
On Thursday, November 10 2011, the drive “died”.
I claimed on twitter there was no warning: there...
November 2011
2 posts
Nearly Hygienic C Macros via __COUNTER__
A few months back Benjamin Stiglitz taught me that it’s finally possible to build practically-hygienic macros with modern plain ol’ C #defines. Here’s his example:
#define MIN_PASTE(A,B) A##B
#define MIN_IMPL(A,B,L) ({ \
__typeof__(A) MIN_PASTE(__a,L) = (A); \
__typeof__(B) MIN_PASTE(__b,L) = (B); \
MIN_PASTE(__a,L) < MIN_PASTE(__b,L) ? MIN_PASTE(__a,L) :...
2 tags
Copy OmniFocus Task Outline Text to Clipboard
Here’s a quick script that will take the selected tasks in OmniFocus 1.9.4 and put a simple space-indented text representation on the clipboard:
tell application "OmniFocus"
tell first document window of front document
set selectedItems to selected trees of content
if ((count of selectedItems) < 1) then
error "Please first select a task"
end if
...
October 2011
1 post
Scott Adams on Systems
Scott Adams:
The trick is that I didn’t have an exercise goal in the first place, so I couldn’t have failed to reach it. What I do have is an exercise system, and I was completely successful at the system. My philosophy is that losers have goals and winners have systems.
Building systems is far more effective than merely aiming at goals.
September 2011
7 posts
2 tags
Swap Word Instances in BBEdit
Sometimes I want to swap all instances of “foo” with “bar”. That is, I want every instance of “foo” turned into “bar” and vice-versa.
This may sound odd, but I encounter often it enough that I formed a strategy long ago, three replacement operations:
Replace “foo” with something unique (a sentinal) in the document. I often use a...
2 tags
Switch Between Tabs and Spaces in BBEdit
Here’s a script I wrote to make it easy to switch between tab-based and space-based indention in BBEdit 10:
tell application "BBEdit"
tell text window 1
if expand tabs then
set currentMode to "Spaces (" & tab width & ")"
else
set currentMode to "Tabs"
end if
display dialog "Current Mode: " & currentMode & ".
Enter...
1 tag
Apps I Love: DTerm
DTerm is a free app that uses the Accessibility API to figure out the current document you’re looking at. When you hit a hotkey (mine is bound to command-shift-return), it pops up a window with a shell command line with the working directory already set to the frontmost document’s folder.
DTerm works awesomely with Finder, BBEdit, TextMate, Xcode, GitX and a bunch of other Mac...
Google Storage Economics
Scott McNulty / @blankbaby:
You can add 1 TB of storage to your Google account for $256 a year. Who knew? bit.ly/pDO7aS
At first glance it seems excessive that Google would charge you $256/year for an extra 1TB of storage when raw 1TB drives run ~$60-80 on Amazon today.
But you need to keep in mind a lot of extra factors:
Redundancy. You’ll need at least two drives to match...
Mac Illustrator Alternatives
Jon Stokes / @jonst0kes:
So the answer to my Illustrator question seems to be that there is no Pixelmator for vectors. You just have to shell out for AI.
I purchased LineForm a while back, however since Freeverse was bought out by ngmoco I doubt for its future. Here’s some other options, mostly gathered by Chris Foresman:
Artboard
iDraw
Intaglio
Sketch and DrawIt
...
[NSScreen mainScreen] != screen with menubar
Karsten Kusche:
for years i’d thought that [NSScreen mainScreen] returns the screen with menu. It returns the screen with the window that has keyboard focus
My testing doesn’t agree with +mainScreen’s documentation:
The main screen is not necessarily the same screen that contains the menu bar or has its origin at (0, 0). The main screen refers to the screen containing the...
Transformation Matrix Funhouse
I wrote Transformation Matrix Funhouse to make is easier to understand and play with -webit-transform: matrix3d(). It’s also cool for grokking transformation matrices in general.
August 2011
7 posts
JRTruthTable
JRTruthTable is my new small+simple Objective-C class for resolving what state you’re in given a condition set.
I have a Cocoa app I wrote back in 2004 for generating truth tables. I was going to modernize it an release it, but now I think I’ll just turn it into a Cappuccino app — there’s no need to tie it to Mac OS X. The rewrite is a little while away, however.
1 tag
HOWTO Use UTF-8 Throughout Your Web Stack
Good is the enemy of Great Latin-1 is the enemy of UTF-8
You write web apps. You understand the web is global, and want to support internationalization. You want UTF-8.
UTF-8 is extremely sane. Well, as sane as an encoding can be that features backwards-compatibility with ASCII.
Everything you care about supports UTF-8. Trust me: you want it everywhere.
Problem is, every last part of the...
3 tags
QuickPick Pulled From App Store
You may recall Seth Willits, whose app QuickPick was rejected from the Mac App Store for being “confusingly similar” to 10.7’s Launchpad. Even though QuickPick has been shipping for years before Launchpad and also runs on 10.6.
Seth submitted a formal appeal to Apple’s App Review Board on April 7 2011. After seven weeks Apple denied his appeal. Seth asked for a...
Drove the Chevy to the Levy
bitcartel / @bitcartel:
Today: 40th Anniversary of Nixon ending Gold Standard. 1 USD was worth 1/35th of an ounce of gold, now just 1/1750th. http://t.co/m3v2LeM
In 1971 you have $105.
$35 goes under the mattress, $35 into a savings account at 0.80% monthly and you buy a single 1oz gold coin.
Satisfied with your investments, you hop in your Corvair, get distracted upon hearing American Pie...
BART Disables Cell Phone Service
San Francisco BART:
BART temporarily interrupted [cell phone] service at select BART stations as one of many tactics to ensure the safety of everyone on the platform.
I’m glad this happened — it provides real-world evidence to the extent mainstream communication channels operate at the whim of nameless bureaucrats.
Cable Subscriber Inflation
Peter Svensson writing for the Associated Press:
The U.S. subscription-TV industry first showed a small net loss of subscribers a year ago. This year, that trickle has turned into a stream.
I pay Comcast $65/month for Cable Internet and Basic Cable.
I don’t need Basic Cable — I don’t even have a TV attached to it. However Comcast would charge me an additional $5/month...
5 tags
Hickey on Values, Identity and State
Rich Hickey delivers a must-watch presentation.
I have a hard time watching presentations on my computer, but this one is very worth it.
In an approachable and high-level manner, Hickey effectively attacks variables as insufficient abstractions, making a compelling argument and offering effective replacements.
Though I’m a Lisp fan, I haven’t been too interested in Clojure since...
July 2011
10 posts
Survival of the Fattest
Olaf Storbeck:
The poor learning ability of the banks yields another important insight: We cannot rely upon the idea that market forces punish badly managed banks. In the financial industry the principle of the “survival of the fittest” does not apply. In this sector we have “survival of the fattest” instead.
I much prefer “Survival of the Fattest” as a descriptive term of the...
"I wish I was born later"
Marco Arment / @marcoarment:
Grandpa: “I wish I was born later.”
Me too. In particular, I wish I were born where born around 1990, so I could take advantage of the web in my formative years for technical information instead of spending lots of money on now-obsolete books.
This also strikes me as a good metric for humanity’s progress. There’s not a time in the past...
4 tags
Using M4 to Compose Your .gitignore File
Chris Wanstrath has a cool project to collect folks’ .gitignore files.
Chris breaks these down by platform and language/environment, which is great. What’s less great is you can’t pass multiple files to core.excludesfile, so you can’t easily compose them.
The ideal situation would to extend git to support multiple ignore files, but that’s a lot of pain (mostly...
1 tag
mogenerator 1.23
What’s New:
[NEW] Support for Mac OS X 10.7 Lion’s ordered relationships (generated relationship code uses NSOrderedSet and NSMutableOrderedSet). (rentzsch 1 2 3)
[NEW] Optional support for ARC: pass --template-var arc=true to mogenerator. bug 63 (Adam Cox)
[NEW] New template that dumps a binary .xcdatamodel into a pseudo-ASCII-plist format perfect for diffing. A great way to...
1 tag
Apps I Love: Yojimbo
I accidentally stumbled across my notes for what would become C4, and I realized I’ve been using Yojimbo for a very long while.
Yojimbo is such a great app, it hard for me to think of the time before I used to use it.
I use Yojimbo as a digital junk drawer, storing programming snippets, shell invocations, SQL nuggets, notes on different projects & processions and archives of web...
2 tags
Apps I Love: JollysFastVNC
If you use VNC much at all, you need JollysFastVNC:
Here’s how it’s better than Apple’s Remote Desktop, which I struggled along with for too many years:
Much faster to connect
Smarter keyboarding (cmd-tab switches apps in the remote process (though ARD may have caught up here))
“Paste as keystrokes” command
Auto clipboard syncing
Built-in ssh tunneling
...
Time Machine: Your Version Control Safety Net
Justin Miller / @incanus77:
Just accidentally blew away 16 files’ & days’ worth of work with hg. Looked up, TIme Machine had just finished. Lost < 1 min. of work.
Time Machine has also repeatedly rescued me from from numerous VCS missteps.
It’s gotten to the point where I want to write a command-line tool that would ensure a Time Machine snapshot before executing...
3 tags
Hibari Mac App Store Holdup
On June 30 Twitter made good on their threat of requiring OAuth flow for third-party Twitter clients in order for them to receive Direct Messages.
Fortunately we submitted Hibari 1.1.4 to Apple on June 27.
Unfortunately it turns out that wasn’t nearly enough time.
On June 30 Apple rejected the Hibari 1.1.4 update solely because its App Store description mentioned you can download a...
5 tags
GoDaddy SSL Cert Scam
On Aug 10 2010 I bought a 1-year SSL cert from GoDaddy (I know, I know) for $12.99. I installed it and successfully used it on an ecommerce site.
On June 25th I get an email warning me that my cert “is coming up for renewal in 15 days”. June 25 + 15 days == July 10th. Sure enough, this morning GoDaddy auto-renewed my SSL cert. Which I never enabled auto-renew on. And, they...
1 tag
The Dreaded Tappable Link
Dan Moren:
Some developers have already begun to make the necessary changes. Last month, video-streaming provider Hulu updated its Hulu Plus iOS app, dropping a link that allowed users to visit the company’s website to sign up for a paid subscription. Others, such as Netflix, have exploited a loophole: The login screen for the video-streaming app tells users to “Visit netflix.com to sign up”...
June 2011
1 post
3 tags
Taxes and Certified Mail
I just paid $48.88 to the State of Illinois, a penalty for my supposed late payment of my 2010 taxes.
I mailed my 2010 forms and payments to both the federal government and state government the same day: March 14th (they need to be postmarked by March 15th because I’m an S-Corp).
Miraculously the Federal government — not one to cut corporations any slack deadline-wise — got...
May 2011
1 post
4 tags
"Search With Google" Using Chrome
About a month back I tweeted:
people of the Internet: how do I make Search With Google (Command-Shift-L) use Chrome (my default browser) instead of Safari?
Mark Rowe informed me:
“Search With Google” is a service provided by Safari.app. You’d need to create a new service and bind it to that key equivalent.
Working from Mark’s suggestion, I first disabled...
April 2011
6 posts
Delegate Genericity vs Specificity
Andrew Pontious:
Let me spell it out: if you have a view subclass (or any class, really) that needs functionality from an associated class, add a typed reference to that associated class. Don’t add an untyped “delegate” reference.
I agree with Andrew that generic, untyped delegates belong more in framework codebases than application codebases.
Applications get to be more specific than...
Application Commoditization
Marco Arment:
Apple commoditizes apps to make iPhones and iPads more attractive (and exclusive).
A wonderfully succinct explanation.
Be very careful when calling -[NSNotification...
Samuel Défago:
Never ever use -[NSNotification removeObserver:] to unregister from notification events, except from a dealloc method. This might cancel registrations made by a parent class, and you cannot know how a parent class is implemented (at least you shouldn’t care). Stick to this rule even if your parent class is NSObject: Your class hierarchy might change in the future, and you...
2 tags
QuickPick Kicked out of the App Store
Seth Willits / @sethwillits:
QuickPick is being kicked out of the App Store.
It doesn’t matter that QuickPick existed years before Launchpad.
Rejected.
Period.
QuickPick is Seth’s application and document launcher. Apple has apparently decided to remove/retroactively-reject QuickPick as being too similar to 10.7’s Launchpad.
A Bad Good Idea
I had a vision of embedding C++ in a funny kind of comment in (Obj-)C(++) that clang would recognize, dynamically compile and then execute its transformations against the containing code’s Abstract Syntax Tree.
I hope to emerge from my LLVM fever swamp any day now.
1 tag
node-mysql-oil
node-mysql-oil is my thin, slick layer on top @felixge’s awesome node-mysql.
It aims to make SQL more JavaScripty by expressing SQL statements as literal data structures instead of dumb strings.
So instead of this:
db.query(
'insert into t_test '+
'(c_user, c_pass, c_uid) '+
'values ("root", "pass", 501)'
);
You can write this:
db({
insert_into: 't_test',
values:{
...
March 2011
10 posts
Tribal Thinking
Tim Bray:
I currently work for Android; can I write about Apple? Or, when I was at Sun, could I write about Dell or HP or Microsoft? I do and I did. But very carefully. The one thing people like better than tribal thinking is a ringside seat at a fight.
I think tribal thinking is a wonderfully succinct phrase for a litany of counterproductive-verging-on-evil human tendencies.
2 tags
Motorola's Web-based OS
Thomas Claburn @ InfomationWeek:
Motorola Mobility has hired a number of experienced mobile and Web engineers from Apple and Adobe and is developing a Web-based mobile operating system as a possible alternative to Google’s Android software, according to a source familiar with the matter.
(via HardMac)
Claburn apparently gets his information from a one Jonathan Goldberg, an analyst....
1 tag
#oldtwitter's cookie
Tonight a twitter cookie of mine expired and I was shunted again into #newtwitter.
Twitter offers a link to switch back to #oldtwitter, but it’s been broken for months now.
I did some digging and found the expired cookie entry in ~/Library/Cookies/Cookies.plist:
<dict>
<key>Created</key>
<real>322609921.51493198</real>
...
The Case for Associative Main Memory and Storage
Steve Dekorte:
If you look at the hw/sw stack, you’ll find that most everything we do involves associative lookups and it would all be much simpler if we moved to using CAMs (content addressable memory) for main memory. A CAM is basically a hw version of a sw dictionary/hasttable. It can do single cycle lookups between a key and a value and keys can be chosen at will.
Current PCs...
SixteenBitUniversalCharacterSetCharacter
Carbon’s MacTypes.h:
typedef unsigned short UInt16;
typedef UInt16 UniChar;
Core Foundation’s CFBase.h:
typedef unsigned short UniChar;
Foundation’s NSString.h:
typedef unsigned short unichar;
Three different frameworks with very differing tactics all boil down to an almost-same name and the exact same typedef.
This is the best evidence that I’ve seen in...
1 tag
Avoiding retain cycles with blocks
Joel Bernstein:
In the traditional pattern for breaking retain cycles, the object with the strong reference is responsible for notifying the other object when it’s deallocating, so the other object can change its weak pointer to nil. This would neatly avoid the problem, because messages sent to nil don’t cause exceptions. Sadly, there’s no way to tell a block to nil-out a pointer in its...
1 tag
retain/release debugging
While I’m on the topic of debugging, here’s some code I use when I tracking down a retain/release bug:
#if 1
- (id)retain {
NSUInteger oldRetainCount = [super retainCount];
id result = [super retain];
NSUInteger newRetainCount = [super retainCount];
printf("%s<%p> ++retainCount: %lu => %lu\n", [[self className] UTF8String], self, oldRetainCount,...
4 tags
id self = (id)0x1 for Block Debugging
I’ve just been bitten again by how easy it is to accidentally retain self using Objective-C blocks.
After a little thought, I came up with a single line of code you can place in the header of your block that will root out most (all?) possible errors: id self = (id)0x1.
Here it is in action:
@implementation MyClass
@synthesize window;
-...
Multitasking
Lukas Mathis:
However, the argument that multitasking on computers is bad because humans can’t multitask is flawed. It uses the word «multitasking» in two different ways, but implies that the two kinds of multitasking are somehow the same thing. They’re not: a task (or an app) on a computer, and a task performed by a human don’t map to each other one-to-one. In fact, a single task performed by...
1 tag
mogenerator 1.22
What’s New:
[FIX] Xmo’d 1.21 introduced a bug where it would no longer create a source folder for your data model (it would work fine it one already existed). bug 43 (rentzsch)
[NEW] -keyPathsForValuesAffectingValueForKey: is now generated in machine.m files, populated by your entity’s scalar attributes. The idea is code like myObject.myIntAttributeValue++ tells Core Data...
February 2011
2 posts
2 tags
CS is not for me
Eugene Wallingford:
Of course, using a powerful, fun language in CS1 creates a new set of problems for us. A while back, a CS educator on the SIGCSE mailing list pointed out one:
Starting in Python postpones the discovery that “CS is not for me”.
After years of languages such as C++, Java, and Ada in CS1, which hastened the exit of many a potential CS major,...
1 tag
Carrier Billing
I wrote:
All said, I think webapps + Carrier billing are the most credible upcoming threat to the App Store so far.
Peter-Paul Koch agrees and fills in details:
One of the major changes 2011 is going to bring is the start of operator billing on the web. It will provide a user-friendly way of making mobile (and web) payments without those silly credit cards that are preventing the...