Showing posts with label mvpbuzz. Show all posts
Showing posts with label mvpbuzz. Show all posts

Monday, 21 May 2012

Using the Azure CDN

A while back I toyed with the idea of moving all my blog assets (images, downloads, etc) over to a CDN just as a proof of concept and to show how it could be done and as a very handy way to get inspiration for a blog post. This evening I finally got around to it. And this post details how to do it.

So first a few basic things about the whole concept of a CDN.

What is a CDN?

A Content Delivery Network (CDN) according to Wikipedia is “a large distributed system of servers deployed in multiple data centres in the Internet. The goal of a CDN is to serve content to end users with high availability and high performance”. Its a large system of caching servers located around the world, speeding up the delivery of your content by reducing the distance between your users and your content and providing higher redundancy.

Why use a CDN?

One of the main reasons to use a CDN is more servers hosting your files, means higher availability meaning that if a node is down, the request will rollover to the nearest node after that.

Also it reduces the latency for your files when you have people accessing your site outside your hosting catchment for example, if your server is hosted in Dublin and a significant amount of your traffic comes from APAC. By using a CDN, your static resources that you have on your blog/site are cached in different locations around the world. When a user requests a file that is hosted on your CDN, the file is served where possible from the closest node in the CDN.

About the Azure CDN

The Windows Azure Content Delivery Network (CDN) caches Windows Azure blobs and the static content output of compute instances at strategically placed locations to provide maximum bandwidth for delivering content to users. You can enable CDN delivery for your content providers using the Windows Azure Platform Management Portal. CDN is an add-on feature to your subscription and has a separate billing plan.

Azure CDN nodes are located worldwide and you can get a list of them here

Setting up on the Azure CDN

This is one of the easiest things to do with Azure. As in absurdly easy. You will need an Azure account and you can sign up for a 90 day free trial at the Windows Azure Portal. You will need a credit card when you sign up to verify but you will not be charged and if you go over your free limit, it will just stop however you can allow it to run and charge to credit card if you so wish.

Once you have your account, sign into the management portal.

Now create a new storage account. This is where you will serve your static resources from. You do not need a hosted account to serve the files.

Type in the name and select the region for the storage and then once done wait for the storage to provision

Once the storage is ready, click on the CDN folder on the left of the management panel. You will see your newly created storage account. Click on the New Endpoint from the top menu and select the defaults.

The CDN endpoint will provision and you will eventually get a URL like XXXXXXX.vo.msecnd.net which is fine but most people want to have their own domain or subdomain on the CDN and this is very easy to do.

Click on the CDN endpoint and select Custom Domain from the top menu. You can insert the address that you want the CDN to resolve to. For example the one for this blog is assets.certsandprogs.com.

A verification CNAME will be created which points to verify.azure.com and you will need to create this CNAME in your domain management of your provider.

Once you have done this, go have a cup of tea or coffee because you will need the new CNAME to propagate and this could take a bit of time depending on your provider. For example, with GoDaddy, it took about 5 minutes but on a previous test, it took two hours on a different provider.

You can click validate to check and once its working you will see Allowed in the custom domain line.

The final thing you need to do now, is create a CNAME that points to your Azure CDN endpoint address. Once all this is done you will be able to use your brand new shiny CDN.

Getting files into the CDN for non programmers.

There are plenty of tutorials on how to get your data into blob storage so you can use your search engine of choice to find these. However, for the non programmers among you (why are you reading this blog?), there are a couple of programmes you can use to get your data into blob storage and onto your newly provisioned CDN

Azure Storage Explorer on Codeplex allows you to see your blob storage in a logical view as well as creating containers and upload objects to your containers.

So that’s about it, a fairly painless way to migrate to the cloud without needing any code.

All the images that in this post are being served from the CDN and I will migrating all the scripts used in the blog over to the CDN over the coming weeks. If I manage to create a nice little migration tool, I will share it on this blog.

Sunday, 25 March 2012

The best of VS11 (Talk from Dev11 Launch)–Demos

Continuing on from my previous post on the best bits of Visual Studio 11, these are the demos that I showed as part of that talk.

Testing integration

As part of the new test runners integration, this demo shows how to run different testing frameworks easily within the same project. To show the testing frameworks in  Unit Test Manager windows, you will need to install the xUnit.net test runner and the nUnit test adapter via the Extension Manager or from the Visual Studio Gallery. br />Once these are installed when you build the application you will see the 3 different unit testing frameworks appearing in the Unit Test Manager pane.
Download the demo project.

OAuth and OpenID providers

One of the new features that appeared with WebMatrix 2 Beta Refresh  (now with added Unicorn sauce) and Web Pages 2 Beta are the OpenID and OAuth providers which allow you to build applications that support these systems such as Facebook, Twitter and Google logins.
Currently these are only available in ASP.NET WebPages but as part of the whole one ASP.NET concept these features will be released for ASP.NET MVC and WebForms later.
This project comes from the WebMatrix starter site. It shows how to use the Google, Twitter and Facebook logins.

Using Google OpenID

Google OpenID is one of the simplest providers to implement. In the _AppStart.cshtml file add the following after the WebSecurity.InitializeDatabaseConnection
OAuthWebSecurity.RegisterOpenIDClient(BuiltInOpenIDClient.Google);

In the Account/login.cshtml you can modify the social login section to look like
<section class="social" id="socialLoginForm">
<form method="post">
<h2>Use another service to log in.</h2>
<fieldset>
<legend>Log in using another service</legend>
<input type="submit" name="provider" id="google" value="Google" title="Log in your Google account" />
</fieldset>
</form>
</section>

Using Yahoo for OpenID is the same procedure

Using Twitter OAuth


Twitter OAuth requires you to create a Twitter application first because the Oauth provider requires a consumerKey and consumerSecret tokens.

Head over to the Twitter developers site and create a new app. If you are developing on localhost, Twitter may not accept this as a valid domain name so you can use the 127.0.0.1 loopback address instead for the WebSite field in the new application creation.

Once you have your Twitter application setup just take note of the Consumer Key and Consumer Secret values.

Back to _AppStart.cshtml add the following
OAuthWebSecurity.RegisterOAuthClient(BuiltInOAuthClient.Twitter,
consumerKey: "",
consumerSecret: "");

Insert you own consumerKey and Secret and then add the new input in your socialLoginForm and viola Twitter login integration!

Download the sample

Maps Helper

The final demo of the day is using the new Maps feature. This one also comes with WebMatrix 2 Beta Refresh but you can use it in MVC or WebForms right now. You need the new v2 of Microsoft.Web.Helpers assembly. You can get this assembly from the Bakery starter site in WebMatrix 2 Beta or from conveniently from here

To add a Google map to your website is as simple as the following lines of code.
<section id="map">
<div style="margin-bottom: 5px; font-weight: bold;">UiS Stavanger</div>
@Maps.GetGoogleHtml("Kjell Arholmsgt. 41, 4036 Stavanger", zoom: 15)
</section>
@Assets.GetScripts()
@Assets.GetStyles()

The map types that are supported right now are Google, Bing, Yahoo and MapQuest.

Download the sample.

Some handy information


You can get more on the new features of Web Pages 2 Beta here. Some of the new features that are in Web Pages now, will appear in the other parts of ASP.NET in line with the one ASP.NET vision.

Tuesday, 20 March 2012

The best of VS11 (Talk from Dev11 Launch)

This evening I have just finished a talk on the best bits of the new VS11 beta entitled turned your Web Development up to 11 (thanks to Glenn Henriksen for the inspiration). Coincidently Scott Hanselman, also published a post today while I was speaking with some of the stuff that I was talking about.

Anyways, here is a quick recap of the session for those that missed it.

The new IDE

The new VS11 IDE has a slimmer new design with Metro styling all the way through it. It has a faster startup time in its Beta version as compared to its older brother VS2010 when both are in their out of the box just installed configuration. I currently have VS2010 SP1 and VS11 Beta running on Windows 8 Consumer Preview side by side without any problems. It makes it very easy to show the new project round tripping feature (discussed later) and removing some of the pressure of trying to run Windows 8 with your existing development environment tools.

New Templates

There are new templates available when running on Windows 8 which are not included in VS11 when running it on Windows 7. And this is because they are Metro specific. These include the new Metro style applications in C# and in JavaScript.

Templates

Search overhaul

One of the one of the biggest overhauls in VS11 is the search and specifically the new Quick Launch. In my talk, I asked how you would change the references for intellisense for JavaScript (which leads into another feature in VS11 .. again which I will say later!). In VS11 it meant, playing hide and seek with the menus and trying to figure out where in the extensive options pane this setting lived. In VS11 it’s a quick case of using the shortcut Ctrl + Q and typing javascript  which will show the different options including changing the references for JavaScript.

Javascript

You can also use this Quick Launch function to learn keyboard shortcuts as it shows you in the results the shortcut along with the description of the item where applicable.

LearnShortCuts

This search overhaul has continued into the Solution Explorer where you can type some text and get any files or classes containing that text. You can even use regular expressions in this search.

SearchSolutionExplorer

Search has been improved in the Add References dialog as well

SearchReferences

In the code view, find now works as expected. In VS2010, pressing Ctrl + F would bring up the Find and Replace dialog box which really didn’t make sense. Now it brings up the Find dialog and you can search across different scopes and again you can use regular expressions if you so wish

The new preview window

Ever get tired of opening files to just see what’s inside of them and those files hanging around cluttering up your tabs because you forgot to close them when you were finished looking in the file? Well that’s all changed now in VS11 with the new preview window. This window opens when you click on a file allowing to preview its contents without actually opening it. But wait there’s more! If you decide that you actually like what you see. And they have finally added the Close All Documents button!!! Before you had Close Document, Close all documents but this. Now you have that final part of the triad, Close All Documents. It’s the tiny things that make a difference

Preview CloseAll

Templates are now extensions

How often do templates that ship with Visual Studio get updated or refreshed. The answer is simple, when the next version of Visual Studio ships. Now they are extensions or VISXs meaning that templates can be updated and added out of band. Now for those of you thinking ahead you can see why this would be one of the excellent little things hidden inside of VS11

Project Round Tripping

One of the biggest problems when a new version of Visual Studio comes along be it in Beta or in its RTM edition is that it has updated the solution file making it impossible for you to work with it in the previous versions. This breaking of solutions meant that all developers had to upgrade at the same time or projects had to be built in only one version of Visual Studio meaning you kept previous versions installed so you could open them. Also if you had clients that you were developing for, who weren’t upgrading that project stayed in the old version.

Of course there were hacks such as two SLN files but this led to developer frustration when someone added a new project to the solution but didn’t upgrade both SLN files. Well this is no more. With the new Project Round Tripping feature in VS11, you can use *nearly all* of your existing VS2010 SP1 projects in VS11 without having to upgrade or break your SLN file. Not all projects are compatible though and there is an article on MSDN detailing which projects will work and which won’t work.

This feature works with Visual Studio 2010 and SP1 and you can’t use it with Visual Studio versions older than 2010. Additionally if you use any feature that is specific to the new version of Visual Studio such as changing the framework version to 4.5 then the project cannot be opened again in VS2010.

Page Inspector

Quite simply, if you use FireBug, you will love this. If haven’t used FireBug before prepare to be amazed. This is honestly one of the best new features for Web Developers in VS11.

Page Inspector allows you to view your page in a number of different ways such as Files Mode which shows you which files in your solution make up this page. Extremely handy if you are brand new to a well established project that combines multiple files into one view.

FileView

You also have inspect mode which shows what control or place in your file generated that piece of HTML. Genius! Forget adding silly text or test calls to find where in the code is generating the output, just hover over the piece in the HTML view that you are curious about and Page Inspector will show you the rest.

InspectMode

You can also play with the source and Page Inspector will see that it has changed and update accordingly once you refresh. It will also prompt you that it has changed.

Refresh

This feature gives you the tools to expertly find where and what is happening in the HTML of your application with more power in actually finding it than FireBug has. Don’t get me wrong, I love FireBug but it doesn’t have the ability to show where in the files is generating the HTML that you are looking at. I also see Page Inspector as a great training tool for anyone trying to learn a new aspect of ASP.NET from junior developers all the way up the food chain.

New HTML editor features

Some of the irritations that you ignored when you started development but grew as you became more and more proficient have been fixed. Such as smart indent. This is where you type a tag and press return and in VS2010 it would start at the same position as the tag rather than tabbing in. Now it does.

Another frustration was when you changed a tag, you had to go find the corresponding closing tag and change that. Now it does.

For those of your who used ReSharper or CodeRush or another IDE extension, you probably wont remember a time where you couldn’t generate a method stub of a control from the Code View. Now you can.

Create

The new Smart Task feature for controls gives you access to the same functionally that you had on a control when in Design view but from the Code view.

DataGrid

And finally the improved Intellisense reduces options and it shows you the bits as you type.

It’s the little things that just make life a bit easier for developers.

New CSS editor features

Do know what the shortcut command CTRL + K, C means? Its means to comment out the piece of code you have highlighted or the line you are on. You know where it never worked. In the CSS editor.. well it does now. It may not sound like a big thing, but when you expect that shortcut chord to work across the editor uniformly and it doesn’t in one spot it because an annoyance.

The new color picker is a simple yet very effective addition to the editor. Before if you didn’t know a hex value for a colour (yes I spell it the British English way!), you had to use something like Paint.NET to find the colour code. Now its built into the editor and it appears when you type color: in the CSS editor.

The Testing Framework

Unit testing is now a complete first class citizen in VS11. There has been a massive amount of investment in this area and Peter Provost has a great series of articles on his blog about this.

This is just a quick overview of some of the features that I like.

VS11 now has a test runner framework which allows test runner extensions to be installed into VS11 so that your unit tests will appear in the Unit Test Explorer window and all run as part of the series of tests regardless of the testing framework you use. So if you use MSTest, Nunit and xUnit.NET in the same solution, no problem. Just download the test runners for Nunit and xUnit and install them and off you go they will appear in the Unit Test explorer. And what is the most important information you want to see about your unit tests? It’s the one that fail and these come up first on the Unit Test explorer window.

UnitTests

Also you can set your unit tests to run automatically on build!

OnBuild

The Code Demos

I finished off with some code demos which I will do in the follow up post to this. I did this like a sprinting lap around VS11 and I hope people got a decent glimpse of the real new goodies in VS11.

If you haven’t already downloaded the beta, you can do get it from here

Monday, 16 January 2012

Request for speakers NNUG Online

Last year I ran a series of online Live Meetings under the brand NNUG Online. NNUG Online was an idea I had on trying to get around the issue of how to get more international speakers to the local Norwegian .NET User Groups. One of the benefits of MVP program is a Live Meeting account so I used that to host these meetings and from there, the issue was to find speakers.

Through the magic of twitter and some networking connections made at the MVP Summit & previous Norwegian Developer Conferences, I was able to line up some excellent speakers and its started with K Scott Allen. Over the year we had Jon Skeet, Scott Hanselman, Scott Guthrie, Hadi Hariri, Jon Galloway and Einar Ingebrightsen.

This year I would like to continue on with NNUG Online as I think it has brought something extra to the Norwegian developer community.

So if you are interested in speaking at one of these meetings please just drop me a line. The meetings range from 60 to 120 minutes including questions. They can be on any topic in programming provided that they can be included in .NET so for example things like Open Source, GIT and such are fine. It is done through Live Meetings so you will need that client on your machine. It is normally scheduled for 20h00 CET (which is 12h00 PST in Seattle for example and 15h00 EST in New York) at the end of the month, though we are quite flexible.

If you are interested in doing a session, please email stavanger@nnug.no with overview of your talk, estimated running time and dates that you can do it.

Friday, 14 October 2011

TechDays 2011 Review

muligheter_techdaysOn the 6th of September I travelled to Oslo to attend the first day of TechDays 2011, the new brand for the TechNet and MSDN Live events. It was held in the Clarion Hotel in Gardemoen which made it very handy to get in an out the same day. There was a mixture of tracks covering subjects like Web, BI, Cloud, and Client.

It was a really interesting day and I got to the following sessions

  • Intro to JavaScript/jQuery with Gøran Hansen
  • Advanced analytics with Excel and SQL Server 2008 R2 Data Mining with Rafal Lukawiecki
  • Collaborative Business Intelligence with Rafal Lukawiecki
  • DDD and the presentation layer with Gøran Hansen

Arif Shafique a developer evangelist with Microsoft stepped in and did a session on HTML5 and Windows Phone 7 due to a last minute schedule change.

Gøran’s first session was an intro session which for me was a bit low, but I like hearing what Gøran has to say and he does talk a lot of sense, which is also why I went to his DDD session. I also bumped into Alex York who did a session the following day as well as Fredrik Kalseth who was also speaking that day on making the enterprise ready for HTML5 apps.

I enjoyed Rafal’s sessions quite a lot as Rafal is very well prepared, speaks with an enormous amount of enthusiasm for his subject and also presents in a very clear and understandable way. If you want to learn more about data mining and SQL Server, Rafal has launched his new Project Botticelli website where he will have videos and training available.

I attended as part of NNUG and later in the day I was interviewed by Petri Wilhelmsen about the role of community in a developer’s learning and also about the Norwegian .NET User Group.

Thanks to Petri and Anders Borchsenius for the invite up and for combing MSDN and TechNet Live into a good event. Hopefully this will be one again next year

Wednesday, 12 October 2011

2011 MVP ASP.NET/IIS

MVP_FullColor_ForScreenTime for the obligatory MVP post.

On the 1st of October this year, I was waiting for notification of whether or not I was going to be renewed as a Microsoft Most Valuable Professional. The process is simple. If you make the grade you get a nice congratulatory email and if you don’t, well you don’t get any email.

I would be lying if I said I wasn’t a bit apprehensive about it and at around 16h00 I was checking mail on my phone a bit too often. By about 16h30 there was still no sign and I started to see on Twitter that folks had been receiving their MVP mail so I took it that I probably didn’t make the cut this time around. At the time I was down in Egersund with my wife and her parents and we were due to head back to Stavanger around then.

Once I got home around 18h00 I logged back into twitter and noticed some people saying to check their spam filters as the mail seemingly had got caught by GMail’s spam filters this time around. And low and behold, there was a mail from 16h00 saying “Congratulations 2011 Microsoft MVP!”. In the vein of Wrath of Khan “Spam Filtersssssss”. It was a happy moment there. Thanks to my MVP Lead William Jansen for all his work last year and here’s hopefully to another MVP summit in Seattle next year.

And to complete the Khan metaphor, here is the famous scene! Complete with echo in space :P

Monday, 10 October 2011

DDD North Wrapup

logoOn the 8th of October 2011 the Developer Developer Developer (DDD) brand of conferences came to Sunderland in the form of DDD North. The University of Sunderland was invaded by attendees and speakers all ready for a solidly packed day of talks and discussions around all aspects of software development and management. The topics for the day included Behavior Driven Design, Android Development, Continuous Delivery in software and NodeJS.

The DDD brand is a growing brand of software conferences that strives to bring a top class conference event for a low low price (actually the cost of admission to the attendees is free!). Speakers are asked to submit their sessions online and then the community votes for what sessions they would like to see. This is a great concept as this means that it is down to the community to decide what sessions they would like to have at their conference.

The man behind DDD North is Andrew Westgarth one of only two IIS MVPs in Europe. Andrew did a fantastic job of organizing the event and had a great team of support and helpers to ensure a very smooth running event. Thanks to all involved for making from a speakers side of things, a conference that was very easy to speak at.

My session on Defensive Programming 101 was picked up for this event (thanks to those of you that voted for it) and I had the pre-lunch slot.Original credit Ian Battersby

Original photo credit Martin CunninghamThis can be a difficult one because its usually when the attendees are hungry and wanting to get out early. So I shortened my session by five minutes so that they could be first in line for their lunch and also I bribed them with sweets to ensure that they stayed awake.  It was a fairly full session with good audience participation so thanks to all who came to it. Original picture credit for the photo on the right to Ian Battersby and for the photo on the left to Martin Cunningham.

The lunch was surprisingly good. A good quality sandwich, a choice of drink, some fruit and a chocolate bar. I am always glad when event organizers put fruit in the lunch menus because its too easy to put just junk and nothing healthy in the packs. It aint just the mind that you are feeding on a day like this so kudos for that.

During lunch there were some Grok Talks, which to the uninitiated are short talks about a subject. They tend to be about 10 minutes long and don’t, contrary to popular opinion have to be on something technical. If you are trying to get into public speaking these types of talk are a great intro on that.

One of the things I love about conferences is the interaction, networking and discussions between sessions. During the lunch break I got to talk to a lot of people including Peter Shaw of LIDNUG and later there was a spirited discussion between some speakers and delegates about the way certain products were going.

After lunch, I caught Paul Stack’s talk on CI/CD. It was a highly enlightening talk delivered by a great speaker. Paul answered questions, opened it up to the floor and gave some very inspiring advice on how to enter into the world of Continuous Delivery and why it will save you time, money and heartache. He made some very compelling arguments on why you should be doing this.

The post DDD North dinner was generously sponsored by those nice folks at DevExpress. They very kindly treated a lot of hungry developers to a proper English dinner of roast beef and pork. The chefs at the Stadium of Light did this traditional fare justice and it was a great end to a solid day of learning and inspiration.

A word of thanks again to Andrew Westgarth for a fantastically organized and well run event. I hope that DDD North runs again. The general buzz from the community was that it was beyond expectations and will become a fixture on the northern developers event calendar.  There are plenty of pictures from the event from Craig Murphy, Martin Cunningham and Ian Battersby.

To follow up on my session here are the links for the different security tools, websites etc.

UPDATE: 11-October - Code samples from my presentation can be downloaded from here

And my presentation on SlideShare

Wednesday, 21 September 2011

70-515 Essentials – Exam Topics Hot List

This post comes from a comment on one my earlier posts that the 70-515 prep guide was a little too much for the average person who is revising for the exam. It was a very valid comment and the poster also suggested maybe doing a “hot” or “must read” list for this exam and I have to say it was a very good idea.

So here is that list. A quick note on how I compiled this list. I took what I know from previous exams and what are considered the hot topics in ASP.NET 4 and what also has changed from ASP.NET 3.5 to 4. This is not an insiders guide, it is just one guys attempt to predict what may or may not be on the exam. If you are already certified on .NET 3.5 this will give you an idea of what you need to look over.

If you are so inclined check out he the change lists at ASP.NET 4 and Visual Studio 2010 Web Development Overview

Now the caveat:  This guide is for use at your own discretion and the author accepts NO liability in relation to incorrect or missing information. Also note that using this guide to study does not imply you will pass the exam

Now with that out of the way, here goes nothing. With each topic and part that I have placed on this list, I give an explanation where possible as to why its there.

Developing Web Forms Pages (19%)

Developing and Using Web Forms Controls (18%)
Implementing Client-Side Scripting and AJAX (16%)
Configuring and Extending a Web Application (15%)
Displaying and Manipulating Data (19%)

Developing a Web Application by Using ASP.NET MVC 2 (13%) – Depending on your knowledge of MVC2 this will be a make or break.

I will probably update this list with some more information when I think a bit longer about but for the moment this is the hot list for the MCTS 70-515 Web Applications Development with Microsoft.NET Framework 4.

Thanks to the original comment poster for the idea.

Monday, 9 May 2011

Resources from DDD Scotland 2011

On Saturday 7th of May 2011,  I presented Defensive Programming 101 at DDD Scotland 2011 in Glasgow. This was the second time I have presented at DDD Scotland and I was thankful to be invited back.  Like last year, it was the same presentation.

I was lucky in my presentation that most of the audience was awake and didn’t mind me asking them questions. Or maybe they did and just didn’t complain! The session went smoothly enough and I would like to say sorry for the human failure in the middle when I mixed up my demo a bit.

Thanks again to the organizers, who did a fantastic job in making sure the day went smoothly.

Based on last years feedback I changed the slides, to remove most of the wordy slides which in turn, made my presentation into a collection of pictures. However at the end I had a lot of resource links and I am publishing them here for those who wanted a copy of them.

Resources Slide 1

Resources Slide 2

The demo bits are available from here and here (they are done as separate posts)

Finally the copy of my presentation on SlideShare

Monday, 10 January 2011

MCTS ADO.NET 70-516 – Objectives List Part 1

Another new year, another set of posts to help you study for an exam. This series focuses on the objectives for the exam 70-516: MCTS Accessing data with Microsoft .NET Framework 4.

Disclaimer: This guide is for use at your own discretion and the author accepts NO liability in relation to incorrect or missing information. Also note that using this guide to study does not imply you will pass the exam.

Modeling Data (20%)