How to deploy Plesk 11.5 on Amazon EC2 (Linux)

AWS LogoAmazon EC2 instances have seriously made my life a lot easier over the last year. And once you get the hang of the management console it’s actually not as scary as I always thought it would be 😉

I’d like to get away from annual contract bindings and “real” servers that could develop hardware faults. But if you wanted to run Plesk on top of CentOS then this was a bit of a headache – until Parallels launched their Plesk AMI on Amazon Marketpalce. With this release we get the convenience of running Plesk out of the box with a convenient one-click install!

I’ve just tried it and took some notes so I won’t forget. You can also take a peek at the KB Article provided by Parallels which also outlines this procedure:

Read more

How to preload images in iOS

When you’re displaying a UIImage in your view controller it’s hardly noticeable how long it actually takes for the engine to “draw” the picture. Lenoard van Driel has tested this and confirms it takes 80ms – or in television terms, 2 frames. That’s something worth putting an audio delay in for. Drawing several images in […]

How to delete an NSManagedObject in Core Data

You can delete individual objects by using the NSManagedObjectContext method deleteObject, like so: [self.managedObjectContext deleteObject:yourManagedObject]; To delete all managed objects from your store, you can use a for-in loop: – (void)clearCoreData { NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@”YourEntity” inManagedObjectContext:self.managedObjectContext]; [fetchRequest setEntity:entity]; NSError *error = nil; NSArray *fetchedObjects = [self.managedObjectContext executeFetchRequest:fetchRequest […]

How to show SQLite Debug output from Core Data in iOS

Add this statement to your app’s Run Scheme -com.apple.CoreData.SQLDebug 1 and your Log Console shall be populated with fascinating statements such as 2013-11-20 18:49:53.715 YourApp[6245:70b] CoreData: annotation: Connecting to sqlite database file at “/Users/versluis/Library/Application Support/iPhone Simulator/7.1-64/Applications/1FED9364-3039-4D47-967E-9B075CBE8277/Documents/PatchBay.sqlstore” 2013-11-20 18:49:53.717 YourApp[6245:70b] CoreData: sql: pragma journal_mode=wal 2013-11-20 18:49:53.718 YourApp[6245:70b] CoreData: sql: pragma cache_size=200 2013-11-20 18:49:53.719 YourApp[6245:70b] CoreData: sql: […]

How to check if your app is running in 64bit

There are two ways to determine this: at runtime (i.e. in your running code), and at compile time (i.e. before the code is compiled). Let’s take a look at both options. Runtime Check // testing for 64bit at runtime if (sizeof(void*) == 4) { self.textLabel.text = @”You’re running in 32 bit”; } else if (sizeof(void*) […]