Andy Edinborough

was here

CSS Stress Testing and Performance Profiling

Posted on April 14, 2011 in Code    Tagged css test stress performance profiling Tweet This

I present you with the CSS Stress Test bookmarklet.


Now let me explain: I have been losing my sanity over the oddest issue.  The project I’m working on right now has a fairly complex stylesheet.  Performance for the site is absolutely critical.  I’ve done my best to squeeze and optimize every line I can.  In all browsers, it runs like a champion.  Except IE9.  It runs terribly in IE9.  To make matters worse, it runs fine in IE8, IE7, and though it’s mangled, it even runs in IE6!


Something specific to IE9 was causing a serious performance glitch.  I realized fairly quickly that CSS was to blame.  Disabling JavaScript had no effect, but disabling all CSS instantly fixed performance.  I went through the usual suspects: filters, and various new CSS3 properties, but nothing seemed to help.  So I reached out to the community looking for something that could profile my… Read More →

Duck-Punching the jQuery UI Datepicker into a Date/Time Picker

Posted on June 23, 2010 in Code    Tagged datetimepicker datepicker jquery Tweet This

There are a TON of awful date pickers out there.  For a who’s who of the worst, check out Date Time Picker Competive Analysis.

jQuery UI’s Datepicker control is by far the best looking and most intuitive picker.  In light of maintaining a uniform UI, I wanted a date time picker that played on that control.  I found two:

  1. http://blog.w3visions.com/2009/04/date-time-picker-with-jquery-ui-datepicker/ – Integrates with Datepicker, but the UI is completely disjoined.
  2. http://engineeredweb.com/blog/10/4/jquery-date-and-time-pickers – The first one listed here is the one I had been using.  It integrated nicely with Datetpicker, but the author’s website is down now, and I found it was quite bulky and that it limited how you could use Datepicker—no inlining, no animation, etc.

So I created a duck-punched DateTimepicker that simply manipulates the Datepicker DOM element and functions to add the missing functionality:image

As you can see, I also added the ability to specify custom buttons… Read More →

Custom .NET Remoting – Easier Than You Think

Posted on April 1, 2010 in Code    Tagged remoting c# Tweet This

The idea of implementing remoting will give most programmers instant heartburn.  Granted, I’m not an expert on all the existing remoting solutions, but I haven’t found one that works intuitively.

All the different solutions I’ve seen require just about double the code.  You write a method once, then write a wrapper for the method to implement remoting. 

Furthermore, they often require special handling to make sure the contextual variables are maintained.  For example, when I was working with CSLA recently, I was appalled to see:

customer = customer.Save();

The Save() method executes remotely, so the customer object that comes back has a separate memory reference.  Surely, we can get around this. 

So I set out to write my own.  I had 4 main goals.  I wanted to be able to:

// Remote any method with no code changes to the business object
Remoting.Execute(customer.Save);

// Executes remotely, and updates the object… Read More →

C# Imap and Pop3 Library

Posted on March 26, 2010 in Code    Tagged pop3 imap c# Tweet This

Sigh. 

These are text-based services… it’s not that hard, and yet all the projects I found out there were nasty—bloated and severely error prone.  So, I rebuilt one.  This is based heavily on xemail-net.  I simplified it quite a bit—created standard methods for repeated code blocks and implemented a base class to simplify the creation of the Pop3 client.

Getting Started with Yahoo and OAuth

Posted on January 29, 2010 in Code    Tagged c# oauth yql yahoo Tweet This

Yahoo doesn’t offer much help to .NET/C# developers when it comes to getting started with using their API’s and OAuth.  So I’ve put together a quick-hit starter pack.

  1. Yahoo! YQL Console
    This is fun for all ages!  I just get all giggly when I see all that Yahoo has made available through YQL (Yahoo Query Language).  You can use this tool to perfect your queries and figure out just what you want to accomplish.  As a supplement, you can check out the PDF Documentation as well as the online version.
  2. My Projects @ Yahoo Developer Network
    Once you’ve got your base application logic in place, you can request the keys you’ll need to communication with Yahoo using OAuth.  This will let you take advantage of the higher usage limit of 100,000 requests / day and 10,000 requests / hour.
  3. Simple C# OAuth Code
    Unfortunately, the C# OAuth libraries listed… Read More →

C# OAuth Implementation

Posted on December 17, 2009 in Code    Tagged .net c# yahoo oauth Tweet This

AAAARRRRGGGHHH!!

I had to get that out of my system.  I’m not familiar enough with the exact specification of OAuth to know whether it’s Yahoo or Yedda that can’t read a spec, but the Yedda implementation of OAuth available on Google Code, doesn’t even begin to work with Yahoo’s YQL API.  Futhermore, the Yedda implementation is bloated and hard to follow.  Why is it that so many programmers feel the need to over complicate EVEYRTHING.

So… Here’s my rewrite of the Yedda implemenation.  It works out-of-the-box.  There are no objects to instantiate, just 4 very simple static methods to use.  A word of caution, System.Net.WebClient cannot be used to talk to Yahoo.

Update (1/29/2010): See a complete working example of C# / OAuth / Yahoo YQL.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using System.Text;

namespace WAN.Lib {
    public static class OAuth {
        private static Random… Read More →

Firefox v3.5 Needs to go back to the drawing board

Posted on July 10, 2009 in Tech Watch    Tagged firefox bugs weeping Tweet This

This truly is “embarrassing”.  image The Mozilla team really pulled a “Windows ME” with their latest release of Firefox.  After being open for 5 minutes, Firefox with only the “embarrassing” tab open has 26 MB more memory usage than IE8 running for hours with 3 tabs open (including a Bing Map).

LAME!  And what happened to Firebug?!  When I try to inspect a page, the CSS gets completely hosed.  I know the Firebug team has rewritten it to use JetPack, but it looks like they had to rush to get a v3.5 compatible version out in time for Mozilla’s release.

I’m not one to rollback software.  I’m a software junkie—I NEED the latest version.  It is with a heart that I uninstall Firefox v3.5.  I’m slighted enough that I’ll probably go back to v2.0 until this whole mess gets straightened out <weeps bitterly />.

Update:  Firefox v3.5.1 is no better

image

I… Read More →

Use Late-Binding in C# Now, without .NET 4.0

Posted on June 17, 2009 in Code    Tagged .net c# late-binding Tweet This

The lack of late-binding in C# has been one of my biggest gripes about C#.  Finally, in the .NET Framework v4.0, the dynamic keyword has been introduced (it could be argued that it is too loose—allowing for variant types).  But until it is released, the need still exists, and even then, not all clients will immediately support it.  So, in a bind, I wrote a simple class to allow access to objects via late-binding in C#. 

The trick to figuring out how to write the code came from using Reflector to decompile some VB.NET code… (I love reverse-engineering :]).  The answer is that the VB compiler makes use of an area of the .NET Framework within the Microsoft.VisualBasic assembly that is marked with the attribute [EditorBrowsable(EditorBrowsableState.Never)] to prevent people from discovering it.

Here’s an example that uses my Late-Binding code to open an Excel Spreadsheet and convert it to a… Read More →

RE: Microsoft may be Firefox's worst vulnerability

A recent article at Slashdot that has now been propagated to TechRepublic, claims that Firefox's biggest vulernability this year is Microsoft.  For those who have not heard, as part of the .NET Framework v3.5 SP1, Microsoft added an extension to Firefox to support Click-Once application deployment.  The claim by Slashdot is that this is Internet Explorer's biggest vulernability and that Microsoft has forced it onto Firefox users.

Having done extensive development in the area, Click-Once deployment does not give the “ability for websites to easily and quietly install software on your PC”.  Click-Once must always be initiated by the user, always displays a dialog, and always requires the user to agree to install the software.  Microsoft didn’t do anything that Firefox doesn’t allow or encourage.  Click-Once is actually very similar to Firefox’s own method for downloading and installing Extensions.

The interesting thing is that the article claims this is… Read More →

© 2013 Andy Edinborough. All your rights are belong to me.