If the online world voted, we would have a better world

I’ve seen many cases of this before, but never one as clear as this. Mike Pence, the vice president of the USA, just released a children’s book about a bunny titled “Marlon Bundo’s Day in the Life of the Vice President” and at the same time, John Oliver of Last Week Tonight released a counter-book titled “A Day in the Life of Marlon Bundo“.

How can you make a counter book against a children’s book? Well, Mike Pence is known for being homophobic, for his views that women should not be in the military. Trump even said, regarding talking about gay people “Don’t ask Mike, he wants them all hung”. John Oliver’s book is about gay bunnies getting married. It’s promoting the values that Mike Pence is against.

I’m not a democrat, I’m not a republican, I’m not a feminist (that one is a bit more complex), I’m not gay, I’m not a Tory, I’m not labour, I’m not black. I’m socially liberal, fiscally conservative person. Or something like that. I do believe that tolerance is a good thing, including letting people chose who they love, who they marry, etc. From that point of view I dislike most conservative governments, from Trump’s to the one in the country I live in, the Tories (Theresa May).

I don’t understand how Trump got elected. I do understand why the group of people that voted for Trump did so. There’s a sector of white middle and lower class in the US that feel disenfranchised as their jobs, their way of living, is disappearing. I don’t believe Trump will solve it, but the problem exist and thus people suffering from it were very likely to vote for Trump.

But Trump’s government is anti-gay, anti-black, anti-women and anti many, many other things. All of those demographics surely outweigh the ones voting for him. This is why I don’t understand how Trump got elected. What were all those other people that Trump’s government is against doing on voting day?

Back to the bunny book, look at the reviews for Mike Pence’s book, Marlon Bundo’s Day in the Life of the Vice President:

Marlon Bundo's Day in the Life of the Vice President

Marlon Bundo's Day in the Life of the Vice President - reviews

and now look at the reviews for John Oliver’s book, A Day in the Life of Marlon Bundo:

A Day in the Life of Marlon Bundo

A Day in the Life of Marlon Bundo - reviews

Now, let’s not kid ourselves. All those reviews, for and against both books, by now, are nothing but political commentary. This is political commentary on a neutral website: Amazon. It’s not political commentary on a political site that is likely to have only one side of the argument. And this is happening on other neutral sites as well, such as Goodreads:

John Oliver vs Mike Pence.PNG

By now, this is a popularity contest and a popularity contest that John Oliver is winning by a landslide. A popularity contest in which a story about a gay bunny is winning against the vice president of the United States.

Since an election is nothing else than a popularity contest, where were all those people that are writing reviews on Amazon on voting day? This is a message for everybody, no matter what you believe or what country you are in: get out of your lazy ass and vote!

There are various confounding factors that I want to address:

  • A lot of these reviews might be international and those wouldn’t have an effect on US elections.
  • Reviews are written by people with access to the internet and there might be a high correlation with Internet access and being anti-Trump, gay, lesbian, female, black, liberal. But didn’t Trump win by masterfully using the Internet and social media among other things?
  • John Oliver announced the book last night, so, there might be a pro-John Oliver wave that will die down quickly and in the long run, Mike Pence’s book might prove to be the winner of the popularity contest.

 

 

 

 

 

 

 

Advertisements

Book Review: Leonardo da Vinci by Walter Isaacson

leonardo-da-vinci-9781501139154_hrThis book was fascinating. I always thought of Leonardo Da Vinci as an artist who did other things aside from painting. This book changed my mind. Leonardo saw himself as a philosopher/scientist/engineer (those were sort of one and the same back then) who also paints; and after reading this book, I have to agree.

I think if it wasn’t for the fact that he didn’t publish his findings, he would be the father of modern science. His science/engineering was strongly empirical. He even disregarded religious explanations for things. I am in awe at many of his findings and discoveries. I’m also amaze at his acceptance of his sexuality, even when part of the world was claiming it was evil (to be fair, Florence in that time was sort-of like the liberal capital of the world).

I’m also glad he wasn’t a tortured soul. Yeah, he had his problems, but he seemed to have lived a long good life and that’s rare for people as exceptional as him. Another rare ocurence is that he seemed to have been appreciated in his time (not as much as later, but at least he was no Van Gohg).

I’m listening to the audio book and there’s a PDF companion that you can use to look at the paintings and drawings being described. I rarely find myself in a position to look at them as I listen to audio books while doing chores, driving, running, etc. Nevertheless the descriptions are good enough to appreciate the techniques but not the art obviously.

In the explanations of why Leonardo da Vinci’s paintings were so good I find myself in awe of the techniques he developed for his art. Specially if we consider that just perspective was something not understood very well long before his lifetime. I guess the renaissance was an important time for the development of art (I know, doh!). Something that annoys me is when the author makes subjective comparisons of the art as if they were objective (best painting, best technique, etc). Thankfully, this is not very common in the book.

★★★★☆

Buy Leonardo da Vinci in USA
Buy Leonardo da Vinci in UK

Book Review: Advance! The Full Licence Book by Alan Betts, Steve Hartley

51Go0CzjPlL._SX346_BO1,204,203,200_This book felt of much lower quality than the previous two. There are many typos and editing errors and I noticed a few technical errors as well. I guess it makes sense the advanced saw less scrutiny than the beginner one as fewer people will ever get to this point. Or maybe it’s my bias because this is the first time I really need to learn from the book (the previous two were, mostly, revision of stuff I already knew).

What really annoyed me is that there were many explanations that felt it was missing definitions of terms of explanations of the most basic parts so, aside from memorizing the concepts, it was hard to learn from it.

I’m obviously still grateful that there’s a book that covers the syllabus of the test for the Full License. At the same time, I wish we, in the UK, had more and better material like in the US, where you have the Extra Class License Manual, a thick 496-pages long nice book, and the excellent Gordon West’s Extra Class 2012-2016, as well as one or two video courses on YouTube covering all the material.

Giving the the physics is the same for the US and the UK, and that the ham radio hobby is having trouble with not having enough people and resources, it would be nice to share more things across countries. I understand the regulations are different and complex, but still, the actual radio stuff could be exactly the same in the US, UK and many other countries.

★★☆☆☆

Buy Advance! The Full Licence Book

The Omnivore’s Dilemma: A Natural History of Four Meals by Michael Pollan

omnivores_dilemma_by_michael_pollan1So far the tone of this book is disgustingly hippish. I think it presents some interesting data, but the way it presents it is so annoying:

– everything modern is bad
– everything mainstream is bad
– the only good alternative is primitive farms
– food and nature is a mystery that we cannot grasp so all efforts to synthesize fertilizers, pesticides, etc are doom to fail
– the natural cycle of chickens, cows, pigs, etc is perfect and shouldn’t be tampered with (mind you, these animals are almost as artificial as computers these days).

The part that annoys me the most is how it attributes negative connotations to the term agrobusiness. The definition of that word is “the businesses collectively associated with the production, processing, and distribution of agricultural products”, so, his idyllic small farms are as much agrobusinesses as the Monsatos he criticizes.

Another example I found ridiculous is when a farmer would refuse to ship him some food because burning fossil fuels to deliver his product was against his principles and instead told him: “If you want to try it, you’ll have to drive here”. Guess what! Driving to a location burns more fossil fuels than shipping a small package through highly efficient delivery companies (unless you drive an electric car and even then, I’m not sure).

I understand if the recommendations of the author were for an individual but he often talks about society as a whole without exploring the economic implications of using much more manual labor to produce food: can we actually feed the world with traditional farms? I don’t know and I have an inkling that the answer is probably very complex and not explored a lot in this book that advocates everybody to eat from those traditional farms.

★☆☆☆☆

Buy The Omnivore’s Dilemma: A Natural History of Four Meals in USA
Buy The Omnivore’s Dilemma: A Natural History of Four Meals in UK
Buy The Omnivore’s Dilemma: A Natural History of Four Meals in Canada

Book Review: Intermediate Licence – Building On The Foundation by Steve Hartley

s-l640I’m not a good person to judge this book because I not only have a technical background in electronics, I also got my American Extra-level license (AC1DM) before this one, so, I had to study all this material a few months ago. This feel like a revision.

Something that really surprises me about the book is that it says the ionosphere reflects radio waves. I understand we use that word in casual speech but I believe a book on ham radio should be more strict and use the correct term: refraction.

For whatever it matters, I passed the exam with a 43 out of 45 questions answered correctly.

★★★☆☆

Buy Intermediate Licence – Building On The Foundation

Book Review: American Prometheus: The Triumph and Tragedy of J. Robert Oppenheimer by Kai Bird, Martin J. Sherwin

80571For this review I’m considering, without any fact checking or cross referencing, that this biography is factual and true to the events although clearly some of the statements in the book would be hard to evaluate as they describe the feelings of large groups of people.

I knew a bit about The Manhattan Project and it was fun to have another take on those years of science, innovation and destruction. What I didn’t know is what happened before and after in the life of Oppenheimer.

During the earlier years, I was surprised by how active Oppenheimer and other people were in the projects of the communist party. It sounds as during those days, for many Americans, it wasn’t the enemy’s ideology but a potential solution to their ongoing socioeconomic problems. Some glorified the Soviet Union before they knew and understood how tyrannical it was. I can’t begin to fathom at the absurdity of the witch hunt that was McCarthyism and what a negative force it excreted on the American scientific society. I can’t help but notice the parallel with the trial against Alan Turing.

What surprised me the most about what I read in this book was Oppenheimer’s transformation. You could never guess that the boy and young man described in the early chapters could ever become a leader of scientists, a pragmatic that could put a practical goal above the intrinsic curiosity that pushes people into science and achieve so much. I guess the fear of a Nazi world was a great motivator.

★★★★☆

Buy American Prometheus: The Triumph and Tragedy of J. Robert Oppenheimer in USA
Buy American Prometheus: The Triumph and Tragedy of J. Robert Oppenheimer in the UK
Buy American Prometheus: The Triumph and Tragedy of J. Robert Oppenheimer in Canada

Book Review: Life in the United Kingdom: A Guide for New Residents by Great Britain Home Office

81DKEZAB9NLThe only real way to judge this book is whether it helps you pass the Life in the United Kingdom test or not and I don’t yet know that. I’ve read the book (it actually took me one full day to go through all of it) and I’m probably going to re-read at least once, but for my actual study I’m using the mock tests at: https://lifeintheuktests.co.uk/life-i… I’ve found many sources of mock tests, but that one seems to have the hardest questions and I personally know someone that passed the test studying from there.

Judging the book by itself, I found it terrible. There’s two reasons for that:
– It’s written for the lowest level of English that would allow you to become a citizen, so, the prose is terse and simple.
– It’s designed to cover just the information you need to pass the test and nothing more, so, it’s almost a regurgitation of facts.

About the last point, for some bits of history that I know a bit about and that are super interesting (WWI, WWII, Scotland’s joining the UK, and a few more) I found the book super boring and skipping all the interesting bits just because it’s not in the exam. It makes sense for this book but it makes for a boring book. I have to admit that it made me curious about some things that I want to read more about and also some places I want to visit now.

★☆☆☆☆

Buy Life in the United Kingdom: A Guide for New Residents in USA
Buy Life in the United Kingdom: A Guide for New Residents in the UK
Buy Life in the United Kingdom: A Guide for New Residents in Canada

Restoring window sizes in JavaFX

Update 2018-05-23: Updated the code to my current version, which fixes a few bugs.
When doing usability testing of an alpha version of Dashman, one thing that I was strongly asked was to have the windows remember their sizes when you re-open the application. The need was clear as it was annoying to have the window be a different size when re-started.

The new version of Dashman is built using Java and JavaFX and thus I searched for how to do this, how to restore size. I found many posts, forums, questions, etc all with the same simplistic solution: restoring width and height, and maybe position.

What those were missing was restoring whether the window was maximized (maximized is not the same as occupying all the available space, at least in Windows). But most important than that, none of the solutions took into consideration the fact that the resolutions and quantity of screens could be different than the last time the application run, thus, you could end up with a window completely out of bounds, invisible, immobile.

I came up with this solution, a class that’s designed to be serializable to your config to store the values but also restore them and make sure the window is visible and if not, move it to a visible place:

// Copyright (c) 2017-2018 Flexpoint Tech Ltd. All rights reserved.

package tech.dashman.dashman;

import com.fasterxml.jackson.annotation.JsonIgnore;
import javafx.application.Platform;
import javafx.geometry.Rectangle2D;
import javafx.stage.Screen;
import javafx.stage.Stage;
import lombok.Data;
import tech.dashman.common.Jsonable;

@Data
public class StageSizer implements Jsonable {
    private static double MINIMUM_VISIBLE_WIDTH = 100;
    private static double MINIMUM_VISIBLE_HEIGHT = 50;
    private static double MARGIN = 50;
    private static double DEFAULT_WIDTH = 800;
    private static double DEFAULT_HEIGHT = 600;

    private Boolean maximized = false;
    private Boolean hidden = false;
    private Double x = MARGIN;
    private Double y = MARGIN;
    private Double width = DEFAULT_WIDTH;
    private Double height = DEFAULT_HEIGHT;

    @JsonIgnore
    private Boolean hideable = true;

    @JsonIgnore
    public void setStage(Stage stage) {
        // First, restore the size and position of the stage.
        resizeAndPosition(stage, () -> {
            // If the stage is not visible in any of the current screens, relocate it the primary screen.
            if (isWindowIsOutOfBounds(stage)) {
                moveToPrimaryScreen(stage);
            }
            // And now watch the stage to keep the properties updated.
            watchStage(stage);
        });
    }

    private void resizeAndPosition(Stage stage, Runnable callback) {
        Platform.runLater(() -> {
            if (getHidden() != null && getHidden() && getHideable()) {
                stage.hide();
            }
            if (getX() != null) {
                stage.setX(getX());
            }
            if (getY() != null) {
                stage.setY(getY());
            }
            if (getWidth() != null) {
                stage.setWidth(getWidth());
            } else {
                stage.setWidth(DEFAULT_WIDTH);
            }
            if (getHeight() != null) {
                stage.setHeight(getHeight());
            } else {
                stage.setHeight(DEFAULT_HEIGHT);
            }
            if (getMaximized() != null) {
                stage.setMaximized(getMaximized());
            }
            if (getHidden() == null || !getHidden() || !getHideable()) {
                stage.show();
            }

            new Thread(callback).start();
        });
    }

    public void setHidden(boolean value) {
        this.hidden = value;
    }

    private boolean isWindowIsOutOfBounds(Stage stage) {
        for (Screen screen : Screen.getScreens()) {
            Rectangle2D bounds = screen.getVisualBounds();
            if (stage.getX() + stage.getWidth() - MINIMUM_VISIBLE_WIDTH >= bounds.getMinX() &&
                    stage.getX() + MINIMUM_VISIBLE_WIDTH <= bounds.getMaxX() &&
                    bounds.getMinY() <= stage.getY() && // We want the title bar to always be visible.
                    stage.getY() + MINIMUM_VISIBLE_HEIGHT <= bounds.getMaxY()) {
                return false;
            }
        }
        return true;
    }

    private void moveToPrimaryScreen(Stage stage) {
        Rectangle2D bounds = Screen.getPrimary().getVisualBounds();
        stage.setX(bounds.getMinX() + MARGIN);
        stage.setY(bounds.getMinY() + MARGIN);
        stage.setWidth(DEFAULT_WIDTH);
        stage.setHeight(DEFAULT_HEIGHT);
    }

    private void watchStage(Stage stage) {
        // Get the current values.
        setX(stage.getX());
        setY(stage.getY());
        setWidth(stage.getWidth());
        setHeight(stage.getHeight());
        setMaximized(stage.isMaximized());
        setHidden(!stage.isShowing());
        // Watch for future changes.
        stage.xProperty().addListener((observable, old, x) -> setX((Double) x));
        stage.yProperty().addListener((observable, old, y) -> setY((Double) y));
        stage.widthProperty().addListener((observable, old, width) -> setWidth((Double) width));
        stage.heightProperty().addListener((observable, old, height) -> setHeight((Double) height));
        stage.maximizedProperty().addListener((observable, old, maximized) -> setMaximized(maximized));
        stage.showingProperty().addListener(observable -> setHidden(!stage.isShowing())); // Using an invalidation instead of a change listener due to this weird behaviour: https://stackoverflow.com/questions/50280052/property-not-calling-change-listener-unless-theres-an-invalidation-listener-as
    }
}

and the way you use it is quite simple. On your start method, you create or restore an instance of StageSizer and then do this:

public void start(Stage stage) {
    StageSizer stageSizer = createOrRestoreStageSizerFromConfig();
    stageSizer.setStage(stage);
}

I haven’t put a lot of testing on this code yet but it seems to work. Well, at least on Windows. The problem is that this snippet is interacting with the reality of screen sizes, resolutions, adding and removing monitors, etc. If you find a bug, please, let me know and I might release this a library with the fix so we can keep on collectively improving this.

What Star Trek: Discovery should have been

Star Trek DiscoveryMy opinion of Star Trek: Discovery is positive, but there’s still something that annoys me and since it’s a bit of a spoiler, you should stop reading here until you watched season 1.

Star Trek: Discovery shouldn’t have been a prequel. STD (oops, unfortunate acronym) should have been a sequel to all the other Star Treks we had. I don’t understand why they made it a prequel. It’s not trying to explain an origin story; if anything, it’s destroying Star Trek cannon.

If it was a sequel, in the 25th century:

  • the uniforms wouldn’t be an issue
  • the introduction of new races wouldn’t be an issue
  • the introduction of a human that went through Vulcan academy wouldn’t be an issue (she could be Spock’s protege, instead of Spock’s father’s protege)
  • the Klingons looking different wouldn’t be an issue
  • flat screens and holograms wouldn’t be an issue
  • the use of a sort of holodeck wouldn’t be an issue
  • discovering a way to teleport through the galaxy without needing warp drives wouldn’t be an issue
  • we could have Star Trek: The Next Generation, Voyager and Deep Space 9 cameos.

The BorgWhy make it a prequel then? There’s no advantage to having it be a prequel. You could still have a war with the Klingons if they wanted to bank on their fame (although a war with the Borg is much more frightening in my opinion, specially since peace with the Borg is impossible).

They couldn’t have the flip phones, I mean, the communicators, which apparently are iconic enough to put on one of the posters, but aren’t the badge communicators also iconic? And if not, it feels like a small lose.

I don’t understand this obsession with needles prequels, are people afraid of the future? of moving forward and seeing what happens next?

Book Review: Things to Make and Do in the Fourth Dimension by Matt Parker

81xpnk+4DXLI was expecting a funny read of math curiosities and indeed there was plenty of humor and curiosities in this book in the style of Matt Parker (Google him and watch his videos, he’s great); but this book had much more than that.

Some parts of the book were not easy at all. I’m glad things were not dumbed down too much for us plebes. Some parts I couldn’t understand a lot and I just skipped them. Mind you, this was bed-time reading for me, so, I didn’t put a huge effort into it.

Something that surprised me when reading this book is how much we don’t know. From studying math in school and college it feels like we have most of it figured out, but I like how often Matt points to corners of the math world that don’t look, but probably are, too complex and they are not know or resolved at all. Similarly, how much of the math that we know is rather young, as in 20th century or second half of the 20th century.

I’m happy to recommend this book to everybody that enjoy maths but for people that don’t, they should read this book, as it might change your mind.

★★★★☆

Buy Things to Make and Do in the Fourth Dimension in USA
Buy Things to Make and Do in the Fourth Dimension in UK
Buy Things to Make and Do in the Fourth Dimension in Canada