It is quite amazing to see how much power is hidden inside the Windows RT operating system if you just go looking for it. Where the iPad iOS is basically a phone with a large screen, the Windows Surface and its brethren have so more to offer as a scaled down PC. You may never want this or need it, but if you do, it’s there.
More useful is the fact that Powershell is supported. But when you try to run a script file, the classic Powershell message that comes up:
File C:\users\peh\documents\test.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see “get-help about_signing” for more details.
On an ordinary PC you would then usually use the command Set-ExecutionPolicy RemoteSigned
If you do this on Windows RT, however, it will throw this message at you:
Set-ExecutionPolicy : Access to the registry key 'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell' is denied.
It took me a while to google an answer to this, but what helped me was this great post by Jeroen W. Pluimers.
The answer from Jeroen is to use a variation of the Set-ExecutionPolicy that only covers the current user – remember that, as opposed to iOS, the WinRT OS has the concept of user-based security:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
After hearing a great talk by Mads Kristensen yesterday at DDC13 – the Danish Developers Conference – I wanted to play around with some optimization and turn on HTTP compression in order to se the results of my pages in Yahoo Yslow or Google Pagespeed.
Using the <urlCompression doDynamicCompression="true" doStaticCompression="true" dynamicCompressionBeforeCache="true" /> web.config parameters I got no results, so I went to the IIS Manager to find this message on the compression settings page:
This is a well hidden feature, but I finally found it via the Control Panel, Turn Windows features on or off:
I have just spent a quite some time trying to figure out why a .Net program I wrote to e-mail users some batch-generated reports would work on my box and not on the users’ machines. Lots of googling turned up exactly nothing, although others must have experienced the same thing.
The basic program has worked fine for a long time mailing a single PDF report, but now I wanted to add some additional HTML files as attachments. This resulted in the following message on the user PC’s:
Mailbox unavailable. The server response was: 5.6.0 Invalid header found (see RFC2822 section 3.6)
What I discovered is that the System.Net.Mail.MailMessage component happily submits .pdf files, .zip files, .txt files and probably a host of others – it’s apparently just .htm and .html files it that makes it (or the mail server?) unhappy!
So what was different? Well, it was the framework. As soon as a user PC hitherto running .Net 4.0 got the latest and greatest .Net Framework 4.5 installed everything was honky-dory and mails flew out over the wire.
Was this a feature or a flaw? Or was it the combination with a fairly restrictive mail-server? Hard to say – but at least my code is now working and I can get on with my life…
“Denmark is to small a language area to have a national ballet” a danish right wing politician once said.
Unfortunately it is also too small a language area for Microsoft to sell and support the Surface here yet, so I’ve had to import one from Germany. However this means that there is no Danish touch cover keyboard, and working with a German or English keyboard is not really worth the price.
Fortunately one of my bright colleagues had the brilliant idea to just plug in a USB keyboard (remember that the Surface has USB as opposed to the iPad), and lo and behold – tiles lit up with the arrow keys… It seems to run perfectly and a mousepointer even comes up when attaching a keyboard with a built-in trackpad! Touch is also active at the same time. So as an interim measure I’ll just get a small wireless keyboard/mouse combo and I can use my Surface as a perfect writing tool whenever I need to. The built-in Surface stand also shows its worth here…
That is sooo nice!
The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.
Here’s an excerpt:
600 people reached the top of Mt. Everest in 2012. This blog got about 11,000 views in 2012. If every person who reached the top of Mt. Everest viewed this blog, it would have taken 18 years to get that many views.
Click here to see the complete report.
Just spent a couple of days googling for an answer to why the window.indexedDB returned null in IE 10 and Firefox 16 when testing my HTML. Chrome and old Firefox versions return values (window.webkitIndexedDB and window.mozIndexedDB).
Turns out that access to IndexedDB is not allowed via the file:// protocol for local access. The answer lay in StackOverflow: http://stackoverflow.com/questions/13120236/window-mozindexdb-is-null-in-firefox-14-to-16-version, referring to http://msdn.microsoft.com/en-us/library/ie/hh779017%28v=vs.85%29.aspx and the following note:
“For security reasons, Indexed Database API only works through the http, https, ms-wwa, or ms-wwa-web protocols in Windows Internet Explorer. That is, Internet Explorer doesn’t allow a local HTML page (
file://) to fully execute the Indexed Database API. Instead, the page must be behind a supported protocol such as
So, put your test-html on a webserver.
I assume that this will also be the case in Chrome (and Safari) once they finish their implementation of this new HTML5 standard – please, Apple in particular, haul ass!
So for now on to getting a small sample to work in Safari as well with the IndexedDB polyfill.
I also need to do work on synchronization with a backend – we live in interesting times! PouchDB seems one way, this StackOverflow answer seems another path to take, but (simple) samples and libraries seem hard to find.
Managing AD FS 2.0 from a commandline is of course supported by a wealth of CmdLets, which you can read about here.
I had a bit of trouble getting started because these CmdLets require the use of a Powershell snap-in like so:
Here is a sample of the error thrown if you don’t add the snap-in and how it works:
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\Users\lc> Get-ADFSRelyingPartyTrust -Name dev-www.vfltest.dk
The term ‘Get-ADFSRelyingPartyTrust’ is not recognized as the name of a cmdlet, function, script file, or operable prog
ram. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:26
+ Get-ADFSRelyingPartyTrust <<<< -Name dev-www.vfltest.dk
+ CategoryInfo : ObjectNotFound: (Get-ADFSRelyingPartyTrust:String) , CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\lc> Add-PSSnapin Microsoft.Adfs.PowerShell
PS C:\Users\lc> Get-ADFSRelyingPartyTrust -Name dev-www.vfltest.dk
The Microsoft documentation for this is available here