Scott Hanselman

Use a second laptop as an extended monitor with Windows 10 wireless displays

October 18, '17 Comments [17] Posted in Tools | Win10
Sponsored By

James Clarke from the Windows team rolled into a meeting today with two Surfaces...but one had no keyboard. Then, without any ceremony, he proceeded to do this:

Holy Crap a Surface as a Second Monitor

Now, I consider myself a bit of a Windows Productivity Tips Gourmand, and while I was aware of Miracast and the general idea of a Wireless Display, I didn't realize that it worked this well and that it was built into Windows 10.

In fact, I'm literally sitting here in a hotel with a separate USB3 LCD display panel to use as a second monitor. I've also used Duet Display and used my iPad Pro as a second monitor.

I usually travel with a main laptop and a backup laptop anyway. Why do I lug this extra LCD around? Madness. I had this functionality all the time, built in.

Use your second laptop as a second monitor

On the machine you want to use as a second monitor, head over to Settings | System | Projecting to this PC and set it up as you like, considering convenience vs. security.

Settings | Projecting to this PC

Then, from your main machine - the one you are projecting from - just hit Windows Key+P, like you were projecting to a projector or second display. At the bottom, hit Connect to a Wireless Display.

Connect to a Wireless Display

Then wait a bit as it scans around for your PC. You can extend or duplicate...just like another monitor...

Connected to a Wireless Display

...because Windows thinks it IS another monitor.

You can also do this with Miracast TVs like my LG, or your Roku or sometimes Amazon Fires, or you can get a Microsoft Wireless Display Adapter and HDMI to any monitor - even ones at hotels!

NOTE: It's not super fast. It's sometimes pixelly and sometimes slow, depending on what's going on around you. But I just moved Chrome over onto my other machine and watched a YouTube video, just fine. I wouldn't play a game on it, but browsing, dev, typing, coding, works just fine!

Get ready for this. You can ALSO use the second machine as a second collaboration point! That means that someone else could PAIR with you and also type and move their mouse. THIS makes pair programming VERY interesting.

 Allow input from the remote display

Here's a video of it in action:

Give it a try and let me know how it goes. I used two Surfaces, but I also have extended my display to a 3 year old Lenovo without issues.


Sponsor: GdPicture.NET is an all-in-one SDK for WinForms, WPF, and Web development. It supports 100+ formats, including PDF and Office Open XML. Create powerful document imaging, image processing, and document management apps!

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 SherWeb

First Impressions - Jibo Social Robot for the Home

October 17, '17 Comments [5] Posted in Reviews
Sponsored By

Jibo moves VERY organicallyAs you likely know, I have a BUNCH of robots in the house. Whether it be turning a tin can into a robot, driving a Raspberry Pi around with Windows IoT, building robot arms with my kids, or controlling a robot with Xamarin code, I'm ALL IN when it comes to home robots. I also have Alexa, Cortana, Siri...but they have no bodies. They are just disembodied voices - why not a social robot with a body AND a personality?

Jibo is the first social robot for the home, and when their team emailed me to try Jibo out - and soon explore their SDK and build more skills into Jibo - I jumped at the idea. Jibo started as an Indiegogo campaign in 2014 and now I've got a pre-public version that I'm stoked to explore and expand.

Jibo showed up in a surprisingly hefty box. He's about 8 pounds and about a foot tall. You turn him on and he starts his initial set up process. Since Jibo has a voice and touch screen, it's pretty straightforward to hook up to WiFi and download whatever updates are needed. After this initial process, updates happen overnight and I haven't noticed them, other than to see that Jibo has new skills in the morning. He's basically maintenance-free.

imageThe first time you set up Jibo and he moves I expect you'll be a little shocked - I was. His movements are extremely fluid and organic. I struggled finding the right words to explain how his movements feel, so I made an animated gif you can see at the right. His body turns, his head moves, he has a little waist and neck. All these joints combined with the color touch screen and his voice give him quite the personality. It's clear within just a few minutes that to dismiss Jibo as a "Alexa with a body" would be a mistake.

The 9 year old and 11 year old have already started going to Jibo in the morning and asking him how his day was, and seeing if he has new skills. I believe the "bonding" - for lack of another world - is connected to the physicality and personality of Jibo.

I realize this photo looks somewhat staged, but it's not. I snuck up on my 9 year old telling Jibo about his day at school and asking him homework questions. Jibo didn't know a number of things, but it was interesting to see how kids are extremely patient with robots, speaking to them as if they're even smaller kids.

The 9 year old says this:

If you are trying to get something to keep track of your meetings or the news you maybe would buy Alexa. But if you have a kid who loves robots you want Jibo. Jibo is fun, if you make noise Jibo will look at you. He can move his big head to look at you and if you tap his eye he will give you a list of things to do. Another new thing is that he now has a list of cool thing you can ask or tell, like one is "Hey Jibo, Are there any monsters in my house" then he will bring up a radar and look around and Jibo will say no, there's no monsters. We also have an Alexa but if your looking for some thing fun we go straight to Jibo he can tell jokes and also favorite part is when Jibo dances.

Since he wrote this, Jibo woke up with the ability to tell me the news, so I can only imagine he'll continue to get Alexa-like skills that will balance the "boring work stuff" my son says I want with the "games and homework help" that he wants.

He recognizes your face, your family's faces (if you train him and opt-in), uses your names, follows your face, and can tell where you are in the room when you talk to him. He's got 6 microphones that let him understand where you and he are in physical space.

I'm imagining the kinds of skills Jibo might potentially get in the future - or that I might write for him - like (and I'm totally brainstorming here):

  • Tell stories before bedtime
  • Watch cartoons
  • Give Khan Academy exercises as Homework
  • Play music
  • Trivia and/or board games
  • Wikipedia stuff
  • Maps
  • Tell me about my blood sugar, show a diabetes chart, wake me up if I go low.
  • Play Tea Time or play along as kids make up stories
  • Vlogging or daily diary keeping

What are your thoughts, Dear Reader? What would you want Jibo to know or do for you?

Disclaimer: The folks at Jibo sent me a pre-public Jibo for free to explore his SDK. However, my words and opinions are my own. I'll post my honest impressions here and there, on my blog and on Twitter as Jibo grows and learns more things.


Sponsor: GdPicture.NET is an all-in-one SDK for WinForms, WPF, and Web development. It supports 100+ formats, including PDF and Office Open XML. Create powerful document imaging, image processing, and document management apps!

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 SherWeb

Scaling Mentorship

October 15, '17 Comments [3] Posted in Musings
Sponsored By
IMG_0170
 

You may have had a mentor in the past. Often these are more senior/elder people who are further along in their career. The presumption usually is that if they are "ahead" of you that they likely have something profound to offer you in the areas of advice or strategy.

This is a classic mentor/mentee situation and while I think it has value, it has a few problems that are worth pointing out. Does it scale? Is a senior person the right mentor for you? Is just one mentor the right number? Does that person's time support mentoring you?

I've been blessed to have several mentors over the years and I've been fortunate to be a mentor myself. But there's only so much time in the day. Even if I could truly mentor 4 people a week, and meet with them a few times a month, that could fill up many days. Plus, I have to ask my self - am I giving them what they need? Personal advice? Career advice? Technical advice? Getting promoted advice? Life advice?

Create a Board of Directors for Your Life

I've been experimenting with a few other models for mentorship. Five years ago I set up a Board of Directors for my life. You can learn more at http://lifesboardofdirectors.com.

Companies have mission statements and a Board of Directors. Your life is pretty important. Why not create a Life Board of Directors to help you through it? Pick 2 to 5 of your friends. Not necessarily your closest friends, but friends that are close enough where you can really confide but not so close that they can't see the big picture. Email them one a month, once a quarter or "once a crisis." Ask them for advice, lean on them, trust them and help them as well.

Assemble "Team You" and use your team to brainstorm directions and implementations of big decisions like moving to New York, or changing your business's direction, starting a new venture, or getting fit.

Use your personal Board of Directors as one of the compasses in your life. You've got family, friends, perhaps faith, hobbies, values, etc. Add your Team to this list of personal compasses.

It might sound like a silly mind game, but that's common with many hacks. Hacks feel insignificant but can have huge effects. The trick is to remember that it is a hack - you're hacking yourself. The idea of life's board of directors is a relationship hack meant to remind you in difficult times that you can agree on something fundamental and you have a team to support you in your endeavors. Set a direction and head in that direction with the confidence you've got a supportive group behind you.

Go assemble your Life's Board today.

Host Mentorship Meals

Over the last several months I've been quietly hosting "Dinner for people on the come up." These are dinners where everything is FrieNDA and we talk frankly about our jobs, our levels, our work situations, and most importantly - we find new mentors and people with whom to brainstorm. It's a mentorship multiplier. We encourage folks to pull from the pool of potential peer mentors.

Tonight we had one with almost 20 people. These were 20 mostly young people, many women and people of color who were all trying to find their way in tech. I have some life experiences to offer this group, but most of all what I can lend is my privilege. I can use my standing within the company and the industry to invite folks together and let them take over and mentor each other.

I host the mean, kick it off, sometimes invite guests to speak, and the attendees often break off into small groups, meet up separately and network. Peer mentorship is just as important as "elder/senior" mentorship.

It also helps mentor people in the the fullness of their personalities. Where I might help with speaking at conferences or technical issues, someone else can better speak to issues of harassment, or how to get a promotion, or how to be better seen and heard in meetings. I can also learn from younger people - and I do - every day.

The goal of mentorship isn't to lecture and preach, it's to guide and counsel, inspire and motivate. Most of all, to listen. Once you've truly heard your mentee, then you can help them think strategically and better plan their career, no matter what their challenges and strengths.

What do you recommend as positive ways to Scale Mentorship?

* Stock photo from The Jopwell Collection


Sponsor: Get the latest JetBrains Rider preview for .NET Core 2.0 support, Value Tracking and Call Tracking, MSTest runner, new code inspections and refactorings, and the Parallel Stacks view in debugger.

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 SherWeb

Botwin offers an interesting alternative option for routing with ASP.NET Core

October 12, '17 Comments [14] Posted in ASP.NET | Open Source
Sponsored By

NancyFx is a great alternative to ASP.NET if you want to make elegant little web apis like this:

public class SampleModule : Nancy.NancyModule
{
public SampleModule()
{
Get["/"] = _ => "Hello World!";
}
}

However, it may be that you want a routing style - the way you define your routes - that is like NancyFx BUT you want to use ASP.NET. Botwin is a library that lets you do just that. They say:

This is not a framework, it simply builds on top of Microsoft.AspNetCore.Routing allowing you to have more elegant routing rather than have attribute routing, convention routing, ASP.Net Controllers or IRouteBuilder extensions.

You can plug Botwin into your existing ASP.NET Core application, or you can even add a basic started Botwin app to "dotnet new" like this:

C:\botwinexample> dotnet new -i BotwinTemplate
C:\botwinexample> dotnet new botwin -n MyBotwinApp
C:\botwinexample> dir
10/11/2017 10:14 PM 284 HomeModule.cs
10/11/2017 10:14 PM 470 MyBotwinApp.csproj
10/11/2017 10:14 PM 421 Program.cs
10/11/2017 10:14 PM 408 Startup.cs
4 File(s) 1,583 bytes

You add Botwin as a service to your ASP.NET Core app:

public class Startup
{ public void ConfigureServices(IServiceCollection services) { services.AddBotwin(); } public void Configure(IApplicationBuilder app) { app.UseBotwin(); }
}

And then add 'Modules' like this:

namespace MyBotwinApp
{
    using Botwin;
    using Microsoft.AspNetCore.Http;

    public class HomeModule : BotwinModule
    {
        public HomeModule()
        {
            Get("/", async(req, res, routeData) => await res.WriteAsync("Hello from Botwin!"));
        }
    }
}

That's a hello world. Let's try something more interesting. You can have Before and After hooks like this:

public class HooksModule : BotwinModule
{
public HooksModule()
{
this.Before = async (ctx) =>
{
ctx.Response.StatusCode = 402;
await ctx.Response.WriteAsync("Pay up you filthy animal");
return false;
};

this.Get("/hooks", async (req, res, routeData) => await res.WriteAsync("Can't catch me here"));

this.After = async (ctx) => await ctx.Response.WriteAsync("Don't forget you owe me big bucks!");
}
}

Here's a more complex example. See how they do a BindAndValidate in the Post() where they check for a valid Actor before working with it.

public class ActorsModule : BotwinModule
{
public ActorsModule(IActorProvider actorProvider)
{
this.Get("/actors", async (req, res, routeData) =>
{
var people = actorProvider.Get();
await res.AsJson(people);
});

this.Get("/actors/{id:int}", async (req, res, routeData) =>
{
var person = actorProvider.Get(routeData.As<int>("id"));
await res.Negotiate(person);
});

this.Put("/actors/{id:int}", async (req, res, routeData) =>
{
var result = req.BindAndValidate<Actor>();

if (!result.ValidationResult.IsValid)
{
res.StatusCode = 422;
await res.Negotiate(result.ValidationResult.GetFormattedErrors());
return;
}

//Update the user in your database

res.StatusCode = 204;
});

this.Post("/actors", async (req, res, routeData) =>
{
var result = req.BindAndValidate<Actor>();

if (!result.ValidationResult.IsValid)
{
res.StatusCode = 422;
await res.Negotiate(result.ValidationResult.GetFormattedErrors());
return;
}

//Save the user in your database
res.StatusCode = 201;
await res.Negotiate(result.Data);
});
}

What do you think about the choices you have with ASP.NET Core? Some people feel like the amount of plugability is overwhelming, but I find the flexibility heartening. Go check out Botwin and, hopefully, help out and contribute to open source!


Sponsor: Get the latest JetBrains Rider preview for .NET Core 2.0 support, Value Tracking and Call Tracking, MSTest runner, new code inspections and refactorings, and the Parallel Stacks view in debugger.

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 SherWeb

Learning about the F# SAFE stack - Suave.io, Azure, Fable, Elmish

October 8, '17 Comments [15] Posted in DotNetCore | Open Source
Sponsored By

Last month I looked at a Functional Web with ASP.NET Core and F#'s Giraffe. Giraffe is F# middleware that takes ASP.NET Core's pipeline in a new direction with a functional perspective. However, Giraffe isn't the only F# web stack to choose from! There's Freya, WebSharper, and there's also a very interesting and quite complete story with The SAFE Stack.

The SAFE Stack

The SAFE Stack is an open source stack, like LAMP, or WAMP, or other acronym stacks, except this one is all open source .NET with a functional perspective. From the announcement blog:

  • Suave model for server-side web programming
  • Azure for cloud-based systems
  • Fable for Javascript-enabled applications.
  • Elmish for an easy-to-understand UI programming mode

To be clear, while this is a prescriptive stack, it's not a stack that forces you to do anything. You can swap bits out as you please.

Fable is particularly interesting as it's an F# to JavaScript transpiler. Try Fable online here http://fable.io/repl and turn F# into JavaScript LIVE! Their Sudoku sample is particularly impressive.

Here's two small - but interesting - examples where F# code ends up as JavaScript which ends up creating ReactJS components:

let words size message =
    R.span [ Style [ !!("fontSize", size |> sprintf "%dpx") ] ] [ R.str message ]

let buttonLink cssClass onClick elements = 
    R.a [ ClassName cssClass
          OnClick (fun _ -> onClick())
          OnTouchStart (fun _ -> onClick())
          Style [ !!("cursor", "pointer") ] ] elements

Then later in a Menu.fs that also turns into JavaScript eventually, you can see where they conditionally render the Button for logout, or links for for other Views for the Home Page or Wishlist. You can read lots more about Fable over at the Compositional IT blog.

let view (model:Model) dispatch =
    div [ centerStyle "row" ] [ 
          yield viewLink Home "Home"
          if model.User <> None then 
              yield viewLink Page.WishList "Wishlist"
          if model.User = None then 
              yield viewLink Login "Login" 
          else 
              yield buttonLink "logout" (fun _ -> dispatch Logout) [ str "Logout" ]
        ]

Elmish for F# takes the Model View Update (MVU) architecture and brings it to F# and the browser. There's a good breakdown of the value Elmish provides also at the Compositional IT blog.

Suave is its own cross platform Web Server. Here's Hello World in Suave.

open Suave

startWebServer defaultConfig (Successful.OK "Hello World!")

Suave has been around for while and gets better all the time. I blogged about it in 2015 and got it running on Azure. My blog post is not a best practice any more - it was a spike attempt by me - and fortunately they've moved on and improved things.

Here's Suave getting set up within the sample app. Check out how they route HTTP Verbs and URL paths.

    let serverConfig =
        { defaultConfig with
            logger = Targets.create LogLevel.Debug [|"ServerCode"; "Server" |]
            homeFolder = Some clientPath
            bindings = [ HttpBinding.create HTTP (IPAddress.Parse "0.0.0.0") port] }

    let app =
        choose [
            GET >=> choose [
                path "/" >=> Files.browseFileHome "index.html"
                pathRegex @"/(public|js|css|Images)/(.*)\.(css|png|gif|jpg|js|map)" >=> Files.browseHome

                path "/api/wishlist/" >=> WishList.getWishList loadFromDb ]

            POST >=> choose [
                path "/api/users/login" >=> Auth.login

                path "/api/wishlist/" >=> WishList.postWishList saveToDb
            ]

            NOT_FOUND "Page not found."

        ] >=> logWithLevelStructured Logging.Info logger logFormatStructured

    startWebServer serverConfig app

Very interesting stuff! There are so many options in .NET open source. I'll be doing podcasts on this stack soon.

Trying out the SAFE Stack

If you're using Visual Studio Community 2017, make sure you've got F# support included. I double-checked under Individual components. You can run the VS2017 installer multiple time and add and remove stuff without breaking things, so don't worry. If you are using other versions of VS, check here http://fsharp.org/use/windows/ to get the right download for your machine. If you're using Visual Studio Code, you'll want the Ionide F# plugin for Code.

Adding F# to Visual Studio Community 2017

Once I had node and yarn installed, it was easy to try out the sample app and get it running locally with "build run." It uses DotNetWatcher, so you can just keep it running in the background and work on your code and it'll recompile and restart as you go.

The SAFE stack running

The complete "SAFE" stack demo website is LIVE here http://fable-suave.azurewebsites.net (login test/test/) and all the source code for the app is here: https://github.com/SAFE-Stack/SAFE-BookStore.

UPDATE: One important point from F# Community Member Steffan Forkmann: "One thing I'd like to add is that SAFE is also an initiative to get multiple companies to give commercial support for this stack. This is IMHO very important for commercial use of an open source stack."


Sponsor: Do you know how many errors, crashes and performance issues your users are experiencing? Raygun installs in minutes. Discover problems you didn't even know about and replicate bugs with greater speed and accuracy. Learn more!

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 SherWeb

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