Scott Hanselman

Hanselman's Newsletter of Wonderful Things: October 14th, 2013

December 16, 2013 Comment on this post [6] Posted in Newsletter
Sponsored By

I have a "whenever I get around to doing it" Newsletter of Wonderful Things. Why a newsletter? I dunno. It seems more personal somehow. Fight me.

You can view all the previous newsletters here. You can sign up here to the Newsletter of Wonderful Things or just wait and get them some weeks later on the blog, which hopefully you have subscribed to. If you're signed up via email, you'll get all the goodness FIRST. I also encourage you to subscribe to my blog. You can also have all my blog posts delivered via email if you like.

Here's the last Newsletter from  October.


Hi Interfriends,

Thanks again for signing up for this experiment. Here's some interesting things I've come upon this week. If you forwarded this (or if it was forwarded to you) a reminder: You can sign up at http://hanselman.com/newsletter and the archive of all previous Newsletters is here.

Remember, you get the newsletter here first. This one will be posted to the blog as an archive in a few weeks.

Scott Hanselman


Sponsor: Thanks to Aspose for sponsoring the blog feed this week! Aspose.Total for .NET has all the APIs you need to create, manipulate and convert Microsoft Office documents and a host of other file formats in your applications. Curious? Start a free trial today!

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

Penny Pinching in the Cloud: Automating everything with the Windows Azure Management Libraries and .NET

December 16, 2013 Comment on this post [10] Posted in Azure
Sponsored By

Even though I work for the Azure and ASP.NET team, I still pay for my own Azure account. Frankly, if I did get free cloud time not only would I likely abuse it, but I also wouldn't be using the cloud in the way it's meant to be used! From my perspective, a good cloud is a cheap cloud. I use CDNs, caching, and focus on a balance of cheap resources and compute that work for me when I need them, and are asleep (and not costing me money) when I don't.

There's things like auto-scale for websites, for example, based on either CPU or a schedule, but the one thing that gets me into trouble (sometimes) is leaving big virtual machines on. I manage most of my Azure assets from the command line, so I can just "azure vm list" to see what's running and I'll see this:

C:\Users\scottha                                                                                      
λ azure vm list
info: Executing command vm list
+ Getting virtual machines
data: Name Status Location DNS Name
data: -------------------- ------------------ -------- -------------------------------
data: VSinTheSky StoppedDeallocated West US vsinthesky.cloudapp.net
data: hanselmandiscourse StoppedDeallocated West US discourse.cloudapp.net
data: hanselmansendy ReadyRole West US sendy.cloudapp.net
data: hanselmanlinuxfarm StoppedDeallocated West US linuxfarm.cloudapp.net
data: hanselmanlinuxfarm-2 StoppedDeallocated West US linuxfarm.cloudapp.net
data: hanselmanlinuxfarm-3 StoppedDeallocated West US linuxfarm.cloudapp.net
data: hanselmanmysql ReadyRole West US mysql.cloudapp.net
info: vm list command OK

If I want to shut one down I can use the command line, the Azure Portal, or even manage VMs within Visual Studio itself:

Managing Azure within Visual Studio

But sometimes I have custom apps to manage Azure resources, perhaps WinForms or WPF apps, MSBuild Tasks, or I want to add cloud management to an existing process. I'll want to not just turn off VMs, but also manage WebSites, create resources, upload things to storage and more.

I just learned from Brady Gaster that there's now Windows Azure Management Libraries for .NET as part of the Azure SDK. Basically this means that you can call the same backend REST APIs that the Azure Portal calls now, except now with a simple wrapper around them that makes it rather a bit easier in .NET.

Brady has a lot of info on his blog about this libraries. Here's some of the best highlights:

  • Supports Portable Class Libraries (PCL)
  • Ships as a set of focused NuGet packages with minimal dependencies to simplify versioning
  • Supports async/await-based task asynchrony (with easy synchronous overloads)
  • Has a shared infrastructure for common error handling, tracing, configuration, and HTTP pipeline manipulation
  • Is factored for easy testability and mocking
  • Is built on top of popular libraries such as HttpClient and Json.NET
  • Is all open source and on GitHub.

They are on NuGet as a group of packages but you can get them separately if you want to just manage VMs, for example. Here's the version I'm using from NuGet. Note it's prerelease as of the date of this writing. https://www.nuget.org/packages/Microsoft.WindowsAzure.Management.Libraries 

png

Azure authentication and authorization is based on X509 Certificates, so you'll use those to initially talk to your Azure instance. You can download your certificates from an authenticated session here and your certificates and subscription id are inside.

I can list out, for example, all my running websites in all their locations (web spaces):

using (var client = new WebSiteManagementClient(creds)) {
var spaces = client.WebSpaces.List();
foreach (var space in spaces) {
Console.WriteLine("Space: {0}", space.Name);

var sites = client.WebSpaces.ListWebSites(space.Name, new WebSiteListParameters{ PropertiesToInclude = { "Name" }});
foreach (var site in sites) {
Console.WriteLine(" " + site.Name);
}
}
}

This little app gives me this output:

Space: eastuswebspace
SmallestDotNet
Space: northcentraluswebspace
Hanselminutes
Space: northeuropewebspace
Space: westuswebspace
babysmash
nerddinnerofficial
ratchetandthegeek
speakinghacks
thisdeveloperslife
hanselmanlyncrelay
HanselmanGhost
anglebrackets
lostphonescreen
loggingtest
GetInvolved
keysleft

I can go and update sites, disable (stop) them, make web farms, scale them, create, configure and generally do everything I can from the command line. Very slick. Now I can manage Azure stuff from PowerShell, from .NET, from node and the cross platform command line, Visual Studio, and the Azure Portal.

Go read all about Windows Azure Management Libraries on Brady's blog, get them on NuGet, or read the code and enter issues on GitHub.

if you link your MSDN and Azure accounts and you can get up to $150 a month in Azure credits, so up to two free VMs running all day for a month.

I've done a few posts on "Penny Pinching in the Cloud" that you may enjoy.

Also, I encourage you to check out Azure Friday, a new show I'm doing at http://friday.azure.com. Azure Friday also on iTunes as a downloadable podcast in HD!


Sponsor: Thanks to Aspose for sponsoring the blog feed this week! Aspose.Total for .NET has all the APIs you need to create, manipulate and convert Microsoft Office documents and a host of other file formats in your applications. Curious? Start a free trial today!

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

Three all new Windows 8.1 video tutorials - what's new in 8.1, keyboard shortcuts, and managing windows

December 08, 2013 Comment on this post [32] Posted in Screencasts | Win8
Sponsored By

I'm really happy with the response from my "Windows 8 moved my cheese" YouTube Tutorial. It's helped thousands of people lose their fear of the change that Windows 8 represents. I encourage you to check it out.

I decided to sit down today and create three more short tutorials that all address Windows 8.1. If you find them useful, please share them with your friends, family, and the people on Twitter and Facebook you call your friends. ;)

I've created a single link to a YouTube Playlist that you can share, or watch them below.

Here's the How to use Windows 8.1 YouTube Playlist.

What's new in Windows 8.1?

Using Windows 8 or 8.1 with a Keyboard

Effectively Managing Multiple Full Screen Windows Store Applicatons

The 25 min Windows 8 Missing Instruction Manual (VIDEO)


Sponsor: Big thanks to Red Gate for sponsoring the blog this week! Easy release management - Deploy your .NET apps, services and SQL Server databases in a single, repeatable process with Red Gate’s Deployment Manager. There’s a free Starter edition, so get started 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 bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Human Computer Interaction Diversity - 7 Devices that AREN'T a mouse and keyboard

December 01, 2013 Comment on this post [20] Posted in Reviews | Tools
Sponsored By
Mix it up a little...try interacting with your computer with something OTHER than a Mouse and Keyboard
 

One of the most wonderful and least appreciated things about computers is diversity of devices. You're probably interacting with your computer with a keyboard and mouse. But in the last few years, you may have added touch and, to a limited extent, voice.

The photo above is of my desk. Yes, it's messy. On it are the things I use to work with my computer. I use these nearly every day and at least every week or they wouldn't last on my desk.

They are:

and not pictured

I think we all should consider our workflows and consider what devices that aren't a keyboard and mouse that might be better suited for the tasks we perform every day.

Leap Motion

I initially gave this product a 10 for concept and a 0 for execution. I'll give it a 3 now...but it's getting better. It's still not well suited for gross motions, but for browsing and scrolling it's at least becoming useful. I keep it on all the time and since I haven't got a touchscreen on my desktop machine (yet) I use it for scrolling while reading and leaning back. It has huge potential and I'm impressed with how often the software updates itself.

I'm using the Touchless for Windows app. The concept is so promising...wave your hands and your computer reacts. I still don't suggest that the Leap Motion is a consumer quality device, but I do use it weekly and turn to its promise often.

LeapMotion Visualizer

Wacom Tablet

Tablets are the gold standard for interacting with Adobe products like Illustrator and Photoshop. I learned Photoshop on a Tablet many years ago and I still prefer using one today. The Wacom Bamboo also has touch support which is a bonus, although I use my Logitech N650 Touchpad as a trackpad as it's more sensitive (to touch).

If you're trying to draw or paint without a stylus like a Wacom, you're truly missing out. They are surprisingly affordable, too.

Wacom Applet

ShuttlePRO v2

My buddy at Channel 9 Larry Larsen turned me on to the ShuttlePRO for video editing. I don't know what I did without it. It's got program-sensitive programmable keys. That means their function changes depending on what's running. I can mark a key as "Split" or "Play" but the ShuttlePro software will automatically use the right hotkey depending on if I'm using Audition or Premiere. Some nice gent even made settings for Camtasia Studio and the ShuttlePro v2. If you do screencasts or video editing like I do, a shuttle is a must.

ShuttlePro Config

Logitech TouchPad

You can get a Logitech T650 Touchpad for less then $35 if you look around. It's a large, gorgeous class touch area that's also wireless. If you have Logitech products already you can use the Unifying Receiver you may already have. I have as USB hub and it works just fine.

I use it to two-finger scroll, pinch to zoom, and all the things that MacBook touchpad folks take for granted. You can also use it with Windows 8 to "swipe in" and task switch. I move between my mouse and this touch pad to reduce repetition and wrist strain with the mouse, but also sometimes just because I'm in the mood. It's a great Trackpad/Touchpad that can ease the transition if you have trouble moving from a laptop and a desktop.

Logitech Touchpad

Great Webcam and Speaker Phone

I adore the Logitech BCC950 Conference Cam so much that I've written software to remotely control its motorized Pan-Tilt-Zoom functionality and use it as an Auto Answer Kiosk. Not only is it a great web cam that I use every day, but it's also a fantastic speaker phone for conferences. It shows up as just another audio device that you can set as the default for communication but not your default speaker. This means Lync and Skype calls come from this device, but your regular computer audio doesn't. Sound quality is killer, confirmed by everyone I've talked to with it.

image

Aside: There's so much untapped usefulness in just a webcam but most programs just don't use it. Have you seen the Windows 8 "Food and Drink" app? You likely already have this app. It has a Hands-Free mode for cooking. You know when you're using a tablet to show a recipe? It uses just the data from your webcam to see your hand wave to move to the next page. Very cool.

Kinect for Windows

The Kinect SDK was updated last year with support for "Near Mode" which is basically "sitting at your desk mode." This update made programming to the Kinect for Windows a LOT more useful for the desktop. Writing apps is fairly easy, like this example where you can control PowerPoint with your hands. With apps like KinEmote you can use the Kinect to control your XBMC media installation and lots more.

Another little known fact is that the Kinect on a PC has a very nice quality Array Microphone that can also be used for things like Windows Speech Recognition or Dragon Naturally Speaking.

Me on Kinect

There's such a huge diversity of ways to interact with computers and it's truly just starting. In my lifetime I'm sure computers will be able to detect (guess) if I'm sad or happy, notice my health status, great me when I walk up, and so much more.

What  devices do YOU have plugged into your computer right now?


Sponsor: Big thanks to Red Gate for sponsoring the blog this week! Easy release management - Deploy your .NET apps, services and SQL Server databases in a single, repeatable process with Red Gate’s Deployment Manager. There’s a free Starter edition, so get started now!

Disclaimer: My Amazon links are affiliate links and that the resulting few bucks buys me gadgets and tacos. Mostly tacos.

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

Introducing node.js Tools for Visual Studio

November 21, 2013 Comment on this post [93] Posted in nodejs | Open Source | VS2013
Sponsored By
node.js and Express running in VS

Just when you thought it couldn't be crazier in Redmond, today they are introducing node.js Tools for Visual Studio!

NTVS runs inside VS2012 or VS2013. Some node.js enthusiasts had forked PTVS and begun some spikes of node tools for VS. At the same time the PTVS team was also working on node.js integration, so they all joined forces and made NTVS a community project. NTVS was developed by the same team that brought you PTVS with help from friends like Bart Read from Red Gate (he did the npm GUI), and Dmitry Tretyakov from Clickberry for several debugger fixes & features.

NTVS is open source from the start, and has taken contributions from the very start. It supports Editing, Intellisense, Profiling, npm, Debugging both locally and remotely (while running the server on Windows/MacOS/Linux), as well publishing to Azure Web Sites and Cloud Service.

It's actually pretty freaking amazing how they did it, so I encourage you to download it and give it a try because some of the stuff (even given this is an alpha) is very very clever.

Blank Express Application

Node.js Tools for Visual Studio takes advantage of V8 Profiling API's as well Visual Studio's Reporting features to give you a sense of where your program is spending its time.

NOTE: See that File | New Project dialog up there? Visual Studio organizes things by language, so node.js is under JavaScript. But you've also got Python and Django, iOS and Android via C#, TypeScript, VB, F#, all in Visual Studio.

One of the things that's impressed me about the way they integrated node.js into Visual Studio was that they didn't try to recreate or re-do things that already worked well. It's node, it runs node.exe, it uses the V8 debugger, it uses the V8 profiler because that's what people use. Duh. But, for example, NTVS can take the output from the V8 profiler and display it using the Visual Studio Profiler Reporting Tools. No need to reinvent the wheel, just use the right tool for the job.

Hacking on the Ghost blogging engine with node.js for Visual Studio

Let's look at an example.

From within Visual Studio, go File New Project, click JavaScript, then "From Existing Node.js code."

From Existing node.js Code

Point NTVS to your Ghost folder.

Create from Existing Code

Then tell node.js for VS that the startup file is index.js, hit Next, save the project file and Finish.

Create New Project from Existing Code

At this point, you've got Ghost inside VS.

Random: that since I have Web Essentials I also get a nice split-screen markdown editor as well.

From here, just hit F5 to Debug, or Ctrl-F5 to start without Debugging. Also notice the properties of the Project in the lower right corner there showing the node path and port as well as the Startup File. You can change these, of course.

Ghost inside Visual Studio with NTVS

Here's me running Ghost locally. You can see the path to node, the ghost.js file and my browser.

Running Ghost in VS with node for VS

You'll get good intellisense for completions and help for method signatures.

Intellisense example

Debugging

Node.js Tools for Visual Studio includes complete support for debugging node apps. This includes support for Stepping, Breakpoints, "Break on exception", as well as Locals, Watch, Immediate and Call Stack tool windows.

You can manage Exceptions just like any other language service. See in the dialog below node.js exceptions are listed along with other exceptions in managed and unmanaged code.

Managing Exceptions in node.js for Visual Studio

The debugging still happens like it always has, with the node V8 debugger, except Visual Studio connects to the debugger over another socket (remember, you can even debug node.js remotely running on a Linux or Mac like this!) and translates how V8 thinks into how Visual Studio thinks about debugging. The experience is seamless.

See in this screenshot, you can see node.exe is being debugged, I'm running Ghost. You can see my Call Stack, and the Locals in the Watch Window. I can inspect variables, step around and do everything you'd want to do when debugging a Web App.

Debugging Session of Ghost in VS with Node Tools for Visual Studio

npmVisual Studio

The npm experience is pretty cool as well. Node.js for Visual Studio is always watching the file system so are more than welcome to run npm from the command line or from within the node immediate window and Visual Studio will see the changes.

You can also use the npm Package Management dialog and search the repository and install packages graphically. It's up to you.

npm package management within VS

Here's a package installing...

Installing a module

The physical node_modules and how modules are handled is pure node...VS doesn't touch it or care. However, the Solution Explorer in Visual Studio also presents a logical view on top of the physical view.

image

NOTE: I really like this. I think it has potential and I'd even like to see references in .NET treated like this. The physical and the logical, along with a dependency tree showing NuGet packages. It helped me understand the project much better.

There's lots more. There's an REPL interactive window, and you can just publish like any other web project using the same Publish Wizard that ASP.NET projects use. You can publish node.js apps directly to Azure as well, either with Git or with Visual Studio publishing.

You can also remotely debug node instances running on other machines by starting node with the included Remote Debugging Proxy.

image

node.exe RemoteDebug.js -machineport 5860 script.js

As mentioned, you can do remote debugging between Visual Studio and node running on any server OS.

Conclusion

I'm personally pretty happy with the way that Visual Studio is turning (in a short amount of time, seems to me) into quite the competent language and environment factory.

Node.js Tools for Visual Studio is entirely open source under the Apache license and they welcome contributions and bug reports. It's Alpha and it's early but it's awesome. Go get it. Big congrats to all involved!


Sponsor: Thanks to Red Gate for sponsoring the feed this week! Easy release management: Deploy your .NET apps, services and SQL Server databases in a single, repeatable process with Red Gate’s Deployment Manager. There’s a free Starter edition, so get started now!

Disclosure: FYI, Red Gate does advertise on this blog, but it was a total coincidence that a Red Gate employee helped with node.js Tools for VS. I just found that out today. They are very nice people.

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.