Wednesday 2009/09/16
4:57 PM

Categories:

CakePHP, Technology's Betrayal, Web Dev

1 Comment

CakePHP and Model File Names

Another example of the little things that you learn when picking up a new framework: filenames for your CakePHP Models should be lowercase. For example, section.php and not Section.php.

I’d been working on a small CMS for a friend’s site, and even though everything worked perfectly on my local MAMP install, when I uploaded it to the production webserver for testing I kept getting an error when retrieving items that had an association with another model:

Notice (8): Undefined index: Section

In this case I had a Section Model that had an association with many Items. Section hasMany Items, in other words. When retrieving the Items listing the respective Sections could not be retrieved.

After I renamed my model files to lowercase and flushed the /app/tmp cache the associations were recognized, and the listing of Items showed the relationship to the associated Section objects.

I think this happened because I hand-coded a few of the Model files before switching to bake to scaffold things.

Oh, and a final note to self: the AMF/SWX CakeSWXPHP plugin appears to require PHP 5. Couldn’t understand why the AMF calls were failing until I checked the PHP version on the remote production server. Sure enough, it was still running PHP 4.


Tuesday 2009/09/01
1:30 PM

Categories:

Cameras, PS3, Tech, Technology's Betrayal, Video

Converting Canon T1i Video for the PS3

Joseph and Kristen have been experimenting with their Canon T1i’s video lately. The MOV files don’t have native support on the PS3, so Joseph and I went digging for a way to convert them. The default PS3 setting in Handbrake resulted in unreadable files, so we experimented with a variety of things: custom recipes for the Handbrake CLI, ffmpeg (that’s technical quicksand, right there). It turns out the solution was pretty simple. I’ll summarize what this thread revealed. The thread was focused on the 5D mk II, but it appears that both cameras use the same file format.

The primary issue appears to be the dimensions of the files: when loaded into Handbrake the size is interpreted as 1920 x 1088, not 1920 x 1080. It turns out that cropping those 8 pixels makes all the difference.

So, based off the suggestions in that thread I created a new preset in Handbrake, starting with the default PS3 setting. I clicked 2-pass encoding, bumped the bitrate to 17000, and in the Picture Settings did this:

Crop set to 8 on the bottom setting, and in Size set Anamorphic to Strict:

canon_1080p_ps3_crop.jpg

That’s it. 8 pixels. Not sure why the size is reported differently to begin with, but at least there’s a workaround.

When I first created my preset I forgot to save the Picture Settings from the current encode, so I lost the crop info. So remember to set Use Picture Size to Current when making your preset:

canon_1080p_ps3_config.jpg


Thursday 2009/08/06
10:24 AM

Categories:

FDT, Flash/Actionscript, Web Dev

Project Names for Ant Build Files

Just posted this over at the DS Tech Blog: Project Names for Ant Build Files. Completely obvious, yet somehow it’s taken me a year to realize this. It’s not usually an issue when you only have one project open, but today I was staring at three build files in the Ant panel, all named “project”. So, just another small step towards better workflow.


Wednesday 2009/07/29
10:51 AM

Categories:

Flash/Actionscript, Web Dev

Flash Runtime Assets

My friend Andy Hatch has been working on utility classes for runtime asset loading in Flash, specifically runtime fonts. Runtime fonts are a particularly tricky thing to get right, but this looks like a clean, simple solution to the problem.


Monday 2009/07/20
12:59 PM

Categories:

Flash/Actionscript, Web Dev, Work

We Choose the Moon, FWA S.O.T.D.

Update 2009-08-04: We Choose the Moon was chosen as FWA Site of the Month!

moon_sotm.jpg

moon_sotd.jpg

We Choose the Moon is today’s FWA Site of the Day. The moon landing is tonight, after which the site will shift to post-live mode where you can investigate each of the stages separately.