<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>AskErnest.com</title>
        <link>http://www.askernest.com/Default.aspx</link>
        <description>You've got questions...I might have answers.</description>
        <language>en-US</language>
        <copyright>Ernest Wilkerson</copyright>
        <generator>Subtext Version 2.5.2.0</generator>
        <image>
            <title>AskErnest.com</title>
            <url>http://www.askernest.com/images/RSS2Image.gif</url>
            <link>http://www.askernest.com/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Decoding Video With JavaScript</title>
            <category>Random/Rambling Thoughts</category>
            <category>Development</category>
            <link>http://www.askernest.com/archive/2010/05/05/decoding-video-with-javascript.aspx</link>
            <description>&lt;p&gt;&lt;font face=""&gt;With all the hoopla surrounding which web browsers will support HTML5 video (and which codecs they will support), a &lt;/font&gt;&lt;font face=""&gt;buddy of mine mused about decoding video in JavaScript. I mean with a canvas tag, people have been able to produce &lt;/font&gt;&lt;font face=""&gt;some amazing things. And these browser JavaScript engines just keep getting faster and faster. So isn't it remotely &lt;/font&gt;&lt;font face=""&gt;possible that some level of video decoding (of certain video formats) in JavaScript would be usable? And it's pretty &lt;/font&gt;&lt;font face=""&gt;cool when one begins to think of the different possibilities. I admit that most of the possibilities I'm thinking of &lt;/font&gt;&lt;font face=""&gt;might be used for some sort of pseudo-DRM. But I could also imagine some pretty nifty uses for it too. There are, if &lt;/font&gt;&lt;font face=""&gt;I remember correctly, some sites out there that allow HTTP download of torrents. What if there was a way to preview &lt;/font&gt;&lt;font face=""&gt;a video before they it was completely downloaded? What if the first X pieces of a file were downloaded and available &lt;/font&gt;&lt;font face=""&gt;for preview before the torrent was complete? That way, a user would be able to determine if they were retrieving &lt;/font&gt;&lt;font face=""&gt;what they really wanted. &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;I could even imagine subscription videos. For instance, using a JavaScript-based decoder in conjunction with &lt;/font&gt;&lt;font face=""&gt;chunk/byte-range XHR requests, a server/service could limit you to the amount video you're allowed to watch. For &lt;/font&gt;&lt;font face=""&gt;instance, you would pay from X GB or MB of video time and the server just rings that up to your account every time &lt;/font&gt;&lt;font face=""&gt;you watch a chunk. So you only pay for what you actually watch -- not the whole video. And service could also &lt;/font&gt;&lt;font face=""&gt;implement some sort of pseudo-DRM. With enough talent, one could create one's own encoding scheme and use rotating &lt;/font&gt;&lt;font face=""&gt;time keys or something for "DRM". Of course, you hand over your decoding code when the user hits your site - but &lt;/font&gt;&lt;font face=""&gt;minification of JavaScript has to be the most (un)intentionally effective obfuscation I've ever seen.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;But anyways, I'm not saying these things don't exist or are not already possible -- just that a completely &lt;/font&gt;&lt;font face=""&gt;ubiquitous approach to it is becoming more and more feasible. The only big piece missing from the pie, so to speak, &lt;/font&gt;&lt;font face=""&gt;is a way to write to an audio buffer. And the developers of FireFox are &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=490705"&gt;working on that&lt;/a&gt;. Hopefully, their API &lt;/font&gt;&lt;font face=""&gt;becomes standard much the way Apple's canvas has become a standard (except for IE). As a proof of concept, I've &lt;/font&gt;&lt;font face=""&gt;implemented a pseudo-H261 decoder in JavaScript. It's not entirely...uhmmm...accurate...but it works for what I &lt;/font&gt;&lt;font face=""&gt;wanted to demonstrate. It can decode an intra frame. No motion compensation routines etc. were implemented for inter &lt;/font&gt;&lt;font face=""&gt;frames/macroblocks -- it just decodes one picture. When I figure out (from the spec) how motion compensation should work &lt;/font&gt;&lt;font face=""&gt;-- I'll have it decode multiple frames. On my laptop it can decode a CIF intra frame in about 25 ms and render it  &lt;/font&gt;&lt;font face=""&gt;in under 100ms -- in Chrome. FireFox is a little slower -- around 68ms and 120ms respectively. The times are a &lt;/font&gt;&lt;font face=""&gt;little slow for full motion video (I think), but this doesn't account for multiple opportunities for optimization. &lt;/font&gt;&lt;font face=""&gt;There are many inefficiencies in my code that could drop the decoding and (especially) render time -- probably &lt;/font&gt;&lt;font face=""&gt;by a significant margin.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;&lt;font face=""&gt;(note: I've only tested in Chrome and FireFox. IE will not work. Safari is an unknown but it should work.)&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=""&gt;You can check out the decoder &lt;a href="http://www.askernest.com/jsh261/default.htm"&gt;here&lt;/a&gt;. &lt;/font&gt;You can download the files &lt;a href="http://www.askernest.com/downloads/jsh261.rar"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://www.askernest.com/aggbug/9.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ernest Wilkerson</dc:creator>
            <guid>http://www.askernest.com/archive/2010/05/05/decoding-video-with-javascript.aspx</guid>
            <pubDate>Wed, 05 May 2010 12:36:34 GMT</pubDate>
            <comments>http://www.askernest.com/archive/2010/05/05/decoding-video-with-javascript.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://www.askernest.com/comments/commentRss/9.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Microsoft Research presents...Infer.NET</title>
            <category>Development</category>
            <link>http://www.askernest.com/archive/2009/01/21/microsoft-research-presents.infer.net.aspx</link>
            <description>Happened to be cruising the Microsoft Research projects page...looking for something cool to mess with. Lo and behold, I came across Infer.NET. I could tell you what it's about...but it's better to &lt;a href="http://research.microsoft.com/en-us/um/cambridge/projects/infernet/default.aspx"&gt;get it straight from the horse's mouth&lt;/a&gt; (so to speak).&lt;img src="http://www.askernest.com/aggbug/8.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ernest Wilkerson</dc:creator>
            <guid>http://www.askernest.com/archive/2009/01/21/microsoft-research-presents.infer.net.aspx</guid>
            <pubDate>Thu, 22 Jan 2009 03:28:47 GMT</pubDate>
            <comments>http://www.askernest.com/archive/2009/01/21/microsoft-research-presents.infer.net.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://www.askernest.com/comments/commentRss/8.aspx</wfw:commentRss>
        </item>
        <item>
            <title>PDC 2008...Here I Come</title>
            <category>Random/Rambling Thoughts</category>
            <link>http://www.askernest.com/archive/2008/07/02/pdc-2008.here-i-come.aspx</link>
            <description>Just finished registering for PDC this year. It'll be my first time attending. I'm extremely excited (like a kid in a candy store). Now only if I could think of a good idea for the "ShowOff"...I'd be set. Everything I can think of is just a mash-up of stuff that's already been done. *Sigh*...oh well.&lt;img src="http://www.askernest.com/aggbug/7.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ernest Wilkerson</dc:creator>
            <guid>http://www.askernest.com/archive/2008/07/02/pdc-2008.here-i-come.aspx</guid>
            <pubDate>Wed, 02 Jul 2008 16:12:46 GMT</pubDate>
            <comments>http://www.askernest.com/archive/2008/07/02/pdc-2008.here-i-come.aspx#feedback</comments>
            <wfw:commentRss>http://www.askernest.com/comments/commentRss/7.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Face Detection in (pure) C#</title>
            <category>Development</category>
            <link>http://www.askernest.com/archive/2008/05/03/face-detection-in-c.aspx</link>
            <description>Have you ever heard of the Open Source Computer Vision Library (OpenCV)? Well if you haven't, you might want to head over to the project's &lt;a href="http://opencvlibrary.sourceforge.net/"&gt;Wiki&lt;/a&gt; page or &lt;a href="http://www.intel.com/technology/computing/opencv/"&gt;Intel's project page&lt;/a&gt;. In short, OpenCV is an cross platform open source library (written in C++) that provides a great deal aid for developing computer vision applications. OpenCV can be used for biometrics, security, human-computer interfacing, etc. The brilliant people behind OpenCV have given us the ability to quickly implement such advanced techniques as Face Detection and &lt;a href="http://www.youtube.com/watch?v=bWl33urh2w8"&gt;Fast Object Tracking&lt;/a&gt;. &lt;br /&gt;
   About a week ago, a friend of mine told me a he was interested in implementing some basic face/feature detection features in a web-based surveillance system (well...a viewer at least). Now, after some research, you can quickly come across some .Net wrappers such as &lt;a href="http://code.google.com/p/opencvdotnet/"&gt;OpenCVDotNet&lt;/a&gt;, but what he needed had to be either Java or 100% C# (so he could convert it  to Java...haha) so that the functionality was as (easily) portable as possible. I chose to write a quick proof-of-concept in C# (at least for the face detection piece). So I did my best to quickly port the face detection functionality from OpenCV. OpenCV is great, but there are some knocks against its face detection...the most prominent ones being that it doesn't take lighting into account enough (it won't find faces in some images that other libraries will and it will report false negatives sometimes) and the fact that it may actually violate a patent.&lt;br /&gt;
    Below you will find what my code as a library project, and a sample project that uses the Yale Face Database. Keep in mind that the code below is just a proof-of-concept and that it can definitely be optimized. I've also skipped doing image histogram equalization which might find more faces in certain images. OpenCV also uses a &lt;a href="http://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm"&gt;k-nearest neighbor algorithm&lt;/a&gt; which i didn't really bother to port...I just used Euclidean distance (I'm not sure if that is what OpenCV was already using)...which should work most of the time. In my testing with the Yale Face Database, faces can be detected in ~1.4 seconds on a 300x300 image. That's nowhere near realtime detection, but that's mostly due (I think) to the bounds checking in .NET arrays and lists. Quick profiling show that for a 300x300 image, there are about 52 million array accesses in that ~1.4 seconds which ain't too bad for C#. So here are some scissors....run with 'em.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.askernest.com/downloads/openCV.Net.rar"&gt;Face Detection Library&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.askernest.com/downloads/openCV.NetTest.rar"&gt;Face Detection Sample Application&lt;/a&gt;&lt;img src="http://www.askernest.com/aggbug/6.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ernest Wilkerson</dc:creator>
            <guid>http://www.askernest.com/archive/2008/05/03/face-detection-in-c.aspx</guid>
            <pubDate>Sun, 04 May 2008 00:57:31 GMT</pubDate>
            <comments>http://www.askernest.com/archive/2008/05/03/face-detection-in-c.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://www.askernest.com/comments/commentRss/6.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Office Fun: Key Flipper</title>
            <category>Development</category>
            <link>http://www.askernest.com/archive/2008/02/18/office-fun-key-flipper.aspx</link>
            <description>I read in my bathroom reader that the top three "problem" employees according to the &lt;span style="font-style: italic;"&gt;Wall Street Journal&lt;/span&gt; are: "The Non-Stop Talker"  "The Screamer" and the "The Practical Joker." I guess that makes me a problem employee then. I don't scream as much I as used to, but I do play practical jokes when appropriate (hehe). Recently we had one of our programmers give his two weeks notice, and because he's a good natured guy (and he's quitting) -- I thought it would be appropriate to give him hell this week. Seeing as I'm a developer, my pranks tend to leverage my aptitude/proclivity for system intrusion and wreaking random havoc. So today (Monday) I decided that I would make a program that hooks his keyboard input and types a predefined, yet configurable, amount of text -- no matter what keys he presses (ex. type "0123456789" and the output is "I love ham"). Hence -- the KeyFlipper program which leverages the KeyboardHooker library. The KeyboardHooker library exposes a KeyboardListener class that can be used to log keystrokes or stop them. The library also exposes the KeyInterceptor class which does all the "real" work required to torture said co-worker(s). This program also goes in the largely useless bin...but seeing the look of joy on his precious little face more than makes up for it. Tomorrow (Tuesday) will feature something similar involving hooking the mouse. Ahhh....I can't wait until tomorrow.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.askernest.com/downloads/KeyFlipper.rar"&gt;KeyFlipper (requires KeyboardHooker)&lt;/a&gt;&lt;br /&gt;
&lt;a href="http://www.askernest.com/downloads/KeyboardHooker.rar"&gt;KeyboardHooker&lt;/a&gt;&lt;img src="http://www.askernest.com/aggbug/5.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ernest Wilkerson</dc:creator>
            <guid>http://www.askernest.com/archive/2008/02/18/office-fun-key-flipper.aspx</guid>
            <pubDate>Tue, 19 Feb 2008 03:07:54 GMT</pubDate>
            <comments>http://www.askernest.com/archive/2008/02/18/office-fun-key-flipper.aspx#feedback</comments>
            <wfw:commentRss>http://www.askernest.com/comments/commentRss/5.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Convert Web Pages to PDF</title>
            <category>Development</category>
            <link>http://www.askernest.com/archive/2008/01/22/convert-web-pages-to-pdf.aspx</link>
            <description>    Today I decided to write a little program to capture every "screen" in our web-based application for regression/documentation purposes. We're undergoing major changes and I wanted something static to use as a reference. Granted, we have now (and will have in the future) digital copies of the current (soon to be previous) version of our application, I feel alot better about being able to just open up a notebook and look at what the application used to look like.&lt;br /&gt;
    So, the bulk of my work consisted of capturing the graphical output of the Microsoft WebBrowser ActiveX control. I was initially using the .NET control, but experienced massive issues trying to cast to MSHTML interfaces that I knew the objects must inherit from. Yay! But anyways...Capturing input from the ActiveX control involved p/invoking good ol' GDI32 and blitting the output from the WebBrowser control onto a bitmap of my creation. Once that was done, I just took my fancy new bitmap and stuck it into a Adobe PDF using &lt;a href="http://www.pdfsharp.com/PDFsharp/"&gt;PDFSharp&lt;/a&gt; (which is quite a handy library).&lt;br /&gt;
    There are multitudes of articles on the internet about capturing a web page to an image, but none of them seem to deal with the issue of pages that have dynamic content (frames). My solution addresses this issue and also has a little bit of error handling -- just in case you happen upon an error page. By default, I have that functionality disabled though because the scanning is done in a very inefficient manner.&lt;br /&gt;
&lt;br /&gt;
Well anyways...here are the &lt;a href="http://www.askernest.com/downloads/web2pdf.rar"&gt;solution files&lt;/a&gt; if anyone ever needs 'em.&lt;img src="http://www.askernest.com/aggbug/2.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ernest Wilkerson</dc:creator>
            <guid>http://www.askernest.com/archive/2008/01/22/convert-web-pages-to-pdf.aspx</guid>
            <pubDate>Wed, 23 Jan 2008 03:02:41 GMT</pubDate>
            <comments>http://www.askernest.com/archive/2008/01/22/convert-web-pages-to-pdf.aspx#feedback</comments>
            <wfw:commentRss>http://www.askernest.com/comments/commentRss/2.aspx</wfw:commentRss>
        </item>
        <item>
            <title>New Host...New Year...New Stuff</title>
            <category>Random/Rambling Thoughts</category>
            <link>http://www.askernest.com/archive/2008/01/20/new-host.new-year.new-stuff.aspx</link>
            <description>    So a new year rolls around, and I look forward to being a year older. Not that it really means that much...the year changing just helps to further distort my perception of reality. As a child of the 80s and 90s, I still think of the late 1990s as being "recent", even though it was a decade ago *sigh*. That aside, it's nigh-on-impossible for 2008 to be as life changing as 2007 for me. I begin this new year in a new state, as a married man, and (more importantly) as a father. I remember writing a similar post to this one on my WordPress blog almost exactly a year ago. &lt;br /&gt;
    At that time, I had no idea how much my life would be changing. Well, I had some inkling...I knew I was getting married, but that was about it. Nothing can surpass the joy that comes from being/becoming a father. The one thing I really look forward to this year is watching my son grow up. His birth has definitely been the highest point in my short life -- and every day since has run a close second. His birth sparked me re-registering this domain -- though I waited until now to actually post anything. Up until now, I was just using the domain to host pictures so my family/friends could readily retrieve them. Unfortunately, I don't have the motivation to migrate all my older blog posts to this site...oh well. Yeah...new host...new dad...2008 here we come!&lt;img src="http://www.askernest.com/aggbug/1.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Ernest Wilkerson</dc:creator>
            <guid>http://www.askernest.com/archive/2008/01/20/new-host.new-year.new-stuff.aspx</guid>
            <pubDate>Sun, 20 Jan 2008 17:53:46 GMT</pubDate>
            <comments>http://www.askernest.com/archive/2008/01/20/new-host.new-year.new-stuff.aspx#feedback</comments>
            <wfw:commentRss>http://www.askernest.com/comments/commentRss/1.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
