How to fix green video screen in Windows 8 Consumer Preview and Release Preview

Flash has this problem where it will show up blank or green when using hardware acceleration to display video. You used to be able to turn that off in Flash options from the right click menu, but in IE10 you have to go to the Internet Explorer options’ advanced tab. There’s a checkbox there that you need to check to fix it at the top.

image

The computer furniture rant

Have you ever noticed that furniture makers always make computer desks with those closed off little cubby holes for the tower? It’s about time someone told them computers need ventilation to work properly. I’ve seen countless computers overheat and die an untimely death due to this lack of understanding of simple common sense.

Computers have fans in them for a reason: air flow. They take cool air in and expel hot air, all the while keeping the internal case at a constant temperature, in theory. Most of the time though they run hot if they’re more than the little Wally-world special.

So, furniture companies, please remember to leave plenty of breathing room and exhaust ports for computers in your desks and nooks.

A quick note on jQuery.Deferred()

Just a quick note on jQuery Deferred objects…

   1: var goGetSomeHtml = function() {
   2:     var deferred = $.Deferred();
   3:     $.ajax({
   4:         url: “some.htm”
   5:     }).done(function(data) {
   6:         deferred.resolve(data);
   7:     }).fail(function(jqXHR, textStatus) {
   8:         deferred.reject({ xhr:jqXHR, textStatus: textStatus });
   9:     });
  10:     return deferred.promise();
  11: };

They’re basically a callback wrapper. This example is a bit redundant since jQuery $.ajax returns a Deferred already, but you get the idea. You can use this for anything that requires a callback. It provides a pattern that pushes the callback function into user code in a way that is standardized. The resolve and reject functions on deferred pass their parameters into the callbacks in the done/fail functions.

This lets you pass the deferred promise around (a promise is just a deferred with the resolve/reject removed from its interface). A bit cleaner functional approach that removes the need for you to worry about call/apply syntax and context.

The above can then be used like this:

   1: $.when(
   2:     goGetSomeHtml()
   3: ).done(function(data) {
   4:     //do success callback stuff here...
   5: }).fail(function(state) {
   6:     //use state.xhr or state.textStatus to handle the error somehow.
   7: }

Enjoy. Smile

What we need to make a jQuery script loader the right way… as part of jQuery itself.

For a while now I’ve been kicking around the idea of a jQuery script loader. There are several that take the problem halfway there, but usually they are implemented in a way that makes them harder to use than they need to be, or they are lacking certain key features.

Here is what I think the loader would need to be capable of in order to be done right. It should:

  • be AMD compliant
  • handle nested dependencies
  • handle composite/combined scripts (scripts that contain other modules that could be loaded separately)
  • allow for a way to check if a script is loaded other than its own internal index (like !!window.jQuery)
  • allow dependencies and composite modules to be defined on the script itself (optionally support a self-executing wrapper)
  • not allow itself to be stomped on if it is loaded multiple times via script tag or other means

Ideally this should be integrated into jQuery itself. Boris Moore has developed a loader that does some of these things called jsDefer but it has some issues at present. Its composite script support does not really function as the documentation would lead you to believe and the script definition process for wrapped scripts is lacking a way to name nested combined scripts easily (or it just has a bug).

There is a loader in the Ajax Control Toolkit that elegantly handled most of these issues, but few knew about it and less used it. However, it is not AMD compliant and has been deprecated and fallen out of favor in most circles due to its tight coupling the the toolkit and the rise of ASP.NET MVC.

So, it needs to be built into jQuery. It makes sense to do so because jQuery has over half the functionality needed by the loader already baked in. It shouldn’t really be a plugin because you should have one consistent way of loading all your plugins. But if it is to be baked into jQuery itself, jQuery needs some modifications. At the moment jQuery does not check for itself when it loads and there are many versions floating around in the wild. When building modular solutions there is a need to load jQuery multiple times on a single page and you cannot guarantee that widget A uses the same version as widget B. So to overcome this we need changes.

jQuery should:

  • defined in a feature manifest for each version, or
  • check for its own existence, and if found
  • check for its version, or
  • check for prior existence of each feature, and
  • override the feature if it is an older version, while
  • not stomping on itself, thus preventing plugins from being trashed (extend, don’t assign)

Anyway, these are just my ideas around a built in script loader and how jQuery needs to change to support this type of scenario, which is becoming more commonplace.

Seattle Interactive Conference (SIC) 2011 … or … How NOT to run a conference for industry professionals

I went to the SIC today and it started out a little sideways. I left the hotel and got a cab to the convention center. Only it wasn’t in the main convention center, that was a legal conference for attorneys. SIC was setup across the street on the opposite corner. When I actually showed up, I hadn’t gone to the pre-party the night before, so I got in the registration line. Problem was they didn’t do the demographics on how many people had A-H or whatever it was as their last name’s first letter. Because of this oversight they managed to create a line that filled the entire lobby for quite a while. Now correct me if I’m wrong, but wouldn’t the organizers, who should be in the marketing field, be the first ones to know that you have to split your registration lines by the number of people and not just by the letters?

After that it went downhill. The first talk I attended was Jeff Barr in Cloud Computing: How We Got Here, Where We Are, and Where We Are Heading. I expected a quick gloss over the past and present since we’re mostly all in the field and we ALREADY KNOW THIS STUFF. Several people left well before the talk concluded for just that reason. The entire day was riddled with this kind of thing from talk to talk. Several of the other talks were just agencies bragging about their portfolios. Nothing to see here, move along… People in the field (marketing, PM, designers, etc.) commented to me about this and how they expected more. I can understand if I find it lacking, being that I’m a developer and I am not the target audience for this, but come on. If even they are talking about it, there is something wrong here.

Anyway, my $.02 is next year, fix the registration line fiasco with some common sense. And get speakers that don’t want to brag, but want to share tips, tricks, ideas, and real meaningful information. Otherwise this is just an excuse to take two days off work and party.

Green tea anyone?

Yesterday my roommate and I decided our little tea pitcher is too small. So this happened… LOL

292526

272a

Snow

I woke up from my slumber this morning to find a thin film of snow on the lawn and it’s still dumping like crazy out there.

Snow!Snow!

Combining the goodness that is ELMAH with FogBugz

I use ELMAH for error handling on a lot of my projects and recently started using FogBugz again after a brief hiatus. The only problem was that to use FogBugz with BugzScout I had to put code in my applications when I already had ELMAH running. I thought that wasn’t very elegant so I grabbed the ELMAH source and the BugzScout source and hacked together a module for ELMAH that will submit to FogBugz. Please note that the formatting needs work as it submits a bunch of HTML at the moment, which FogBugz is interpreting as plain text. Once I get that fixed I’ll post an update or feel free to send me one if you’re ambitious.

I’ve linked the sample files above if you care to look. Just add these to the ELMAH project and use the custom configuration section…

   1: <errorFogBugz
   2:         area="Misc"
   3:         customerEmail="webserver@example.com"
   4:         project="Misconfigured"
   5:         url="https://yoururl.fogbugz.com/ScoutSubmit.asp"
   6:         userName="John Doe"
   7:         defaultMessage=""
   8:         forceNewBug="false"
   9:         />

And you have to add the config section to the top…

   1: <section name="errorFogBugz" requirePermission="false" type="Elmah.ErrorFogBugzSectionHandler, Elmah"/>

Finally you add the module to your modules sections…

   1: <httpModules>
   2:     <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
   3:     <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
   4:     <add name="MsAjaxDeltaErrorLog" type="Elmah.MsAjaxDeltaErrorLogModule, Elmah"/>
   5:     <add name="ErrorTweet" type="Elmah.ErrorTweetModule, Elmah"/>
   6:     <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
   7:     <add name="ErrorFogBugz" type="Elmah.ErrorFogBugzModule, Elmah"/>
   8:     <!--<add name="FixIIS5xWildcardMapping" type="Elmah.FixIIS5xWildcardMappingModule, Elmah"/>-->
   9: </httpModules>

or for IIS7 use this one…

   1: <system.webServer>
   2:         <validation validateIntegratedModeConfiguration="false"/>
   3:         <modules runAllManagedModulesForAllRequests="true">
   4:             <add name="ErrorMail" preCondition="managedHandler" type="Elmah.ErrorMailModule, Elmah"/>
   5:             <add name="ErrorLog" preCondition="managedHandler" type="Elmah.ErrorLogModule, Elmah"/>
   6:             <add name="MsAjaxDeltaErrorLog" preCondition="managedHandler" type="Elmah.MsAjaxDeltaErrorLogModule, Elmah"/>
   7:             <add name="ErrorTweet" preCondition="managedHandler" type="Elmah.ErrorTweetModule, Elmah"/>
   8:             <add name="ErrorFilter" preCondition="managedHandler" type="Elmah.ErrorFilterModule, Elmah"/>
   9:             <add name="ErrorFogBugz" preCondition="managedHandler" type="Elmah.ErrorFogBugzModule, Elmah"/>
  10:         </modules>
  11:         <handlers>
  12:             <add name="Elmah" preCondition="integratedMode" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
  13:         </handlers>
  14: ...

I hope that someone finds this useful. If there is interest I may package these as a companion library for ELMAH or contribute them to the project.

Marketing Babble

Why is it that marketing people in big corporations can’t just get to the point? Recently I’ve been tasked to go through a not so small amount of marketing material that is supposed to be aimed at small business people. This material is rife with buzz words that the marketing establishment loves to throw in front of clueless executive types to wow them into praising the marketers for their clever use of verbiage.

But, and this is the important part, they are totally missing the point. This is a common mistake in web site content, print materials and just about any form of written communication I’ve come across in the last 15 years I’ve done design, development and computer support.

No small business owner worth their salt has time to read 15 pages of marketing drivel. They don’t care if it sounds like it’s the greatest thing since sliced bread. They do care whether whatever it is solves a problem they have or allows them to make more money. Period. End of sentence. That’s it.

Often in my experience selling services that normally have all this marketing attached is down to that and how much the client trusts the person doing the selling. Usually the conversation goes like this:

Small Business Owner (SBO): “Does this solve my problem?”

Sales Person (SP): “Yes, and then some.”

SBO: “How much does it cost?”

SP: “It’s reasonable. $xxx”

SBO: “Ok, we need it. Do it.”

… or if the client is wavering…

SBO: “What other alternatives are there?”

SP: States some alternatives and costs and why this is better than them.

SBO: “Ok, we need it. Do it.” or “Ok, I’ll look into it and get back to you in a few days.”

What the SBO does not do is go read all your marketing materials. They might glance through them, but then they go to their buddy down the street and ask him what he uses, or to their search engine and see what the reviews online say. They mostly ignore anything coming directly from the company offering the service.

Why, you ask? Well, it’s obvious isn’t it? They want an independent evaluation of the product or service before they buy it. Duh!

So I plead with all you marketing types out there, and you know who you are, please, please be more to the point when you write your materials. More is not always better, and much to the chagrin of many a professor, bullshit does not work on small business people for very long.

That’s my rant on marketing materials. I hope someone takes this advice.

Do and Run

A couple of quick extension methods for your amusement that I use a lot.

 

   1:          /// <summary>
   2:          /// Runs action against the specified source.
   3:          /// </summary>
   4:          /// <typeparam name="T">The type of the element.</typeparam>
   5:          /// <param name="source">The source.</param>
   6:          /// <param name="action">The action.</param>
   7:          public static void Run<T>(this IEnumerable<T> source, Function<T> action)
   8:          {
   9:              if (source == null)
  10:              {
  11:                  throw new ArgumentNullException("source");
  12:              }
  13:   
  14:              if (action == null)
  15:              {
  16:                  throw new ArgumentNullException("action");
  17:              }
  18:   
  19:              foreach (var element in source)
  20:              {
  21:                  action(element);
  22:              }
  23:          }
  24:   
  25:          /// <summary>
  26:          /// Does action against the specified source and returns the source.
  27:          /// </summary>
  28:          /// <typeparam name="T">The type of the element.</typeparam>
  29:          /// <param name="source">The source.</param>
  30:          /// <param name="action">The action.</param>
  31:          /// <returns>The source after the action is executed.</returns>
  32:          public static IEnumerable<T> Do<T>(this IEnumerable<T> source, Function<T> action)
  33:          {
  34:              if (source == null)
  35:              {
  36:                  throw new ArgumentNullException("source");
  37:              }
  38:   
  39:              if (action == null)
  40:              {
  41:                  throw new ArgumentNullException("action");
  42:              }
  43:   
  44:              return source.Select(
  45:                  element =>
  46:                  {
  47:                      action(element);
  48:                      return element;
  49:                  });
  50:          }

    Month List

    Recent Tweets

    Twitter May 3, 14:32
    New blog post: http://t.co/4oTIhV1rML - To observe or not to observe? That is the question…

    Twitter April 8, 23:17
    #SignalR is fun

    Twitter December 20, 04:04
    Updated blog post: http://t.co/ETo7eiH5 - A Quick Comparison Between jsViews and Knockout

    Twitter December 10, 16:44
    Haha

    @wforney

    Widget Twitter not found.

    Root element is missing.X

    VSAchievements

    Visual Studio Achievements
    Bill Forney (157 Points)
     
    Bill's bookshelf: read

    How to Win Friends & Influence People Getting Things Done: The Art of Stress-Free Productivity The Fellowship of the Ring The Dragon Reborn A Game of Thrones Towers of Midnight

    More of Bill's books »
    Book recommendations, book reviews, quotes, book clubs, book trivia, book lists

    Recent Comments

    Comment RSS

    About the author

    William L. Forney was born in Pennsylvania and relocated to Washington State in early 1999. His hobbies include all the usual things: movies, books, music, video games, etc. He writes short sci-fi/fantasy stories which will someday be published in the form of small novels.

    Bill's Photograph

    He loves computers and has worked in several different areas from web, multimedia, video and 3D animation to database and windows development.

    Currently he works at Visible Reality, LLC as the lead developer and improvGroup, LLC as a networking consultant.

    He also works with Padgett & Padgett, PLLC, the accounting firm where he setup shop after moving.

    His other blog can be found here.