CakePHP Basics Tutorial – Part 2

Overview

In this tutorial I’ll show you in about 30 minutes how to create a html form with the built-in FormHelper of CakePHP which automatically links up to the database fields to see what kind of input field should be generated.  Further on we also check out the built-in validation options and how we can save our submitted form data to the database. And at the end I’ll explain how you can use CakePHP’s Model callback functions to put in our custom code before a CakePHP action.

Continue reading CakePHP Basics Tutorial – Part 2

CakePHP Basics Tutorial – Part 1

Overview

In this tutorial I’ll show you in about 30 minutes how to do a basic setup of CakePHP and read some data from the database without writing any SQL!  This will be an i-don’t-know-how-many-parts tutorial, but I’ll try to add every week a few until the basics are covered!

Continue reading CakePHP Basics Tutorial – Part 1

Generate code with CakePHP’s cake bake command

Overview

In this tutorial I’ll show you in 25 minutes how to generate some basic CRUD functionality into your CakePHP website without writing a single line of code! This can be done by using the console which you get for free with CakePHP.
This is a great way to get up’n’running in minutes and start from what CakePHP has generated for you.

Continue reading Generate code with CakePHP’s cake bake command

Declaration of beforeSave() should be compatible with Model::beforeSave( $options = array() )

I’ve just upgraded my servers to PHP 5.4 and got this error when loading a project.

Declaration of MyModelName::beforeSave() should be compatible with Model::beforeSave( $options = array() )

There seems to be a problem when using PHP 5.4 and CakePHP 2.1 which results in this error.  Since PHP 5.4 E_ALL and E_STRICT are now combined and with a default CakePHP installation error reporting is set to E_ALL & ~E_DEPRECATED!

Luckily it is really easy to fix!

Continue reading Declaration of beforeSave() should be compatible with Model::beforeSave( $options = array() )

Debug IOS applications with Charles Web Proxy

When you are doing (naughty) stuff with the Internet, Charles Web Proxy is probably the most valuable thing a developer could have!

Normally I just use Firebug’s Net panel to see what my request/responses are, but since I’ve discovered Charles it took debugging and inspection to a whole new level. Especially now I can hook it up to inspect the traffic sent to and from my iPhone. Continue reading Debug IOS applications with Charles Web Proxy

Archiving your iPhone app and icon dimensions don’t meet the size requirements

I’ve just archived an update for iCapital and I stumbled upon a weird warning.

It said the following

icon dimensions (0 x 0) don’t meet the size requirements.  The icon file must be 57×57 pixels, in .png format

I double checked my build settings and my app icons had the right dimensions.  When I searched for the warning on Google, there were a lot of other people who also had the issue since they updated to XCode 4.2 and OSX 10.7.3.

Luckily it’s really easy to fix the issue. You just need to set ‘Compress PNG files’ to NO in your Build Settings and re-archive your app!

Forms with UITableview in IOS

When you’re developing IOS apps you often need user input to receive some data.

You have the following options to get the data from a user:

  • Poorly designed form on a rather ugly white background
A rather ugly form
A rather ugly form
  • Use Storyboard to get static UITableviews in which you can easily create a nice form
A form by using static UITableview
A better looking form by using static UITableview

Continue reading Forms with UITableview in IOS

How to do a lightweight Core Data migration

Why do you need to migrate?

When you release an app and add new features, there will be a time you need to update you persistent store. This is easy to do when you are in a development stage, because you can just delete your app and the persistent store will be re-generated. But when you are live and people have downloaded your app, you need to be careful. They won’t like it if suddenly their saved data has disappeared!

Continue reading How to do a lightweight Core Data migration

iOS Face recognition

There is a nice API for face/person recognition on the internet at http://www.face.com/.
Their API provides quite a lot of interesting data, such as

  • Position of the eyes
  • Position of the nose
  • Position of the mouth (right, center, left bounds)
  • Yaw/roll/pitch rotation of the detected head
  • Attributes: gender, wearing glasses, smiling, mood, …

And the best of all … it’s a free service which gives you 5000 calls an hour to their API which is more than enough for a little experiment.

Continue reading iOS Face recognition