Please Donate: The Leukemia & Lymphoma Society - Scenic Shore 150 Bike Tour [Donate Here]
Adjust font size: [-] [+]

Wednesday night, Fun at the Lakefront

June 23rd, 2008

As I mentioned previously, there is going to be a special event on Wednesday night. We are going to be treated to an event at the Quadracci Pavilion, at the Milwaukee Art Museum. This room is a beautiful space below the Burke Brise Soleil. At 4:15pm there will be two presentations for the Unified Communications User Group. This is the inaugural meeting and everyone is welcome. At 5:45pm everyone is invited to meet up with other developers in the .NET and Microsoft communities. (please spread the word) Come to chat with others in our great user group community which is getting stronger all the time. Please attend the presentations if you are able to make it and then be sure to stick around afterward for some gaming and other fun.

Below are the details:

Unified Communications Group Inaugural Meeting

Come be a founding member at our inaugural Unified Communications User Group meeting!

  • Learn and share your thoughts and ideas around Exchange, Office Communication Server, LiveMeeting, Presence, VOIP, and other collaborative techniques.
  • Meet like-minded peers who share common interests and challenges
  • Learn -> Understand -> Share!

We are privilege to have our first meeting in the Quadracci Pavilion, at the Milwaukee Art Museum.

Wednesday, June 25th - Meeting Agenda:
4:00pm - 4:15pm Welcome! – First User Group Kick-Off
4:15pm - 5:00pm Christine Malone - Microsoft Unified Communications Solution Specialist – speaking on UC
5:00pm - 5:15pm Break
5:15pm – 5:45pm Steve Zimmerman – CIO of Prent Thermoforming to present on their OCS and Exchange UM implementation.
5:45pm Networking

Sign up here or visit www.wucug.net for more information.

Special Event on June 25

June 5th, 2008

Planning is currently underway for an event at a great location for area developers. Keep the date free so that you can make it once the announcement goes out. You will not want to miss it.

Recommended Books on JavaScript

May 12th, 2008

JavaScript: The Good Parts With AJAX spreading to more and more web sites it is becoming increasingly valuable to learn how to use JavaScript. Most web developers cringe at the thought of working with JavaScript after years of bad experiences with no debugging support for very buggy and incompatible web browsers that do a poor job of interpreting JavaScript properly. Once you get to know the language as it was meant to be you really will learn to appreciate the power it provides. You just need guidance on working with what is a powerful language on a pretty rough terrain where IE6 is still in the mix to a significant degree. Meanwhile the terrain over IE7 and FF2 is not all that bad.

The newest book to be released is JavaScript: The Good Parts (170 pages) by Douglas Crockford who is the lead JavaScript Architect at Yahoo. He knows all about the bad parts and in this book, which I ordered and just shipped a minute ago, covers the good parts that you can use that will allow you to create the kind of web site that will make your users ecstatic and win you more fun and interesting projects.

Last year I read Pro JavaScript Techniques by John Resig who is the creator of the wildly popular JavaScript library jQuery. All of the books that I purchased just a few years back, covering advanced topics like DHTML (a term that makes my eyes roll), were using horrible syntax which did not allow for building advanced sites due various problems that are easily overcome with techniques explained in Pro JavaScript Techniques. You will learn about scoping, namespacing, inheritance and how to handle cross-browser issues.

Later this year a new book by John Resig called Secrets of the JavaScript Ninja will be published. The book is made up of topics suggested by the community through his blog which were not covered in depth in his first book or any other book out there. I am extremely anxious to get my hands on this book. Resig has an uncanny talent when it comes to JavaScript and reading his last book was an eye opener for me and I expect to learn a great deal more with this next book.

It is an important year for JavaScript. With competing technologies like Flash, Adobe AIR and Silverlight fighting for market share it is necessary for JavaScript to keep pace and it is not standing still. Soon the standard for JavaScript 2 will be nailed down and features like the Canvas in HTML5 and SVG will offer major competition to the proprietary alternatives. Now is a good time to retrain yourself on JavaScript. I strongly suggest you pick up these books.

Writing Better Code and Formatting Tip

May 6th, 2008

Sometimes when I work with other developers I inevitably find that all of the code looks different. Some developers like to write really compact code, as if we were still working on cartridges when disk space for the source code really mattered. Some developers also firmly believe that fewer lines of code in C# means it will somehow run faster because doing 5 things on a single unreadable line of code will somehow run in a single instruction in compiled code versus carefully expanded and readable code that performs the same 5 actions. I am not a fan of compact code. I prefer readable and verbose code with the occasional comment to help explain a bit of code that implements some strange business logic that was defined in the specifications but is not obvious from looking at the code.

Read the rest of this entry »

ASP.NET: Fixing a Bug in the MS AJAX Client-Side

May 2nd, 2008

I discovered a problem with the ASP.NET AJAX Client-Side library. It seems it was trying to access a property on a variable when the variable was not defined. The difficult part of the problem was that the function that was being called is a part of a series of events that are bound to various elements on the page automatically. I am unaware of what it is doing exactly or how to prevent it so fixing it was a challenge. Fundamentally the function was working like this...

Because the a parameter was passed in as undefined from a function that my custom code did not call I could not simply fix it on my end. I needed a way to first check if the a value was defined before it attempts to access the disabled property on it. Since JavaScript is a dynamic language I can redefine and remap functions very easily. I dug into the JavaScript in the MS AJAX Client-Side library and found the context for the function and wrapped it with my own function that checks if the given parameter is defined. If the value is defined I call the original function.

The code below is my fix. The _onFormElementActive function which is defined in Sys.WebForms is the function that was causing me trouble. This code first saves the existing function to a local reference and then reassigns a new function to that name within the prototype. Then within that function I name the function with FIXED at the end the name so that it can be called within the context of the object instance. The original function needed to access this with the right context which is why that is necessary. Then I can simply check the value of a and call the fixed function with the same parameters.

The beauty of this code and this solution is how JavaScript works. I can safely redefine an existing function, wrapping it with my own code, and still call the previous function easily. And even if the object instance for this class was already defined this adjustment will still take place because this change not only affects all instances created in the future, but all pre-existing instances.

Next I hope to get in touch with the ASP.NET AJAX team and let them know about this particular problem. Ultimately they may just need to code to read if (a && a.disabled) and the bug would be corrected. I also want to know how this problem came up. This web site was working fine for a couple of weeks before this started to happen. And curiously enough, it only affects IE7 and not IE6 or FF2.

ASP.NET: Clearing All Items in the Cache

March 28th, 2008

I wanted to give the QA team a way to clear the items in the cache during their testing so I justed added a button to the main QA test page with a button that runs the following code. I actually ripped this code from my book, Pro ASP.NET for SQL Server.

Consumer Unions for Cheaper Mobile Phone Bills

March 27th, 2008

Mobile phone plans really suck. Yesterday I saw a commercial for Sprint with their new CEO and he stated that he is going to change things up. Their offer seems to be $99 for unlimited everything. I can get unlimited web, GPS, txt and voice for a fixed monthly fee like I do with cable TV and internet. It is an obvious solution. More people have phones than any other electronic device. Every adult and nearly every high school and college student has one and are paying much more than a typical cable bill. Yet it is not uncommon to go over your minutes and get hit with more than $200 in over charges. I have seen it a few times over the last couple of years and I do not like it.

So I am wondering, is there such a thing as a consumer union where consumers combine together to collectively bargain with the mobile phone providers? If I wanted unlimited web, GPS, txt and voice for $60 and I had 1,000 people who are willing to sign up for a 2 year contract for that deal is it reasonably possible to make a deal with the big mobile phone companies?

I live in a condo and this past year we signed a contract with Time Warner to get a half off deal for basic plus movie and sports channels for 2 years. We have less than 200 people living here so if 200 people can make such a negotiation happen, it should be possible for a group of 1,000 to sign a contract to get an unlimited usage deal for a great price.

JavaScript Therapy

March 23rd, 2008

Our relationship with JavaScript has been turbulent these past 10 years. In the early days there was so much promise as both the Netscape and Internet Explorer teams worked feverishly to add new features to the browsers and coined the term DHTML. It was an exciting time, for a while at least. Then the fact that features did not work reliably or even across the two dominant browsers started to sink in and the polish on this shiny new thing started to wear off. Yet we still persisted in trying to find ways to make it work, only to be slapped in the face over and over again.

One strategy I followed was to focus only on Netscape 4 for certain functionality and I would spend hours trying to nail down my new script, thinking I had the syntax right, alt-tab, F5... and then see inexplicable behavior happen. I naively thought that the Netscape 4 engine for JavaScript was bulletproof and I was wrong. I did not realize until a few years later, after ignoring JavaScript during that period, that the syntax I was using was completely valid. It was just the browser misinterpreting my code.

Starting just a few years back I started to see JavaScript becoming useful again. The combination of Google producing web applications like Google Mail and the Firebug extension for Firefox caused me to reconsider JavaScript one more time. What Google created excited me about what JavaScript could do for my web applications and Firebug offered support for making it happen by exposing what was happening inside the browser.

Gradually as I re-educated myself on JavaScript I picked up techniques to write JavaScript more efficiently and reliably while also making it work across a broader selection of browsers than were available in 1998. And a major push forward was the rising popularity of JavaScript libraries (jQuery, Prototype, YUI and many others has made it nearly trivial to add advanced client-side behavior to web applications that works across all of the major modern browsers. After learning a bit about the available JavaScript libraries I read Pro Javascript Techniques by John Resig which opened my eyes on how much more powerful JavaScript can be. Later I watched a video of a presentation that Resig made for Yahoo! on Advancing JavaScript with Libraries (Part I, Part II). His book is excellent and these videos compliment it very well.

With my efforts to re-educate myself about JavaScript the last few years I feel I have a good relationship with JavaScript. This re-education has been like therapy for this troubled relationship with a once flawed technology. Each time I talk with someone about web development they seem surprised or even shocked that I would be so willing to jump head first into attempting complex functionality with JavaScript. It seems there is a lot more "JavaScript Therapy" that needs to happen. People have not forgotten the bad old days and letting go of that negative experience has been hard for most web developers. I have come to accept the fact that in order to produce rich web applications that I have to leverage JavaScript along with everything I know about HTML and CSS. These three technologies can do amazing things together and as the browser makers compete to produce faster, more stable and more standards compliant browsers these capabilities will only improve.

In the coming weeks I will be writing about what I have learned about modern JavaScript, especially with ASP.NET. In the meantime, if you are interested in JavaScript I strongly suggest reading Resig's book, watching those videos and exploring the tools referenced in Web Development Tools for the Power Developer. Later you can check back here for more on JavaScript techniques.

Shared Content Across Sites with ASP.NET User Controls and JavaScript

March 15th, 2008

Rendering a User Control in ASP.NET using a web service or a generic handler is easy. Taking the string that is generated with a User Control and then serializing it to be embedded in JavaScript is also easy. Both combine to what you will need to create custom ads that are exactly like how Google Ads are served. This technique can also be used to share a common piece of markup across many web sites. As the central web site is updated so are all sites that reference it.

The first method below will render a User Control to a string. The second method will serialize that string for use with JavaScript as a JSON value. The value can then be included in a dynamically generated script for use from remote sites. I had some early troubles with the DataContractJsonSerializer which replaces the deprecated JavaScriptSerializer but eventually I got the following code to work reliably. Previously I created something similar but without User Controls a while back for the local .NET User Group to show banners for upcoming meetings.

Find me on Twitter

March 15th, 2008

I just create my Twitter account. Twitter has come up in discussions at work and with several friends who are using it. Nobody really has a good sense of what it really is or how to use it. I think it is broadcast IM or micro blogging. I am not sure how I will find it useful, but I have avoided it because it is just another potential distraction from the work I should be doing. Here are the things I plan on twittering about...

  • Links to good articles or blog entries
  • Links to my new blog entries or articles
  • The artist and title of a really good song I am listening to at the moment
  • Random thoughts while I work at my computer, likely related to software development
  • Questions on a problem I am currently trying to solve

And through these twitterings, or tweets as some call them, I hope to get some interactions going with people who are interested in and working on the same topics. My current primary interests are building dynamic web interfaces using ASP.NET AJAX and jQuery and extending Visual Studio 2008 to assist with creating those interfaces. In the work that I do we often do very quick projects (2 to 3 months) and doing the setup for a new web site to support the client-side functionality that I now do typically is a bit of work. My self-training on the topic of modern AJAX UI was done with the Kvetch Reborn project which actually has some features in common with Twitter. The source for it is available for download. I have used what I have learned for Microsoft ASP.NET AJAX and jQuery to assemble that application which has rich client-side functionality with direct integration with the server-side on a single page. I have more to do in automating the setup work for creating such projects, including completing the baseline features for the JavaScript Browser.