August 20th, 2010
Serendipity didn’t survive system upgrade, so i trashed it and replaced it with Habari. Migrating sqlite always interesting, but successful thanks to mono/linq. But now I am tired, and i have “Day of Dot Net” Tomorrow…err…Today…
Tags: sleepy | 0 Comments
February 22nd, 2010
So again I’m trying to get back in the habit of blogging. I typically stick to blogging about Mac programming, however I do so much more .NET programming these days, and I come across a lot of interesting issues when .NET programming that I’m not going to stick to strictly Mac topics anymore.
So at work our website is a mini content management system, built with ASP.NET MVC and SQLite. From this CMS system we have built in support to link to other web applications. I had been doing this with just a plain redirect if a content page is marked as a link content page. However, these web apps were running on our own server, now we have a very minor app from a vendor that is hosted on their server. They provide sufficient branding customization except for the url of course. So I added url masking as a new option to our CMS system. MVC made this easy, I just added another database field, a new view template that provided the frameset for the url mask and a quick check in the view action.
That part went fine, however I needed to add another feature, this url I was masking used SSL, so I needed the frameset to be sent over SSL too so the user would get a lock. Not a big issue, I just needed to make sure if the user typed in the address and it defaulted to http that it would automatically redirect to https. So I add a check in the view action to check if the requested scheme was not https and content required https and then redirected to https. And this would redirect to the https masked url the first time but the second time it would stay http, it was totally weird. A little debugging discovered that the action wasn’t being called the second time. OutputCache!! Since it’s a CMS I use to OutputCache to get serious performance benefit without worry (typically) of outdated content since the CMS is interactively updated it’s cache is interactively invalidated.
So where did I go wrong here. Well my mental model of OutputCache missed 2 details, first that redirects aren’t cached by the OutputCache, and second that OutputCache does not vary by the full url (sans query string). Once I figured what was going on my ultimate solution was quite easy I just need to ensure that the cache varied by url protocol as well. I first looked for a http request header that might differ between a http and https request, however I couldn’t find one and it didn’t seem reasonable that one would exist, so I used Microsoft’s convenient varyByCustom attribute for the OutputCache.
public override string GetVaryByCustomString(HttpContext context, string custom){
if(custom == "scheme"){
return context.Request.Url.Scheme;
}return null;
}
One simple if statement and my cache varies by protocol and then my code worked as it should, and now I have a better mental model of the ASP.NET OutputCache.
Tags: .net, asp.net mvc and outputcache | 0 Comments
October 13th, 2009
I need to get back in the habit of posting to my blog. I’m doing Coding 4 Charities this weekend, which in lock in style will have facilities open 24×3 (but you can leave and come back at any time unlike a lock in) to work on completing, mainly websites, but other various technology projects needs for St. Louis Charities that can be completed in one weekend. I think it will be fun, I met with my team tonight, and our team leader, Muljadi Budiman, gave us a pretty good general idea of what our charity’s website (Turning Point Shelter) will need to do. Anyway it sounds like Coding 4 Charities still needs people, of both developers and graphic designers so if you are one of these and in st. louis area consider volunteering and signing up on their website. Although their website says .net & java developers, at our meeting it was brought up that LAMP is on the table so don’t let that stop you php guys.
Tags: | 0 Comments
June 1st, 2008
What Is WOV?
WOV pronounced “wahhv”, stands for Wrapper Of Video, its a Mac OS X package format that contains both a non quicktime video source and a pre-parsed QuickTime reference movie and is QuickLook compatible.
What’s WOV Got to Do With It?
If you have ever had a large Window Media File you want to open with WMVPlayer plugin for QuickTime, you may have noticed it’s really really slow. Same goes with Perian and MKV’s, though not nearly as bad. Since they are converting to a QuickTime movie format in memory its possible to save that file and have much quicker load times with subsequent opens. However you must be careful, because these plugins can (and have in the past) changed they way they work such that imported quicktime movies can be broken with updates, so it’s imperative that you don’t save self contained movies only reference movies external to the original file. So thats what WOV does, it keeps a reference movie which is really small and the original file combined into its package format, that makes it easy to organize these pairs, repair the reference movie if necessary in the future, and completely undo the WOV container and restore it to the original files (if you so desire).
WOV WOV WOV.
So early on playing around with the idea of WOV, I soon realized it was a good format for simple non destructive QuickTime edits, so I chose one I though was particularly useful which is joining files. So there exists an option, when converting a batch of files in WOV Converter, to combine multiple files into a single WOV file. That resulting package contains a chapter-ized reference movie, the original files, and an M3U playlist of the original files. Thus when trying to open the WOV file in a non native QuickTime App it will try and open the M3U file, I choose M3U since it is so simple it’s likely to be supported in most apps (it is supported in VLC specifically).
Tainted WOV.
There are decent possibilities for caveats with this format, which is why I am putting it out in this early beta and not integrating into NicePlayer right away. One of the obvious caveats is that the original type is masked, which makes it hard to tell if a non native quicktime app is going to be able to open a WOV file ahead of time. I’m not sure if that will be a big deal, but I need people to use WOVConverter & WOVOpener to get feedback to figure out stuff like that.
It should be noted that there is also major issues with using WMVPlayer with WOVConverter. WMVPlayer version 2.2 must have the preference “Open Local Files Immediately” unchecked, or alternatively you must downgrade to version 2.1 to work properly with WOVConverter.
The Book of WOV.
WOVSuite — entirely open source, licensed: MPL/LGPL/GPL
has a few parts:
- WOV Opener — Utility that opens WOV files. You set the actually program you want to open the video and whether that program supports quicktime files natively. Supported on 10.4 & 10.5
- WOV Coverter — Utility that converts any quicktime importable file into WOV files, repairs broken WOV files, and unwraps original files from WOV files too. Supported on 10.5 Only
- WrapperOfVideo.framework — Framework to make it easy for other cocoa applications to support WOV packages without WOV opener. Supported on 10.4 & 10.5
Fun Footnotes
Tags: WOV, niceplayer, programming and rubycocoa | 0 Comments
March 26th, 2008
While NicePlayer is pre-1.0, I strive to make each release solid enough for general mass consumption. However it’s not easy, it involves testing on different processors, os’s, migrating localizations, updating readme’s and documentation—it’s a long laundry list of things. And we need more help on testing. NicePlayer is open source and the source can be checked out and built prior to release for anyone to try out features and bug fixes, but I don’t think that is accessible enough to get the feedback necessary to for quality releases. So I created a Preview builds page where I can easily upload preview builds of NicePlayer.
http://jay.tuley.name/build/
These releases aren’t ready for mass consumption, but are solid enough for enthusiasts to try out. Anyone is welcome to try them, but please only link to the build page and not the actual download. Also be forewarned that the download links changes every 5 minutes so if you try to link to the actual download it will stop working quick (so no unauthorized MacUpdate posts!). On the build page I add what’s changed and what I need tested to the description of each build. The description will also show up in the preview appcast that NicePlayer autoupdates from, so you can keep up to date on this bleeding edge track.
Tags: niceplayer | 0 Comments