Blog

Making NSDate a little less painful

Posted: Mar 26, 2009 by Billy Gray Tagged cocoa, nsdate, nsdate-helper, software

I just made a couple of updates to our NSDate (Helper) project, thanks to a suggestion from Stephan Burlot in our comments. We’re not the only ones who think working with NSDate is a big pain! The code I had in there to determine relative days ago was based off of NSCalendar and while accurate in its own special way, wasn’t quite what you’d want for a relative time display.

In addition to the tweaks made in the code, I finally got around to creating a more illustrative set of examples in the README, and put up a corresponding document in our software archive. Check out how it works over at Github.

Deep Thought

Posted: Mar 26, 2009 by Billy Gray Tagged deepthought, palm, iphone, treo, apple, bluetooth, sync

I miss my old Treo’s bluetooth sync capability. And for a device that does syncing (although in a much more limited way) and has bluetooth, it’s somewhat obnoxious that I have to sync over the wire with my iPhone, that wireless sync isn’t available.

It’s amazing that all smart phones still commonly cripple the bluetooth capabilities of the devices to keep you from using them and for all sorts of reasons – Apple doesn’t want you looking at the file system, Verizon wants you to buy ring tones over their EVDO network, etc. I was hoping Apple would be a pioneer here, tell the carriers to shove it, and go further than Palm did, making other bluetooth capabilities available.

On a mostly unrelated note, there has got to be a better way to package up and bundle Cocoa code you frequently use in different applications.

Last night's changes to Tempo

Posted: Mar 25, 2009 by Billy Gray Tagged tempo, updates

Last night we deployed a pretty substantial update to Tempo, our time tracker. Many of the changes are unseen, nuanced, and/or performance-related, so I want to give our customers an update on what we’ve done. It looks like a short list, but it was quite a bit of work. Details follow for some of the more significant changes.

Improved Time Zone Support

This was a huge update. In order to support future planned features we needed to overhaul our handling of time localization. There were a couple of hiccups last night during the deploy related to this, but we’ve got it worked out now. Tempo does browser-based detection of your time zone for new users, setting your time zone preference. On the Account screen you can now change this preference, should you so desire.

Remote Command Stability Upgrade

As mentioned last week, we’ve done a bit of work to make sure that our remote command message handlers are rock solid in the face of weird input via email, and outages on Twitter. The remote command handlers are Looper daemons that check to see if you’ve sent in time entries or timers by email or Twitter.

Batch Tagging Performance

Also mentioned here previously, the batch tagging interface received a serious speed bump. This was a bit tricky, because we’ve been caching tags as a concatenated string on the entries for performance. Nothing a little PL/PgSQL can’t fix.

Rails Upgraded

It’s no secret that Tempo is a RubyOnRails application. It started it out on 1.2 and we’ve kept upgrading with each update to the framework; we’re now on the 2.3 series. This brings significant performance and flexibility improvements. It may not seem like a big deal, but the amount of work that goes into making these upgrades a success is well worth the sweat considering the capabilities it opens up for Tempo in the future.

Potential XSS Vulnerabilities Closed

Being a security company, we try to never take the appearance of security for granted. We decided to give our code a thorough review to plug any potential cross-site-scripting vulnerabilities. Generally speaking, such holes allow an attacker to execute malicious Javascript in your browser. Such code can execute as you inside the application in question, which can wreak all sorts of havoc. Fortunately, we’ve been really on top of this from the beginning, so we only found a couple of instances in Tempo where this was possible, and plugged up the few holes we found.

Coming Soon!

That’s that for this update, but there’s a lot more coming around the corner. We have a new feature that’s almost ready, and we’re working with nGen Works to develop a new graphic design and improve the user experience dramatically.

Tempo Update Tonight 24-MAR-09

Posted: Mar 24, 2009 by Billy Gray Tagged tempo, update

We’ll be pushing a number of maintenance and performance improvements out to Tempo tonight, at 10pm EDT. This should only briefly interrupt service for our users. More information on the various changes will be posted here once the update is complete.

Moving a Rails app to UTC in PostgreSQL

Posted: Mar 23, 2009 by Billy Gray Tagged postgresql, rubyonrails, migration, utc

We all make mistakes. Or we make decisions that we have to later revisit, to put it kindly! I’ve got a Rails app where I wasn’t using UTC back in the beginning, and this was pre Rails 2.1, so ActiveRecord has been storing all the time stamps into postgres as Eastern time. I need to move all those dates over to UTC for this particular app to go through its next growth spurt, so I threw together a migration that does just that. I’d like to think it couldn’t get more DRY, hope it’s useful to anyone else out there. It’s dependent on Postgres, but you could adapt the increment statement to suit your own DB or to be more generic:

Bands On A Budget & Ben Franklin

Posted: Mar 20, 2009 by Billy Gray Tagged bandsonabudget, bret, benfranklin, rocknroll, team-z

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.

Wrapping Up the Week

Posted: Mar 20, 2009 by Billy Gray Tagged tempo, strip, updates, beta, team, bret

The last two weeks have seen a ton of development work here at Zetetic. We’ve been working to cut over one of our bigger client’s single-sign-on systems to a new location, we’ve built new features into the Strip beta (update coming soon, promise!), and we’ve completed a pile of performance, stability, and maintenance improvements for Tempo, our time tracker.

I should say that a lot of this work was made possible by an extra pair of hands; we’ve recently brought Bret Morgan onto our team as a developer. He’s been doing a lot of great Rails development work on Tempo and helping out with testing and Q&A for Strip.

Without going into all the changes we’ve made in Tempo, there are two I’d like to highlight:

Message Handler Stability

Tempo provides our customers with various ways to log time remotely and start timers, and our message handler is responsible for scooping up email and Twitter messages. We did some tweaking that dramatically improves its ability to handle the unexpected (you wouldn’t believe the weird stuff that comes in from MS Exchanges and Outlook systems), touches up its ability to respond to erroneous messages, and ensures that Message Handler keeps it up. We had some older daemonizing code in there, and ripped it out in favor of the Looper module we posted to Github recently. We’ve been using Looper in PingMe’s handlers for quite some time now, it was time to gemify it and use it in Tempo.

Tag Operations Improved ++bajillion

Sometimes you need to re-name your tags in Tempo, sometimes you need to add a tag like ‘oracle’ to everything tagged ‘apex’, and sometimes you just need to delete a tag from all of the entries in the current report. To provide this capability we added the Batch Tag interface, and it got the job done, but it was horribly slow. We got down and dirty with the SQL and updated our tag caching strategy to get it right. Operations on hundreds and hundreds of entries that used to take really long times (often leading to time-outs, I’m sad to say) are now complete within a second or two.

The batch tags interface still needs work, I will concede. We’re not entirely happy with the UI itself and expect to overhaul it soon.

We are planning to roll out these updates and more on Monday night EDT, and we’ll publish a full list of improvements made once it’s complete.

So let’s talk Strip. A number of people are already finding that the simple Categories → Entries navigation can be a little restrictive. We’re working on a number of features to allow for easy re-categorization of Entries, but there are two new features that will make accessing your data a lot easier:

Recents

Simple idea, extremely convenient, a tab displaying the most recent entries you’ve opened up:

I use this more than the Categories → Entries navigation already.

Search

Sometimes I just don’t remember where I put something, and I don’t really want to figure it out, I just need the information, and I need it now. I also tend to think that perfect taxonomies are a thing of fantasy, and I get annoyed at software that expects me to be a perfect person. Accordingly, the new Search interface allows me to start typing the name of an Entry, or any data I’ve stored in Strip and it will pull up any matching Entries:

I think you can expect to see these new features among others in the next version of the Strip beta early next week. Thanks for all the great feedback, and keep it coming. If you’ve recently e-mailed us about joining the beta, or you’d like to join the beta, be sure to send us your device’s UDID to support@zetetic.net. The Ad Hoc Helper app (free) will actually take care of the details for you.

Nichepapers

Posted: Mar 16, 2009 by Billy Gray Tagged papernet, print, publishing, newsprint, nichepapers

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.

It's TV Time

Posted: Mar 12, 2009 by Billy Gray Tagged hcatlin, tv, shows, hackers, hacktheplanet

Hampton has a TV show, apparently! Looking forward to it.

Hack the planet! Someone should totally do Hack the Planet. In face paint. Gotta be authentic.

Using SoS for blog comments/discussion

Posted: Mar 12, 2009 by Billy Gray Tagged ideas, SonOfSam, blogging, discussions, listserves

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.

NSDate (Helper)

Posted: Mar 11, 2009 by Billy Gray Tagged iphone, codebook, cocoa, nsdate, nsdate-helper, nscalendar

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:


- (void)viewWillAppear:(BOOL)animated {
	[super viewWillAppear:animated];

	// 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?

self.dateLabel.text = [NSDate stringForDisplayFromDate:date];

This gives us:

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.

http://github.com/billymeltdown/nsdate-helper

Zetetic is the creator of the encrypted iPhone data vault and password manager Strip and the open source encryption-enhanced database engine SQLCipher.

Some bug fixes for Tempo

Posted: Mar 11, 2009 by Billy Gray Tagged tempo, update, maintenance

We haven’t forgotten about our time tracker in the midst of all this excitement about Strip! We just pushed a small update to fix a couple of outstanding issues.

The Prototype-based Autocompleter we were using on text entry and tag entry had to go, we’re giving the jQuery version a shot now. The old one was driving us crazy, and it really bothered a few users who took us to task. The fix is a bit over-due, but it’s quite snappy now. If you find the new version to be buggy or have any suggested tweaks, do let us know.

Canceled accounts can no longer log in! (doh) Account cancellations happen some times, and we provide a self-cancel service in Tempo. It really does terminate your account, inactivating your projects and making sure that you no longer get billed. However, a small bug was still allowing users with canceled accounts to log back in to the system. This has been fixed. As always, if you want to reactivate your account with us, let us know, we’ll always be glad to have you back!

Looks like in the process we ended up with a small bug in the bookmarklet that whacks the layout just a bit due to a javascript error. I’ve got a fix ready and we’re hoping to move that out shortly!

Thanks for being patient and for using Tempo.

Update: We will be briefly interrupting service on Tempo today at Noon, EDT to get that bug fix out.

And we're off!

Posted: Mar 10, 2009 by Billy Gray Tagged strip, beta

So today the Strip beta has actually kicked off! We got the last few UDID’s that were sent to us into the mobile provisioning profile, and blasted out a link to download everything with instructions to everyone who signed up. Thanks for waiting!

Apple has made this process – using Ad Hoc provisioning to beta test your app – an incredible time sink. In other words, really expensive. You can get a sense of the process over here.

For those of you who didn’t get a UDID in to us already, send it in, I think we should be able to get you into the next round of provisioning and we’ll re-issue the profile with the next version of the beta once we’ve had a chance to take a look at everyone’s feedback and fix any issues that stand out.

So, please send us your feedback to support@zetetic.net, we’re really looking forward to it!

Hang Tight

Posted: Mar 09, 2009 by Billy Gray Tagged strip, beta

A few folks have asked us what’s happening with the Strip beta. We’re almost finished provisioning all the Ad Hoc profiles. Don’t worry about what this means, other than it’s unbelievably annoying crap that Apple makes us do so we can have beta testers without making you pay for the app. Feel free to write them a strongly-worded letter!

Other things to read while you wait:

  • Unspace has opened up registration for their follow-up conference to RubyFringe: FutureRuby (Stephen and I will be attending!)
  • The AppleiPhoneApps.com folks coin the term Pocket Rejection, which I think is very clever if depressing.
  • Geithner out by June?

Codebook

Posted: Mar 06, 2009 by Billy Gray Tagged iphone, codebook, sqlcipher, openssl, notes

STRIP isn’t the only iPhone application we’ve been working on. Can’t really go into the details right now, but I just wanted to give a heads up:

Strip Beta List

Posted: Mar 02, 2009 by Billy Gray Tagged strip, iphone, update, beta, testing

We’re getting the beta email list together for Strip on the iPhone, we’ll be announcing the details shortly. If you want to participate, please shoot us an e-mail at support@zetetic.net. For those who aren’t hip with it just yet, Strip is our personal information and password manager. It stands for Secure Tool for Recalling Important Passwords, and you can read more about it over here.

Thanks for your patience while we’ve been getting the app together. It’s basically all set to go, but needs some user-vetting, and we need to spend a little time cranking out some utilities to migrate Palm Strip users to the new app (or to at least give them a CSV they can use to migrate to another platform).

And now I leave you with the Moz, got work to do: