Archive for the 'Uncategorized' Category

Just downloaded the new SMH iPhone app from the AppStore…

Wednesday, September 29th, 2010
  • Lots of content, which last a bit longer than the 10 minutes it takes to read the entire contents of the free m-site, cover-to-cover.
  • Very pretty, but sadly it’s a bit much for my retro iPhone 3G, which feels like it’s about to die at any moment under the weight of fancy graphics and animations. Indeed this is what I should have come to expect by holding onto this relic.
  • The price is right at $2.49 upfront, and $2.49 per month.
  • There’s a bit of a glitch (a show-stopper actually) with the subscription extension functionality which no doubt has the development team in post-launch frenzy. We know that stuff can be a bit tricky, especially when the Apple Developer documentation can be a bit lacking, to say the least ;-) Pats on the back to the Extro dev team for getting this right first time oniPad & iPhone App Publishing Platform for The Chaser App.

Definitely worth a look, even if you have no intention of paying the ongoing subscription, which probably includes most sticky-beekers, I suspect. It’s worth it just to catch a glimpse of the “future of the news”.

No iPad version, which is a bit surprising because I think the whole world was expecting an iPad version to be unveiled, given their lateness in entering the market, but I’m sure that will be on its way soon. There’s no rush because the number of iPads out there is a drop in the ocean compared to iPhones.

Difficult to compare this iPhone app to The Australian iPad App which, for the record, was a bit of a disappointment in my opinion with its nasty full-page popup ads and limited content. But in fairness, it’s hard to be too critical when you’re trying to re-invent an entire industry while the whole world looks on, waiting and hoping for the pay-walls to collapse spectacularly, paving the way for an eternity of free, high quality, non syndicated journalism.

Console Logging for Flash (i.e. Tracing in a browser)

Monday, May 26th, 2008

If you want to trace something in flash but you want to load the flash in a browser, you can rework your trace statements to display them with the Firebug extensions.

Instead of using trace() you can use the following:

var flash_variable = ‘testing 123′;
getURL(“javascript: console.log(‘”+ flash_variable +”‘)”,”_self”);

These statements will appear in the Firebug console inside Firefox. For more options, you can view the full capabilities of the console: www.getfirebug.com/console.html

You could create a new function that automatically traces to both sources, but make sure it is not switched on by default, or it could cause problems and expose data to maliscious users. AP

Newbie CakePHP Tips

Monday, February 25th, 2008

Here are a few things to keep in mind when learning CakePHP.

  • Learn Cake’s naming conventions. If you don’t understand them, you will not understand cake. Simple. e.g. If you have a field dropdown field in a form, in your view you should use $form->input(‘featured_status’), and in your controller you could use $this->set(‘featuredStatuses’, array(0=>’Not featured’,1=>’Featured’) ); The naming convention automatically converts between then, so your featured_status field will be populated with all the relevant featuredStatuses.
  • Lean what “Fat Models, Thin Controllers” means. http://www.littlehart.net/atthekeyboard/2007/04/27/fat-models-skinny-controllers/
  • You don’t strictly need a separate controller for every single model. Often, it’s much better to have few er controllers which store all related actions. This often makes it a lot easier to locate relevant code. (e.g. If you had a fruit model, as well as models for oranges, apples, and bananas, it could be good to just have a single fruits_controller, rather than separate controllers for each one.
  • Code newsting inside views should generally be based on the HTML structure, rather than PHP structure. e.g. You should indent code based on div’s, rather than php ifs and loops.
  • You should NEVER use straight database queries. You should learn how to use model associations (hasMany, belongsTo, etc) to perform your queries. Be sure to learn bindModel and unbindModel to perform special quieries -> they allow you to dynamically change your model behaviours, but conveniently, they only last for one query, so your other code will not be affected.
  • Use a small number of standard elements to build most of your site. Add optional parameters for adding headings, links, rows of data etc. The fewer generic elements you can use to build your ENTIRE site the better.
  • Beware the dreaded self-closing div tags < div / >. You must always have a separate end tag for divs. Don’t know why, it’s just the rules. e.g. < div>< /div>
  • When doing browser compatability, comment out each element in turn to identify which elements are causing problems. Also, use Firebug and Internet Explorer Developer Toolbar to ensure your div nesting is correct => incorrect nesting is a major source of browser bugs, because Firefox is a lot friendler than IE, so if you develop and optimise in Firefox you layout may look right, but it may actually contain structural errors which really need to be fixed, rather than just using unreliable browser hacks to hide the problems.
  • IE is particularly picky when using AJAX -> perform W3C Validation frequently on your html/css, because it will often pick these errors up for you! Rather than digging around in your code for an elusive missing tag or incorrect nesting order.
  • When using Enum values, use this method to populated your form fields (by adding it to your app_model.php): e.g. Controller code: $this->Event->getEnumValues(‘approval_status’)); http://bakery.cakephp.org/articles/view/baked-enums
  • You don’t need to include all tables in your $uses array. If you include one table, you can uses any models that are associated with that first model by accessing the sub-model as a child of the first model. e.g. If your controller users Author, but you want to use a Book model, you could use the format: $this->Author->Book->findById($book_id)
Top