Handy Developer Tools & Links

by wforney 29. December 2013 04:51

There are a lot of tools out there and others have posted lists that are handy. I’m going to put my list of common tools here and try to keep it updated every now and then for my own use as well as anyone else who may like to reference it. Feel free to send me more to add to the list.

Code & Text Editors
Visual Studio Extensions
General Utilities
Updaters

Tags: , ,

Software Development | Technology

single page application architecture

by wforney 16. December 2013 19:22

I've been poking around at a lot of JavaScript over the last year or two and have been refining this layered architecture for setting up applications. The main idea behind it is to cover all the old bases in a way that also reduces the number of requests and performs very well. The layers I am using are setup like so:

  • Web front end (static HTML)
    • UI views, scripts, and related image files
    • Localized strings as JSON files
  • Middle tier (WebAPI/SignalR)
  • Back end (database/web services)

So, to explain a little about this layout… The front end is all static. The files may be generated by a compiler or parser but upon publish they are static and require no server processing. This allows one to put these files into a CDN whether it is Azure or Amazon for massive scale and economy. Having the localization files as static JSON allows them to be packaged up with the front end and sent along with it. Depending on the configuration and build process these files could even be combined and minified further.

The middle tier is your standard WebAPI and/or SignalR server side code layer hosted on a standard ASP.NET server, usually Azure Web Sites in my case. This tier is basically an API that provides the site with any dynamic actions and information it needs.

Finally, the back end consists of a database used by the middle tier, usually a SQL server of some kind, and any external web services needed by the middle tier. You could lump the external web services into the middle tier but I prefer to think of them as something separate for the sake of organization.

There are some interesting issues you run into when implementing this pattern, including how to handle authorization and security trimming. I generally move the navigation page list into a JSON object that can be generated by the API. In this manner you avoid exposing all your pages to the client even though the templates for those pages may exist in your CDN as public files. All of the security should be enforced on the middle tier so that users cannot perform actions they are not supposed to be allowed to do.

I've found that this model is fast and performs well under load when done properly. The trick is keeping it simple while utilizing all the tooling available to generate the published result. If anyone is interested I could go into more detail about that.

Tags: , , , , ,

JavaScript | Software Development | Technology

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

by wforney 6. July 2012 14:09

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

Tags: ,

Technology | Quick Fixes

The computer furniture rant

by wforney 7. June 2012 21:36

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.

Tags:

Technology | Furniture

A quick note on jQuery.Deferred()

by wforney 6. January 2012 21:53

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

Tags: , ,

JavaScript | jQuery

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

by wforney 16. November 2011 10:41

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.

Tags: , , , , , ,

jQuery | JavaScript

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

by wforney 2. November 2011 20:59

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.

Tags: , ,

Conferences

Green tea anyone?

by wforney 19. June 2011 15:36

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

292526

272a

Tags:

Family & Friends

Snow

by wforney 29. December 2010 08:42

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!

Tags:

Photography

Combining the goodness that is ELMAH with FogBugz

by wforney 1. November 2010 07:31

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.

Tags: ,

C# | Software Development | Technology

Calendar

<<  July 2014  >>
MonTueWedThuFriSatSun
30123456
78910111213
14151617181920
21222324252627
28293031123
45678910

View posts in large calendar

Month List

Page List

Email Subscription


RecentComments

Comment RSS

VSAchievements

( Points)