Scott Hanselman

Getting Started with Windows 10

July 28, '15 Comments [25] Posted in
Sponsored By

I've been making Windows 10 videos at night to help out friends and family, and because it's fun.

NOTE: Please share my videos with your family, friends, and social networks with this easy to remember URL: http://hanselman.com/windows10

#NinjaCatWindows 10 comes out July 29th, and it takes what was familiar about Windows 7 and what was great about Windows 8 and takes it forward. It's nice on a tablet, it's nice on a laptop, and I'm on my desktop with it now. Features like game streaming from an Xbox are amazing. The Office Touch apps look great.

I've just finished a new one where I show what the Start Menu will look like immediately after your upgrade. I'll show some tips you perhaps didn't know about like pinning links to apps to the Start Menu, Task Bar, *and* the Desktop. I'll show you how to pin Control Panel sections to Start as well. You can still add common icons to your Desktop like My PC, but you can also add Downloads, Documents, Music, and More to the Start Menu itself.

Customizing the Start Menu after Upgrading to Windows 10

Detailed Tour of Windows 10 in 8 minutes

A complete tour of the new Windows 10 Control Panel

How to prepare for an upgrade to Windows 10 from Windows 7 or Windows 8

if you have ideas on new videos I can do, let me know in the comments!


Sponsor: Big thanks to our friends at Infragistics for sponsoring the feed this week! Responsive web design on any browser, any platform and any device with Infragistics jQuery/HTML5 Controls.  Get super-charged performance with the world’s fastest HTML5 Grid -Download for free now!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

Bring Kindness back to Open Source

July 23, '15 Comments [38] Posted in Open Source
Sponsored By

Nick Burns - Your Company's Computer GuyWhen you're rude/crisp/sharp/whatever to someone in a PR or Issue, your meanness may have turned off the next generation of open source committer. It's that simple. When folks are just starting out as Code Newbies their initial interactions in this new world matter.

I've been doing this for over 20 years. There's knowledge and (hopefully) wisdom that I've gained in all that time, assuming it's not the same year of experience twenty times. Along with all that time that I (and you!) put in comes great responsibility. We need to think as a community about stewardship, sustainability, and successor management.

There are folks in open source - successful folks - that think that all this talk of "niceness" is overrated. "Talk is cheap, show me the code" is a fun thing to say. But no, talk isn't cheap. It's not cheap, yes, it takes time and patience, but it IS important.

As we try to move towards more representative teams and expand the leadership beyond the old network, this somehow controversial idea of being welcoming and patient to new people is even more important.

There are many folks out there with skills and knowledge that are not joining open source because their initial attempts to contributed were rebuffed.

Jesse Pollak posted two great tweets last week that really point out what's wrong with open source, especially for new people just starting out.

Jesse pledged a "no meanness" rule. I join him in this pledge and encourage you to also.

I've thought similar things before.

Sound like too much work? There are ways to built a welcoming culture into the process. Here's some ideas. I'm interested in yours also.

  • Make a contributing.md.
    • Gently point folks to it.
    • If you get a lot of newbies, write a kind form letter and funnel them towards forums or mentors.
    • Create a Getting started friendly FAQ.
  • Tag issues with "up-for-grabs" in your repositories.
    • Classify by difficulty. Easy, Medium, Hard, Insane.
  • Point new people towards samples, easier parts of the code, docs, tutorials, etc. Grow your enthusiasts.
  • Join http://up-for-grabs.net
  • Consider applying the Contributor Covenant or a similar CoC to your project. Enforce it.
  • Make an issue and "only accept a PR from someone who has never contributed to open source" just like Kent C Dodds did for his project!

Have you helped with an open source project? Did you had a bad initial experience? Did it slow you down?

Perhaps you had a great one and your first pull request was awesome? I'd like to hear your story.

Sound off in the comments!


Sponsor: Big thanks to Infragistics for sponsoring the feed this week. Responsive web design on any browser, any platform and any device with Infragistics jQuery/HTML5 Controls.  Get super-charged performance with the world’s fastest HTML5 Grid - Download for free now!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

Visual Studio 2015 Released plus ASP.NET 5 Roadmap

July 21, '15 Comments [29] Posted in Open Source | VS2015
Sponsored By

Microsoft released Visual Studio 2015 today! You can watch the keynote video from today with me, Soma, Beth Massi, Amanda Silver, and Brian Harry here on Channel 9. All the supporting videos and Q&A are also up as individual videos if you'd like.

ASP.NET in 2015

NOTE: Because ASP.NET 5 will not only run on .NET Framework 4.6, which was released today, but also on the .NET Core Framework that will support Windows, Mac, and Linux, ASP.NET 5 isn't released today. The ASP.NET 5 roadmap is up on GitHub though. We'll have a Release Candidate that you can Go-Live with Microsoft support in November and it will 1.0 in the first quarter of 2016. Also, be sure to grab the free Visual Studio Code, no matter what platform you're on. http://code.visualstudio.com

That ASP.NET 5 developers should start exploring the framework now, and go live around the holidays on the operating system of your choice with ASP.NET 5 and the Core CLR. We'll keep doing the weekly ASP.NET Community Standup and updating you each week on our progress. Remember that the schedule is at http://www.asp.net/vnext and the documentation is growing at http://docs.asp.net.

ASP.NET 4.6

That said, ASP.NET 4.6 is live today and included in Visual Studio 2015 and VS has some great new features for Web Developers.

  • JSON is first class with a .json editor and JSON Schema validation within VS. There's also intellsense for bower.json, npm, and other JSON formats.
  • Even more HTML 5 support in the editor. Of note is intellisense for Angular, ARIA, and Bootstrap CSS classes. We're also watching Web Components and including support (as the world decides) for things like link rel="import."
    Angular
  • JavaScript support for Angular JS controllers, factories, animations, etc. Support for JSDoc and more.
  • Syntax Highlighting and intellisense for ReactJS! Support for Grunt and Gulp!
  • HTTP/2 Support in ASP.NET 4.6 with SSL enabled on Windows 10 and IIS Express.

There's lots of significant updates in 2015, but Roslyn is likely the most significant. Roslyn is the open source .NET Compiler Platform. It includes the new features Visual Basic and C# 6 and can be used in your ASP.NET Web Forms projects, pages, and MVC pages.

For example, with String interpolation, this link in Web Forms:

<a href="/Products/<%: model.Id %>/<%: model.Name %>">

looks like this with C# 6. See the string that starts with $""? It's got model's embedded within it. Common calls to String.Format get a LOT easier with this feature.

<a href="<%: $"/Products/{model.Id}/{model.Name}" %>">

Web Forms in ASP.NET 4.6 gets async model binding as well, which means less digging around in the Request object for stuff and you'll do it all asynchronously.

Visual Studio Community 2015 - It's Free!

If you're a student, open-source contributor or a small team, Visual Studio 2015 Community is free. You can use extensions and develop however you'd like. We've got not just Windows and Web Apps, but you can also use Xamarin or Cordova, and even use our Windows Phone and Android Emulators.

Learn about the Community, Professional, and Enterprise versions here and compare them in a feature matrix here.

I'm using Visual Studio 2015 to edit even .NET 2.0 apps so I'm not using older versions of VS, but if you like, it does live side-by-side. On one machine I have 2010, 2012, 2013, and 2015, even though it's not really needed.

The final versions of all of today’s releases are available now. 


Sponsor: Big thanks to Infragistics for sponsoring the feed this week. Responsive web design on any browser, any platform and any device with Infragistics jQuery/HTML5 Controls.  Get super-charged performance with the world’s fastest HTML5 Grid - Download for free now!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

A/B Testing and Testing In Production with Azure Web Apps

July 17, '15 Comments [6] Posted in Azure
Sponsored By

I've got a lot of production web sites running in Azure right now. Some are for small side projects and some are larger like the sites for the Hanselminutes Podcast and This Developer's Life. I like Web Apps/Sites (which is Platform as a Service) rather than Virtual Machines (Infrastructure as a Service) because I don't like thinking about the underlying operating system if I can avoid it. I like to be able to scale the site up (faster, bigger) or out (more machines in the farm) with a slider bar.

In fact, there's some other more advanced and useful features that Azure Web Apps have that keep me using Web Apps almost exclusively.

I'll use a little site I made called KeysLeft.com that tells you how many keystrokes are left in your hands before you die. Think of it as a productivity awareness tool.

First, I'll add a Deployment Slot to my existing Git-deployed Web App. The source for KeysLeft lives in GitHub here. When I check-in a change it's automatically deployed. But what if I wanted to have a staging branch and automatically deploy to a staging.keysleft.com first? If it works out, then move it to production by swapping sites. That'd be sweet.

Staging Slots for Azure Web Apps

You can see here my main KeysLeft web app has a Staging "side car" app that is totally separate but logically related/adjacent to production. Notice the "swap" button in the toolbar. Love it.

Adding Deployment Slots to an Azure Web App

This Web App has its configuration copied from the main one, and I can setup Continuous Deployment to pull from a different branch, like "staging" for example. The name of the deployment slot becomes a suffix, so keysleft-staging.azurewebsites.net unless you set up a custom CNAME like staging.keysleft.com. You can have up to 4 deployment slots in addition to production (so dev, test, staging, whatever, production) on Standard Web Apps.

A/B Testing for Azure Web Apps

Once I've got a slot or two set up and running a version of my app, I can do A/B testing if I'd like. I can set up a feature that was called "Testing in Production" and is now "Traffic Routing" and tell Azure what percentage of traffic goes to prod and what goes to staging. Of course, you have to be sure to write your application so such that authentication and session is managed however is appropriate, especially if you'd like the user to have a seamless experience.

Here I've got 10% of the traffic going to staging, seamlessly, and the other 90% is going to production. I can make a small change (background color for example) and then hit the main site over and over and see the occasional (10% of course) request being routed to the staging slot. You can configure this static routing however you'd like.

10% Traffic to Staging

Then I could hook up Application Insights or New Relic or some other event/diagnostics system and measure the difference in user reaction between features that changed.

Advanced Testing in Production

Made it this far? Then you're in for a treat. Static routing is cool, to be clear, but scripting a more dynamic experience is even more interesting. Galin Iliev, one of the developers of this feature, gave me this Powershell script to show off more powerful stuff.

First, you can use PowerShell to manage this stuff. You can change routing values and ramp up or ramp down. For example, here we start at 10% and change it by 5 every 10 minutes.

# Select-AzureSubscription YOURSGOESHERE

$siteName = "keysleft"
$rule1 = New-Object Microsoft.WindowsAzure.Commands.Utilities.Websites.Services.WebEntities.RampUpRule
$rule1.ActionHostName = "keysleft-staging.azurewebsites.net"
$rule1.ReroutePercentage = 10;
$rule1.Name = "staging"

$rule1.ChangeIntervalInMinutes = 10;
$rule1.ChangeStep = 5;
$rule1.MinReroutePercentage = 1;
$rule1.MaxReroutePercentage = 80;

Set-AzureWebsite $siteName -Slot Production -RoutingRules $rule1

But! What if you could write code to actually make the decision to continue or fall back dynamically? You can add a callback URL and a Site Extension called the "TiP Callback Extension."

$rule1.ChangeDecisionCallbackUrl = https://keysleft.scm.azurewebsites.net/TipCallback/api/routing

The Site Extension (and all Site Extensions for that matter) is just a little sidecar Web API. This callback gets a small POST when it's time to make a decision, and you decide what to do based on HTTP-related context that was passed in and then return a ChangeDirectionResult object as JSON. You can adjust traffic dynamically, you can adjust traffic when doing a deployment, do a slow, measured roll out, or back off if you detect issues.

NOTE: The ChangeDescisionCallbackUrl and this code below is totally optional (so don't stress) but it's super powerful. You can just do static routing, you can do basic scripted dynamic traffic routing, or you can have make a decision callback URL. So the choice is yours.

You can check out the code by visiting yoursite.scm.azurewebsites.net after installing the TiP callback site extension and look at the Site Extensions folder. That said, here is the general idea.

using System.Web.Http;
using TipCallback.Models;

namespace TipCallback.Controllers
{
public class RoutingController : ApiController
{
[HttpPost]
public ChangeDirectionResult GetRoutingDirection([FromBody] RerouteChangeRequest metrics)
{
// Use either Step or RoutingPercentage. If both returned RoutingPercentage takes precedence
return new ChangeDirectionResult
{
Step = (int)metrics.Metrics["self"].Requests,
RoutingPercentage = 10
};
}
}
}

Here's the object you return. It's just a class with two ints, but this is super-annotated.

/// <summary>
/// Return information how to change TiP ramp up percentage.
/// Use either Step or RoutingPercentage. If both returned RoutingPercentage takes precedence
/// Either way MinRoutingPercentage and MaxRoutingPercentage set in API rule are in force
/// </summary>
[DataContract]
public class ChangeDirectionResult
{
/// <summary>
/// Step to change the Routing percentage. Positive number will increase it routing.
/// Negative will decrease it.
/// </summary>
[DataMember(Name = "step")]
public int? Step { get; set; }

/// <summary>
/// Hard routing percentage to set regardless of step.
/// </summary>
[DataMember(Name = "routingPercentage")]
public int? RoutingPercentage { get; set; }
}

All this stuff is included in Standard Azure Web Apps so if you're using Standard apps (I have 19 websites running in my one Standard plan) then you already have this feature and it's included in the price. Pretty cool.

Related Links


Sponsor: Big thanks to Infragistics for sponsoring the feed this week. Responsive web design on any browser, any platform and any device with Infragistics jQuery/HTML5 Controls.  Get super-charged performance with the world’s fastest HTML5 Grid - Download for free now!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

Stop, think, research, debug

July 14, '15 Comments [18] Posted in Musings
Sponsored By

I got this great letter from a listener/reader recently. They listened to a recent show on Debugging Windows and it helped them debug a problem at work, but not in a specific technical way. Instead, it changed how they thought about their approach to the topic.

By the way, I've had some amazing guests on lately. If you haven't subscribed, it's a good time to join us. Explore the archives and check our our diverse topics and voices and subscribe. Also, BTW there is a new This Developer's Life out so check that out also.

I've been doing Hanselminutes: Fresh Air for Developers for almost 500 episodes over darn-near 10 years. Getting emails like this is so meaningful, especially when I think about taking breaks or stopping. Sometimes a few shows will go by with no comments and I'll wonder if anyone listens, and then I hear from a Real Live Human who was helped by all this free content I put out and it keeps me going. So first, thanks to all of you for this, if you've ever emailed or donated to fight diabetes.

US Navy Cryptanalytic Bombe by brewbooks, used under CC

Here's what this particular listener said, with emphasis mine.

Scott,
After listening to your podcast with Mario Hewardt earlier this week on Windows Debugging, I had some of the things you were talking about running through my head. Though I've always come away from your podcasts feeling enriched and excited to tackle new and interesting problems, this was the first time that it had a direct impact on my work so soon after listening.

I work at a big data company that does a lot of social network analysis. We use ElasticSearch in our stack, and we are consistently processing millions of documents using complicated, user generated queries. A release we put out late last week allowed for many, larger, even more complicated user queries, which in turn led to substantial slowdown of our product. Though the code only existed in our staging environment, we are on a deadline for release early this next week. As it became obvious that the application was spending a LOT of time in the code my team was responsible for, we were tasked with "fixing" it ASAP.

I took the first shift, and though my brain immediately started coming up with ways to improve our code, something about your podcast regarding "know the tools your tools are built on" was stuck in my head. Instead of jumping in and optimizing what I was already comfortable with, I spent an hour researching the internals of the ElasticSearch functionality we were relying on.

Not sure how familiar you are with ES, but it distinguishes between searches that simply return a set of documents that match a query, much the way that traditional SQL databases do, and searches that return how well documents match a query, for ranking purposes. As it turned out, we were inadvertently using one of the latter ones, meaning when we provided X giant queries in an OR block, even though it was an OR block, which we expected would short circuit as soon as it returned a TRUE condition, it processed all X queries to determine how well each document matched. My big O notation is a bit rusty, but suffice it to say, it was one of the bad ones.

Instead of a gigantic fire drill app optimization over a weekend, it turned out to be an hour of research followed by switching the word "bool" to the word "or". It's remarkable how the most efficient coding you can do is often stopping and thinking about the problem for awhile!

Anyway, thanks to both you and Mario for saving me and my team a bunch of time!

This was a great reminder to me as well. Research is hard. It's not as dynamic as interactive debugging but it can often save you many wasted hours. Truly successful debugging means doing whatever it takes to understand the problem domain and the code paths.

Do you have any tales of debugging where taking the time to really understand the problem domain saved you time? Or perhaps the opposite, where you just dove in and poked at some code until it worked? Don't be ashamed, I think we've all be on both sides.

Sound off in the comments!


Sponsor: Big thanks to Infragistics for sponsoring the feed this week. Responsive web design on any browser, any platform and any device with Infragistics jQuery/HTML5 Controls.  Get super-charged performance with the world’s fastest HTML5 Grid - Download for free now!

* Photo - US Navy Cryptanalytic Bombe by brewbooks, used under CC

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.