and has 0 comments

  Gina Kolata's Flu: The Story of the Great Influenza Pandemic of 1918 starts with a question that, I believe, is more important than the cause of the epidemic or even its terrible effects: Why don't we know about what happened in 1918? Why isn't it taught at school, why isn't there more information about what happened, why aren't there more books, songs, reports, movies and memoirs about what can be safely called the biggest killer event in human history in terms of numbers? Not only regular people, but also medical professionals find themselves surprised to know so little about it. In fact, if we weren't living during pandemic times right now and the parallel hadn't been drawn, we would still be in a general state of ignorance about the very existence of the event.

  And it's not only the military censorship during World War I, which surely had a lot to do with it, but a more insidious and yet generalized reason: people want to forget about it. The story is not one of heroism, it doesn't follow the hero's journey, it doesn't end with humanity defeating its foe, with suffering teaching an important lesson or with a patriarchal being or group coming to the rescue. Instead, it is one of utter defeat, of something unknown devastating tens of millions of lives, while they are incapable to do anything and no one comes to their aid or even acknowledges their suffering. Just senseless death, then it's over. Just like surviving a bear attack after the bear got bored of clawing and biting bits of your crying, self pissing helpless body.

  Yet the rest of the book is about the unsung heroes of the story, scientists that attempt to learn from the experience and guard against it happening again. It follows people trying to find the infectious agent that caused the 1918 pandemic, identify it and pry its secrets. These are people that focus on a task and obsess about finding ways to complete it. They work tirelessly in labs, dig up century old frozen bodies to find what killed them, overcome obstacles (mostly put there by other people) and are the only ones who actually know anything about something and can guide action against future disease.

  Gina Kolata's book is a great read in these times, because it not only shows people are actually doing something about epidemics, even if no one is excitedly talking about it in the media, but also shows how every pandemic follows a predictable path. It's not just our politicians that seem to be completely baffled on what to do. It's not just our scientists who get blocked in their work by malicious rumor and public opinion about things they understand nothing about. It's not just our industry that for financial reasons thwarts efforts to do something and not just us that think random chemicals can safeguard us from the new threat. Epidemics are the great stories that no one learns from and therefore we are all doomed to repeat living through them.

  Flu is also a great companion to Barry's The Great Influenza book. While that one was more historical in nature and focused more on the path the virus took and how people reacted to it, Kolata is almost taking the reverse path, starting with current efforts to understand what happened in 1918 and thus slowly creating a picture of the events then, through the work of dedicated scientists and the biological information discovered about the virus.

  Bottom line: this is a book well worth reading, particularly in these troubled times. Hell, it's not like you have a lot of other things to do anyway!

and has 0 comments

  Submission is the most French book I've ever read. It's an intellectual examination of political France (and by extension the whole Europe) from the viewpoint of a womanising, wine drinking, misanthropic, misogynistic university professor as it is suddenly, but without resistance, turning Muslim. Bound to generate reactions, the book is tongue-in-cheek offending everything and everybody: political systems and pundits, religions and zealots, apathetic atheists, women, muslims. But it is also examining human failings and demanding a solution that doesn't completely suck. This is the first Michel Houellebecq book I've read. It intrigued me and I may read another soon.

  Just a few quotes to wet your appetite:

  • the mediocrity of the ‘political offerings’ was almost surprising. A centre-left candidate would be elected, serve either one or two terms, depending how charismatic he was, then for obscure reasons he would fail to complete a third. When people got tired of that candidate, and the centre-left in general, we’d witness the phenomenon of democratic change , and the voters would install a candidate of the centre-right, also for one or two terms, depending on his personal appeal. Western nations took a strange pride in this system, though it amounted to little more than a power-sharing deal between two rival gangs, and they would even go to war to impose it on nations that failed to share their enthusiasm.
  • As I got older, I also found myself agreeing more with Nietzsche, as is no doubt inevitable once your plumbing starts to fail. And I found myself more interested in Elohim, the sublime organiser of the constellations, than in his insipid offspring. Jesus had loved men too much, that was the problem; to let himself be crucified for their sake showed, at the very least, a lack of taste , as the old faggot would have put it.
  • For men, love is nothing more than gratitude for the gift of pleasure, and no one had ever given me more pleasure than Myriam. She could contract her pussy at will (sometimes softly, with a slow, irresistible pressure; sometimes in sharp, rebellious little tugs); when she gave me her little arse, she swivelled it around with infinite grace. As for her blow jobs, I’d never encountered anything like them. She approached each one as if it were her first, and would be her last. Any single one of them would have been enough to justify a man’s existence.

The protagonist is a professor whose only love appears to be Joris-Karl Huysmans, of who he thinks constantly and of who he wrote the dissertation that allowed him his position teaching in the Sorbonne university. As the system in France is turned upside down by a combination of voter apathy and political mathematics, a Muslim party gains majority and, under the skillful leadership of its charismatic leader, it begins to turn France and then the whole Europe into a moderate Muslim empire fueled by petro-dollars.

Of course the premise is ridiculous, after all the book was written before Trump came to power, which seemed equally ridiculous right before it happened. The book compares the submission of women to their men, the only true way of achieving happiness, to submission to a religion, or a political system, or a literary philosophy. It is masturbatory in nature and speaks to one's weakness and decay. It is not an islamophobic book, it's a trollish, nihilistic book, meant to show how reasonable a change like that might seem when supported by politics and media and allowed by lassitude and apathy. Usually books like these end up describing the advent of some Nazi government ruling with violence, fear and ruthlessness. Houellebecq says no: let it be a moderate Muslim party that each divided part of society accepts for different reasons, but accept, submit, they do. The main character ends up considering converting to Islam and living his life married to three wives and teaching in the private Muslim university of Sorbonne.

and has 0 comments

  Octavia E. Butler blew my mind with her Xenogenesis trilogy, where she explored the needs and choices of human beings when their control is taken away from them not by aggressive beings, but by god like aliens who can control and change the very nature of one's body and mind and kindly, like parents who know best, rape Earth and all the humanity for three long books. It was daring, it was thought provoking, it was sickening.

  I can see similar motifs in Fledgling, where the point of view is that of an amnesiac vampire who needs to understand who and what she is and find the people who killed her entire family and almost killed her as well. Vampires are not evil in this book, instead just having the ability to completely redirect the feelings of people they feed from towards adulation and love, a bit like the aliens in Xenogenesis. And consider the fact that the protagonist looks like a ten year old black girl and in just a few chapters she has consensual sex with a large man. I wonder what the hell happened to Butler when she was young!

  Unfortunately, the story starts with this very intriguing reimagining of vampire lore, with a feel reminding me a bit of Let the Right One In, only to become mired in a sort of legal proceeding and then abruptly end. It's a fine exploration of this new idea of the vampire, but not much more. I liked the book, it was interesting from beginning to end, but it felt mostly like an intellectual exercise that could have become something so much better with just a little refinement and further exploration.

  Bottom line: I recommend it, as it again fiddles with our notions of propriety, sexuality and race, but Xenogenesis was much better.

and has 0 comments

  A Very Punchable Face is an attempt to answer the question "Who is Colin Jost?" by small sketch like chapters that have very little to do with each other and also seem to have not very much to say about Colin himself. Some of the more interesting or personal issues are just ignored or assumed known by the reader. If you don't already know who he is and what he did in life, some of the passages in the book won't make any sense to you. Also, isn't it obnoxious to write a "memoir" when you're 38?

  So who is Colin Jost? He is a guy whose greatest fear is to be mediocre. Understandable since he went to Harvard, married Scarlett Johansson and wrote and hosted for Saturday Night Live. Who in his shoes wouldn't, right?

  I usually enjoy self biographical works because they are deeply personal, and while I enjoyed reading this book, it didn't feel that personal. It was filled with jokes, but they didn't do anything for the story. They were there just because Jost is used to think of jokes all the time. It held some personal anecdotes, but mostly event descriptions, with little interior revelation of personal thoughts and feelings and intentions. Of all of the chapters I loved the one about his mother most, even if it had nothing to say about Colin himself. And I swear he speaks more about the times he shat himself than, let's say, Scarlett!

  Bottom line: The book doesn't say anything you probably thought you were going to read it for. The rest is amusing, but felt like a series of sketches and not something to convey how a person feels inside and experiences life. Also the writing was rather... well... mediocre.

and has 0 comments

  Daniel Suarez is a trailblazer: he takes technology in its infancy and creates stories about how it could be used today, given a little bit of determination and perhaps insanity. He is a competent writer, paying more attention to events and dialogue than to character development. This makes the books packed with ideas and information, but less lyrical, let's say. They also start brilliantly, with a new angle on a situation that could be happening today without big leaps in technology or stretches of imagination, yet kind of go over the edge towards the ending, become less plausible. Suarez's view of the state of the world and human nature in general is both optimistic and terribly dark.

  Delta-V follows the same pattern, this time focusing on space mining, a subject that I am personally really interested in. What would happen if someone would ignore the bureaucracy and the ethical bog in which Earth is mired in and instead just push the boundaries, dare to do where others barely dare to dream? What if we would use the money we throw every day on wars and maintaining an artificial system of wealth and politics on something that lifts us all?

  I liked the technical aspects of the book, but less the interactions between people and the way events unfolded. The story raises many interesting points, but fails to raise something more important: hope. The plot is akin to those high stakes James Bond chases, thrilling, but implausible, letting me feel like it would be crazy to even try. Delta-V leaves a bitter sweet taste after reading: to know what is possible with just a little commitment and to know that the world is poised to stop you at every point for the simple reason that it must justify its existence and protect its pecking order.

  I liked Daemon more, but this one has a subject that is closer to my heart.

and has 0 comments

  The Abyss Beyond Dreams ended with Bienvenido being thrown out of the Void and outside the very galaxy. A different set of heroes now need to battle Fallers, idiotic government people and spacetime to save the world!

   A Night Without Stars is almost as good as the first one. It brings new challenges, a slightly different setup, other characters. In a way, it's pretty much a separate book. And while it follows the plethora of different people, each doing their own thing, it keeps the entire narrative together and consistent. Still had parts and leaps of logic that felt a bit lazy, but the main flow of the story was captivating and the characters sympathetic.

   But, being the actual end of a story and being a Peter F. Hamilton book, it doesn't end on a cliffhanger, but as abruptly as falling off the cliff. To give you a taste: the fate of the Void is resolved in less than a paragraph. The end of the book introduces no less than three different alien races, each with their own few paragraphs. It was like Hamilton was saying "Hey, glad you enjoyed the book. I also had this list of ideas while writing it. I'll list them at the end and let you think about the possibilities as homework".

  Bottom line: if you are a Hamilton fan (or you like good hard science fantasy) there is no force that will stop you reading these two books. I even felt like they were slightly better written than the ones before, even if a bit less carefully. However, the cold turkey endings of these stories stop me from feeling like I want more. It's like enjoying a high speed car ride and hitting a tree. It was fun while it lasted, but you don't feel like driving now.

and has 0 comments

  The Void trilogy brought us the captivating idea of an area of the galaxy that has different properties than the rest, a place where electricity and electronics don't work well, but people have psychic abilities. Also steampunk heroes that fight the system and have superpowers. 

  Well, The Abyss Beyond Dreams is also set in the Void, but on another planet. It starts with Nigel and Paula discovering the cache of telepathic recording of "Edeard's dreams" and Peter F. Hamilton makes fun of his own work by having Nigel tear up at the end of consuming them because it was such an exact hero's journey. I understand Hamilton's embarrassment as I remember reading the books and waiting impatiently for the hard sciency part of the book to finish so I can see what Edeard was up to, which is the opposite of what I normally do.

  Anyway, Nigel goes into the Void to mess it up, as it engulfs more and more of the galaxy to fuel its function, and he arrives on a planet in an early industrial stage of development and that is ruled by a bureaucratic government. So he encourages a Trotsky-like movement in order to reach his goals.

  To me the book was very entertaining, I've read it in a few days, and I also think is one of the good Hamilton books. It's not hard to spot the logical errors in it. I saw clearly how he wanted to create a new story, this time examining other aspects of human psychology and sociology by dissecting a socialist revolution, and so he paid less attention to other sides of it. But it's a book, a hard science fantasy story! It is not perfect and still pretty cool.

  I also liked that the two parts of this story, one being this book, the other A Night Without Stars, were almost standalone, with different characters doing things in different ages. The ending of the book is abrupt as it usually is with PFH, but not as jarring as other of his books, nor ending in a terrible cliffhanger, nor like the end of the second book... :) And this time it's not a trilogy, but a duology. Hurrah for self contained stories!

  Bottom line: good read, I didn't realize how much I was missing reading some of Peter F's stories until I started reading this.

and has 0 comments

In 1859, Charles Darwin was publishing "On the Origin of Species by Means of Natural Selection, or the Preservation of Favoured Races in the Struggle for Life", a book that was proposing a theory that was logical, but against every cultural idea that people adhered to at the time. It said that people were animals and that the only force that pushes for change and therefore speciation, is evolution. People went mad with anger: we are not monkeys! Evolution is really easy to understand though, especially if you are not thinking of people or even of live things. Bear with me, while I make this point, before we move to the real theme of this post.

Imagine a chair maker. He buys the wood, carves the various components used to make chairs, then puts them together and sells them. He makes normal chairs: four legs supporting a platform and then a backrest. Whenever people need chairs, they come to him. Now, another chair maker comes into town. He figures that a chair is almost as stable with three legs as it would be with four. So he starts making three legged chairs, which cost less to make, so he sells them cheaper. Most of the people who need chairs start buying from him. In this case the force that applies pressure on the chairs is the public wanting sturdy, comfortable and cheap chairs and the cause of change is the design of the chair maker. The four leg chair maker will either switch to three legs, make more beautiful chairs or find a different production method if he wants to stay in business.

And before you tell me that I am explaining evolution through intelligent design, I will agree with that point. Because evolution is not something that denies intelligent design, it works with or without it just as well. It's a logical outcome of existing conditions and the rules that govern the environment. It has nothing to do with gods and nothing against them. If you have a population of things that can multiply in a way that allows for change, be it random or designed, and there is a pressure that limits the growth of the number of things, whether random or designed, then evolution takes place, favoring some variants (species or races) and disfavoring others. It happens every time men prefer blue eyes to brown ones in women, whenever women prefer tall men over bulky ones, whenever people make chairs or when there is pressure applied to the growth of a virus.

Yes, we reached the real point of the post: the characteristics of a virus in the human population will depend on the amount and direction of pressure we apply on its growth. Let's take some examples, shall we?

When we open schools because the Covid virus doesn't affect young children, but we limit or forbid adults gathering or going places, we put pressure on the virus to grow inside children. It's not complicated at all. Just like the chair maker, if the virus survives it only does it where it can spread. Because you can't stand your own children being children in your house with you and/or because you somehow believe that the linear and continuous application of regimented education without any breaks is more important than your children's health, you get a variant of virus that spreads through children. If you're lucky, it will come home with them and make just you sick. If you're unlucky, it will kill your children, too.

When we let political and economic pressure dictate the response to a viral outbreak, thus letting the virus spread unchecked through the population, you exponentially increase the chance of mutation (remember the multiplication which allows for change? That's called mutation in biology) thus getting more virus variants. Some of them will be more lethal, some of them will not. It's a throw of a dice that you should never have thrown. If after this horrid year of 2020 we start getting vaccinated and there is a variant out there that can infect vaccinated people, then it will spread through the entire population like we did absolutely nothing. And this happens whether your country implements a full lockdown or not, because other countries don't. Viruses care nothing about borders. So you're not losing money or political clout in the short term, but medium and long term you are losing big time.

This brings us to the last example and you won't like it. It goes like this: if you vaccinate people starting with the sick and elderly, and without even testing them first, you will have more chances of vaccinating already infected people. That means that while the vaccine will make your body reject a specific type of virus, that virus is already multiplying inside you and - yes, you guessed it - if any of them mutate into something that the vaccine did not prepare for, then it will be selected faster for evolution and survival, thus increasing the chances for a virus variant that the vaccine is ineffective for. A vaccine is the true long term solution for any viral outbreak: it uniformly limits the spread of the virus at scale with minimal cost. But only if applied uniformly!

This is not medical science that I am explaining here, it's simple logical progression from a given point applying a set of rules. When people address the issue of a viral epidemic by discussing their legal or moral rights, the existence or nonexistence of various deities, by considering the economy or advantages for various political parties or even some crackpot conspiracy or their personal comfort, they are missing the point. All you can do, as a person, group or government, is to alter your behavior so that the pressure you apply or do not apply leads to the best result for you and your people. The application of logic does not invalidate your beliefs, unless your believe that logic is wrong, which just makes you stupid.

The virus doesn't care what you believe or what you think. It will just move forward on the path of least resistance. It's your job to carve that path so that it leads where you want it to lead.

Whatever you read on Facebook also obeys the rules of evolution. So do media reports and politics. If they can't spread, they will die, so they will mutate into something that spreads and infects more readily. Your job is again, to act according to your own interest, to decide where you want to take things. Where will you apply the pressure and where will you go soft?

As I was saying in a post from a year ago, a virus (or a meme) tends to become more infections, but less damaging in time. Again, it's pure logic. It needs to spread better and therefore not kill its host too quickly or limit its mobility and thus its ability to infect others. But that only applies on a virus that is left unchecked. Once you apply pressure, you change the rules, it changes direction. All I am saying here is push it towards where you want it to go!

and has 0 comments

  Plain Bad Heroines is a lesbian gothic book, as it features unexplainable horror and almost everyone in it is gay and female. Should I call it sapphic gothic? It has the benefit of scaring you twice as much if you're homophobic, I guess. The first thing you notice is how well the book is written. Emily M. Danforth is clearly a talented author and she must be praised for it. I continued to read the book until I finished it mostly because of how well it was written. However, while I am a fan of intermingling stories and self referential prose, most of these stories bored me to tears.

  It is possible, though, that I was not connected to the subtleties of the book, as I was frequently falling asleep while reading it and starting to read it again from a random point that seemed vaguely familiar. I mean, it is a book about the making of a movie that is based on a book, itself inspired by Capote's unfinished work, that researched the spooky happenings at an isolate manor which was being used as a girls only school in the 1900's and where said happenings were being associated with a book written by an outspoken bixsexual feminist who wrote a confessional memoir. And that's just the synopsis. It talks about life in the glamourous Los Angeles movie scene, about societal gossip and the history of Truman Capote, the more or less overt lesbianism accepted at the beginning of the 20th century in high class educational institutions, book writing, sexting and flirtation, life under the spotlight with crazed fans following your every move, witchcraft, even a nod to Lovecraft.

  The thing that bothered me about the storytelling was that most of these subjects were not interesting to me. They felt neither very personal nor technical. As a book inspired by two others, one a shockingly honest autobiography and the other a shockingly honest autopsy of high social circles, Plain Bad Heroines felt really subdued. The scenes that most elicited emotion out of me were neither the lesbian romance, nor the behind the movie scenes machinations, nor the old timey 1900 era rich manor life. It was the witchy curse scenes, which in the end had a very underwhelming explanation. It felt like a book about nothing, going in circles around the point that it was trying to reach, but never getting there. It was a rim job!

  Bottom line: probably more subtle that I understood it to be, it might be just the thing to read if you're gay or into the socialite L.A. life. To me it was difficult to finish and find an interest in.

So I wanted to use the button on my Android headset to control the audio of the application I was currently using: a book reader or a music player or something similar like that. And instead an annoying assistant was blinging annoyingly and impotently in my headphones, while my music was still on. It is not at all obvious what does that and how to stop it. And there are two assistants on my phone: Google Assistant and Bixby. Turns out you only need to care about one.

Here is what I tried and didn't work:

  • disable assistants
    • Bixby can't even be disabled
    • Google Assistant can be disabled, but by that it means it doesn't listen to your voice commands anymore, buttons are fair game
  • apps to change the action for the headset button
    • they either don't work right or can't work when the screen is locked
    • the "many apps" recommended by some articles are not even in the store anymore
    • they need full control permissions on your phone

So, here is what you need to do:

  1. have your headphones connected to your phone
  2. open Google application
  3. tap the three dot More button
  4. go to Settings
  5. select Google Assistant
  6. go to Devices (it's a section in blue on my phone)
  7. you should see Wired headphones (or maybe something else depending on your headset type) - tap it
  8. uncheck the option Get help from Google


That's it! You don't have to disable the assistant on your headphones, but your headphones in your assistant. And this is regardless of whether the assistant is "off" or "on". Now you can listen to your music and books in peace.

"But, what about Bixby?" you will ask. As far as I can see, Bixby is something that comes over Google Assistant. I did disable some stuff in it, but I doubt it was a problem to begin with.

and has 2 comments

Update Aug 28 2023: the book has finally been uploaded to the Internet Archive in both PDF and epub formats!

  I have been working on this adventure computer game that is a tribute to the history of adventure stories. One important part of that history is what we call a gamebook, a printed work that allows the reader to choose one of several paths to complete the story. Because of very aggressive marketing and copyright tactics, this is now almost absorbed by the Choose Your Own Adventure brand and for sure Bantam Books (now Random House) would like us to think that they invented the concept. In fact, the man who sold the idea to them, Edward Packard, was not even born when two American women collaborated on what is now credited as the first book in the genre: Consider the Consequences! from 1930.

  Now, imagine that you would know what is the first book in a literary genre, like the first horror book, or the first romance. You would expect to find pages and pages written about it, you would think others have mentioned it in their works in the field and you would certainly trust to be able to find it somewhere to read. Well, Consider the Consequences! has almost disappeared. A book that probably has a dozen copies left in the world and is carefully (yet greedily) hoarded by a few libraries and collectors.

  Go on, search for it on the web, the place where everybody talks about everything. You will probably find it on Amazon, where it is unavailable, and on Goodreads, where you have one rating and one review. Perhaps you would find mentions of it on a site called Gamebooks, which only seems fair, on a blog called Renga in Blue and a long tweet from a James Ryan. Then there are some context mentions and that is it! The first ever instance of a book in an entire genre is about to go extinct!

  Now, I don't know if it was any good or not. That's kind of the point, I can't judge this work because I can't find it anywhere. If I had lived in the US or the UK maybe I could have read it in the library of some university, although that is just a possibility and not something that I would expect to be able to do. I don't even know if it is in the public domain or not. The U.S. legislation says conflicting things and something written in 1930 may perhaps become free of copyright in 2026.

  And the authors were the real deal: activists, suffragettes and all that. Perhaps I should complain that the patriarchy is trying to stifle the roots of feminine literature and then something would happen. It's astounding, really.

  Update, September 3 2021: Andy Mabbett left a comment about a new Wikipedia entry for the book. Thanks, Andy!

  From the link, a partial play in a radio show, where you can get a feel of what the book was like. Revolutionary for the genre, to say the least! Here it is:

  [youtube:SWCu6PnK5ls]

and has 0 comments

  The Mother Code is not a terrible book, but it is certainly not a good one. It has problems of structure, story and characters. But worst of all, it is really not about motherhood.

  Imagine a world where Uncle Sam "tests" a biological weapon somewhere in Afghanistan, only later realising that they have doomed the whole of humanity. Their solution is not to create self sustained habitats that eschew the issue, going to another planet, moving to Antarctica. Instead they focus on two avenues: finding a cure and creating a fleet of robots that can incubate, raise and protect children that have been genetically manipulated to resist the disease. Yes, because that is doable if you put (just) a team of people to work. It gets worse. The only mention of other countries is in about three or four paragraphs. They don't exist in the American mind, other than an afterthought, and indeed that's the political response of the government in the book, working in secret even knowing they are the cause and that other countries might help. And of course, all the children are American, as are the personalities of the "mothers".

  And really, you might accuse me for nitpicking here, I mean, I've read a lot of bad or naive stories over the years, why be so upset with this? But Carole Stivers decided to also show what happens in the future in parallel to the epidemic story, thus eliminating any thrill of what might happen. The core of any sci-fi story, the what-if, was halved in the moment she presented the end at the same time with the beginning. And later on, when there was another serious question about the future of humanity, the author again chooses to show her cards early and resolve the tension before it even started building.

  So what's left? A deep and interesting analysis of what it means to be a mother, explored through the eyes of the children raised by machines? No. That's just an afterthought, instead the focus being on a group of people that just... exist, with no real consequences to the story until the very end. I understand the dilemma of the editor: should they remove the superfluous writing, thus ending up with a short story, or should they leave it in in hope people would buy "a book" and thus pay for their salary.

  And the whole "mother code" thing is barely touched upon, which is so very sad, because the concept of a software developer trying to understand and code a nurturing mother is amazing! Yet that part takes just a few chapters and it doesn't really feel like what would happen to a software person.

  Bottom line: a really good idea, wasted on a subpar book that buries it under a lot of unnecessary story and forgettable characters.

and has 0 comments

  I always appreciate autobiographies for the glimpse they offer into another person's life. Double points for something that is well written and, if anything, A Promised Land is well written. Barack Obama's voice makes everything feel present and personal, which is the hallmark of a good biography. Yet one has to wonder how much of the story has been left out, how many personal failures have been explained away by a personality affected by the hubris of being the president, particularly given the several sections of the book where political figures were criticized for speaking out of turn or saying too much to the wrong people. So am I conflicted about this. I liked reading the book and I am glad to have had a taste of the experience of being a president, but I cannot take anything else at factual value.

  The book only covers the first four years of the presidential term, starting before the Democrat candidate elections and ending with bin Laden's death. It portrays Obama as an idealist, a reasonable man, one of those few people that need the world to make sense. He tells the story of him becoming a candidate almost like he got caught up in a current.

  He then tells stories about his Democrat colleagues and Republican adversaries, taking great care to talk as nice of them as possible. Notable exceptions are Sarah Palin, which Obama sees as the prototype Trump: an uneducated know-nothing who gained political capital not despite, but because of her ignorance, and Mitch McConnell, who is for all intents and purposes the Palpatine of the story. Trump is also mentioned at the end, deliberately almost like a footnote and depicted as a mindless buffoon.

  Reading the book from start, when the hero is a young idealist who believes in America and its political system, to end, when the hero is a battered soldier fighting economic collapse, terrorism, Republican lies and suicidal policies meant to counter him personally, felt painful. A good kind of pain, like the one (I assume :) ) one would get after a good workout, but pain nonetheless. It also started as a manifesto of hope and kind of ended in a bunch of apologetic explanations on why the good things that he did were not noticed by people and why the good things he did not do had good reasons for not getting done.

  I liked that Obama is a politician who hates the way politics work. I loved that he is a principled man as it is my personal belief that only well thought and agreed principles should guide important decisions, not personal feelings. I liked that the book did not focus on racism or social justice and the few passages about that were well argumented and put in context.

  I don't think being president helped him a lot, it sounded like it was one of those soul sucking jobs that people get into for money and prestige and the hope of achieving something, but that get them exhausted and lifeless at the end. Even for a positive and hopeful person, his book leaves a bitter taste of disappointment in how the world works.

My conclusion: it is a long book, 1700 ebook pages, and it only covers the first term of his presidency and a few years before as a politician. It is well written and I imagine the audio book, which is narrated by Obama himself, has an even stronger impact. I liked that he tried to present himself accurately, with strengths and weaknesses, qualities and flaws. I do believe, though, that the narrative of the book and especially they way he sees himself is a bit fantastic. Some of the chapters felt like rationalizations of past failures. There were valid reasons for that, but they were failures nonetheless and it felt like he refused to own responsibility for some of them. I recommend the book, but for someone not interested in politics, it may feel a bit boring.

  Update: more analysis shows that the change was not because of the OR clauses, but because of some debug OPTIONs that I had used. This post is thus wrong.

Original post:

  So I had this stored procedure that would calculate counts from a table, based on a specific column which was also indexed. Something like this:

SELECT Code, COUNT(*) as Nr 
FROM MyTable

  The code would take the result of this query and only use the counts for some of the codes, let's say 'A', 'B' and 'C'. There was also a large number of instructions that had a NULL Code. So the obvious optimizations was:

SELECT Code, COUNT(*) as Nr 
FROM MyTable
WHERE Code IN ('A','B','C')

  And it worked, however I was getting this annoying warning in the execution plan: "Operator used tempdb to spill data during execution". What the hell was that?

  Long story short, I found a very nice SO answer that explains it: SQL Server cardinality estimation can use two types of statistics to guess how many rows will get through a predicate filter:

  • about the column on average using the density vector
  • about particular values for that column using the histogram

When a literal is used, the cardinality estimator can search for that literal in the histogram. When a parameter is used, its value is not evaluated until after cardinality estimation, so the CE has to use column averages in the density vector.

  Probably, behind the scenes, ('A','B','C') is treated as a variable, so it only uses the density vector. Also, because how the IN operator is implemented, what happens to the query next is very different than replacing it with a bunch of ORs:

SELECT Code, COUNT(*) as Nr 
FROM MyTable
WHERE (Code='A' OR Code='B' OR Code='C')

  Not only the warning disappeared, but the execution time was greatly reduced!  

  You see, the query here is simplified a lot, but in real life it was part of a larger one, including complicated joins and multiple conditions. With an IN clause, the execution plan would only show me one query, containing multiple joins and covering all of the rows returned. By using OR clauses, the execution plan would show me three different queries, one for each code.

  This means that in certain situations, this strategy might not work, especially if the conditions are not disjunct and have rows that meet multiple ones. I am also astonished that for such a simple IN clause, the engine did not know to translate it automatically into a series of ORs! My intent as a developer is clear and the implementation should just take that and turn it into the most effective query possible.

  I usually tell people to avoid using OR clauses (and instead try to use ANDs) or query on values that are different (try for equality instead) or using NOT IN. And the reason is again the execution plan and how you cannot prove a general negative claim. Even so, I've always assumed that IN will work as a series or ORs. My reasoning was that, in case of an OR, the engine would have to do something like an expensive DISTINCT operation, something like this: 

SELECT *
FROM MyTable
WHERE (Code='A' OR Code='B')

-- the above should equate to
SELECT *
FROM MyTable
WHERE Code='A'
UNION -- not a disjunct union so engine would have to eliminate duplicates
SELECT *
FROM MyTable
WHERE Code='B'

-- therefore an optimal query is
SELECT *
FROM MyTable
WHERE Code='A'
UNION ALL - disjunct union
SELECT *
FROM MyTable
WHERE Code='B'
-- assuming that there are no rows that meet both conditions (code A and code B)

  In this case, however, SQL did manage to understand that the conditions were disjunct so it split the work into three, correctly using the index and each of them being quite efficient.

  I learned something today!

and has 0 comments

Just saying.