Reading width & height of Flash file
Obtaining the movie height & weidth of a Flash file is an easy task using the swfdump tool that comes as part of the swftools package. Here's an example of how to invoke swfdump from C# and read out the height & width of a given Flash file. Start out by downloading on of the swftools releases. I'm using the latest development snapshot. I'll be using one of the Flash files I made in a previous blog post as a test file, but you can use any .swf file you want. The test Flash file is called test.swf. ...
Defending against the improbable
As little children we've all been taught that it's better to program defensively than relying on exceptions being thrown. However, sometimes it's preferably to just hope for the best and catch exceptions if they happen. Defending against the improbable Say we have a web application that receives and ID through the query string and serves a file accordingly, usually we'd write that like: if(File.Exists(path))
serveFile(path);
else
serve404();
This is what I've been doing in a large image serving website I run. However, it recently struck me that on average about 99.9% of all...