John's Posterous http://blog.jpterry.net Trying to figure it out posterous.com Sat, 21 Aug 2010 01:01:21 -0700 Möbius http://blog.jpterry.net/mobius http://blog.jpterry.net/mobius

Permalink | Leave a comment  »

]]>
/images/profile/unknown75.gif http://posterous.com/people/4afJK8cFJntn John Terry John John Terry
Sun, 01 Aug 2010 01:15:15 -0700 FTW http://blog.jpterry.net/ftw http://blog.jpterry.net/ftw Today I won this.

Sent from my iPhone

Permalink | Leave a comment  »

]]>
/images/profile/unknown75.gif http://posterous.com/people/4afJK8cFJntn John Terry John John Terry
Fri, 11 Jun 2010 10:40:26 -0700 Ceci n'est pas une bomb http://blog.jpterry.net/ceci-nest-pas-une-bomb http://blog.jpterry.net/ceci-nest-pas-une-bomb

Permalink | Leave a comment  »

]]>
/images/profile/unknown75.gif http://posterous.com/people/4afJK8cFJntn John Terry John John Terry
Thu, 22 Apr 2010 13:32:38 -0700 Builders http://blog.jpterry.net/builders http://blog.jpterry.net/builders I saw a group of men in my home town
I saw a group of men tearing a building down
With a heave and a ho and a mighty yell
They swung a beam and the side wall fell
I said to the foreman, "Hey, are these men skilled?"
"You know, the type you'd hire if you wanted to build?"
He laughed and said, "Why no, indeed."
"Common labor is all I need."
"For with common labor I can tear down in a day or two"
"What it took a builder ten years to do."
I thought to myself as I walked away,
"Which of these roles am I going to play?"

Permalink | Leave a comment  »

]]>
/images/profile/unknown75.gif http://posterous.com/people/4afJK8cFJntn John Terry John John Terry
Mon, 12 Apr 2010 23:01:00 -0700 Ordinalize function in Obj-C http://blog.jpterry.net/ordinalize-function-in-obj-c http://blog.jpterry.net/ordinalize-function-in-obj-c
A function to ordinalize numbers in objective-C, e.g. 3 => 3rd, 2 => 2nd, etc.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
- (NSString *)ordinalize:(NSInteger)number{
if (number >= 11 && number <= 13)
return [NSString stringWithFormat:@"%dth",number];
switch (number % 10) {
case 1:
return [NSString stringWithFormat:@"%dst",number];
case 2:
return [NSString stringWithFormat:@"%dnd",number];
case 3:
return [NSString stringWithFormat:@"%drd",number];
default:
return [NSString stringWithFormat:@"%dth",number];
}
}

- John

Permalink | Leave a comment  »

]]>
/images/profile/unknown75.gif http://posterous.com/people/4afJK8cFJntn John Terry John John Terry
Wed, 17 Feb 2010 01:30:43 -0800 Ternary Toggle http://blog.jpterry.net/ternary-toggle http://blog.jpterry.net/ternary-toggle
Toggle using the ternary operator in Obj-C:

isToggled = isToggled ? NO : YES;

Permalink | Leave a comment  »

]]>
/images/profile/unknown75.gif http://posterous.com/people/4afJK8cFJntn John Terry John John Terry
Fri, 05 Feb 2010 21:55:04 -0800 Check it http://blog.jpterry.net/check-it-232 http://blog.jpterry.net/check-it-232

Check it out. 

An arduino and a display, connected via serial.

Permalink | Leave a comment  »

]]>
/images/profile/unknown75.gif http://posterous.com/people/4afJK8cFJntn John Terry John John Terry
Mon, 07 Sep 2009 19:10:46 -0700 Hi http://blog.jpterry.net/hi-1715 http://blog.jpterry.net/hi-1715 Hello.

Permalink | Leave a comment  »

]]>
/images/profile/unknown75.gif http://posterous.com/people/4afJK8cFJntn John Terry John John Terry