Tuesday, 13 February 2018

Annihilation (Southern Reach #1), by Jeff VanderMeer

book cover Annihilation, by Jeff Vandermeer, is a very short book that seems to be inspired by the Strugatsky brothers' Roadside Picnic. The same timeless quality, thoughtful introspective characters and a weird area that seems to defy the laws of physics and biology. But nothing is truly revealed, or learned, other than the somewhat senseless thoughts that the main character has. The other three women quickly succumb to the influence of "Area X", so we are left with a weird chick moving around in an unexplainable place with unfathomable rules. If Dallas' Pamela would have woken up from a dream at the end of the book, it would have meant just about the same as the actual ending.

I only read the book because of the upcoming movie. I am fairly certain that it will be better than the book, which manages to bore in half the pages of a decent story. It isn't that I disliked it, it's that I did not actually like anything in it. Everybody is acting crazy and without context and in the few pages that bring some context, it's the boring relationship between the lead and her husband and I couldn't care about any of them.

I am sorry, but when you write a book about a scientific expedition, it's customary you write about characters that behave like scientists, not like directionless drunkards with self-traumatic histories. I don't understand how this book won any science fiction award. It is well written, but it's barely average. I am not going to read any of the other books in the trilogy.

Monday, 12 February 2018

ASP.Net Core "System.InvalidOperationException: No authenticationScheme was specified, and there was no DefaultChallengeScheme found."

Update for .NET Core 3.0:

Seems for .NET Core 3.0 the solution is much simpler:
  • install the Microsoft.AspNetCore.Authentication.Negotiate NuGet package
  • add authentication in ConfigureServices like this:
    services
    .AddAuthentication(NegotiateDefaults.AuthenticationScheme)
    .AddNegotiate();
  • use the authentication in Configure (above app.UseAuthorization();)
    app.UseAuthentication();

No need to UseIISIntegration, UseHttpSys or anything.

Original post:

If you get the System.InvalidOperationException "No authenticationScheme was specified, and there was no DefaultChallengeScheme found." it means that ... err... you don't have a default authentication scheme. Solution:
  • Install NuGet package Microsoft.AspNetCore.Authentication in your project
  • add
    services.AddAuthentication(Microsoft.AspNetCore.Server.IISIntegration.IISDefaults.AuthenticationScheme);
    to the ConfigureServices method.

Update: Note that this is for IIS integration. If you want to use self hosted or Kestrel in debug, you should use HttpSysDefaults.AuthenticationScheme. Funny though, it's the same string value for both constants: "Windows".

Oh, and if you enter the credentials badly when prompted and you can't reenter them, try to restart Chrome (as in this answer)

Get rid of annoying Application Insights Telemetry output items in ASP.Net Core web projects

I was working on this web ASP.Net Core 2.0 project that was spewing a lot of "Application Insights Telemetry (unconfigured): ..." messages in the Debug Output window. At first I thought I should just remove the Microsoft Application Insights NuGet package, but it didn't work. By default, it will still use insights even if you don't have it referenced anywhere in your code.

The solution is to do have installed Microsoft Application Insights NuGet package, but then set
Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.DisableTelemetry = true;
somewhere in Startup.cs (the constructor is fine).

Apparently, in the preview versions of Visual Studio 2017 there is an option under Options → Projects and Solutions → Web Projects → Disable local Application Insights for Asp.net Core web projects, too.

Update: A comment suggested you need to Disable the automatic loading of hosting startup assemblies which can be done in two ways:
  1. setting ASPNETCORE_preventHostingStartup to True or 1 in the project properties → Debug → Environment variables
  2. Doing something like
    WebHost.CreateDefaultBuilder(args)
    .UseSetting(WebHostDefaults.PreventHostingStartupKey, "true")
    ...
    - available from .NET Core 2.0

Either of these works, and although I agree with Andrei that the underlying issue for the unwanted telemetry is the automatic loading of hosting assemblies, I feel like the first option, the one that actually contains the word Telemetry in it is better for reasons of readability. But it's good there are three options to choose from.

Sunday, 11 February 2018

The Atrocity Archives (Laundry Files #1), by Charles Stross

book cover The Atrocity Archives tells the story of a technical computer geek enrolled by force in the British governmental organization that keeps us safe from supernatural threats. By Charles Stross' own admision, as a mix of Len Deighton and H.P.Lovecraft by way of Neil Stephenson (with a bit of Le Carré and Flemming thrown in for good measure), the book seeks to bridge the emotional catharsis of facing one's fears (the realm of the horror) with the desire to reveal the truth of the thriller. Bundled with it, the short story The Concrete Jungle, continues the saga of our protagonist.

I liked the book. A master of technobabble and fast paced intelligent action, Stross first came to my attention with the wonderful Accelerando, which I will never stop recommending. In the Laundry Files series, he tackles with equal humor horrors that could suck the universe dry of energy and life and things like bureaucracy (less efficient versions of the same thing) in government agencies. The pace is alert, the writing good and easy to read, the characters sympathetic if a little too shallow, funny, punny and, once I got into it, this book was almost impossible to put down.

I don't know if I will continue with the rest of the series, but as science fantasy goes, The Atrocity Archives is a pretty good book.

Saturday, 10 February 2018

Angular gotcha: every import path needs a directory specified

This is actually a TypeScript module resolution thing. The shape of the import name tells TypeScript what kind it is. The relative path imports always need a directory specified, so './myModule' and not 'myModule'. That's because myModule could be the name of an already declared ambient module.

Well, it's more to it, but the takeaway is that you have an import like import {something} from 'folder/something' and you want a similar import with a file from the same folder, you don't just delete folder/, you replace it with a dot, like this: import {somethingElse} from './something-else'

Tuesday, 6 February 2018

A Natural History of Dragons (The Memoirs of Lady Trent #1), by Marie Brennan

book cover Written as a 19th century explorer's memories, this book subtly achieves several things, effectively and decently. First of all, it is a sort of fantasy, although really if one removes the dragons, it's pretty much normal history. Second of all, it is a feminist story, but one done well. Instead of describing the horrible things done to women by evil cardboard characters, we get an intelligent and driven female hero that makes the most of her advantaged situation to expand her goals and enrich her life, despite social norms, but supported by friends and loving family. She is young, attractive, but not extraordinarily so, and her fascination towards dragons and science books leads her towards a career normally reserved for men. She is inspiring as a model, rather than complaining about her helplessness. She gets by through her efforts and skill, not by magically being gifted super powers. The fact that the action is set in a reasonably old period so that folk don't get touchy about it, but close enough so that it describes people that thought themselves the pinnacle of civilization helps with making the reading comfortably remote, but seriously instructive. Thirdly, it is written in an easy to read way, a personal memoir that can be understood by adults and children alike.

As such, I think A Natural History of Dragons is one of the few books that can claim to have made the world a better place, as it provides both escapist pleasure and educational value. That doesn't mean it's a perfect book. Marie Brennan's educated Victorian noblewoman style starts off as refreshing, but quickly gets old, the details providing less and less context and just filling up space. The book is well written, but at times I just wanted to get past the way people were dressed or how the architecture influenced the mood of the main character. The title is misleading at best, as the story is marginally related to dragons and instead focusing on one person and her incidental fascination with them. You learn almost nothing "scientific" about dragons but you sympathize while you observe this young woman desperately trying herself to understand more.

In conclusion, this is a book that I would gladly give to a hypothetical young daughter to read. As an adult, it is light enough to be enjoyable. The world is built thoroughly and perhaps the next books will be more action packed, while expanding on our view of it. The story is a bit lackluster, but nothing to complain about. It reads as a light fantastical autobiography. A more alert pace would have made it more accessible, but it would have probably detracted from the character's voice.