Saturday, March 23, 2019

Toad Words and Other Stories, by T. Kingfisher

When we are children we can believe anything and everything we see carries hidden, if false, meaning. It is the time when fairy tales enchant our imagination with just a little bit of detail, a simple story, a happy ending. We ask our parents "why?" and take their answers for granted. Later, we gain the experience to understand fancy from real, yet we rarely go back on the whys or on the fairy tales, to revisit them with our grand new outlook on life. They have become cemented into our childhood and have become the roots of our personality.

It seems to me that revisiting fairy tales is what Ursula Vernon, under the pen name T Kingfisher, wanted to do in Toad Words and Other Stories. So I enjoyed the dark ironic attention to details like why would a peasant girl wear a red hood, when the pigment is so expensive and unstable, or why would the grandmother choose to live in the forest rather than in the village with her niece. I liked the talking animals, often more wise and kind than the people. But it went from interesting to old really fast. At least the short stories were concise and to the point; if I didn't like one, I would maybe enjoy the next. But then there was the Boar and Apples novella which bored (heh!) the hell out of me.

So bottom line, an interesting concept, but I have not enjoyed the execution.

Thursday, March 21, 2019

The Hidden Half of Nature: The Microbial Roots of Life and Health, by David R. Montgomery and Anne Biklé

book cover I am conflicted about this book. On one hand, the subject is of terrible relevance and needs to be known by as many people as possible. On the other, the authors are not very good writers: the whole book feels like a big blog post, filled with repetitions, personal opinions and little in the way of hard data. Most of the information in it I already knew, but that's because I am fascinated with the subject. If I didn't know it, I would have probably loved the book.

But what is The Hidden Half of Nature? It's an ecology book. It explains how microbes are the unsung true heroes of plant growth and animal health, including humans. While we cling to narrow views of us versus them and try to kill anything that doesn't agree with us, our lives, our food, our health and our lands depend on the biological health of the microbiome. And it makes a lot of sense. Why would a plant develop a way to absorb nitrogen or break down rock, if all it has to do it exude some sugar and bacteria or fungi are going to do it for it? Why would animals develop complicated organs to break down complex molecules like cellulose when all they have to do is make a space where microscopic creatures live off them and give the animal simple nutrients back? How would it even work to evolve completely independent of the life that you can't see with the naked eye, but outnumbers and outmasses any macroscopic life? We thus learn that most microbes are beneficial and imbalances are much more dangerous than a specific species of a bug.

The book starts with the authors, David R. Montgomery and Anne Biklé, husband and wife, buying a house and dreaming of tending a garden, only to discover that their yard had almost no soil. Bringing a lot of organic matter to decay and be assimilated by microscopic life and then other creatures, from insects and worms to birds and other animals, they are shocked to discover that soil recovers much faster and in inexplicable ways than they were taught. Following the rabbit in its hole, they embark on a journey of discovery on how the microscopic influences every aspect of the macroscopic. It all starts with soil, but then it goes into nutrition and health and it all comes together: the idea that good comes from the health of the entire ecosystem, as all we can actually see with our eyes are big enough to be counted as such, colonized and tended by microscopic creatures that have evolved and cooperated with us to reach an equilibrium.

We become familiarized with the concept of dysbiosis, or dysfunctional symbiosis, and how it affects the nutritional values of food, the quality of the land, our chronic and acute diseases, cancer, allergies. Parallels are drawn: the digestive system as roots, a person as an ecosystem, our gut as a garden. All in all a fascinating and cutting edge subject where the ecology, the systemic health on all levels, is the important driver of our lives.

Yet the style in which the book is written really put me off. I started finding reasons not to read. The first half especially. The book starts by bemoaning the dry style of scientific publications and vows to tell the story in a way that anyone can understand. That means a lot of dramatizations, personal opinions, very little in the way of sourcing the ideas other than a name here and there. And whenever they were getting into something promising, they skirted on the details. I believe that if this book would have moved just a little bit away from the conversational blog-like style towards the Wikipedia format it would have been at least twice as valuable.

Bottom line: a book that most people should read, but I wish it would have been written differently.

Billy Crystal: 700 Sundays (2014)

I was browsing the selection of films on HBO Go and I have to say, for someone who is used to the options available on torrent sites, the films and series that are available there are both incredibly diverse and woefully inadequate. But if there is something that I am grateful for with that particular network, it is Billy Crystal's autobiographical play. It's called 700 Sundays and it is everything I have come to love about actor biographies... in video format. Within two hours of wonderful acting and playwriting, Billy finds the way to tell the story of his childhood, adolescence and adulthood without once getting into the things we actually know him for: acting, comedy, Hollywood. It's so wonderfully personal that is feels a bit too intimate, like someone describing in detail their love life.

Boy, does this guy love. There is this cliche about comedians that are essentially depressed and fight it, for a while, with humor, until their inevitable depression and subsequent suicide. Billy Crystal is nothing like that! He owns every scene, he fights for his audience and he is proud of his legacy. He is blessed, even while he mourns the death of his parents, because while they were alive, they loved him with all their strength and while he is alive, love is what defines him.

Bottom line: it is two hours of wonder. Whether you watch it on HBO Go or download it from somewhere, it is a must, it is absolutely necessary that you watch what a 67 year old master of storytelling and comedy will make out of his life story. I like biographies and this it one of the best, created in the medium Crystal feels most at home: stand up comedy.

I was half expecting the show to be freely available on YouTube or something similar, but in this day and age, quality is always behind some paywall. I leave you with a trailer to the show and I urge you to see it:

Friday, March 08, 2019

Assembly redirect woes

I spent hours trying to manually fix the assembly redirects in a web.config, only to give up and use the default Add-BindingRedirect in the NuGet package manager. And it worked! I have no idea if this won't break something else, but I got it from Rick Strahl's blog and it worked for me. More in his article. Thanks, Rick!

One thing to remember is that you first have to delete the dependentAssembly elements from the .config file in order for the command to work.

Wednesday, March 06, 2019

Building a Visual Studio solution from the command line, without Visual Studio

Update: there is an issue related to NuGet packages. I was recommending to run MsBuild with the command line option /t:Restore;Rebuild which should restore packages and rebuild the solution. However, as detailed here, the MSBuild Restore option only restores packages defined in the project PackageReference elements, not the ones in packages.config. In order to restore those, you still need to manually run nuget restore. Where do you get nuget.exe from? Obviously not from the Visual Studio Build Tools... but from the NuGet Gallery.

Now, for the original post.

So I had this medium size Visual Studio solution, in .NET Framework 4.6.1, containing a bunch of projects, including a Wix setup and a web API and I wanted to build it on a machine that did not have Visual Studio, for Continuous Deployment reasons. Since Visual Studio uses MSBuild to compile, I thought it would be a five minute job. Boy, was I wrong!

First of all, the command to build a solution is clear:
MSBuild You.sln
and since it was a .NET 4.0 project, it made sense to use the MSBuild.exe from C:\Windows\Microsoft.NET\Framework64\v4.0.30319. Well, enter the first error: CS1617: Invalid option 'latest' for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default. This is caused by the project using C# version 7 which is NOT supported by the MSBuild version in the .NET Framework, you need MSBuild version 15, which comes with Visual Studio. I didn't want to install Visual Studio.

The solution is to install Visual Studio Build Tools, preferably using the Visual Studio Installer. Now, the correct MSBuild version is found at C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe. Note that it is in located in a Visual Studio folder, not the MSBuild folder, which is also there.

An issue that occurred here was that previously warning messages saying the framework is 4.6.1 and the installed framework is 4.7.2 now became errors. The solution is to install the .NET Framework SDK 4.6.1 or to upgrade all your projects to 4.7.2. Warning: you need the Developer Pack, not just the Runtime.

Second error: error MSB4036: The "GetReferenceNearestTargetFrameworkTask" task was not found.. The problem? The NuGet package manager and/or the NuGet targets and build tasks are not installed. In order to install them, run Visual Studio Installer and look under the Individual Components tab, in the Code Tools section. See this Stack Overflow question for more details.

Next problem: The type 'IDisposable' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard'. This is a weird one, since the compilation in Visual Studio had no issues whatsoever. This is related to the framework version, though, as .NET 4.6 uses netstandard 1.0 and 4.7 uses 2.0. The solution is to add a <Reference Include="netstandard" /> tag in your .csproj (tip: Search and replace <Reference Include="System" /> with <Reference Include="System" /><Reference Include="netstandard" /> in all your .csproj files)

Another problem similar to the one above is Predefined type 'System.ValueTuple´2´ is not defined or imported and that is because ValueTuple is not in .NET Framework 4.6.2 or earlier and you need to install the System.ValueTuple package in your project (using the NuGet package manager, more details here)

For both problems above as well as for the issue with the framework conflict further up a possible solution is to upgrade all projects to .NET 4.7+ or whatever is latest.

Next, targets errors: error MSB4226: The imported project "Microsoft.WebApplication.targets was not found. and error MSB4057: The target "_WPPCopyWebApplication" does not exist in the project. This is because even if Visual Studio Build Tools is installed, the targets for it are not. The solution is to copy the folders Web and WebApplications from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Microsoft\VisualStudio\v15.0 to "\\BuildMachine\C$\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0". You may need to copy the NuGet targetss as well, I don't remember if that is what I did or the NuGet package manager installation solved it.

Last but not least, Wix errors. Obviously, for the Setup project to compile you need to install the Wix Toolset. However, you may still run into this error: error MSB3073: The command "heat dir ..blah blah blah" exited with code 9009. If you were trying to executing the build from a command prompt and you installed Wix while it was open, you need to open another one in order to refresh the changes the installer did to your environment PATH variable.

Finally, in order to compile for a specific platform and configuration, use the flags: /property:Configuration=Release /property:Platform=x64.

Then just run the line:
nuget restore
"c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe" /t:Restore;Rebuild Your.sln /property:Configuration=Release /property:Platform=x64

Hope it helps.

Monday, March 04, 2019

Asteroid Hunters (TED Books #14), by Carrie Nugent

book cover Part of the TED Books series, Asteroid Hunters is a tiny booklet, with few ideas other than those expressed in Carrie Nugent's TED talk: Adventures of an Asteroid Hunter. They even repeat. It feels like someone wrote a blog post and was in the mood to write and then they thought to make it a book, but without adding more material to the original post.

Nugent presents the job of asteroid hunter, which makes it technologically feasible to detect potentially dangerous asteroids years before they have a chance to do damage to the Earth. In that time frame, changing the rock's trajectory would be within our means. Let us do our job and fund it, she says, and the Earth will be safe from an asteroid impact, a predictable and preventable event.

Bottom line: that's the entire book. No funny anecdotes, no personal stories or insights, no analysis of the world of asteroids and meteors outside the job of finding them. It's informative, terribly bland and a bit repetitive. I didn't like it.

Friday, March 01, 2019

High Stakes (Wild Cards #23) by George R.R. Martin, Melinda M. Snodgrass

book cover High Stakes is so full of interesting and delicious horror that I am willing to forgive the bland and boring setup in the previous Wild Cards book, Lowball. A mosaic book like many others in the series, where different characters are written by different authors, it describes the coming of a supernatural horror that can change reality itself. People (normal, joker and ace alike) get turned physically and psychologically into rage filled monsters that want to eat babies and kill everything for the glory of their dark god. Even if some sections were reminiscent of the bore in Lowball, with love between people and worry and relationship issues, the bigger problem of the end of the world took precedence and made this into one of the best books in the series.

In many ways it reminded me of the early Wild Card books, when the virus was still a thing of awe and fascination, horror and fear, but with even more oomph. I think this particular volume washes the sins of many of the recent others that kind of forgot what the Wild Card was all about. I do hope this becomes a trend and the next books are at the same level.