18 May 2010, 4:04pm

leave a comment

Robot Chicken Star Wars

Finally saw Robot Chicken Star Wars the other day, @AusRob practically forced me to watch it as my education had been clearly lacking.

Have to say, I love this dialog:

Palpatine: [on the phone with Darth Vader] Vader! How’s my favorite Sith?… Whoa whoa whoa… whoa, whoa. Just – slow down. Huh? What do you mean they blew up the Death Star? Fuck! Oh, fuck! Fuck! FUCK!… Who’s “they”?… What the hell is an Aluminum Falcon?

[sighs]
Palpatine: OK, OK, so who’s left?… Are you shitting me?… Well, where are you?… Wait a sec, you’ve been flying around for two weeks trying to get a signal?… Oh, you must smell like… feet wrapped in leathery, burnt bacon… Oh, oh, oh! Oh, I’m sorry, I thought my Dark Lord of the Sith could protect a small thermal exhaust port that’s only two meters wide! That thing wasn’t even fully paid off yet!… Do you – do you have ANY idea what this is going to do to my credit?
[phone beeps, he sighs]
Palpatine: Hang on, I’ve got another call.
[switches line]
Palpatine: WHAT? I’m very busy right now!… Oh! Oh, well – well, where are they going?… Oh, all right, uh… just get me a turkey club… Um, coleslaw, I guess. I’m not even gonna eat it… Well, what are you getting?… See, I always order the wrong thing. No, no, I’ll just stick with that. OK, bye – what?… Oh, uh, Cherry Coke. Thanks.
[switches line]
Palpatine: Sorry about that.
[sighs]
Palpatine: What?… Oh, oh, “just rebuild it”? Oh, real fucking original. And who’s going to give me a loan, jackhole, you?… You got an ATM on that torso Lite-Brite? Now get your seven-foot-two asthmatic ass back here, or I’m going to tell everyone what a whiny bitch you were about Padama-may or Panda Bear or whatever the hell her name is!…
[covers receiver]
Palpatine: Oh, jeez, he’s crying!
[giggles, then into phone]
Palpatine: Hey, hey, hey, hey. C’mon. C’mon, don’t do that. Just – just. Look, you know, I’m just dealing with a lot of crap right now. Death Star blown up by a bunch of fuckin’ teenagers, you know? I didn’t mean to snap.
[makes "jack-off" motion]
Palpatine: Oh, uh – just get back here. OK. OK. Bye. I… um… I…
Palpatine: [whispers into phone] I love you, too.

16 May 2010, 4:37pm

leave a comment

Auto resize the Default.png when in a call & tethering

The iPhone can automatically resize the Default.png to take into account the status bar, even when the status bar is double in size.

It even crops out a bit in the middle so your top and bottom toolbars still line up!

To take advantage of this, make your Default.png 320×460, not 320×480.  Simple :)

Thanks to samwize for the tip.

15 May 2010, 5:14pm

1 comment

Making FBDialog.h Modal

UPDATE: I submitted a patch for this issue to the latest version of the Facebook iOS SDK, and it was recently approved.

FBConnect (now Facebook iOS SDK) for iPhone is a cool way to interact your App with Facebook. The FBDialog.h class is also a pretty cool way to display a HTML page to the user in a modal way.

Yeah it’s open source too (Apache 2.0) so no problem with appropriating it for other uses :D

However it’s not totally modal. You can still interact with the underlying view on the edges.  This is especially bad on the iPad where the dialog is much smaller than the screen.

Fixing this fortunately is easy:

Under – (void)show, replace:

[window addSubview:self];

with:

_modalView.frame = window.frame;
[_modalView addSubview:self];
[window addSubview:_modalView];

And in – (void)postDismissCleanup, replace

[self removeFromSuperview];

with

[_modalView removeFromSuperview];

Just add a member UIView* _modalView, init and release in the classes init and dealloc respectively :)

Easy.

Thanks @facebook for the useful code!

12 May 2010, 8:07pm

leave a comment

ICBC

Signed up a for a new bank account today, BoC is miles away from my home, no handy ATMs either.

Took a bit longer to signup, this ICBC has a longish queue. Took 3 staff to sign me up, passing paper back and forward (the usual). ¥15 to signup, got internet banking working easily, using the free one-time-pad (presumably used for outgoing transfers). All up, no complaints. The website seems cleaner than BoC. Will see how the wire transfer works.

It seems ICBC is more popular, with my very informal poll, and may have more ATMs. Also two times I have tried to use my BoC card outside Shanghai have failed, once in Hainan (apparently the BoC ATM was out of money?) and another in HZ (maybe the bank ATM was not aligned). The g/f has ICBC too so I guess that makes it easier.

Forex rates are slightly better… so that’s good (better than being slightly worse, at any rate).
ICBC 608.82 17:08:28
AUD:
BOC AUD: 608.25 2010-05-12 17:15:20

Encode what cannot be NSCoded

Isn’t it annoying that UIImage can’t be serialized (as evident with the error “UIImage unrecognized encodeWithCoder”).  Really throws a spanner in the works when trying to serialise your UI (or applying this hack) given that images are everywhere…

Well this can easily be fixed with a monkey-patch, and a pretty safe one at that.

Here it is (just throw this in a “.m” file, and include it in your project):

@implementation UIImage (NSCoder)

- (id) initWithCoder:(NSCoder *)coder {

	self = [self initWithData:[coder decodeObjectForKey:@"PNGdata"]];

	return self;
}

- (void) encodeWithCoder:(NSCoder *)encoder {

	// if space is a concern, replace with UIImageJPEGRepresentation

	[encoder encodeObject:UIImagePNGRepresentation(self) forKey:@"PNGdata"];
}

@end

So there you go!  This hack was brought to you by the people behind GPS Log for iPhone (please check it out, it’s free to try!).

Why do I claim that this monkey-patch is safe?  Well it encodes and decodes your image. The method is doing what it is contracted to do.  *If* UIImage were to implement this method, then you would have issues, but *only* if you serialized with one implementation, and deserialized with another (which wouldn’t normally happen, and it’s a pretty big *if* anyway…).

Why is it a “monkey patch”?  Well you’re throwing your own code into UIImage implementing standard methods…  pretty much the text-book definition.

Be aware… serialising images to PNG format will consume a decent amount of memory and disk space, and can be slow, especially if those images are big.  So if you already have these images on disk somewhere else, then you probably should be loading them from disk rather than doing this (I have a feeling this is why Apple did not implement this method, to force people to load from disk).

So why is this method useful?  Well for one, you can use it to Copy what cannot be NSCopied :)

Copy what cannot be NSCopied

Sometimes you need to deep-copy an object in Objective-C.  Normally you just go newObject = [oldObject copy].  But what if oldObject does not support NSCopying (typified by the error “copyWithZone: unrecognized selector”)?

Well.. if your object supports NSCoding, then you can simply serialize it, and deserialize it!  Saves you having to monkey-patch the copyWithZone method (though may be a tiny bit less efficient at runtime).

How can do you perform this voodoo magic?  just one line of code…

newObject = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:oldObject]];

NB. (for iPhone programmers) ‘newObject’ is autoreleased, so make sure you retain it somewhere!

There you go.  This hack was brought to you by the people behind GPS Log for iPhone (please check it out, it’s free to try!).

Where do I use this?  Well I have some UITableViewCell objects that I defined in an XIB file, but I need lots of copies (this is a pretty common use-case, which the SDK does not handle very well at all).  Instead of sticking the object in it’s own XIB file, and loading it from the XIB each time (as is one workaround), I use the trick above :)  And it’s more more efficient (object is copied in memory, rather than loaded from flash-storage).

In fact, many UI elements don’t support copying, but they do support serializing, so this can be pretty useful. For UI elements, you may need to add this monkey-patch to get UIImage to play nice.

 

free winrar download

free winrar download

winrar download free

winrar download free

windows 7 key generator

windows 7 key generator

windows 7 activation crack

windows7 activation crack

free winzip

free winzip

free winrar

free winrar

winzip free download

winzip free download

winrar free download

winrar free download

windows 7 crack

windows 7 crack

winzip free download full version

winzip free download full version

winzip activation code

winzip activation code

windows 7 product key

windows 7 product key
\n