Thursday, January 10, 2008

We are very excited and happy to welcome Aaron Joseph Zupancic into this wild world!  The youngest of five children, Aaron has four older sisters.  In other words, 5 moms.  I fear for his well-being!

Seriously, though, Aaron was born on January 8th, 2008 at 8:19 AM, weighing in at 8 lbs 10oz.  What a wonderful blessing he is to our home!  Mom and baby are doing great and we expect them home this weekend.

On a selfish note: we can finally get some cool toys around here! (no offense to his sisters :-).

Thursday, January 10, 2008 4:39:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback

Tonight we, at the Utah .NET User Group, will be putting on a special event: Visual Studio 2008 InstallFest.

We're very excited to be able to put on such an event; a big thanks goes out to Craig Berntson for working with the folks at Microsoft to acquire the DVDs.  In fact, we were able to acquire 35 such copies to give out to attendees.  So, bring your laptop and a power strip and come join in the festivities, it'll be a great time!

Place: Digital Draw Network - Suite 300 (10897 South River Front Parkway, South Jordan)
Time:  6:00 PM
Date:  Thursday, January 10th, 2008 (tonight)

Thursday, January 10, 2008 2:57:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, January 01, 2008

Alright, there has been a particular issue with the Regular Expression Builder that I've known about since its creation and it's long bugged me.  I haven't, until today, taken the time to address the issue.  Essentially, in order to maintain the root namespace within the regex assembly created, I had created a custom Attribute (AssemblyBaseNamespaceAttribute) that was baked into the target DLL.  This hasn't truly proven to be an issue (at least when running on Windows), though the compiler would warn you when referencing it because the RegexAssemblyBuilder.exe application wasn't to be found.  It was more of an annoyance.  However, as I learned today, it does seem to be an issue when running on Linux/Mono.

Now I had the incentive I needed to fix the problem.

So, today I present a minor (but important) update to the Regular Expression Builder.  Version 2.0.0.1 provides two updates:

  • The ability to save a 'Release' version of the assembly.  This version is saved to a \Release folder beneath the project path and is created without the AssemblyBaseNamespaceAttribute so the dependency is no longer there.  Applications should reference this DLL and this is the one you should deploy.  However, when making changes, use the original as it still has the attribute.
  • You can now TAB through the pattern field in the regex editor form.  If you want, however, you can still insert TABs (ASCII 9) within your regular expression in the Zoom window via CTRL+TAB.  This is particularly helpful if you want your regular expression to be broken up onto multiple lines for readability and/or to comment it and use the IgnorePatternWhitespace option.

Download it here

Tuesday, January 01, 2008 3:15:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
I received an email today indicating that I have been named a Microsoft MVP in the area of Visual Developer - ASP.NET.  This is exciting news for me and marks the third straight year of such an honor.  Thanks to everyone's support and the awesome community we've been nurturing here in Utah.  Let's make 2008 even better!
Tuesday, January 01, 2008 2:00:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Monday, December 31, 2007

Due to popular demand I (finally) got around to updating my Regular Expression Assembly Builder Tool.  If you're not familiar with it, you can read more about it and its history here and here, but suffice it to say, it's a handy little utility that compiles regular expressions into their own assembly (dll).  There is a lot of power behind this, not the least of which is that you can effectively pre-compile your regular expressions for your application and gain some performance improvements.  You can read more about it in my aforementioned posts.

The updates to the utility include the following:

  • NEW: Upgraded to version 2.0.0.0.
  • NEW: Upgraded to VS.NET 2008, .NET 3.5.
  • UPD: Added resizability to regex dialog, supporting a larger text field for regex entry, line breaks, tabs (with a tabstop of 3), etc.
  • NEW: Added scrollability to editor panels rather than not at all.
  • NEW: Added support for a command-line-specified DLL to load.
  • NEW: Added support for hierarchical (namespace) representation of regular expressions.
  • UPD: Context menus add regular expressions to the hierarchy based on the user's selection.
  • FIX: Fixed issue involving the various RegexOptions checkboxes where an invalid configuration of options could be selected (particularly involving ECMAScript, Multiline, and Singleline.

So, apart from some nicer UI interactions than in previous versions, this version most notably includes

  1. Organization of your regular expressions my namespace.
  2. Alphabetical listing of regular expressions.
  3. The ability to provide an argument on the command-line designating the DLL to load.

Let me know what you like and/or don't like about it and I'll see what I can do to improve it for you!

Download it here

Enjoy!

Monday, December 31, 2007 5:03:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, December 24, 2007

I was working with a customer today that, after upgrading to the latest version of our software, was running into an error that I had never seen before.  The product, as you may be aware, is a web-based Product Configurator for Microsoft CRM.  Historically, our upgrades have been very clean and easy, but today the customer received the following error message when attempting to launch the application:

The file or directory is corrupted and unreadable.

The error was occurring at launch (during the initialization of ASP.NET) and was caused by an IOException.  Inspecting the call stack it was apparent that it was happening during the System.Web.HttpRuntime.FirstRequestInit() method while loading the assemblies from the \bin folder (System.Web.HttpRuntime.PreloadAssembliesFromBin() method).

My first thought was that something security-wise was amiss.  So, via Windows Explorer, we inspected the security properties on the folder for the website.  Sure enough, some credentials were messed up so we fixed those; but the application continued to fail with the same error.

Something in the back of my mind told me it was still security related.  After considering it a bit the answer was obvious.  We proceeded to open \Windows\Microsoft.NET\Framework\vX.X.X\Temporary ASP.NET Files to the folder for the application.  Upon drilling down the folder tree Windows reported the exact same error.

To fix it, all we had to do was fix the security settings on the folder, perform a CHKDSK, and delete the application's folder in the \Temporary ASP.NET Files folder.  After that, everything ran beautifully.

Monday, December 24, 2007 9:07:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Wednesday, December 19, 2007

As you're probably already aware, Microsoft recently RTM'd Visual Studio 2008.  Well, I had a moment to come up for air the other day and decided it was time to upgrade my machine to this newest encarnation.  I must say that the installation was probably one of the easiest I've ever done.  The product installed very smoothly without even a hiccup.  Also, much to my delight, ReSharper 3.0 continues to work flawlessly with VS2008! :-)

Having played around with the Beta and CTP versions of VS2008 I was very excited to move onto the released version.  It's flat out awesome!

Highly recommended!

Wednesday, December 19, 2007 2:47:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [2]  |  Trackback
 Thursday, December 06, 2007

As a special treat this year my company was kind enough to bequeath me a copy of Adobe Creative Suite 3: Master Collection.  I've been giddy with delight as I'm a long time user of both Photoshop and Illustrator and absolutely swear by the products.  I've had it sitting on my desk here for a few days and just tonight am getting the opportunity to install it.

Of course, as with most everything, things don't always go according to plan.  Not two seconds after starting to install, I was greeted with the most pleasant and informative error message and the setup aborted:

Setup has encountered an error and cannot continue.  Contact Adobe Customer Support for assistance.

Internal Error 2739

Though slightly disheartened, I sought a resolution on Adobe's site and didn't find anything.  However, after a single search on everyone's favorite search engine I found a resolution.  Though the solution is simple (regsvr32 jscript.dll) I would have never guessed it.  Thanks, Gopinath M for the great tech tip!

Thursday, December 06, 2007 11:04:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, November 26, 2007

I have a website that I created that uses an ASP.NET Login control to assist in user authentication on the site.  I've used the Login control on other sites and it's provides a very convenient mechanism for authenticating a user.  On this site particular site I have the Login control contained within a wrapper control (which I called LoginBox).  Due to the nature of this site, the LoginBox does not exist on the page in the ASP.NET HTML markup but rather is added to the page dynamically.  As such I don't have the convenience of editing the HTML markup of the asp:Login control directly but must interact with it programmatically.

The Login control provides several properties through which I can achieve a nice look and feel.  It contains child controls for the title, labels, textboxes, required field validators, checkboxes, and buttons.  Each of these can be customized via CSS styles or by directly assigning values to the controls' properties.

In this particular site I needed to extend the appearance of the control, adding some textboxes to the control.  At first this wasn't very intuitive, but I'll show you that it is, in fact, quite easy to achieve.  You can easily add fields to the control (e.g., a 'verify password' field, an 'email' field, a CAPTCHA control, etc) by customizing the LayoutTemplate of the Login control.

Were I to have had the control in the HTML markup of my page this would be a piece of cake.  Note, via the designer, you can simply click the Login control's smart tag and click “Convert to Template“ or create it manually:

<asp:Login runat="server" id="login">
  <LayoutTemplate>
    <!-- HTML template here -->
  </LayoutTemplate>
</asp:Login>

However, as the control is being generated entirely in code, the template must be created programmatically.  As a bare minimum, you need two controls in your template that implement the ITextControl interface for the control to render; otherwise, you'll get an exception (TextBoxes will suffice or any control you create that implements that interface).  These controls are UserName and Password.  I recommend adding the login button as well (Button, LinkButton, or ImageButton) with a CommandName set to “Login“.  Using a template, you can fully customize the look and feel of the output.  Note, that when you go the route of creating a custom template, you are solely responsible for the output.  In other words, you're completely replacing the output that the Login control generates; if you want field validators, you need to add them.

// somewhere in the page (e.g., Page.Init)
Login login = new Login();
login.LayoutTemplate = new LoginTemplate();
Controls.Add(login);

internal class LoginTemplate : ITemplate {
  public void InstantiateIn(Control container) {
    TextBox txtUserName = new TextBox();
    txtUserName.ID = "UserName";
    container.Controls.Add(txtUserName);

    TextBox txtPassword = new TextBox();
    txtPassword.ID = "Password";
    container.Controls.Add(txtPassword);

    ImageButton btnLogin = new ImageButton();
    btnLogin.ID = "LoginButton";
    btnLogin.ImageUrl = "~/images/LoginButton.gif";
    btnLogin.CommandName = "Login";
    container.Controls.Add(btnLogin);
  }
}

With this, I have an extremely boring-looking Login control, but you get the idea.

When the page is posted back, you can easily retrieve the contents of any control you added to the template by calling the .FindControl() method, referencing it by name:

string emailAddress = ( ( TextBox )login.FindControl("txtEmail") ).Text;

Monday, November 26, 2007 3:36:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [3]  |  Trackback
 Saturday, November 03, 2007

I had the opportunity to present at the Utah Code Camp today on the topic of Regular Expressions.  This topic is near and dear to my heart, but (being my worst critic) I feel that I couldn't get my act together.  In part I feel that the presentation went very poorly; it was definitely among my worst.  I felt my explanations lacking, incomplete, or erroneous, my examples unsuccessful or poor, and my 'togetherness' absent.  It was a very far cry from a similar presentation I had given back in Sept 2006 to the Utah .NET User Group which was among my best I feel.  That made it all the more disappointing for me.

I guess on the positive side I've updated my RegexTester application and it's available for download here.  Thanks to all that came and participated.  We had a great turnout to the event so that was very positive.  I just wish my presentation hadn't ruined my day...it's been lousy ever since.  I guess you can't win them all.

Saturday, November 03, 2007 1:54:00 PM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [3]  |  Trackback