We’re a pretty diverse bunch here, so once in a while I like to drop some info and links to various things we’re involved in.
Bret, who recently joined our team, has a really cool project called Bands On A Budget. I’ve been in a number of musical projects in the last.. uhm… 15 years I guess? And while I love the whole DIY thing, I have songs to write and shows to book, so I don’t have time to go silk-screening anything, really. For my last band we needed good and cheap t-shirts and stickers on the quick, and we kept going back to BoaB because the orders were always correct, the work was always good (the silk screening of our t-shirts was fantastic).
I’ll definitely be going through them to get merch done up for my next project. The new band is called Ben Franklin. In the words of Scott Pilgrim, we’re totally not sucky, and we’ll be recording our first proper record in the beginning of May.
I’m still keeping an eye on the development of Papernet-like things, and my friend Warren posted a link to an interesting article this morning about the shrinking newspaper/print business and “nichepapers”, which includes this neat little quote:
“When a 14 year old kid can blow up your business in his spare time, not because he hates you but because he loves you, then you got a problem.”
Quite a different perspective that people have these days.
I like Zed’s idea of using Son of Sam for blog comments/e-mail discussion, it’s a really great idea. It’s perfect for sites with high comment rates that need to filter down noise in a discussion and foster some real thought churning. It may give the impetus for actual discussion instead of the common sounding off of anonymous trolls.
Zed’s really into rules (is this blog post even 500 words?), which makes perfect sense for high traffic sites, but a little less restriction on the length of time that a discussion can last and that a user can stay subscribed, it’d be really useful for folks like us who have a blog that does get comments but doesn’t have quite such a need for policing them and keeping the discussion on track.
An interesting marriage between the forum and the mailing list! Too bad the Son of Sam code isn’t up anymore, I’d be looking at it right now (despite my utter and complete aversion to Python). I even checked archive.org, I’m so curious.
I saw Matt Drake’s post with tips about using NSDate over on Mobile Orchard’s iPhoneFlow today and figured I’d give the drummer some more.
When setting up Codebook (a secure notebook iPhone app we hope to release soon) I needed to do some fancy-pants date formatting all over the place because I wanted to mimic what Apple had pulled off in the Notes application for iPhone. Now, there are many ways to do this, I’m sure I’ve overlooked some useful tricks that Cocoa provides (it has a number of default date format “styles” you can use), but I think what’s important is to always avoid repeating yourself. And to do it in such a way that if, say, I realize that I really should have used the Cocoa candies, I could change the implementation in one place and the rest of my code would be none the wiser. DRY, as it were.
Now date calculations in Cocoa can be nasty. I don’t know if they have to be, but you can end up with a real mess of code involving NSCalendar, NSDateFormatter objects, or calculating offsets by seconds. Totally ugly.
Objective-C’s categories are a really nice way to bottle up some of this code and re-use it. In Codebook I used categories to implement helper methods on built-in objects and classes, like NSDate. So in the aforementioned example of Codebook, I implemented a series of methods for doing date calculations, and convenient methods for getting calculation-based formatted dates. Wrapping them up in NSDate (Helper) allows me to do things in the app like:
// figure out date display data at top of view NSDate *relativeTime = (!targetObject.timestamp) ? [NSDate date] : [targetObject date]; dateLabel.text = [NSDate stringFromDate:relativeTime withFormat:@"MMM d"]; timeLabel.text = [NSDate stringFromDate:relativeTime withFormat:@"h:mm a"]; daysAgoLabel.text = [relativeTime stringDaysAgo];
//... }
The really tricky part on the notes listing was getting the conditional display like ‘11:59pm’ for an entry updated today, ‘Friday’ for a date within the last 7 days, ‘Jan 23’ for a date in the current calendar year, and ‘Nov 16, 2008’ for dates not in the current calendar year. And how simple is it now?
I have posted NSDate+Helper on Github, anybody is welcome to use it, fork it, add things, send pull requests. I bet we could build up a nice library of these guys for use in our applications.
Zetetic is the creator of the encrypted iPhone data vault and password manager Strip and the open source encryption-enhanced database engine SQLCipher.
Zetetic LLC is a small company specializing in applied data security. As the developers behind the SQLCipher encrypted database library and Codebook Password Manager, hundreds of organizations and millions of users trust Zetetic’s software and frameworks.