Category: Technology's Betrayal


Wednesday 2009/09/16
4:57 PM

Categories:

CakePHP, Technology's Betrayal, Web Dev

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


Wednesday 2009/07/01
10:09 PM

Categories:

Flash/Actionscript, Technology's Betrayal, Web Dev, Work

Event.ACTIVATE and WMode

Another classic case of finding things out the hard way: in ActionScript Event.ACTIVATE and Event.DEACTIVATE do not fire if the swf is embedded with wmode set to transparent. I was working on a project that needed to know when the user switched focus away from the swf, and couldn’t figure out why the event would fire in the standalone player but not when run in the browser.


Tuesday 2009/06/23
10:29 AM

Categories:

Flash/Actionscript, Tech, Technology's Betrayal, Web Dev

Changing Filename Case in SVN

This one has bugged me for a long time. During a project where things get passed from developer to developer or designer to designer things often get renamed to the same name, only with a different case. For example, myFlv_IN.flv becomes myFlv_in.flv. I used to think you had to move the files away, rename them, and then re-add them. Turns out if you simply include the full path to the repository it'll do the rename in place for you.

For example:

CODE:
  1. svn mv -m 'rename' http://my.repository.com/myFlv_IN.flv http://my.repository.com/myFlv_in.flv

More details can be found here, at the Subversion FAQ.


Thursday 2008/05/22
3:43 PM

Categories:

Flash/Actionscript, OS X, Technology's Betrayal, Web Dev

FDT, AS3, and OS X

Just set up the trial of the Flash Actionscript IDE FDT. There's a few things to keep in mind when installing it on Mac OS X, however:

1) You need to download the standalone Flex SDK, and point to that in the Core Libraries Settings (Preferences > FDT > Core Libraries > AS3 Core Libraries). If you're running the standalone Flex Builder and try to point to the SDKs in that install it won't work. Make sure that there's no spaces in the path to the SDK, either, otherwise FDT won't be able to find it. I put mine in ~/Documents/sdks/flex_sdk_3/

2) You need to copy the playerglobal.swc file to a location without spaces as well, as suggested here. I put mine in ~/Documents/fdt/playerglobal.swc.

Those were the two big differences from the instructions in the Basic AS3 tutorial (Help > FDT User Guide > Getting Started > Basic AS3 Tutorial).

I'll be putting FDT through its paces, comparing it to TextMate of course. I have a feeling for big projects it'll be pretty useful, since it has the project-level hinting/completion that TextMate lacks.