10 results per page considered harmful
Posted: August 22, 2011 Filed under: Musings | Tags: rant, usuability, web Leave a comment »Websites the world over, please allow me to have more than 10 results per page! Except for the degenerate case of 10 or fewer items, I think 10-per-page is pretty much the worst case for usability. There are 2 extreme options for presenting a large list, each have their own obvious merrits: A) no vertical scrolling, a screen full is shown at a time and more results are revealed only by paging left and right, and B) no paging, all results on a one, perhaps super-long, page.
10-per-page is a compromise between A and B that has the worst of each and putting you equally in two modes at once. It necessitates many many page flips left & right, like A, but throws out its single benefit of being able to view each page all at once. It forces me scroll up and down, like B, but doesn’t let me stay in that mode long enough to gain its advantage. For many screen sizes, 10-per-page results in an amount of vertical scrolling that perfectly maximizes annoyance, like having to bob up and down. It’s as efficient as reading a book where every page has a fold out flap. There’s a reason why dictionaries aren’t pop-up books.
The one thing that’s reasonable with 10-per-page is that it results in bearable page load times, when on dialup. Are we still designing for 1998′s lowest common demoniator? Yes, I believe google is to blame.
Some better solutions: a gradually revealed infinitely scrolling page – like the last twitter redesign, a large number of results per page – 100 is pretty good, a logical grouping of results per page – a day’s or week’s worth or something say, which at least this reveals some rationalle for combining paging and scrolling besides driving the user mad.
Finally giving away that unlocked iPhone !!!
Posted: July 16, 2011 Filed under: Work | Tags: 321photo, click, contest, iphone, iphone4 Leave a comment »[This was a comment I made to last year's original post about my company's contest. I thought it deserved its own post though.]
Hooray, we’re finally giving away that iPhone in the coming weeks. History: last year my company (my friend & i) started a contest to promote our iPhone camera app 321 Photo. We were giving away a iPhone 4 (kinda new at the time), notably one of the factory-unlocked variety which were available in Canada then but not the US.
After failing to get the initial response we wanted, a little before the original deadline we restated the contest to end only after hitting a (modest) number of twitter followers & facebook fan^H^H^H likes, which also we failed to reach after several months. Our internal plan was to finally do the give-away, no matter how many followers, as promotion of the app’s forthcoming major update.
Well due to feature creep, gold plating and fixes to crap implementations (my bad), it’s taken all this time to get this update done. But not we finally have the improved and rebranded app in the store, Click!. The first flavour available being the new for-pay app ($2 i think), and the free-plus-in-app-purchase-upgrade-for-more-features flavour (precisely an upgrade of 321 Photo) coming very soon.
It’s not too late to enter. Read more about the rebranding on our site’s blog.
[UPDATE: also, to promote my app's update & rebranding, I changed my wordpress theme to Clean Home by Mid Mo Design]
More On Software Patents (pun intended)
Posted: July 16, 2011 Filed under: Musings, Programming | Tags: algorithms, apple, patents Leave a comment »I originally wrote this as a response to this macrumors article where I say Apple’s 2 software patents, for which the judge ruled in their favour against HTC, are lame.
It’s because all software patents are lame [or.. moronic]. The decision on these 2 patents doesn’t cover any part of the core of what makes the iPhone what it is, and like most similar patents, there’s surely prior art in the past decades of the patent-less software industry but nothing that can be proven.
It used to be that a patent was on a physical invention and you submitted its technical design (or even a working unit, was it?) and the mechanics of how it worked was what you had protection for. Also the design was put into the public record so that the invention didn’t die with the inventor, which was apparently common beforehand when everything was trade secrets. This was the problem that the patent system was meant to solve.
A patent on, say, an automatic car window, applied to the design of the mechanism inside the door that makes it work. Some competitor could invent a different mechanism that worked the same way to the user. If patents on physical invention worked like a software patents then they wouldn’t need to submit the mechanism, only the idea and vague outline of its workings (with the lifter unit represented by a square in a diagram, connected to crude drawings of the door, switch and window) such that anyone inventing a new mechanism would be in violation of the patent.
The mechanics and technical design of software, what mirrors the patentable design of physical inventions, is by definition the source code. But because the patent office employs lawyers and not coders, all they have the expertise to analyse are high-level requirements specifications and behavior (diagrams with boxes and lines described by paragraphs of useless legalese).
Software patented should follow the intent of the patent system. It should be a kind of open source process, the code is submitted and visible to competitors, but they can’t use in the marketplace until after however-many years. To be in violation the patent you’d have to had copied that source code, reimplementing it would almost invariably be a new invention. (Don’t believe that? Look at a coding competitions and see how different people’s solutions are.)
A software patent should assist competitors in copying the software exact behaviour! And with source code made open, they can ensure they’re using different algorithms. (Most commenters on that macrumors forum talk about algorithms where they don’t even know what the word means, like that of Apple’s multitouch. Under their concept, all similarly-performing sorting algorithms would be the same because the produced the exact same behaviour to the user)
[I may be totally wrong, IANAL and all I know about patents are vague recollections from a long time ago, probably from a schoolhouse rock PSA]
Wow! Eero language, dialect of Objective-C
Posted: July 7, 2011 Filed under: Musings, Programming | Tags: eero, objective-c Leave a comment »I saw this a few months ago in passing, planned to get back to it, but nearly forgot until earlier today.
http://eerolanguage.org/
I say again, wow. It’s a mod to the clang compiler (or set of patches, or fork, what have you) that adds a tons of yummy syntactic sugar to Objective-C. I can’t wait until this is stable enough for production. If I was starting a project now that had a ship time a few months out, I’d jump on board right away.
For maximal effect read this then the blog in reverse (ie. chronological) order.
Cocoa terse backtrace using NSRegularExpression
Posted: June 20, 2011 Filed under: Programming | Tags: apple, ios sdk, iphone, three20 1 Comment »I recently wanted to improve some logging code to print out the callers to some methods (I’m tracking down errant retains / releases). [NSThread callStackSymbols] is excellent and easy, but I found that simply logging a chunk of the call stack was too verbose. I wanted to include callers from just my app and also parse it to include just the method names, ie. to turn this output from callStackSymbols:
0 MyApp 0x0005da3a -[UnsavedPhoto retain] + 136,
1 CoreFoundation 0x02b75fac CFRetain + 92,
2 CoreFoundation 0x02b7ea52 __CFBasicHashAddValue + 98,
3 CoreFoundation 0x02b86219 CFDictionarySetValue + 105,
4 CoreFoundation 0x02c620d5 -[__NSCFDictionary setObject:forKey:] + 117,
5 MyApp 0x000d631e -[OrderedDictionary setObject:forKey:] + 165,
6 MyApp 0x0005c668 -[PhotoSaver addPhoto:] + 224,
...
into just this: "-[OrderedDictionary removeObjectForKey:] < -[PhotoSaver discardPhoto:]".
I made a method in NSString category (um, because it generates a string), which I call like this:
logthis = [NSString appBacktraceOfDepth:2 fromStackSymbols:[NSThread callStackSymbols]];
Here it is, fairly concise. Note that it does something reasonable if pre-iOS4 and NSRegularExpression is not present (namely just returns a chunk of the line from the top stack frame), fires an assertion if the regular expression fails (because it shouldn’t), and restarts without the restriction of matching only app calls if there are none in the stack before main.
I mostly decided to blog this because I didn’t initially spot any good examples of using NSRegularExpression to extract capture groups. The answer was to use firstMatchInString:options:range: to get a NSTextCheckingResult and then replacementStringForResult:inString:offset:template:.
@interface NSString (backtraceOfDepth_fromStackSymbols)
+ (NSString *)appBacktraceOfDepth:(int)depth fromStackSymbols:(NSArray *)frames;
+ (NSString *)backtraceOfDepth:(int)depth fromStackSymbols:(NSArray *)frames;
+ (NSString *)backtraceOfDepth:(int)depth fromStackSymbols:(NSArray *)frames matching:(NSString *)from;
@end
@implementation NSString (backtraceOfDepth_fromStackSymbols)
+ (NSString *)appBacktraceOfDepth:(int)depth fromStackSymbols:(NSArray *)frames { return [self backtraceOfDepth:depth fromStackSymbols:frames matching:[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleNameKey]]; }
+ (NSString *)backtraceOfDepth:(int)depth fromStackSymbols:(NSArray *)frames { return [self backtraceOfDepth:depth fromStackSymbols:frames matching:nil]; }
+ (NSString *)backtraceOfDepth:(int)depth fromStackSymbols:(NSArray *)frames matching:(NSString *)from {
NSRegularExpression *regex = nil;
if (!NSClassFromString(@"NSRegularExpression") || !(regex = [NSRegularExpression regularExpressionWithPattern:@"[0-9]+ +(.+[^ ]) +0x[0-9a-f]+ (.+) \\+ [0-9a-f]+" options:0 error:nil]))
return [[frames objectAtIndex:1] substringFromIndex:51]; // no regex, be lame and rely on column counts
for (int goodframes=0, framenum=1; goodframes < depth && framenum < [frames count]; ++framenum) {
NSString *frame = [frames objectAtIndex:framenum];
NSTextCheckingResult *match = [regex firstMatchInString:frame options:0 range:NSMakeRange(0, [frame length])];
if (!match)
NSAssert1(NO, @"unparsed stack frame: %@", frame);
if (from && ![from isEqualToString:[regex replacementStringForResult:match inString:frame offset:0 template:@"$1"]])
continue;
++goodframes;
NSString *caller = [regex replacementStringForResult:match inString:frame offset:0 template:@"$2"];
if (from && goodframes == 1 && [caller isEqualToString:@"main"])
return [self backtraceOfDepth:depth fromStackSymbols:frames matching:nil]; // no useful calls from us, take ones from anyone instead
result = !result ? caller : [result stringByAppendingFormat:@" < %@", caller];
}
return result ? result : @"?";
}
@end
My thoughts about the GPL
Posted: January 10, 2011 Filed under: Musings, Programming | Tags: gpl, software licenses Leave a comment »A thought on GPL that didn’t fit in a tweet. GPL developers are idealists and have noble intent and I’m saddened to see people I respect tarnish their efforts when they bad-mouth the GPL.
For commercial software developers, code that people want to contribute to the GPL is unusable to them, but then again so is the source code to MS Word and Photoshop, where’s the vitriol against that set of source code. To use one set of source you sign your over to the FSF’s concept to community, to use the other you accept a job at MS or Adobe and sign your work over to them.
From the outside of both groups, their an unusable set of source I don’t see a big difference between the two. Oh, except that I can inspect and study GPL code and, use the resulting products freely, contribute missing functionality if I so desire, all benefits. To complain that you can look but not touch seems petty to me. Maybe I’m missing the point.
Found my TTPhotoView bug
Posted: January 5, 2011 Filed under: Programming, Work | Tags: 321photo, iphone, iphonesdk, three20 1 Comment »
This is a tip for anyone hacking TTPhotoViewController, and specifically TTPhotoView. If you’re finding swiping only rotating between three photos, and if there’s a mix of landscape and portrait then it gets a redraw bug that looks like this:
then you’ve probably disabled updateLayer (perhaps because it wasn’t working for photos with orientations other than Up) but didn’t replace it with [self setNeedsDisplay]. You’re welcome.
Also, for anyone else trying to untie TTPhotoView from TTURLCache and instead work with images you can’t load asynchronously: don’t. Instead make it work with fake URLs, force-feeding the cache as you go. Hey ALAssetLibrary, thanks for being async in all the wrong places.
A multitouch UIPanGestureRecognizer trick
Posted: November 25, 2010 Filed under: Programming, Work | Tags: 321photo, iphone, iphonesdk, uikit Leave a comment »Even though I wanted our app to still support iPhone OS 3.1, I realized that since our extra gesture-based features are iOS4 only, I could use UIGestureRecognizer for those. I already had a UIView subclass I was using as a transparent overlay where I implemented my custom tap detection and drag tracking. What I did was bite the bullet and replaced it completely with a plain UIView with gesture recognizers attached. In a few minutes I was able to duplicate all the behaviour that took lots of trial and error to get right. Kudos to everyone at Apple who worked on UIGestureRecognizer.
One part of the new behaviour I wanted to try out was a drag that started with two fingers. It looked like UIPanGestureRecognizer was working but it was ending the gesture when one finger was lifted. I wanted to support starting with a two-finger tap but then still track if the user lifts one finger.
I thought I’d have to implement a custom recognizer subclass when I came upon a little hack that seems to work: In my action method, I change the minimumNumberOfTouches property from 2 to 1 on the fly when called in the Began state, then set it back to 2 when called with Ended or Cancelled.
- (void)drag2Fingers:(UIPanGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateBegan) {
sender.minimumNumberOfTouches = 1;
...
} else if (sender.state == UIGestureRecognizerStateEnded ||
sender.state == UIGestureRecognizerStateCancelled) {
sender.minimumNumberOfTouches = 2;
...
}
}
This seems to work but maybe it’s presumptuous to think it’s always going to. I think I’ll be doing that custom recognizer subclass in a future update.
Note to Blenz Coffee
Posted: November 8, 2010 Filed under: Musings, Personal | Tags: firesheep, network secutity, wifi, wpa2 Leave a comment »[comment sent to http://blenzcommunity.com]
Dear Blenz Corporation,
Please add WP2 to your wifi hotspots. Users already need a code on a piece of paper from the cashier, it’s wouldn’t be much more trouble to include a common wifi passcode on those. Something even as obvious as “password” would be ok.
Why? Please search for the recent news about “firesheep” to find out. Turning WPA2 on, even with an obvious password, provides isolated point to point encryption so one user can’t snoop packets from another.
If you feel that some your users won’t be able to use WPA2 or won’t be able to figure out the extra layer, then an option would be to provide a secondary WPA2 network, perhaps with the passcode spelled out in the network name/SSID. People who knew or cared about security would have the option to use that and you would still satisfy those would weren’t compatible. I would suggest adding instructions to your access code entry landing page to help users to migrate from the insecure to the secure network for their own benefit.
Regards,
Neighbourhood Enthusiast Talking Critically Lamenting Open Wifi Networks
UIAlertView + UIImage
Posted: October 14, 2010 Filed under: Programming | Tags: iphone iphonesdk uikit uiimage Leave a comment »Today I wanted some debug code to easily display an UIImage to check its orientation. At first I was going to just add it to my main view then remove it after a few seconds, but then realized a modified UIAlertView would be better since it could be displayed fire-and-forget style like [alert show]; [alert release];, it wouldn’t go away before I had a chance to look, and there could be a title to remind me what I was looking at.
Some trial-and-error was involved to get the message newlines & image position right, but here’s what I came up with. It displays the image scaled to 100 units height.
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:@"\n\n\n\n\n" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
CGFloat imageHeight = 100;
CGFloat imageWidth = imageHeight * image.size.width / image.size.height;
imageView.frame = CGRectMake(floor((284 - imageWidth)/2), 47, imageWidth, imageHeight);
[alert addSubview:imageView];
[alert show];
[alert release];
Intercepting UINavigationController back button
Posted: October 5, 2010 Filed under: Programming | Tags: iphone, iphonesdk, uikit Leave a comment »I was looking for a simple way to add a UINavigationBar to my a modal view controller that presents a normal (pointy) Back button as if there was a root view controller to go back to. It would be as if my outer view was the root view controller.
Now I know one legitimate way of doing this would be to wrap a UINavigationController around my existing outer view an hiding the navigation bar, but that would be an intrusive change to my view class that I didn’t want to change. Another way would be to create UINavigationBar and have my view controller manage it, but this seemed like extra work I was hoping to avoid. I was looking for a self-contained, sneaky way of using a UINavigationController within my modal view controller class’ code.
The two issues were: giving the navigation bar a pointy Back button, and getting called when the user presses the button.
Since it seemed impossible to create a left-pointing button on-demand, I figured the first issue could most easily be solved by making a fake root view controller then pushing my modal view controller onto the UINavigationController’s stack. To keep this detail private to my modal view controller, I made a public method containerViewController that assembles this UINavigationController & fake root view. My caller uses it like:
modalViewController = [[MyModalTableViewController alloc] init];
modalViewController.delegate = whatever;
// and other setup, notification observers added, and such
[myViewController presentModalViewController:
[modalViewController containerViewController] animated:YES];
// rather than presenting modalViewController itself
To intercept the back button, I searched the net to find a solution. One of the top hits suggests subclassing UINavigationController and overriding - [UIViewController popViewControllerAnimated:]. This worked but I was saw that the UINavigationController’s pop animation back to the fake root controller was still happening, which was interfering with my delegate’s for dismissing the modal view. I needed to find another override that could prevent the pop animation.
I noticed that UINavigationController is documented to be the delegate of UINavigationBar, even though it isn’t declared to be in the header file. I figured this meant UINavigationController implemented the UINavigationBarDelegate methods, one of which is - [UINavigationBarDelegate navigationBar:shouldPopItem:] and I found that indeed my sneaky UINavigationController subclass did indeed get a call to this method.
Here the code I made to do what I wanted:
@interface UINavigationController (UndocumentedUINavigationBarDelegateMethod)
- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item;
@end
@interface SneakyNavigationController : UINavigationController
@end
@implementation MyModalTableViewController
. . .
- (UIViewController *)containerViewController {
UIViewController *fakeRootView = [[[UIViewController alloc] init] autorelease];
fakeRootView.navigationItem.title = NSLocalizedString(@"Back", @"Modal TableView Back button");
MyModalTableViewController *navController = [[[MyModalTableViewController alloc] initWithRootViewController:fakeRootView] autorelease];
navController.navigationBar.barStyle = UIBarStyleBlack;
[navController pushViewController:self animated:NO];
return navController;
}
@end
@implementation SneakyNavigationController
- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPopItem:(UINavigationItem *)item {
UIViewController *viewController = nil;
for (viewController in self.viewControllers)
if (viewController.navigationItem == item)
break;
if ([viewController isKindOfClass:[MyModalTableViewController class]]) {
[(ManageSocialAccountsViewController *)viewController close];
return NO;
}
return [super navigationBar:navigationBar shouldPopItem:item];
}
@end
Mysterious twitpic authentication problem fixed
Posted: September 14, 2010 Filed under: Programming, Work | Tags: iphone, iphonesdk, twitpic, twitter 1 Comment »Error 401 from twitpic “Could not authenticate you (header rejected by twitter).”
Thanks to http://shkspr.mobi/blog/index.php/2010/05/howto-twitpic-and-oauth/ and i found that the OAuth header must be created with “GET” even though the request to twitpic is sent as a “POST”. That was unexpected and it probably would have taken me quite a while to find this just going by the documentation.
I wrote an AppleScript!
Posted: September 14, 2010 Filed under: Personal, Programming | Tags: applescript, itunes, mac Leave a comment »After messing up a migration of my iTunes library, I was left with many tracks in my library duplicated on disk
…/iTunes Music/Radiohead/OK Computer/01 Airbag.mp3
…/iTunes Music/Radiohead/OK Computer/01 Airbag 1.mp3
…/iTunes Music/Radiohead/OK Computer/02 Paranoid Android.mp3
…/iTunes Music/Radiohead/OK Computer/02 Paranoid Android 1.mp3
with iTunes using the later duplicate, the one with the ” 1″ prefix.
I made a script to iterate through all the iTunes library, find these tracks that point at these duplicate files, remap them back to the original files, then deletes the duplicate.
Posted script to macscripter.net
This was done with iTunes 9, I have no idea if the script would work on iTunes 10.
My company is giving away an unlocked iPhone 4
Posted: August 25, 2010 Filed under: Work | Tags: 321photo, contest, iphone, iphone4 1 Comment »And by “my company” I mean myself & my friend Brad, aka http://room1337.com
The contest is for promoting our iPhone camera app 321 Photo. Enter by signing up to follow us on twitter at @room1337 and posting a tweet that mentions http://bit.ly/321contest such as the examples on our contest page.
We’re giving away the phone after we get to, I think, 5000 followers. Also, 5 tweeters every day will get a promo code to upgrade our freemium app to the full verison (or, at least, make you not lose the premium features once the demo period expires).
If this contest helps us get more downloads then we can afford to.. well, eat, but to also spend more time adding features to our app. Currently we’re working on AVFoundation API support for faster photos & focus/exposure control, posting photos directly to twitter, facebook & flickr, and other secret features. Winners (and buyers) of our full version will get these features when we finish them (we’re not making 321 Photo 2!, or 321 Photo RED), and the more our users support us the more we can justify working to get it done faster, and the quicker we’ll be able to work on other cool new features we really want to get to.
Our app isn’t the slickest, but we strive to make it functional and efficient and with a unique spin. For example, we’re dedicated to tap anywhere on the screen to take a picture, but also tap & hold and it will take pictures continuously as long as you have available memory. I’ve been able to, after clearing out background apps in iOS4 on my 3GS, take over 20 photos as fast as the camera could snap them, nearly 2 photos per second.
Response to Nick Bostrom on the Fermi Paradox
Posted: June 28, 2010 Filed under: Musings | Tags: science Leave a comment »In this interview Nick Bostrom gives to George Dvorsky invokes Occam’s razor to conclude that intelligence is probably rare enough that cosmic distances separate us, yet is failing to apply it when he suggests an unseen Great Filter mechanism. He talks about the super-rare intelligence case as his “belief”, a telling word given that our lack of data gives us no firmness for any kind of certainty. Given another sample point in our Solar System, he should be re-evaluating his conclusions and not inventing a scenario that supports his beliefs.
Another possibility, if life is common, is that intelligent life is somewhat common as well, or perhaps simply “rare” vs Nick’s super-rare. And Fermi’s Paradox has other often-discussed solutions that Nick waves off: difficulty in detecting of intelligence: they wouldn’t know to come check visit us and we wouldn’t see them, stellar distances & travel difficulty: how frequent do intelligent explorers visit any given system vs human history. One needn’t even mention the less likely possibilities that they have visited and just chose to not make themselves be known. In fact, adding the data point that life is common may be argued to decrease the likelihood that others would have come visiting: because before humans evolved however-many few thousand years in the past, Earth biology might not have been so unique to be worth study.
I don’t believe Common life + Super-rare intelligence + Great Filter is not a simpler explanation than Common life + Somewhat rare intelligence + standard responses to the paradox. Certainly not simpler enough to justify equating the discovery life elsewhere in the solar system with “bad news”. That kind of philosophy has been argued by Dr. David Livingston and guests to his audio program such as Robert Zubrin to be a dangerous trend guiding current Nasa policy, and not one I’d like to see propagate unchallenged.
Improvement to Trevor Harmon’s UIImage+Resize.m
Posted: January 14, 2010 Filed under: Programming | Tags: coregraphics, iphone, iphonesdk, uikit 6 Comments »Trevor says:December 24, 2009 at 9:18 pmTrue; I didn’t bother with handling the imageRotation setting in croppedImage. I changed the method to include a source code comment explaining this.If anyone would like to contribute an improved croppedImage function that fixes this oversight, I’d be happy to include it in the distribution.
// Returns a copy of this image that is cropped to the given bounds.
// The bounds will be adjusted using CGRectIntegral.
// JPMH-This method no long ignores the image's imageOrientation setting.
- (UIImage *)croppedImage:(CGRect)bounds {
CGAffineTransform txTranslate;
CGAffineTransform txCompound;
CGRect adjustedBounds;
BOOL drawTransposed;
switch (self.imageOrientation) {
case UIImageOrientationDown:
case UIImageOrientationDownMirrored:
txTranslate = CGAffineTransformMakeTranslation(self.size.width, self.size.height);
txCompound = CGAffineTransformRotate(txTranslate, M_PI);
adjustedBounds = CGRectApplyAffineTransform(bounds, txCompound);
drawTransposed = NO;
break;
case UIImageOrientationLeft:
case UIImageOrientationLeftMirrored:
txTranslate = CGAffineTransformMakeTranslation(self.size.height, 0.0);
txCompound = CGAffineTransformRotate(txTranslate, M_PI_2);
adjustedBounds = CGRectApplyAffineTransform(bounds, txCompound);
drawTransposed = YES;
break;
case UIImageOrientationRight:
case UIImageOrientationRightMirrored:
txTranslate = CGAffineTransformMakeTranslation(0.0, self.size.width);
txCompound = CGAffineTransformRotate(txTranslate, M_PI + M_PI_2);
adjustedBounds = CGRectApplyAffineTransform(bounds, txCompound);
drawTransposed = YES;
break;
default:
adjustedBounds = bounds;
drawTransposed = NO;
}
CGImageRef imageRef = CGImageCreateWithImageInRect([self CGImage], adjustedBounds);
UIImage *croppedImage;
if (CGRectEqualToRect(adjustedBounds, bounds))
croppedImage = [UIImage imageWithCGImage:imageRef];
else
croppedImage = [self resizedImage:imageRef
size:bounds.size
transform:[self transformForOrientation:bounds.size]
drawTransposed:drawTransposed
interpolationQuality:kCGInterpolationHigh];
CGImageRelease(imageRef);
return croppedImage;
}
- (UIImage *)resizedImage:(CGImageRef)imageRef
size:(CGSize)newSize
transform:(CGAffineTransform)transform
drawTransposed:(BOOL)transpose
interpolationQuality:(CGInterpolationQuality)quality;
- (CGAffineTransform)transformForOrientation:(CGSize)newSize;
The End-around of Net Neutrality
Posted: May 12, 2009 Filed under: Musings | Tags: games, netneutrality Leave a comment »OnLive is one of several services, if the cable companies’ wishes come true, that may need special quality of service that your provider would like to sell you. They may end winning the Net Neutrality fight after all by going at it the other way.
They wanted the ability to limit or cap normal service unless both ends pay, and it’s looking likely they won’t get a chance to do this. Instead, they just need to invent an extra high-capacity or low-latency capability that nobody gets by default, then they can charge for that and end up with nearly the same result.
Why will people pay for better than normal capacity or latency? Services like OnLive that may not work well without it. If more of these services appear the cable companies can let us have our Net Neutrality cake, and they’ll eat it too. Leo Laporte says the providers will be the ones selling OnLive to you, ensuring you can’t even get the service without paying for the connection mojo.
The question is, however, will the providers be so desperate that they’ll pay services like OnLine the privilege to charge the public rather than the other way around?