improve.dk
Just another mindless drone looking for the perfect stack
posts - 220, comments - 475

November 2009 Blog Posts


Reading width & height of Flash file

Written on Wednesday, November 11, 2009 by Mark S. Rasmussen in Development: .NET, Development: AS/Flex/Flash

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. ...

No comments | Write first comment
 

Defending against the improbable

Written on Thursday, November 05, 2009 by Mark S. Rasmussen in Development: .NET

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...

1 comments | Read comments