Archive for February, 2009

Charles v3.3 released

Sunday, February 15th, 2009

I’ve released Charles v3.3 today. This release adds several new and exciting features including:

  • HTML, CSS & RSS/Atom validation
  • XML export formats
  • JSONP support

I’ve blogged previously about these, and other new features, so I’m just going to link through to those! Read the first announcement and the second announcement.

The next release of Charles will focus on improving various UI and usability features. Particularly the ability to focus in on a small set of hosts, so you don’t get cluttered with others. Also I’ll be making improvements to the Sequence view; probably some sorting. I’ve received lots of suggestions along these lines; if you have anything to add please leave a comment with your thoughts!

Download Charles v3.3

iPhone cannot play video over 3G

Monday, February 9th, 2009

We just tracked down an issue where H.264 video would play on the iPhone over WiFi but not over 3G. The problem turned out to be that the server emitted a Vary: User-Agent header as part of its mod_deflate handling. That header alone was causing the video to fail to play over 3G. I suspect that it may have been a problem on the 3G network itself rather than the iPhone. If you have similar head-scratching issues maybe this is the cause.

Charles v3.3 public beta 2

Monday, February 9th, 2009

The second public beta of Charles has just been released. This update adds:

  • “Window always on top” setting and window remembers maximised state
  • Summary table column sorting improved to sort numeric columns
  • Map Remote can now map http requests to https servers
  • Location matching now supports adding $ after the final / for an exact directory match rather than an implicit wildcard

It also includes fixes and improvements to JSON and JSON P and validation. In particular you can now repeat a request within the validation results and have it repeat the original request and then validate the result – really handy for iterative testing and fixing!

This release is heading for final this week I hope so please send your feedback.

Download Charles v3.3 public beta 2

iPhone OS 2.2.1, UITableViewCell and UITextAlignmentCenter

Sunday, February 8th, 2009

As of OS 2.2 there was a problem with UITextAlignmentCenter and UITableViewCells where the text would always show left aligned. The easiest solution was to compile your application for OS 2.0, if you weren’t using any new API features, in which case the original behaviour continued to work. However as of OS 2.2.1 it appears that this no longer works! There were some proposed solutions but they also don’t appear to work anymore.

I’d like to continue building my application for OS 2.0 compatibility so I don’t unnecessarily inconvenience users who haven’t upgraded yet, so I built the following solution that you may find useful – a UITableViewCell subclass that centres the text itself and works when your application is compiled for OS 2.0 or 2.2.1 (and probably others in between).

@interface MyButtonTableViewCell : UITableViewCell
{

}
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString*)reuseIdentifier;
@end

@implementation MyButtonTableViewCell

- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString*)reuseIdentifier
{
	if ((self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) != nil) {
		self.textAlignment = UITextAlignmentCenter;
	}
	return self;
}

- (void)dealloc
{
	[super dealloc];
}

- (void)adjustLabelSize
{
	/* Center the label view. This works around a bug in OS 2.2 which now effects even code compiled for OS 2.0.
	 * When compiled for OS 2.2.1 this code is unnecessary but still works.
	 */
	NSArray *subviews = self.contentView.subviews;
	if ([subviews count] > 0) {
		unsigned int i, c = [subviews count];
		for (i = 0; i < c; i++) {
			UIView *subview = [subviews objectAtIndex:i];

			if ([subview isKindOfClass:[UILabel class]]) {
				CGRect frame = subview.frame;
				frame.origin.x = floorf(self.contentView.frame.size.width / 2 - frame.size.width / 2);
				subview.frame = frame;
			}
		}
	}
}

- (void)layoutSubviews
{
	[super layoutSubviews];
	[self adjustLabelSize];
}

@end

Debian Sarge to Lenny upgrade

Friday, February 6th, 2009

This morning I have upgraded a non-production but important server from Debian Sarge to Debian Lenny. Figuring it was about time that I did the upgrade I took some advice that Lenny is very stable and could buy me a longer support period by skipping Etch altogether. Time will tell.

This post itemises the steps I went through for posterity and prosperity if I ever need to refer to them again. I’m writing this up from my notes so it is possible that I’ve missed something; if you do attempt a similar upgrade yourself and something turns up, please feel free to suggest it in the comments.

I started by reading (skimming) the release notes for Lenny on upgrading, which are currently in draft as it is in testing. In the future Lenny will obviously become the release version so that URL will become invalid. If you’re upgrading I suggest you to the same; furthermore if you’re upgrading from Sarge read over the Etch release notes for upgrading too. My process is based on and pretty much identical to the process described therein.

(more…)