CFUnited 2010 here I come!

I will be speaking at this years CFUnited conference in Lansdowne Virgina, at the Lansdowne Resort

CFUnited is an annual conference based around the Coldfusion, Flex, and AIR languages and platforms.

This year I will be co-presenting with Luis Majano on “ColdFusion Powered iPhone Applications

The session will cover how to develop and power iPhone applications via ColdFusion REST Services. I will cover all the development basics, intricacies, best practices, etc of iPhone development. The focus will be on how to make an iPhone application connect and consume ColdBox REST services.

The ColdFusion portion of the session will be led by Luis Majano, Creator of the Coldbox Framework.

I’m really looking forward to this great experience. I will be posting the slides and sample code here, after the presentation.

timthumb.php returns a 404 Error in WordPress

timthumb is a great little php script that helps create thumbnail images (http://code.google.com/p/timthumb). I’ve used it before, but recently I purchased a wordpress theme that used it, and it wasn’t working.

I would get a 404 error when I tired to access the directly via a url like this:
theDomain.com/wp-content/themes/theTheme/scripts/timthumb.php?src=/wp-content/uploads/2010/05/moose1.jpg&h=207&w=237&zc=1&q=80

After some digging around in log files on my server I realized the error

SoftException in Application.cpp:610: Directory “/home/usernamehere/public_html/wp-content” is writable by others

My problem had to so with the directory permissions! “writable by others” means that the permission on the directory were set to “777”. I changed the permissions of the directory using chmod to 755, and everything started to work.

Lesson learned, if timthumb.php is not working at giving you 404 errors, check the permission of the directory that contains the php file.

iPhone Keyboard Covers Text Field

Recently while developing an app, I ran into an issues where the iPhone keyboard was sliding up and covering the text field. I did some quick searching on the on the internet an came across some sample code on StackOverflow (http://stackoverflow.com/questions/1247113/iphone-keyboard-covers-text-field)

I took the code that was given and spun it for my own uses. After placing the code in the project, I linked the hidden textFields ‘Editing Did Begin” and “Editing Did End” events to the “slideFrameUp” and “slideFrameDown” methods.

The end result works great!

-(IBAction) slideFrameUp;
{
[self slideFrame:YES];
}

-(IBAction) slideFrameDown;
{
[self slideFrame:NO];
}

-(void) slideFrame:(BOOL) up
{
const int movementDistance = 50; // tweak as needed
const float movementDuration = 0.3f; // tweak as needed

int movement = (up ? -movementDistance : movementDistance);

[UIView beginAnimations: @"anim" context: nil];
[UIView setAnimationBeginsFromCurrentState: YES];
[UIView setAnimationDuration: movementDuration];
self.view.frame = CGRectOffset(self.view.frame, 0, movement);
[UIView commitAnimations];
}