Scott Hanselman

Syncing Windows Live Writer Drafts to the Cloud (Dropbox) and other bug fixes

May 21, '15 Comments [17] Posted in Tools
Sponsored By

I still use Windows Live Writer (http://www.windowslivewriter.com) to post to this blog. It remains the best little blogging app out there. It has a nice plugin ecosystem, great WYSIWYG editor (using IE) even though it hasn't been updated since 2012. A bunch of us are working to get it open sourced, and I'll let you know the second I know something.

But for now, let me fix two things about Windows Live Writer that have been bugging me.

Clearing Cached Blog Themes

First, a small bug. My HTML Styles look like this, and have for a while. See how the background is black? Annoying. I always assumed it was a GDI or graphics bug. In exploring the Windows Live Writer code I learned a few things.

Windows Live Writer with black styles

It turns out that Windows Live Writer is trying to render your styles by using your download blog theme's CSS inside those little boxes! My blog (and others, I've heard) doesn't render nicely.

The downloaded them is stored in %AppData%\Windows Live Writer\blogtemplates and you can easily fix this annoyance by simply deleting the folders below blogtemplates.

Using the Default Windows Live Writer Theme

Ah, much nicer.

Syncing your Windows Live Writer Drafts with OneDrive or Dropbox

I've seen some blog posts with folks suggesting junction or reparse points (symbolic links) to hack together a way to "roam your draft blog posts" with Windows Live Writer. It's much easier than that, in fact. You can just set a registry key with your preferred Drafts folder. I put mine in my Dropbox, but you could also use OneDrive or Box. This means your local draft blog posts will "roam" to all your machines. If you're someone who works on a blog post for a few days you'll appreciate this new ability. You can start a post at work and finish it at home. Even the images will roam.

Head over to HKCU\SOFTWARE\Microsoft\Windows Live\Writer in your registry (via Regedit.exe) and make a new String Value called "Posts Directory."

image

Windows Live Writer will make new Drafts and Recent Posts folders in the location you specify. I set this registry key on all my machines that I have Dropbox installed and now all my blog post drafts are there too!

I hope this helps you out! And I'll be sure to let you know about our plans with Windows Live Writer as soon as I know more. ;)


Sponsor: Big thanks to Atalasoft for sponsoring the blog and feed this week! If your company works with documents, definitely check out Atalasoft's developer tools for web & mobile viewing, capture, and transformation. They've got free trials and a remarkable support team, too.

About Scott

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

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

Git-deployable F# based Web Applications in the Azure Cloud with WebSharper

May 19, '15 Comments [4] Posted in Azure | Open Source
Sponsored By

Web Apps with WebSharper and F#Last month after I wrote a small prototype to get the F# Suave.io web framework running on Azure Web Apps (a git deployed managed Platform as a Service) I started looking for more F# Azure resources.

Here's a list of some other existing F# programming technologies that are great with Azure. Did I miss any? I surely did. There's a huge list up at FSharp.org for resources running F# on any cloud.

  • Fog (an F# Azure data scripting API)
  • MBrace (a scalable distributed programming model for F#)
  • FSharp.Data (a set of F# type providers for common cloud data manipulation scenarios)
  • Suave (a simple web development F# library for lightweight microservices including route flow and task composition)
  • FSharp.CloudAgent - a simple framework to easily distribute workloads over the cloud using standard F# Agents as the processing mechanism. Support exists for both simple and reliable messaging via Azure Service Bus, and for both workers and actors.
  • AzureStorageTypeProvider - An F# Azure Type Provider which can be used to explore Blob, Table and Queue Azure Storage assets and easily apply CRUD operations on them
  • Try F# - A web programming console for F# that can be reoriented towards Azure programmability
  • HadoopFs - A lightweight F# implementation of the Hadoop Streaming API
  • FSharp.Azure - A wrapper over WindowsAzure.Store using idiomatic F#

There's also the WebSharper web framework. WebSharper isn't ASP.NET with F#, it's its own idiomatic thing. What's that really mean, "idiomatic?"

You know how when you Google Translate a sentence it doesn't quite work? I mean, it works, but it doesn't feel right. It doesn't feel right because the translator understands the words, and some phrases, but not the idioms - the underlying thoughts that are unique to that language. There was a time a few years back when folks were constantly looking for C# to VB convertors. This is something that's quite possible, almost line for line. However, changing an imperative language into a functional one is not like turning American English into British English. ;) Let functional languages be functional.

F# people like to do things their way and the language has very different goals and ideas than C# so it makes sense there would be a opinionated web framework for F#. I like it.

(Although I'm sure there will be a way to use ASP.NET 5 and MVC with F# in the future, this post isn't about that.)

WebSharper has a VS Extension so you can File New new projects, and here's a hello world ToDo List app (minus the HTML view, which you can see here)

namespace UINextApplication1

open WebSharper
open WebSharper.JavaScript
open WebSharper.JQuery
open WebSharper.UI.Next
open WebSharper.UI.Next.Notation

[<JavaScript>]
module Client =
type IndexTemplate = Templating.Template<"index.html">

let Tasks = ListModel.FromSeq ["Have breakfast"]

let Main =
JQuery.Of("#tasks").Empty().Ignore

let newName = Var.Create ""

IndexTemplate.Main.Doc(
ListContainer =
(ListModel.View Tasks |> Doc.Convert (fun name ->
IndexTemplate.ListItem.Doc(
Task = View.Const name,
Done = (fun e -> Tasks.Remove name)))
),
Task = newName,
Add = (fun e ->
Tasks.Add(newName.Value)
Var.Set newName "")
)
|> Doc.RunById "tasks"

More interesting is the recent blog post by Adam Granicz where he expands on my "Suave to Azure via GitHub" prototype and shows how to deploy a real F# WebShaprter app to Azure Websites via GitHub.

One of the main improvements is that my solution used FAKE and I found myself wanting a binary version of the FSharp compiler as  NuGet. An issue was open and closed within days, simplifying the deployment. Additionally their WebSharper solution creates an ASP.NET app that runs in the context of ASP.NET and IIS, while my Suave solution needed a separate process. WebSharper 3.1 was recently released, and you can see their sample running live in Azure here: http://websharper-clientserver.azurewebsites.net

And of course, you can deploy it to Azure right from here using the Deploy to Azure button!

Deploy to Azure

Do you dabble in F#, are you doing F# professionally? What do you think about F#-based web applications?


Sponsor: Big thanks to Atalasoft for sponsoring the blog and feed this week! If your company works with documents, definitely check out Atalasoft's developer tools for web & mobile viewing, capture, and transformation. They've got free trials and a remarkable support team, too.

About Scott

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

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

The Mysterious Case of the Rogue Roaming Browser History - Removing OneView Internet Login

May 16, '15 Comments [10] Posted in Tools
Sponsored By

I like a good mystery and I hope you do, too. I'll give you two versions. First, the TL;DR version so you can just fix it, and later second, the maddening technical details.

See how it flashes OneView Internet Login in the title for a moment?

TL;DR - Why does my Internet Explorer say OneView Internet Login?

If you go googling for "OneView Internet Login" google will suggest things like "...remove." You'll find Yahoo Answers where folks are thinking they have a toolbar installed or a virus because when they launch Internet Explorer they see a flash of OneView Internet Login in the title bar.

To remove it, go to the Star in Internet Explorer's toolbar and click History, then By Site. Find "One View Internet Login," right click and delete that history record.

Note here in this screenshot that the site is http://google.com but the Title is OneView Internet Login. Delete that.

NOTE: If your home page is not google, then find your IE home page by Site, and delete the entry with the wrong title. Or, go nuclear and clear all history.

Delete it from your history

CSI: My Computer - Why does OneView Internet Login show up on all my computers? What is it and why won't it go away?

A year ago or so I stayed at a Hyatt Hotel. Hotels like the Hyatt often use "Captive Portals" when getting you on their internet. A captive portal "captures" your browser's traffic so no matter what site you asked for you'll get their login screen. So you get on their wi-fi, you type googlebing and they redirect you to GlobalSuite.net or whatever to sign up. Only then does your traffic go through.

If you visit a hotel like this and hit it with IE for the first time with a fresh cache (nothing in your history or you've recently cleared your history) the Title that gets saved in the browser database will be the URL of the site you asked for but the title of the Hotel's Captive Portal. Weird? Just wait.

I noticed that my laptop would flash OneView Internet in the title (see the animated gif above) when opening my home page for the first time. Every once in a while I'd go looking for it, search the registry, do a hard-drive-wide grep or findstr but then I'd give up.

Later, though, my desktop at home started showing OneView Internet Login in the title bar on startup. To be clear, that's my desktop computer that hasn't left my house.

Roaming, my friends. All browsers roam things now. They roam passwords, history, bunches of stuff. This record, this cache, this tab, this something was getting roamed to all 5 of my machines. Now every time I open a browser on any machine I own I get a little gentle reminder of how hotel wi-fi sucks and how the GlobalSuite OneView Internet Login Captive Portal is sending a 301 or lousy headers or something dumb. Next time I stay there I'll do a Fiddler trace and prove it. Until then I wanted to find out where this was being stored on my hard drive.

Where is IE History stored? It's stored in a database using a technique called Extensible Storage Engine or ESE. In fact, Windows has shipped this database tech for over 13 years. You can even use it in your apps as a free and fast local database, but no one knows it exists. Over at NirSoft there are a host of wonderful utilities (they are saints, truly, give them money) and one of them is the ESEDatabaseView.

Run ESEDatabaseView and go File | Open IE10 Locked Database (even though you may be using IE11) and you'll be into the depths.

NirSoft's ESEDatabaseView

In a tabled called Container one I found a bunch of history entries:

The offending Entry

There's my first tab, my home page, but I didn't find "OneView Internet Login" or even the word OneView. I searched the while database, every table.

I was stuck here for a while.

Then I noticed way off to the right (like I literally had to scroll off to the right) there was  column called ResponseHeaders with a bunch of HEX.

20 01 00 00 1C 01 00 00 31 53 50 53 A1 14 02 00 00 00 00 00 C0 00 00 00 00 00 00 46
11 00 00 00 17 00 00 00 00 13 00 00 00 00 00 00 00 41 00 00 00 10 00 00 00 00 1F 00
00 00 17 00 00 00 4F 00 6E 00 65 00 56 00 69 00 65 00 77 00 20 00 49 00 6E 00 74 00
65 00 72 00 6E 00 65 00 74 00 20 00 4C 00 6F 00 67 00 69 00 6E 00 00 00 00 00 15 00
00 00 18 00 00 00 00 40 00 00 00 40 E8 3E C4 96 8E D0 01 11 00 00 00 0D 00 00 00 00
13 00 00 00 00 00 00 00 11 00 00 00 09 00 00 00 00 13 00 00 00 00 00 00 00 11 00 00
00 22 00 00 00 00 13 00 00 00 00 00 00 00 11 00 00 00 06 00 00 00 00 13 00 00 00 0A
00 00 00 55 00 00 00 15 00 00 00 00 1F 00 00 00 22 00 00 00 68 00 74 00 74 00 70 00
3A 00 2F 00 2F 00 77 00 77 00 77 00 2E 00 67 00 6F 00 6F 00 67 00 6C 00 65 00 2E 00
63 00 6F 00 6D 00 2F 00 66 00 61 00 76 00 69 00 63 00 6F 00 6E 00 2E 00 69 00 63 00
6F 00 00 00 00 00 00 00 00 00 00 00 DC 00 00 00 D8 00 00 00 31 53 50 53 A1 14 02 00
00 00 00 00 C0 00 00 00 00 00 00 46 11 00 00 00 20 00 00 00 00 03 00 00 00 00 00 00
00 11 00 00 00 14 00 00 00 00 03 00 00 00 01 00 00 00 15 00 00 00 28 00 00 00 00 40
00 00 00 70 0D 51 33 D8 6C D0 01 11 00 00 00 21 00 00 00 00 13 00 00 00 00 00 00 00
3D 00 00 00 1D 00 00 00 00 42 00 00 00 1E 00 00 00 70 00 72 00 6F 00 70 00 34 00 32
00 39 00 34 00 39 00 36 00 37 00 32 00 39 00 35 00 00 00 00 00 08 00 00 00 EB 03 00
00 00 00 00 00 15 00 00 00 1E 00 00 00 00 40 00 00 00 3C DC B8 DF 12 6D D0 01 11 00
00 00 1C 00 00 00 00 03 00 00 00 00 00 00 00 11 00 00 00 27 00 00 00 00 13 00 00 00
01 00 00 00 00 00 00 00 00 00 00 00           

First thing I noticed (I assume you do also) is all the zeros. They are mostly not used as if this is UTF16. But I really look for HEX that I know. That means CR, LF, and Space, so 0D, 0A, and 20.

See that there?

4F 00 6E 00 65 00 56 00 69 00 65 00 77 00 20 00 49 00 6E 00 74 00 65 00 72 00 6E 00
65 00 74 00 20 00 4C 00 6F 00 67 00 69 00 6E 00 00 00 00 00 15 00 00 00 18

That's One View Internet Login. I converted from Hex to ASCII/UTF16. There's lots of online Hex to String Convertors where you can just paste this into a text box. I can also put the string above into a PowerShell string and convert it like this:

$HEXDATA.Split(“ “) | FOREACH {WRITE-HOST –object ( [CHAR][BYTE]([CONVERT]::toint16($_,16))) –nonewline }

There it is, OneView Internet Login. The title of the portal was cached along with the original URL (google.com) and the location to the favicon. When IE hits the page it shows what it has and then corrects it as soon as it gets the current title.

image

What's not clear to me is why this never expired. This title sat around for a year, at least. Maybe an IE engineer will read this and answer in the comments. If they do I will update the post with their answer.

The Good News is that if you delete the history record manually as seen at the very top of this post, that delete will roam and automatically fix this issue on all your machines (to be clear, all those that are logged in with the same Microsoft Account and roaming your browser data.

Remember, Dear Reader, the Internet (and your computer and its operating system) is not a black box. Look inside.


Sponsor: Big thanks to the folks over at Grape City for sponsoring the feed this week. GrapeCity provides amazing development tools to enhance and extend application functionality. Whether it is .NET, HTML5/JavaScript, Reporting or Spreadsheets, they’ve got you covered. Download your free trial of ComponentOne Studio, ActiveReports, Spread and Wijmo.

About Scott

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

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

How to set a Network to a "Private Network" in Windows 8.1

May 15, '15 Comments [12] Posted in Tools | Win8
Sponsored By

A while back Windows introduced this concept of public networks and private networks. Basically it comes down to a question of "do I mostly trust this network?" However, it's never been totally obvious how to change this back and forth. There's lots of posts on the internet explaining how, but most are pretty complex with a lot of steps.

The most common reason to want Windows to treat the current network as a Private Network is so you can have someone connect to your machine, either share files over SMB, or connect via Remote Desktop (RDP). I hit this issue probably once a month where I can't figure out why I can't see this machine over Remote Desktop, and it's because it thinks I'm on a Public Network.

One technique is to go to Network within Windows Explorer and try to get this yellow bar to show up.

Network Discovery and file Sharing are turned off. Network Computers and devices are not visible.

Clicking on it will give you a choice that isn't clear to Non-Technical Family Member.

Do you want to turn on Network discovery and file sharing for all public networks? NO

No is the right answer, always. But this is a bad dialog because it looks like a Sophie's Choice.

You WANT to treat THIS NETWORK - the one you are on - as a Private Network. Select No.

A better, clearer way to change a Network to Private Network

  • Press the Windows Key + W to search Settings.
  • Type "Network Connections" and Press Enter

Windows 8.1 Network Connections

  • Click on your Network
  • Turn "Find PCs and Content" to ON. This Network is now a Private Network.

Find Devices and Content

Don't believe me? Bring it up side by side with the Classic Network Center and watch it switch back and forth in real-time!

Switching a Network Private in Windows 8
Switching a Network Public in Windows 8

I hope this helps you out as much as it did me!


Sponsor: Big thanks to the folks over at Grape City for sponsoring the feed this week. GrapeCity provides amazing development tools to enhance and extend application functionality. Whether it is .NET, HTML5/JavaScript, Reporting or Spreadsheets, they’ve got you covered. Download your free trial of ComponentOne Studio, ActiveReports, Spread and Wijmo.

About Scott

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

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

BUILD 2015 ASP.NET 5 Training Videos - Introduction and Deep Dive

May 6, '15 Comments [16] Posted in
Sponsored By

First, here's a few great annoucments and little details that you might have missed during the BUILD Conferenceapalooza last week. Amidst all the Windows 10 and the Holograms, Microsoft also did these interesting things.

Not to mention a lot of blog posts, not the least of which being these: ScottGu, TMyerson, Soma, BHarry, ScottHa, VS team, VS Code, ALM series, .NET roll-up, ASP.NET 5 and EF 7, Azure SDK 2.6, C++, and more

But, that's not what this blog post is about. This one is about you learning ASP.NET 5. Join us LIVE every Tuesday for the ASP.NET Community Standup to start.

At BUILD this year Scott Hunter and Damian Edwards and I teamed up for two hours of ASP.NET 5 training. Those videos are up now at Channel 9 and we think they are pretty great. At the end you should have a good working understanding about what's going on with ASP.NET 5 and the DNX environment, as well as cross platform development and why. You'll also want to spend some time at our beta docs site (built with ReadTheDocs) here http://docs.asp.net and get involved.

One note about these videos. Be sure to download the HIGH-RES version as they include the split screen and let you see both the screen AND the people. The low-res ones will give you just the screen sharing.

Introduction to ASP.NET 5 - Part 1 - Download

Deep Dive into ASP.NET 5 - Part 2 - Download

I hope you enjoy these!


Sponsor: Big thanks to the folks over at Grape City for sponsoring the feed this week. GrapeCity provides amazing development tools to enhance and extend application functionality. Whether it is .NET, HTML5/JavaScript, Reporting or Spreadsheets, they’ve got you covered. Download your free trial of ComponentOne Studio, ActiveReports, Spread and Wijmo.

About Scott

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

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

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