Development

This category is for all things relating to scripting or programming languages, as well as software construction, design and development.

Interactive showdown: csi.exe verses fsi.exe

Visual Studio 2015 Update 1 brings with it a nice little utility called C# Interactive which you can access from the View menu, but we’re going to have a look at the command line version which you can run from the Developer Command Prompt for VS2015.

Using this tool you can quickly run C# using a REPL environment – which is a fast and convenient way to explorer APIs, frameworks, and script existing code from .NET assemblies in a non-compiled way.

While this is new to Visual Studio and C#, we have enjoyed this functionality for a long time with F#.

(Technically this has been around for a while, but it’s officially shipping now!)

I decided to take a look at the new csi.exe application, and compare it to how I already use fsi.exe and see if it’s enough to make me switch my default command line tool.

C# Interactive

For me the most important way I’d use C# Interactive is via the command line, so it’s important to know what it’s capable of, even though you may not need to use the advanced features right away.

To find out the current version and get a list of the command line options in C# Interactive, just add the /? switch and read the output:

PS> csi /?
Microsoft (R) Visual C# Interactive Compiler version 1.2.0.51106
Copyright (C) Microsoft Corporation. All rights reserved.

Usage: csi [option] ... [script-file.csx] [script-argument] ...

Options

/help Display this usage message (alternative form: /?)
/i Drop to REPL after executing the specified script.
/r:<file> Reference metadata from the specified assembly file (alternative form: /reference)
/r:<file list> Reference metadata from the specified assembly files (alternative form: /reference)
/lib:<path list> List of directories where to look for libraries specified by #r directive. (alternative forms: /libPath /libPaths)
/u:<namespace> Define global namespace using (alternative forms: /using, /usings, /import, /imports)
@<file> Read response file for more options
-- Indicates that the remaining arguments should not be treated as options.

Form a first look, I can see that csi.exe has all of the command line options I really want in normal use – I especially find /i to be useful – but we’ll come to that shortly.

F# Interactive

F# Interactive has been around for a lot longer, and is built on different technology under the hood – so there are a more options going on here, but we can take a look by providing a similar -? switch:

PS> fsi -?
Microsoft (R) F# Interactive version 14.0.23413.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

Usage: fsi.exe <options> [script.fsx [<arguments>]]...

Input Files

--use:<file> Use the given file on startup as initial input
--load:<file> #load the given file on startup
--reference:<file> Reference an assembly (Short form: -r)
-- ... Treat remaining arguments as command line arguments, accessed using fsi.CommandLineArgs

Code Generation

--debug[+|-] Emit debug information (Short form: -g)
--debug:{full|pdbonly} Specify debugging type: full, pdbonly. ('full' is the default and enables attaching a debugger to a running program).
--optimize[+|-] Enable optimizations (Short form: -O)
--tailcalls[+|-] Enable or disable tailcalls
--crossoptimize[+|-] Enable or disable cross-module optimizations

Errors and Warnings

--warnaserror[+|-] Report all warnings as errors
--warnaserror[+|-]:<warn;...> Report specific warnings as errors
--warn:<n> Set a warning level (0-5)
--nowarn:<warn;...> Disable specific warning messages
--warnon:<warn;...> Enable specific warnings that may be off by default
--consolecolors[+|-] Output warning and error messages in color

Language

--checked[+|-]Generate overflow checks

--define:<string> Define conditional compilation symbols (Short form: -d)
--mlcompatibility Ignore ML compatibility warnings

Miscellaneous

--nologo Suppress compiler copyright message
--help Display this usage message (Short form: -?)

Advanced

--codepage:<n> Specify the codepage used to read source files
--utf8output Output messages in UTF-8 encoding
--fullpaths Output messages with fully qualified paths
--lib:<dir;...> Specify a directory for the include path which is used to resolve source files and assemblies (Short form: -I)
--noframework Do not reference the default CLI assemblies by default
--exec Exit fsi after loading the files or running the .fsx script given on the command line
--gui[+|-] Execute interactions on a Windows Forms event loop (on by default)
--quiet Suppress fsi writing to stdout
--readline[+|-] Support TAB completion in console (on by default)
--quotations-debug[+|-] Emit debug information in quotations
--shadowcopyreferences[+|-] Prevents references from being locked by the F# Interactive process

As you can see there’s a lot more options for F#, but many of them are not needed for every day use.

Quick Interactive Use

It’s fairly common that I use F# Interactive just to test out how part of the Framework behaves.

In this instance, I’ll use HttpUtility.HtmlEncode method to see see what output I get when one of my emoticons is encoded into HTML-friendly characters.

PS> fsi

Microsoft (R) F# Interactive version 14.0.23413.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> open System.Web;;
> let encode s = HttpUtility.HtmlEncode(s);;

val encode : s:string -> string

> encode "<(>_<)>";;
val it : string = "&lt;(&gt;_&lt;)&gt;"
>

This is how I’d do it in F# – we could call the HtmlEncode function directly, but creating functions is so easy with F# that we might as well shorten the name to make it nice and easy if we need to run it multiple times.

The function encode actually returns a string rather than printing it to the screen, but F# is setting that output to a special value called it – a special identifier which is used for displaying the value of the last expression on the screen. It’s handy, and you’ll see why.

Alright so here’s my first attempt to do something similar in C# Interactive.

PS> csi
Microsoft (R) Visual C# Interactive Compiler version 1.1.0.51109
Copyright (C) Microsoft Corporation. All rights reserved.

Type "#help" for more information.
> using System.Web;
> HttpUtility.HtmlEncode("<(>_<)>");
(1,1): error CS0103: The name 'HttpUtility' does not exist in the current context
>

Ah. HttpUtility is missing because it hasn’t loaded the clases from the System.Web.dll assembly. I didn’t notice on the first line becuase of the way namespaces work – the namespace exists, but not the class we want. No problem, we just reference it using #r – you reference assemblies this way in F# too!

> #r "System.Web"
> HttpUtility.HtmlEncode("<(>_<)>");
>

This worked and we have access to the static HttpUtility class and the HtmlEncode method – however the output has not been displayed to the screen because C# Interactive doesn’t have that the specal it value F# had.

I didn’t realise this at first but in the absense of the it value F# has, the C# Interactive prompt introduces a slightly different syntax for when you want to see the value.

> HttpUtility.HtmlEncode("<(>_<)>");
> HttpUtility.HtmlEncode("<(>_<)>")
"&lt;(&gt;_&lt;)&gt;"
>

Notice the difference a semicolon makes? This is important, and something I missed when first trying out C# Interactive. Avoiding the semicolon would normally result in invalid C#, but this is a great way to view the output as if you’re typing it into the Immediate Window in Visual Studio.

Let’s also create a function using normal C# syntax so that we don’t have so much typing to do. Notice that I’m going to call this function without the semicolon so that I can see the output.

> string encode(string s) { return HttpUtility.HtmlEncode(s); }
> encode("<(>_<)>")
"&lt;(&gt;_&lt;)&gt;"
>

Loading Scripts

Let’s keep things simple, we’ll take the functions we just created in each langauge, and create a script file so that they can be loaded up when we start an interactive session.

First of all, let’s do it with F#. Here’s the content of encode.fsx:

open System.Web
 
let encode s =
    HttpUtility.HtmlEncode(s)

And then we can run it from the command line using the --use switch. This will drop us into an interactive prompt after the code file has been loaded.

PS> fsi --use:.\encode.fsx

Microsoft (R) F# Interactive version 14.0.23413.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

>
val encode : s:string -> string

> encode "<(>_<)>";;
val it : string = "&lt;(&gt;_&lt;)&gt;"
> encode "<(^o^)>";;
val it : string = "&lt;(^o^)&gt;"
> encode "<(T_T)>";;
val it : string = "&lt;(T_T)&gt;"
>

Not bad at all. So let’s do the same thing with the C# interactive, using a file called encode.csx:

#r "System.Web"
using System.Web;
 
string encode(string s)
{
    return HttpUtility.HtmlEncode(s);
}

I love that they used a similar extension! And again, we can run the code file and then get an interactive prompt as above using the /i switch.

PS> csi /i .\encode.csx
> encode("<(>_<)>");
&lt;(&gt;_&lt;)&gt;
> encode("<(^o^)>");
&lt;(^o^)&gt;
> encode("<(T_T)>");
&lt;(T_T)&gt;
>

We have the same end result, though like before the actual functions behave slightly differently. C# Interactive gives a cleaner output here, though you can always clean up the F# Interactive prompt a little bit by using the --nologo switch.

Use Inside PowerShell

Because I want to get access to both of these utilities as fast as possible, I have added a few lines to my PowerShell profile which will ease their use.

I’ve mentioned doing this kind of thing before – and I highly that developers using Windows spend a good amount of time learning PowerShell – but here’s a little snippet that may be useful.

$PROGFILES32 = "C:\Program Files (x86)\"
 
# create an alias to the full path of the executable
Set-Alias fsi "$PROGFILES32\Microsoft SDKs\F#\4.0\Framework\v4.0\fsi.exe"
Set-Alias csi "$PROGFILES32\MSBuild\14.0\Bin\amd64\csi.exe"
 
# add helpers which include common switches
function fsu ($fsx) { fsi --nologo --use:$fsx }
function csu ($csx) { csi /i $csx }

Adding this to my profile means I can just run them using fsu encode.fsx or csu encode.csx respectively. Very easy.

Windows Server 2016 for Developers

Windows Server

It’s not often I get excited about new versions of Windows Server. It has been a long time since I have professionally managed any servers or worked in any kind of IT environment. It’s also been a long time since I’ve had my own personal servers at home. At one point, I had five Windows Server 2003 boxes in an Active Directory domain!

As a developer, many of the changes coming in Windows Server 2016 have got me excited.

The things I care most about are servers which power cloud applications, and not the traditional view of a back office server for files and printers – something Windows has traditionally been associated with since the 1990s.

With this in mind, here are the top three technologies I am most interested in as a software development engineer and a solution architect.

1. Nested Virtualisation

Nested Virtualisation

Virtualisation has always been something I have been keen on, and Microsoft’s main platform for this is Hyper-V, a powerful server-based virtualisation platform which works on the client, server, and cloud.

Because Hyper-V uses a hypervisor to directly access virtualisation-enabled hardware, there has always been a limitation stopping you from running hypervisor based virtualisation inside a machine which is already virtualised. With the latest version of Hyper-V shipping with Windows Server 2016 (and Windows 10) you can actually nest these hypervisors inside each other – essentially letting you run a virtual machine inside a virtual machine.

I use a virtual machine hosted on Azure as a developer platform, so the ability to use virtualisation technologies (including Windows and Android emulators) inside of that virtual machine would be very handy. At the moment I have to run these tools locally on my physical hardware.

Currently, virtual machines need to be manually tweaked to enable the nested virtualisation – so we’re not quite at the stage where it is completely seamless, but being able to run a Windows 10 Mobile emulator inside of a Windows 10 desktop virtual machine running inside of Windows Server doesn’t seem too far fetched.

2. Containers

Windows Containers

Container technology is similar to virtualisation, but rather than having the overhead of virtualising the whole machine, applications can be sandboxed into their own execution environment while continuing to share system resources, like the file system.

This means these sandboxed applications can be started much faster and the overheads are smaller, allowing much higher density.

Windows Server 2016 brings container technology to Windows applications and also allows an extra level of separation by offering Hyper-V containers as well.

You can see why nested virtualisation is important.

Containers aren’t new, Linux has had support for containers for a while now, and the recent popularity of Docker has made this technology a fantastic option for developers to design their applications to work inside these containers, and then share them on Docker Hub.

Microsoft recently announced a partnership with Docker and you can find plenty of material from the folks in Redmond showing how the Docker tools work with Windows containers. It’s important that Microsoft get this right, as they don’t want to miss out on this important change in the way developers build and ship solutions.

With the ability to have a full VM separation running in Hyper-V containers, it’s quite possible that Linux could run on top of the Windows Server container system. A single management interface to run mixed containers? Sign me up.

For this to really take off, developers would need to be able to do this on their own machines. Right now Docker on Windows is a pain if you use Hyper-V as it’s incompatible with the current version of the Docker Toolbox. Microsoft have to be trying to fix this with their partnership and it’s likely ‘Barcelona‘ is part of this.

Windows is most certainly my platform of choice for the desktop, but I want the applications I create to be cross platform. Being able to create Linux containers using the same management tools as Windows containers is a must.

3. Nano Server

Nano Server

When trying to increase the density if your containers, you want your operating system to be as compact as possible. Windows Server has always been quite a bit larger than Linux when used in its smallest configuration.

Nano Server is a new, highly cut-down version of Windows specifically designed for virtualisation, containers, and cloud environments. Nano Server’s new reduced feature set is a minimum bar to which Windows containers can target – anything that runs on the Nano SKU can run on the Core SKU and above too. But this new minimum bar cuts out many features which are unnecessary, including any UI. If you want to do anything on Nano Server you need to use PowerShell or SSH. (PowerShell Direct is an awesome new feature which will ensure you can connect to a virtualised Nano Server even when it’s not connected to the TCP/IP network – very cool)

Out of the box, Microsoft claims that Nano Server will have over 90% smaller VHD footprint and 80% fewer reboots than the current Windows Server. That’s a big improvement for both Hyper-V hosts and guests.

Roles like IIS can be already be added to Nano Server and Microsoft’s Tools for Docker already helps you write ASP.NET, Node.js, or any other kind of application and directly target a Nano Server container. The tools are great for publishing, and remote debugging is supported, just as you’d expect.

Running a Nano Server in a Hyper-V container like this means the overhead on the developer’s machine is smaller, but it’s still running the real environment just as you’d get in production. Need a special version of a framework for a project? No problem – it’s a container running inside Nano Server which you can spin up as required. This makes me think that all three of these technologies born in Windows Server 2016 must be coming to Windows 10. You can’t expect a developer to run Windows Server 2016 on their Surface!

One Last Thing…

There is one part of this release which is bothering me.

Why call it Windows Server 2016?

I think the trend of having these year-based names must come to an end, It just doesn’t make sense anymore. I’d much rather see Microsoft brand the platform as Windows Server 10 or something similar. Think of how companies like Ubuntu brands their server versions: 14.04 LTS, 14.10, 15.04, 15.10 etc. (LTS stands for Long Term Support, something Microsoft is now doing for their Windows 10 Enterprise customers.)

Currently, Nano Server skips all of this branding in Microsoft’s documentation. I don’t know if that’s just because it’s in preview, but I hope it’s a sign of changes to come. Recently, Microsoft decided to drop year-based naming from their Dynamics AX ERP product, I think they should do this for Windows Server too.

For me, the details are important. In a world where Microsoft is finally embracing new thinking, I feel this year-based branding is a tradition that should let go.

Keep in mind it’s December 2015 and the current version of Windows Server is called “Windows Server 2012 R2 with Update” – seriously.

Windows Server 2016 is due to ship in late 2016.

Launch PowerShell with AutoHotkey

Sometimes nerds like me just need to open PowerShell as fast as possible.

This is very easy to achieve thanks to AutoHotkey – a very popular desktop automation application for Windows.

First install AutoHotkey from their website. Modern Windows machines just want the x64 + Unicode option when installing, if in doubt check their help documentation.

Once you’ve got it installed you need to create a new file for the script. For me, I created a new file called PowerShell.ahk in my scripts directory using gvim – but you can use your editor of choice and place it wherever you like.

Inside the file enter the following script:

#+p::
   Run, PowerShell
Return

The # is the symbol used for the Windows key, the + is the symbol used for shift, and the p stands for PowerShell. On then next line I’ve put Run, PowerShell and that’s it.

This means we are set up to run PowerShell when we press WIN + SHIFT + P.

Obviously you can do a lot more than just this, and for me starting PowerShell like that is not enough – I really dislike that blue background they use by default.

I have already set myself up with a nicely customised shortcut to PowerShell which I keep in my scripts folder and syncronise across machines. This includes the font and colour options I prefer.

#+p::
   Run, C:\Users\Julian\Scripts\PowerShell.lnk
Return

However you decided to script it, you just need to double click the PowerShell.ahk file when you’re done and AutoHotkey will register the combination for you.

There you have it! A super fast way to bring up a PowerShell prompt whenever you need it.

Microsoft Future Vision 2015 – Redux

Back in April I wrote about the latest ‘Future Vision’ video from Microsoft and I was very pleased to see this video come back onto my radar.

Dave Jones and Anton Andrews

Larry Larsen at Channel 9 posted an interview with Dave Jones and Anton Andrews – a couple of the guys who worked on creating this fantastic (yet realistic) vision of the future.

Dave and Anton give us some context on the decisions and thoughts behind the various ideas, including a few extra details about my favourite concepts – the flexible digital notebook and the wrist device.

Future Vision

It’s well worth watching if you are interested in these forward looking concepts, but make sure you watch the Future Vision video first!

Something I had missed when watching the original video was the idea that the system itself had noticed Kat had gone into a flow state. The suggestion here is that the various devices would work together, taking sensor information like heart rate and galvanic skin response, to automatically switch into this mode.

Automatic Mode Switching

The system would then automatically block out any unwanted distractions like notifications and set her communication status to do not disturb.

A nice touch is that the earpiece also switches to red to show other human beings. Very cool.

In The Flow State

As a software architect and technology enthusiast I find myself bombarded with huge amounts of information – communication requests, push notifications, reminders, and much more.

Getting myself into the flow state is hard enough (music helps) but keeping it can be even more difficult. The idea of having the system automatically sense this and move things into a ‘do not disturb’ state is very attractive.

An important part of these Future Vision videos is that they are realistic, and all of this could be done today:

  • Notice high amounts of use in productivity apps (Office, Visual Studio)
  • Sense physical changes in the user (Band)
  • Set ‘Quiet Hours’ for notifications (Windows)
  • Change status to ‘Do Not Disturb’ (Skype)
  • Handle exceptions that can break through (Cortana)

Microsoft controls each one of those components, but the fact is that the most futuristic part of these videos is not the hardware or the software – it’s the integration.

Considering Microsoft reaffirmation as the productivity company, it’s probably something they should try to integrate in order to achieve their goal.

Being productive on Windows 10

I thought I’d write down some of my thoughts on how I’m productive on Windows 10 now that it has been out for a little while and all of my machines have been updated.

Including my phone and 7 inch tablet, I run Windows 10 on four machines:

The following discussion is only about the first two, which are both configured to be general purpose devices used for all sorts of tasks, including development and productivity. I’ll write about the phone and tablet another time.

Windows 10 Desktop

With Windows 10 the desktop is back on the PC and, as usual with my computers, there are no icons in sight. I use my desktop for temporary things, not as a place to keep anything for any extended amount of time. If I’m downloading a file to run it through a comparison tool or something like that, my desktop is fine.

I’m still using teal as the main colour for the user interface. I have used this on my workstations for a number of years now and, with Windows 10, the colour configuration is better than ever. You can choose to have it just as a highlight colour on top of black or have variations of the colour used throughout the Start Menu and Action Centre UI. I prefer the latter with this colour choice.

I feel like teal has worked really well for me, it’s fairly conservative and seems to fit into multiple uses really well:

  • It is not too bright, and offers good contrast with both black and white
  • It works well in both cool or warm lighting environments
  • It doesn’t become too saturated when used with high F.lux settings

For my Surface, I have selected a nice ultra-wide space wallpaper which fits nicely with the colours I choose. This has been a real favourite of mine since I first started using it, but I am unsure who the original artist is. I’d love to give them credit.

Windows 10 Taskbar

I have no applications pinned on my taskbar so I get a really clean environment when I have nothing open. I launch all of my applications from the Start Menu or PowerShell.

I’ve loved using live tiles since they were first introduced on the phone. I enjoy the benefits you get from the glanceable information and I find the grid based organisational structure is way more useful than just a menu. My initial thoughts were that having the Start Menu in the corner may not be as good as having it full screen like on Windows 8, but I quickly changed my mind as soon as I started using it on the insider previews.

Right now, I have grouped the tiles into four main sections with the bottom right configured slightly differently depending on which machine I’m using.

Windows 10 Start Menu

My current setup of tiles and most used applications is pretty much a snapshot in time though – I don’t feel like I have had enough time to really know what I want to have pinned here. At the moment I’m enjoying having a mixture of glancable information (Weather, Calendar, etc.) unread content counts (NextGen Reader, Mail, etc.) and launcher icons (Edge, Store, etc.).

I’m certain this will change quite a lot with use.

Windows 10 Cortana

Cortana has been a very welcome addition to the PC. I’ve been using Cortana on my phone since the original previe, and she’s very much a part of my computer use now. She has had numerous improvements over her first iteration and now that she’s available through all my personal Windows devices, using her for things like reminders and glanceable information has been easier than ever.

I use her on my Surface quite a bit, though I do sometimes have trouble with her listening to me when I say ‘Hey Cortana’, so I usually just press WIN + C to activate her, then she has no trouble understanding my requests.

All of my requests are typed when I use the Virtual Machine. Typing requests is as easy as pressing the Windows key. I find typing to be just as natural as speech, and really fast when I’m using a desktop keyboard. I also tend to use the VM when I’m in locations where speaking wouldn’t be very useful anyway.

I have had issues with using the location-based features on the VM, but I worked around it using a Fake GPS driver.

The Task View is a another new addition to the Windows task bar, and even though I regularly use the key combination WIN + TAB to activate it, I still like to have the icon on the task bar anyway. This screen also includes the ability to add a number of virtual desktops. Surprisingly, I don’t use virtual desktops as much as I thought I would – but I am really glad they there when I do use them.

I originally thought I would always split things out every time I used the computer. For example, I thought that all my communications apps would always be in one desktop and development apps would belong in another. It just didn’t really happen that way. As I was regularly switching between them, I quickly got confused when I had more than a few apps open.

Virtual desktops become useful for me when I really want to concentrate on one or two different activities. I move their windows around on the Task View and put them into their own desktop to get a distraction fee environment when I need it. Ad hoc desktops to help me focus have been much more useful than trying to set rules for myself.

CTRL + WIN + LEFT and CTRL + WIN + RIGHT are used to switch back and forth between desktops. (I’d like to see better support for this with a three finger swipe on the trackpad please Microsoft!)

Windows 10 Notification Area

The Notification Area has been shuffled around a bit in Windows 10. The keyboard icon is now integrated and right next to the clock, and there’s now an additional new notification icon for the Action Centre.

I only show the very minimum of icons here – Process Explorer, Power, Network, Sound. I often use a FuzzyClock application to change how the time is displayed down here too. I am not a fan of using the notification area as a place to minimize windows, or launch applications.

Process Explorer is Microsoft’s ultra-nerdy replacement for the Task Manager and something I always use on my Windows machines. I find it to be way more detailed than the built in version and it includes many features developers find useful. As you can see from the screenshot, you also get a glanceable indicator of CPU usage here too. I find that CPU usage is often the most important metric for how the machine is doing, as I don’t really care how much RAM is being used unless I am having problems with something. If I do have problem, full access to everything running on the machine is just a click away.

Windows 1`0 Action Centre

Action Centre is a welcome addition to Windows on the PC, and something I’m already well used to using, thanks to Windows Phone. The version that ships today is not perfect though. Over time I’d like to see better notification sync with the phone. I also find that the having a solid icon isn’t enough to really draw attraction to the fact there is a new notification pending. I’d like to see options here for flashing or some other more substantial indicator, though I have to admit, I probably wouldn’t want it to be like that all time.

In fact, when I’m trying to be super productive, I turn on Quiet Hours. I use this in combination with the Quite Hours feature on my phone to ensure I don’t get annoyed with notifications when I don’t need them. But they’re still a click away.

The utilities I have mentioned above, like FuzzyClock and Process Explorer, are tiny portable executables and don’t require some system-changing installation mechanism. All these small applications I use are stored in a Scripts folder I have been maintaining for years.

This folder lives in my profile under C:\Users\Julian\Scripts and is synchronised to a private Git repository hosted on Visual Studio Online. Inside there are a number of scripts to run automated tasks and setup my PowerShell profile to be exactly the same across machines. In addition to these scripts, there’s a Tools folder which contains all of these small utility applications as well as some larger applications which have been modified to work in a ‘portable’ way.

windows-10-powershell

I spend a lot of my time in PowerShell and this folder is absolutely fundamental to how I complete many tasks on my Windows machines including, but not limited to:

  • Scripting languages and runtimes – Ruby, Python, IKVM
  • Text editors and UNIX utilities- Vim, grep, wget, curl
  • Windows Tools – Process Explorer, Autoruns
  • General Utilities – FileZilla, Far, WinMerge, Putty
  • Plus years of PowerShell and F# scripts, registry files and more

I could probably go into more detail around this in the future. If you are interested, let me know in the comments.

Not everything is installed this way though. Some of the biggest applications I use require installation from the web through subscriptions, like Office 365 and MSDN:

  • Outlook, OneNote, Visio and the rest of Office (from Office 365)
  • Visual Studio Enterprise (from MSDN)
  • Visual Studio Code, Node and Git (free)
  • Wunderlist, Slack and Skype (free)
  • 7-Zip, F.lux, Paint.NET (free)

And finally, there are a number of applications which either are preinstalled on Windows or I have to install from the Windows Store. The ones I use the most are:

  • Groove Music, Film & TV, Photos and other entertainment apps
  • MSN apps like Weather and Sports
  • Audible, Netflix
  • NextGen Reader

Applications installed through the Windows Store are super painless. I wish more applications could be installed this way. I’d like to see more parity with the phone too, and I’m sure that’ll be coming when Windows 10 Mobile ships at the end of the year.

Overall, I feel like I’m more productive on Windows 10 than I have been on any other operating system. I feel like things are only getting better in general – with things like SSH and containers coming soon, the future is pretty bright for Windows 10.

Using Cortana with a fake GPS driver on Windows 10

I’ve mentioned before that I like to offload some of my development and productivity tasks to Virtual Machines running on Microsoft Azure. On these machines I like to run Visual Studio, Office and any other apps I need so I can be productive anywhere.

One of the apps that helps me be productive is Cortana, so I was pleased to get her up and running on my Windows 10 VM.

Cortana can helpfully give you reminders and recommendations based on location, but can you guess what the problem is when using Cortana on a VM in Azure?

Location in Redmond

The location services think I am currently located in Redmond, Washington. Oh dear.

The cross devices functionality of Cortana gets very confused because of this. When I’m using my phone she thinks I’m in Leeds, but if I switch to using the VM she thinks I have suddenly appeared in the United States.

I had a think about how best to approach this issue, and currently I’m trying out a solution which seems to work well: using a homemade Fake GPS driver.

FakeGPS Sensor Driver

I went through the code in the Windows DDK and found an example for creating a GPS driver. Rather than getting the data from a real hardware devices, I hard coded the latitude and longitude. Once I had it set up in exactly the way I wanted, it was just a matter of compiling the C++ for Windows 10 and getting it installed.

Location in Leeds

Now this Fake GPS driver simply returns the geolocation coordinates which I want, and Cortana thinks that I’m in Leeds. Sorted!

This isn’t a perfect solution. For example you have to switch your OS to run in Test Mode, and obviously the location doesn’t automatically change depending on where you are. However my initial use shows me it’s way more useful than just letting the OS guess the location from the IP address.

Cortana on Windows 10

If people are interested in trying out this solution for themselves, I’ll share the code on GitHub. It shouldn’t be too tricky to add an interface to set the location as required.

Let me know in the comments.

Update

It’s on GitHub at https://github.com/juliankay/FakeGPS

Highlights from Build 2015

The Build 2015 conference has just taken place in San Francisco.

Like last year, this has been another huge event for Microsoft, and a big deal for the people who build solutions using their technologies.

There have been way more interesting things happening than I can possibly cover in one article, but I have decided to cover the three most important to me:

.NET, Windows and Azure.

An exciting future for .NET and Open Source

The future of .NET is the continued push to an open source .NET Core, which is at the centre of both the latest ASP.NET runtime and the Universal Windows app platform. In the future, this will expand and include other application types. In my opinion, they’ve picked the right place to start.

Applications running on the CoreCLR can be developed and deployed on cloud and server-based infrastructures running different operating systems including Windows, Linux and OS X. I have been watching the development efforts on GitHub for a while now, and I’ve set it up on my own machines running both Windows and Linux. It sure is a sight to see.

As well as the core runtime itself going open source, other technologies like Roslyn have enabled products that many wouldn’t have guessed would see the light of day. Having an open source compiler platform has enabled Visual Studio Code – a new cross platform text editor with Intellisense – to be built.

I was lucky enough to see Visual Studio Code before it was announced, and it changed the way I thought about collaboration with Mac users instantly. I’ll have more on this new text editor soon.

Visual Studio Code

With the RC of Visual Studio 2015 there have been some big improvements in the languages supported including both the more traditional C# and Visual Basic, and (my personal favourite) F#.

The Visual F# improvements in ‘every day’ activities are dramatic for anyone who has been using the language. This is all thanks to the new open source attitude, and the amazing community around F# who have helped to develop the Visual F# tools on GitHub.

This new world of cross-platform and open source .NET technology is going to enable some amazing scenarios for .NET developers like myself.

Windows 10’s application platform takes shape

The aforementioned Universal Windows app platform is really taking shape now. Gone are the days of very prescriptive (and maybe too forward-looking) design patterns of Windows 8, and in is the ‘do what’s right for your applications‘ model that has been working well for some for a while.

Universal Windows apps scale from the smallest phones and Internet of Things devices up to the large screens of the Xbox One and the Surface Hub. The most ‘universal’ of these apps are built with just one binary which includes a scalable UI. This allows you to even have the ‘desktop’ app experience when used on a landscape 5.7 inch phone, or when plugged into an external screen using an amazing new Continuum for Phones feature.

For app developers there are some interesting (and controversial) new ways for software venders to build for Windows. The biggest of which are the bridges from Android and iOS. These two are extremely important for the phone and work especially well for iOS games which don’t rely too heavily on the operating specific UI elements. Combined with the bridges for ‘classic windows’ apps and websites using Microsoft Edge, the Store should get a lot more apps on this Windows 10 wave of releases.

From a user’s view, Windows 10 has really rounded out, with the latest Insider Preview feeling a lot more polished than any of the previous builds. Seeing HoloLens run standard Windows Universal apps was a big deal too.

I’ll have more thoughts on these in the future as the Insider Preview continues, and more information for HoloLoens is released at E3.

Microsoft <3 Docker and other Azure improvements

Azure, and the Microsoft Cloud in general, continue to amaze me. Microsoft has managed to embrace this new way of building (and selling) software in at breakneck speed. Additional services were added throughout the platform all the way from storage and networking, to analytics and machine learning. Way too many for this article.

Two of the biggest highlights were the ability to run the complete Azure Stack locally, and Azure’s new Data Lake features too, something which Amazon has had a lot of success with.

Microsoft <3 Docker

For me though, the most interesting changes were around Docker support across Windows and Azure. Docker has been on my radar for a while, but I have yet to use it in production. I have plans to do so in the not too distant future.

Microsoft Future Vision 2015

I’ve always been inspired by the Microsoft ‘Future Vision’ videos which depict a not-too-distant vision of productivity. This year’s entry has not been a disappointment, with a number of interesting UI concepts explored.

The best thing to do is watch the video above to see them all, but I’ve picked four of my favourites below.

Augmented Reality + Tactile Controls

I’m not really what to call this, so I’m just going to call it a ‘holographic puck’. In this instance, a round hardware device can be rotated to make selections on a holographic UI which has been augmented over the top of Kat’s vision.

By mixing the feel of tactile controls with the holographic interfaces you can avoid the strange experience of ‘tapping thin air’ while still providing the users with the infinite possibilities of augmented reality.

Holographic puck

I really like this concept, and it’s not too unrealistic considering the holographic technology coming in Windows 10. Later in the video you see the same hardware device used to transfer the data collected in the first scene.

Flexible Digital Notebooks

Opening the flexible computer

My favourite concept from the whole video is shown when our hero attends a café. The tea selection is shown on this flexible display, and when Kat opens it all of her personal stuff is automatically available to her.

While I think the folding doesn’t look as amazing as it could be (give me a proper notebook style folding, please) – it is a great example of the kind of computers we will be using in the future, and something I really want.

Flexible computer

Being a massive notebook and stationery nerd, I really love the idea of having a flexible notebook computer like this. I hope it happens in the not-too-distant future. The Surface line of computers already has rich inking capability, so it’s only going to get better over time.

Wearable Computing Devices

Throughout the video only one computer looks like it belongs exclusively Kat. The screen on her wrist is probably the equivalent of the smartphone today, being a general purpose communication and computing device.

Wrist computer

This is quite a way off the current Microsoft Band, but the technology sector is certainly going this direction. My Band has already helped give me the motivation to be fitter and healthier, and while we don’t really see much in the way of health statistics in this video, it can certainly be inferred from the way things are going.

Large Table-like Displays

Large table

I also love this large table computer concept. When Kat needs to get some real work done, she just uses her wearable computer to hand off to a bigger computer in a shared workspace.

I’m sure this kind of keyboard-free interaction will be best suited to a world where voice interaction has been perfected. Though I’m sure a software keyboard could be provided. You can even see Kat use a Bluetooth headset (Bragi Dash?) to work with Cortana-like assistant in the top left of the UI.

Captivated by Her

When reading an article about how design is shaping the new Microsoft, I stumbled upon a video by Kat Holmes from last year.

In this video, Kat talks about how conversations power innovation and new experiences. She goes on to discuss how the movie Her both validated and shaped Microsoft’s thinking around their Cortana digital assistant.

Like Kat I have found the movie Her to have a fascinating look at the future of human and computer interaction, primarily through verbal communication and relationship building. While the movie certainly takes the relationship part of the equation to the extreme, I firmly believe that this kind of trust between digital agents and ourselves will eventually enable a new kind of human excellence.

her

Microsoft also collaborated with Vice’s Motherboard to produce a couple of short documentary videos titled Captivated by Her. They’re well worth watching if you’re interested in how human emotion inspires and shapes technology.

Holographic Computing is Coming

Microsoft HoloLens

A bit like something out of their Future Vision videos, Microsoft’s Windows Holographic software and HoloLens hardware look to enable many of the augmented reality dreams technologists like myself have been imagining for years.

Truly I’m excited about this platform, and I’m keen to try out the product as soon as I possibly can, but I still have a large amount of questions.

What happens if you put your hand ‘in front’ of a hologram?
If you have a virtual 80 inch TV screen – what resolution does it have?
Can you stream Xbox games to it?
How long does the battery last?
Can other people hear the audio from the speakers located on the side?
How hot is the air that comes out of the vents?
How well does it work with glasses?
Will there be a holographic version of PowerShell?

It may be a while until all our questions are answered, but until then I’m going to simply imagine the possibilities this new form of computing will bring. Check out the videos below and have a look at Microsoft’s website to get an idea of what’s coming.

As someone who is always trying to simplify and keep things minimalistic, I always question new technologies to decide if they’re really worth investing in. One part of my believes I already have enough computing devices, but another part yearns to try new technology and find new ways to interact with the digital world. The HoloLens definitely seems like something I’m going to want to experience.

Will it be a success? Only time will tell. But future versions of the hardware will no doubt be smaller, and have better field of view. One day this kind of thing will simply be built into a normal pair of glasses – but that’s a little way off.

More to come soon.