# Sunday, 19 August 2012

JavaScript’s popularity proves how useful people have found the language. Novices use it to add simple validations to web forms, while advanced build amazing applications with JavaScript.

Yet, for all its utility, many look at JavaScript with disdain and fear, pointing to dangerous features and to the difficult of dealing with the browser's Document Object Model.

In JavaScript: The Good Parts, Douglas Crockford distinguishes between the good features of JavaScript that make it and elegant and powerful language; and the bad parts that make it dangerous and difficult to understand. Crockford’s message is to use the good parts and avoid the bad parts and stop fearing JavaScript.

According to Crockford, most people misunderstand JavaScript and so they misuse it; then, they complain about the language.

Crockford acknowledges that the designers of JavaScript made some mistakes (global variables, for example), but that there are enough good features of the language to make it appealing to a wide range of users writing a wide range of applications. He notes that JavaScript succeeded as a platform for creating client code for the web – something that that the more powerful Java language attempted and failed badly – and that this proves JavaScript’s power.

Applications will be better and developers happier, notes Crockford, if developers avoid the bad parts of the language. For example, always use the "===" operator, which returns what most users expect because it doesn't do any type coercion. Avoid the confusion of the "==" operator, Crockford recommends.

Crockford's style is concise and straightforward. At fewer than 200 pages, the book has no room for distractions. Regular Expressions are presented and described and examples are shown how to use them. Crockford clearly describes Closures, a feature that is likely new to many developers; and he spells out how callbacks are implemented in JavaScript.

Before reading this book, I was unaware of implied semicolons in JavaScript and whey they can be dangerous. Crockford spelled out the dangers and how to avoid them very clearly.

JavaScript can be a great language if you confine your programs to using the best parts of the language and steer clear of most of the dangerous features. This book will help distinguish the two.

Sunday, 19 August 2012 03:36:23 (GMT Daylight Time, UTC+01:00)
# Tuesday, 14 August 2012

Here is Mike Wood's presentation on Continuum (of the Windows Azure Variety) at the July 2012 Great Lakes Area .NET User Group meeting.

Tuesday, 14 August 2012 13:36:59 (GMT Daylight Time, UTC+01:00)
# Monday, 13 August 2012
Monday, 13 August 2012 20:27:00 (GMT Daylight Time, UTC+01:00)
# Sunday, 12 August 2012

I recently delivered a presentation titled “Persistence in the Cloud: How to Use Azure Storage” at the aspconf online conference. A recording of this presentation is available at http://channel9.msdn.com/Events/aspConf/aspConf/Persistence-In-The-Cloud-How-to-use-Azure-Storage.

Sunday, 12 August 2012 17:52:59 (GMT Daylight Time, UTC+01:00)
# Monday, 06 August 2012
Monday, 06 August 2012 07:49:43 (GMT Daylight Time, UTC+01:00)
# Wednesday, 01 August 2012

I recently delivered a presentation titled “HTML5 is the Future of the Web” at the aspconf online conference. A recording of this presentation is available at http://channel9.msdn.com/Events/aspConf/aspConf/HTML5-is-the-Future-of-the-Web.

Wednesday, 01 August 2012 15:07:00 (GMT Daylight Time, UTC+01:00)
# Tuesday, 31 July 2012

Training is an important part of employee development and most managers recognize this. At the same time, most managers have a budget to which they need to adhere.

Next time you request training, do yourself, your manager, and your company a favor by articulating the reasons for this training. To reduce misunderstanding and ambiguity, state your case in writing. Be explicit about what you are requesting. This may include time away from work, training fees, and travel expenses.

Your statement should answer as many of the following questions as you  can:

  • How will this training benefit your ability to complete your current project or an upcoming project? How will this training benefit the company or department?
  • How does this training align with your career goals?
  • How much will the training cost? How much time will you need to miss from my regular assignments? Do you plan to make up this time? Do you plan to take vacation for the missed time?
  • If the training is out of town, is similar training available locally? If so, why is the out-of-town training preferable.
  • If your company provides "free" training resources, what does this training provide that is not available in those resources?

Generally, managers are supportive of training for their employees. Help them make the decision easier by clearly stating a case for your training.

Note: This blog post was inspired by a recent conversation with career counselors at the Sogeti Minneapolis office.

Tuesday, 31 July 2012 09:54:50 (GMT Daylight Time, UTC+01:00)
# Monday, 30 July 2012
Monday, 30 July 2012 16:57:00 (GMT Daylight Time, UTC+01:00)
# Saturday, 28 July 2012

I have volunteered for many community-run conferences and I have organized two: GANG10 and Detroit Day of Azure. One of the challenges of a conference is getting people to attend. It's not enough to have great content. You have to spread the word about the event and you have to inspire people to register and to attend. If your target audience doesn't know about you event, they will not attend it.

Here are a few things my team and I have done to promote conferences.

Create a web site as soon as possible and keep it updated. This will save you time. When people ask for event details, you can point them to the web site. A Facebook or LinkedIn page is fine, but not sufficient because these sites are for members only and your audience will need to log before they can read all the information.

Create a Twitter account and post to it regularly. Have that Twitter account follow all your speakers and volunteers and ask that they follow it back. The new Twitter account won't have many followers at first, but you want followers who are willing to re-tweet what you post. Prior to the event, I would post to the Twitter account every day; then re-tweet from my own account (which had more followers). Because the promotional messages are coming from the event Twitter account, it feels less like spam to my followers than if it were coming from my personal account. Consider using a service like FutureTweets or an application like TweetDeck to schedule tweets in advance. This makes it easier to space out your tweets throughout the day. Be creative in your tweets: announce the speakers; announce some of the other perks, such as door prizes and lunch menu; talk about the venue; thank the sponsors. If you repeat the same message over and over, people tend to tune it out.

Make a list of people you think might be interested in the event and contact them. If it's a couple dozen, send a personal e-mail to each one or call each one; If it's several hundred, send out an e-mail blast. Services like Constant Contact can help with this.

Who are the influencers in the area that the conference covers? Offer them a free ticket to the event. Call them and let them know you'd really like them to be there. They will spread the word and reach more people than you could on your own. If they are talking about the event, that is great advertising.

Think of popular bloggers who would be interested in this event and tell them about it. Even if they can't make it, they may blog about it, increasing exposure.

E-mail your co-workers to let them know about the event. Ask them to spread the word among their colleagues, customers, and friends.

Print flyers. Hang them up in your workplace and in your customer's workplace and anywhere that your target audience congregates. Many companies have a bulletin board in the lunch room or break room just for things things like this. Ask others to do the same. Make sure the flyer has all the relevant information, such as date, time, and the web site URL.

Register the event at http://CommunityMegaphone.com.

Get others involved. Recruit volunteers. Not only will it help defer your workload, but those who are involved will feel ownership and will be more likely to spread the word enthusiastically.

Contact user group leaders. Ask them to promote the event at their meeting. Ask if they will send out an e-mail promoting the event. Some groups have a monthly newsletter and will be happy to add to this. If possible, attend user group meetings and promote the event yourself. Ask the leader if you can have 2 minutes to talk about it.

Send an e-mail to speaknet@googlegroups.com. You will need to join this group first.

Create an event on Facebook and LinkedIn. As mentioned earlier, this is no substitute for a web site, but you may reach an audience that you otherwise might miss.

Contact the chair of the CS department of local universities and ask them to promote to their students. Consider offering a discount or free admission to students.

Contact podcasters and ask if you can be a guest on their show to talk about the event. I appeared on Community Megaphone a few weeks before GANG10 and this helped spread excitement about that event.

For Microsoft events, contact your local Developer Evangelist. They have their own channels for communicating with the local technical community.

I have done almost all of these things in order to drive interest in the event. The two key points are: let as many people know about the event as you can; and get people excited about the event.

Planning an event is a lot of work and a lot of fun. But the payoff is more satisfying if you have a good turnout.

Saturday, 28 July 2012 07:44:54 (GMT Daylight Time, UTC+01:00)
# Tuesday, 24 July 2012

Functional testing, system testing, and acceptance testing of software often involves manual actions by a user. To verify that an application works as designed, a user launches the application, navigates to a specific module, enters some data, and verifies the expected output.

Such testing tends to be expensive in terms of time, labor, and money. In addition, like all activities requiring human intervention, testing in this manner can often be error-prone and inconsistently executed.
Microsoft Visual Studio 2010 Premium and Ultimate contains the Code UI Testing tool that provides a way to automate these tests, so that regression testing can be performed more quickly, efficiently, and consistently.

A Coded UI Test gives developers and testers the ability to create tests that simulate user interactions with an application.
Coded UI Tests are stored in a Test Project. To create a new Test Project in Visual Studio,

  1. Select File | New | Project… The New Project dialog displays. 
  2. In the Installed Templates panel, expand the Visual C# or Visual Basic node and select the Test category.
  3. In the Project Type panel in the middle of the New Project dialog, select Test Project.
  4. Enter a name and location of the Test Project.
  5. Click the OK button. Visual Studio creates a new Test Project. You can view it in the Solution Explorer.

In our example, the project is named TestProject1. Link: Download TestProject1.

By default, a new Test Project contains a Unit Test class named UnitTest.cs. We won’t need this class, so it is safe to delete it.

Add a Coded UI Test to the project. (Project | Add Coded UI Test…) and provide a meaningful name for the map class.

The Generate Code for Coded UI Tests dialog displays. Select the Record actions, edit UI map or add assertions radio button. Click the OK button.

The Coded UI Test Builder toolbar displays in the bottom right of your screen.

Click the record button () to begin recording your actions. From this point, you can launch an application, navigate to a web site, click buttons, or enter data into forms – pretty much anything you do with your mouse and keyboard will be captured and turned into code by the recorder.

You can stop the recording either by clicking either the Pause button () or the Generate Code button ().
When the recording is paused, you can add an assertion by holding down the left mouse button over the Add Assertion button () and dragging the cursor to a control that contains a property against which you will create an assertion. A blue outline appears around any control as the cursor moves over it. Release the mouse while over the control to create an assertion about that control. An assertion declares an expected property value of the control. Comparing the actual property value against the expected value.

Clicking the Generate Code button generates C# code that reproduces the mouse and keyboard actions that you performed while the recorder was running.

The Generate Code button creates or updates three files in your project. The You can generate code button and create assertions as often as you  like. When you close the Coded UI Test Builder, Visual Studio generates three files share a similar name but different extensions: *.uitest, *.cs, and *.Designer.cs.  In our TestProject1 demo, the files are named files UIMap.uitest, UIMap.cs, and UIMap.Designer.cs. Because these files are related, UIMap.cs, and UIMap.Designer.cs appear beneath UIMap.uitest within the project hierarchy.
UIMap.uitest contains an XML file with information about the recorded steps.  If you don’t have the graphical interface to edit this file, you may want to download the Visual Studio 2010 Feature Pack 2 (http://msdn.microsoft.com/en-US/vstudio/ff655021.aspx ). This XML file is used to generate C# code stored in the UIMap.Deigner.cs  file.
Using the Coded UI Coded UI Test Editor, you can view each recorded step, change properties of a step; and split a method into multiple methods.

UIMap.Deigner.cs is overwritten every time any new recordings are created, so you should not edit this file.  Instead, move the method you wish to modify into the UIMap.cs file. This file is not overwritten, so your code can store anything you want here. UIMap.cs and UIMap.designer.cs are partial classes of the same class, so it doesn’t matter to the compiler in which file a method, property, or field is located.

Tuesday, 24 July 2012 15:37:00 (GMT Daylight Time, UTC+01:00)