Scott Hanselman

Collecting Windows 10 "Anniversary Edition" Keyboard Shortcuts

August 05, 2016 Comment on this post [40] Posted in Win10
Sponsored By

The new Windows 10 Calendar widget is lovelyI'm a big fan of keyboard shortcuts.

There's a fantastic list of Windows 10 shortcuts *inside* the Windows 10 Insiders "Feedback Hub" app. The in-app direct link (not a web link) is here but I think the list is too useful not to share so I don't think they will mind if I replicate the content here on the web.

There is also a nice support page that includes a near-complete list of Keyboard Shortcuts for Windows 7, 8.1 and 10.

"We asked our engineers on the team to share some of their favorite (and lesser-known) keyboard shortcuts for Windows 10. Here is the list!"

Note: [NEW] denotes a new keyboard shortcut introduced in the the Windows 10 Anniversary Update.

Quick access to basic system functions:

  • Ctrl + Shift + Esc: Opens Task Manager.
  • WIN + F: Opens the Feedback Hub with a screenshot attached to your feedback. 
  • WIN + I: Opens the Settings app. 
  • WIN + L: Will lock your PC. 
  • WIN + X: Opens a context menu of useful advanced features.
  • WIN + X and A: Opens Command Prompt with administrative rights. 
  • WIN + X and P: Opens Control Panel. 
  • WIN + X and M: Opens Device Manager.
  • WIN + X and U then S: Puts your PC to sleep. 
    • Scott: Or just push the power button on most laptops or close the lid
  • WIN + Down: Minimizes an app. 
  • WIN + Up: Maximizes an app. 

Capturing what’s on your screen:

  • Alt + PrtScrn: Takes a screenshot of open window and copies to your clipboard. 
  • WIN + PrtScrn: Takes a screenshot of your entire desktop and saves it into a Screenshots folder under Photos in your user profile. 
  • WIN + Alt + R: Start/stop recording your apps & games. 

Mastering File Explorer:

  • Alt + D in File Explorer or browser: Puts you in the address bar. 
  • F2 on a file: Renames the file. 
  • Shift + Right-click in File Explorer: Will give you option to launch Command Prompt with whatever folder you are in as the starting path. 
  • Shift + Right-click on a file: “Copy as path” is added to the context menu.
    • Scott: These two are gold. Copy as path has been around for years and is super useful.

For the taskbar:

  • WIN + <number>: Opens whatever icon (app) is in that position on the taskbar. 
  • [NEW] WIN + Alt + D: Opens date and time flyout on the taskbar.  
    • Scott: I love the new calendar stuff in Windows 10. You just click the clock in the corner and you get not only clock and calendar but also your agenda for the day from your calendar. I think Windows 10 should include more stuff like this going forward - integrating your mail, calendar, plan, trips, commutes, directly in the OS and not just in Apps. That's one of the reasons I like Live Tiles. I like to see information without launching formal apps.  I like widgets on iOS and Android.
  • WIN + S: Search for apps and files. Just type the app name (partially) or executable name (if you know it) and press Enter. Or Ctrl + Shift+ Enter if you need this elevated.
  • WIN + Shift + <number>: Opens a new window of whatever icon (app) is in that position on the taskbar (as will Shift + Click on the icon). 
  • WIN + Shift + Ctrl + <number>: Opens a new window of whatever icon (app) is in that position on the taskbar with administrative rights. 

Remote Desktop and Virtual Desktop:

  • CTRL + ALT + Left Arrow: VM change keyboard focus back to host.   
  • CTRL + ALT + HOME: Remote Desktop change keyboard focus back to host.

For example, in a VM, CTRL + ALT + Left Arrow then ALT + TAB lets you get focus back and switch to an app on your dev machine besides the VM.

Cortana:

  • [NEW] WIN + Shift + C: Opens Cortana to listen to an inquiry. 

Other neat keyboard shortcuts:

  • Alt + X in WordPad: Using on a selected character or word in WordPad will show/hides the Unicode.
  • Alt + Y on a UAC prompt: Automatically chooses yes and dismisses the prompt. 
  • Ctrl + mouse scroll-wheel: Scrolling will zoom and un-zoom many things across the OS. Middle clicking on the mouse scroll-wheel will dismiss tabs, open windows in taskbar, and notifications from the Action Center (new). 
  • Shift + F10: Will open the context menu for whatever is in focus. 

Here are some useful keyboard shortcuts on Surface devices: 

  • Fn + Left arrow: Home
  • Fn + Right arrow: End
  • Fn + Up arrow: Page Up
  • Fn + Down arrow: Page Down
  • Fn + Del: Increases screen brightness.
  • Fn + Backspace: Decreases screen brightness.
  • Fn + Spacebar: Takes a screenshot of the entire screen or screens and puts it into your clipboard. 
  • Fn + Alt + Spacebar: Takes a screenshot of an active window and puts it into your clipboard.

What are YOUR favorite keyboard shortcuts for Windows?


Sponsor: I want to thank Stackify for sponsoring the blog this week, and what's more for gifting the world with Prefix. It's a must have .NET profiler for your dev toolbox. Do yourselves a favor and download it now—free!

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

GitKraken Pro git client teaming up with NightScout to support Open Source Diabetes software

August 01, 2016 Comment on this post [8] Posted in Diabetes
Sponsored By
GitKraken + NightScout

There's a great new cross-platform Git client available now called GitKraken. It's totally free to download and but the optional Pro version includes some great features like a Merge Conflict editor, profile support to keep work and personal separate and more. It's $6 a month or just $5 a month if you go annually.

We've talked to the folks at GitKraken and we've brokered an amazing deal. My friend Hamid Shojaee who owns Axosoft has always supported open source and is a generous charitable giver. He's always asking about my diabetes and the software I use to manage it. As you may know, I use the open source Nightscout application running in Azure to visualize my blood sugar in near-real-time. My wife and family can see my numbers and support me remotely. If you are diabetic or have anyone with diabetes in your life, you'll quickly find that NightScout is indispensible. For parents of children with diabetes it's truly life-changing.

Since GitKraken is great for Git and working with software hosted on GitHub and Nightscout is all open source and hosted on GitHub partnering up seemed very natural. GitKraken is going to give all the revenue for the first month's sales to the Nightscout Foundation!

As well as providing awesome additional features, upgrading to GitKraken Pro is an opportunity to help raise money and increase awareness for the Nightscout Foundation, a nonprofit that is improving the lives of people and families affected by type 1 diabetes, through their support and creation of open source diabetes management systems.

So, until August 28, 2016, 100% of first month revenues from the sales of GitKraken Pro will be donated to the Nightscout Foundation. There is no upper limit to how much money Axosoft will donate for the month, but we’ll be making a minimum commitment of $5,000!

GitKraken is written in Electron and is totally cross-platform. It's tree-view is a standout feature in my opinion and makes it a lot easier to visualize complex repositories and branches.

GitKraken

Again, it's free but you can optionally upgrade to Pro if you like it and want some more advanced features. And, for the next month if you do upgrade GitKraken to Pro you'll be helping the Nightscout Foundation support the development of opens source software to fight diabetes!


Sponsor: I want to thank Stackify for sponsoring the blog this week, and what's more for gifting the world with Prefix. It's a must have .NET profiler for your dev toolbox. Do yourselves a favor and download it now—free!

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Exploring a minimal WebAPI with .NET Core and NancyFX

July 30, 2016 Comment on this post [12] Posted in Open Source
Sponsored By

WOCinTechChat photo used under CCIn my last blog post I was exploring a minimal WebAPI with ASP.NET Core. In this one I wanted to look at how NancyFX does it. Nancy is an open source framework that takes some inspiration from Ruby's "Sinatra" framework (get it? Nancy Sinatra) and it's a great alternative to ASP.NET. It is an opinionated framework - and that's good thing. Nancy promotes what they call the "super-duper-happy-path." That means things should just work, they should be easy to customize, your code should be simple and Nancy itself shouldn't get in your way.

As I said, Nancy is open source and hosted on GitHub, so the code is here https://github.com/NancyFx/Nancy. They're working on a .NET Core version right now that is Nancy 2.0, but Nancy 1.x has worked great - and continues to - on .NET 4.6 on Windows. It's important to note that Nancy 1.4.3 is NOT beta and it IS in production.

As of a few weeks ago there was a Beta of Nancy 2.0 on NuGet so I figured I'd do a little Hello Worlding and a Web API with Nancy on .NET Core. You should explore their samples in depth as they are not just more likely to be correct than my blog, they are just MORE.

I wanted to host Nancy with the ASP.NET Core "Kestrel" web server. The project.json is simple, asking for just Kestrel, Nancy, and the Owin adapter for ASP.NET Core.

{
  "version": "1.0.0-*",
  "buildOptions": {
    "debugType": "portable",
    "emitEntryPoint": true
  },
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.Owin": "1.0.0",
    "Nancy": "2.0.0-barneyrubble"
  },
  "commands": {
    "web": "Microsoft.AspNet.Server.Kestrel"
  },
  "frameworks": {
    "netcoreapp1.0": {}
  }
}

And the Main is standard ASP.NET Core preparation. setting up the WebHost and running it with Kestrel:

using System.IO;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;

namespace NancyApplication
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseKestrel()
.UseStartup<Startup>()
.Build();

host.Run();
}
}
}

Startup tells ASP.NET Core via Owin that Nancy is in charge (and sure, didn't need to be its own file or it could have been in UseStartup in Main as a lambda)

using Microsoft.AspNetCore.Builder;
using Nancy.Owin;

namespace NancyApplication
{
   public class Startup
    {
        public void Configure(IApplicationBuilder app)
        {
            app.UseOwin(x => x.UseNancy());
        }
   }
}

Here's where the fun stuff happens. Check out a simple Nancy Module.

using Nancy;
namespace NancyApplication
{
        public class HomeModule : NancyModule
    {
        public HomeModule()
        {
            Get("/", args => "Hello World, it's Nancy on .NET Core");
        }
    }
}

Then it's just "dotnet restore" and "dotnet run" and I'm in business. But let's do a little more. This little bit was largely stolen from Nancy's excellent samples repository. Here we've got another route that will respond to a GET to /test/Scott, then make and return a new Person() object. Since I'm going to pass in the Accept: application/json header I'll get JSON back.

using Nancy;
 
namespace NancyApplication
{
    public class HomeModule : NancyModule
    {
        public HomeModule()
        {
            Get("/", args => "Hello from Nancy running on CoreCLR");
            Get("/test/{name}", args => new Person() { Name = args.name });
        }
    }

    public class Person
    {
        public string Name { get; set; }
    }
}

I'm using the Postman application to test this little Web API and you can see the JSON response below:

Postman shows a JSON object coming back from a GET request to a Web API

Nancy is a very complete and sophisticated framework with a LOT of great code to explore. It's extremely modular and flexible. It works with ASP.NET, with WCF, on Azure, with Owin, alongside Umbraco, with Mono, and so much more. I'm looking forward to exploring their .NET Core version as it continues development.

Finally, if you're a new open source contributor or are considering being a First Timer and help out an open source project, you might find the idea of getting involved with such a sophisticated project intimidating. Nancy participates in UpForGrabs and has some issues that are marked as "up for grabs" that could be a good starter point where you could help out a deserving project AND get involved in open source.

* WoCTechChat photo used under CC


Sponsor: Thanks to Aspose for sponsoring the feed this week! Aspose makes programming APIs for working with files, like: DOC, XLS, PPT, PDF and countless more.  Developers can use their products to create, convert, modify, or manage files in almost any way. Aspose is a good company and they offer solid products. Check them out, and download a free evaluation!

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Exploring a minimal WebAPI with ASP.NET Core

July 26, 2016 Comment on this post [12] Posted in ASP.NET | ASP.NET Web API
Sponsored By

They are still working on the "dotnet new" templates, but you can also get cool templates from "yo aspnet" usingn Yeoman. The generator-aspnet package for Yeoman includes an empty web app, a console app, a few web app flavors, test projects, and a very simple Web API application that returns JSON and generally tries to be RESTful.

yo aspnet

The startup.cs is pretty typical and basic. The Startup constructor sets up the Configuration with an appsettings.json file and add a basic Console logger. Then by calling "UseMvc()" we get to use all ASP.NET Core which includes both centralized routing and attribute routing. ASP.NET Core's controllers are unified now, so there isn't a "Controller" and "ApiController" base class. It's just Controller. Controllers that return JSON or those that return Views with HTML are the same so they get to share routes and lots of functionality.

public class Startup
{
public Startup(IHostingEnvironment env)
{
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddEnvironmentVariables();
Configuration = builder.Build();
}

public IConfigurationRoot Configuration { get; }

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
// Add framework services.
services.AddMvc();
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();

app.UseMvc();
}
}

Then you can make a basic controller and use Attribute Routing to do whatever makes you happy. Just by putting [HttpGet] on a method makes that method the /api/Values default for a simple GET.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

namespace tinywebapi.Controllers
{
[Route("api/[controller]")]
public class ValuesController : Controller
{
// GET api/values
[HttpGet]
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}

// GET api/values/5
[HttpGet("{id}")]
public string Get(int id)
{
return "value";
}

// POST api/values
[HttpPost]
public void Post([FromBody]string value)
{
}

// PUT api/values/5
[HttpPut("{id}")]
public void Put(int id, [FromBody]string value)
{
}

// DELETE api/values/5
[HttpDelete("{id}")]
public void Delete(int id)
{
}
}
}

If we run this with "dotnet run" and call/curl/whatever to http://localhost:5000/api/Values we'd get a JSON array of two values by default. How would we (gasp!) add XML as a formatting/serialization option that would respond to a request with an Accept: application/xml header set?

I'll add "Microsoft.AspNetCore.Mvc.Formatters.Xml" to project.json and then add one method to ConfigureServices():

services.AddMvc()
        .AddXmlSerializerFormatters();

Now when I go into Postman (or curl, etc) and do a GET with Accept: application/xml as a header, I'll get the same object expressed as XML. If I ask for JSON, I'll get JSON.

 Postman is a great way to explore WebAPIs

If I like, I can create my own custom formatters and return whatever makes me happy. PDFs, vCards, even images.

Next post I'm going to explore the open source NancyFx framework and how to make minimal WebAPI using Nancy under .NET Core.


Sponsor: Thanks to Aspose for sponsoring the feed this week! Aspose makes programming APIs for working with files, like: DOC, XLS, PPT, PDF and countless more.  Developers can use their products to create, convert, modify, or manage files in almost any way. Aspose is a good company and they offer solid products. Check them out, and download a free evaluation!

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Making YouTube videos look sharp and professional on a budget

July 23, 2016 Comment on this post [21] Posted in Musings
Sponsored By

My team is doing some videos to show off some features in Visual Studio. Most of my videos or YouTubes are screencasts so the video quality of the people parts aren't a huge deal. I REALLY try to make my audio sound good but I've been somewhat lax on the video side, usually just using a webcam. While the Logitech 930e is amazing as webcams go, it's not really "pro." It looks good but it still looks and feels like a webcam in both field of view and depth of field.

image

I went looking for videos that had the look and feel I wanted and asked those folks that I admired how they did it.

I always love the way my friend Chescaleigh's YouTube videos look. They are clear and in focus, with amazing lighting and the background is "blown." That means there is a shallow depth of field with just Franchesca in focus and the background is a somewhat blurry.

Franchesca's videos are very professional

Franchesca pointed me to the Canon T3i DSLR HD camera. This is not just a nice still camera but also a very competent HD Video Camera that puts out fantastic 1080p video directly to an SD Card along with the ability to use alternate lenses. It also has options you can add on later like a remote control for focusing and starting/stopping recording.

The trick with the T3i is that it's a little older and you can find them for as little as $200-$250 on Craigslist. I've seen them cheap on Amazon as well. That makes them reasonable for a budget but again, the results look AMAZING.

I also love this video by Rachel Weil doing an overview Visual Studio Code. She steps it up with an interesting background and razor sharp focus. Her audio is also fantastic.

Rachel adds this Canon EF 50mm lens to her Canon DSLR to get a really tight focus. I haven't bought this lens yet but it's on my Amazon wishlist for the future.

Rachel's video is top notch

Good audio is so important. I tried cheap lavaliere microphones but I find I get the best results with a condenser mic held just out of frame. I like the Samson C01U but you can get decent USB Mics for <$50. Record your video and audio in separate files, and before you start talking *CLAP* very loud to make a spike in your audio, then you can line up your audio and video/audio files in your editor like iMovie or Movie Maker. Then mute the audio in your main audio/video file so you'll be hearing the high quality audio from your good mic and the high quality video from your camera.

Lining up video and audio

Finally, you need GOOD LIGHTING. ZOMG it matters so much. Even if you ignore all these tips and just use a webcam, get a nice light. Maria from my team recommended this CowboyStudio Dual Mount Brackets to let me mount a mic and lights to my camera, then I picked up this FANTASTIC 160 LED Power Panel. It's perfect because it's dimmable and includes color filters for getting different color temperatures or a diffuse effect.

image

I feel like the result is very close to the look I wanted and looks much more professional given a reasonable budget. Again, if you keep your equipment module (mic, camera, lenses, stands, lights, etc) you can improve your setup, as I have, as you have the cash.

image

How do YOU make videos that look sharp? Let me know in the comments.


Sponsor: Do you deploy the same application multiple times for each of your end customers? The team at Octopus have been trying to take the pain out of multi-tenant deployments. Check out their 3.4 beta release.

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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

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