Shared posts

30 Mar 05:21

Does God Exist?

by Stephen Downes
Église Saint-Jean-Baptiste de Saint-Jean-de-Luz, photo by the author.


Prompted by a sketch on CBC radio, I was curious this morning to see how Google would answer the question, "Does God exist?" To my mild surprise, the first page of results consisted of statements that God does, in fact, exist.

I don't know whether or not God exists. But I have no good reason to believe that God exists. No evidence to suggest existence. No reason not to disbelieve. And that's why I was surprised to see a page of Google results all arguing in favour of existence.

Now let me be clear. If you wish to believe in God that's your right, and I respect that decision. Belief in God is not a simple matter, and involves much more than simple arguments and evidence. I respect that. And rest assured that whatever my own beliefs, I take your faith seriously, and I celebrate that fact about you.

The list of articles on Google's front page, however, are a different matter. They are addressed to people who don't know the answer to the question of whether God exists, and they offer reasons to believe. It would be nice if Google offered a more balanced view. And that's the purpose of this post.

Basically, the plan is this: I'm going to look at the reasons these articles give us to believe in God, and explain why they are not actually good reasons.

The first article offers us "six straightforward reasons to believe that God is really there."

1. The complexity of our planet points to a deliberate Designer who not only created our universe, but sustains it today.

This first argument points to the fact that the Earth is perfectly suited to life, and to the complexity of life on earth, and suggests that the only explanation for this is that God exists, created life on Earth, and continues to sustain it. The author also argues that "evolution alone does not fully explain the initial source of the eye or the brain."

This is known as the teleological argument for God's existence and has been around - and refuted - for several centuries.

To understand why this isn't a good argument for the existence of God, let's suppose that all of our other answers actually do fall short. We don't know why the Earth is perfect. We can't explain exactly the human eye or brain came into existence.

It doesn't matter. There might not be any explanation. If you have an infinite number of monkeys typing on an infinite number of typewriters, one of them will eventually create the complete works of Shakespeare. If you have an infinite number of planets, one of them will produce perfect conditions for life. What if they couldn't? Well, then we wouldn't exist.

We presume that there must be an explanation, and that this explanation can be knowable by humans. That's a lot to presume. Too much, I think, to provide good reason to believe that God exists.

2. The universe had a start - what caused it?

This is known as the cosmological argument for the existence of God, and has been around even longer than the first.

It is especially popular these days because of the existence of the big bang theory of the universe - the idea that at a point some billions of years in the past, the universe came into existence with a big bang, and has been expanding ever since.

So the cosmological argument is essentially this: "The universe has not always existed. It had a start...what caused that?"

I'm pretty sure I don't know what caused the big bang. I'm pretty sure you don't either. In fact, I'm not sure there was a cause at all! When we say that "everything has a cause" - how do we know?

Indeed, the concept of causation is itself a very weak foundation on which to build an argument. It might be that there are no causes at all. The concept of causation might be something we invented as humans in order to make sense of the world. You can explore this argument in the writings of David Hume.

3. The universe operates by uniform laws of nature. Why does it?

This is sometimes known as the natural law argument and is similar to the argument we just considered. And yes, scientists have expressed amazement that the world appears to follow natural laws.

As argument above, there might not be any reason why there are natural laws. Or even if there are reasons, we might not have discovered them yet.

Equally likely, though, is the proposal that there might not be any natural laws, at least, not in the sense that this argument describes them. The argument is this: the laws might not exist in nature. They might only exist in our minds.

When we look at random things, we see patterns in them. This is something we do all the time. When we look at clouds, we see animals. Human brains are essentially pattern-recognition devices. So it's no surprise that we recognize patterns.

When it comes to natural laws, though, we take the concept a step further. We think of these laws as an explanation for the natural world. We talk as though natural laws control phenomena in the world. That they have independent - and infinite - existence. But we have no reason to believe any of this is true.

But suppose all of this was true. We still don't have any reason to believe that, because of this, God exists. There might be no reason why natural laws exist, or the explanation for them might be beyond us.

4. The DNA code informs, programs a cell's behavior.

This is a variation on the teleological argument. It is essentially this: "DNA is a three-billion-lettered program telling the cell to act in a certain way. It is a full instruction manual... You cannot find instruction, precise information like this, without someone intentionally constructing it."

The problem with this argument is that I could use the exact same evidence to argue for the opposite conclusion. I could argue that "DNA is precise information that programs the creation of a human being, and it was not designed, therefore, you can find precise information like this without someone intentionally constructing it."

When they say "you can find precise information like this without someone intentionally constructing it" I just say "why not?" And it is here that the argument cannot be made.

It's like, if we look at something really complicated, like a human being, you cannot be surprised to find it created and run by something really complicated, like DNA. I look at this and way, "well, what did you expect to find?"

Humans are complex. We all knew that. But it doesn't follow that God exists.

5. We know God exists because he pursues us. He is constantly initiating and seeking for us to come to him.

This argument is sometimes called the trademark argument, and can be found in the writings of Rene Descartes. "The mere fact that I exist and have within me an idea of a most perfect being, that is, God, provides a very clear proof that God indeed exists."

As I said above, this morning I typed "Does God exist" into Google. By the time I sat down to read this article, an email advertisement called 'Sync with God' had appeared in my email. But that wasn't God pursuing me. It was a direct marketing company called Vertical Response.

The author of this article writes, "I didn't realize that the reason the topic of God weighed so heavily on my mind, was because God was pressing the issue." But of course there could have been may other reasons why the topic of God was on their mind.

Indeed, I think of many things that don't exist. For example, I have frequently thought about my Nobel Price. I wonder how the present King of France gets along with the Queen. I often think about the way I can fly though the air unaided.

6. Unlike any other revelation of God, Jesus Christ is the clearest, most specific picture of God revealing himself to us.

The argument here is that though Jesus God actually presented himself to the world. "Look throughout the major world religions and you'll find that Buddha, Muhammad, Confucius and Moses all identified themselves as teachers or prophets. None of them ever claimed to be equal to God. Surprisingly, Jesus did."

It should go without saying that the mere fact that someone says they are God does not prove the existence of God. We would need additional evidence to show that they actually are God.

We are told two things: first, that he said that he was God, and second, that the miracles prove that he is God. There isn't sufficient evidence to believe that either statement is true.

The best evidence for the first statement is the evidence of what he said in the Bible, and yet even in the Bible he doesn't actually come out and say that he is God, but rather uses vague metaphors like "I am the light of the world" and "I am the way, the truth, and the life, no one comes to the Father but through me."

But even if he said it, do the miracles prove it? For the sake of argument, let's suppose that the miracles actually happened as described in the Bible - that he cured the sick, raised the dead, fed the hungry, walked on water, etc. Do these things prove that he is God?

Numerous alternative arguments suggest themselves (and have been thoroughly explored in science fiction). Maybe he was an alien. Maybe he was an illusionist. Maybe he was a skilled doctor. Maybe he was a magician, either a real one like Merlin or the djinn, or a fake one like Harry Houdini. 

The second set of results from the Google search reference the work of the respected philosopher Alvin Plantinga and offers eight reasons to believe God exists. Plantinga is required reading for those who study modal logic (that is, the logic of necessity and possibility). Most of the arguments have nothing to do with Plantinga, so we'll look at them first.

God is the best explanation for...

The first four arguments offered in this article overlap with the articles we just discussed above, and I won't restate them. Suffice it to say that they are all of the form "God is the best explanation for x" where 'x' is existence, or causation, or design, etc.

This type of inference - 'inference to the best explanation' - is known more formally as abduction and originates with Charles Sanders Pierce (though the form has been around a lot longer). It's the sort of reasoning employed by Sherlock Holmes.

But what makes something the best explanation? It's the best if it's the only explanation, and you have ruled out all other possibilities (which is what Sherlock Holmes did). But often, there are other explanations. So what makes one explanation better than another? This is the subject of a lot of debate, but in general, scientists prefer:
  • the simplest explanation (this is known as Ockham's Razor)
  • the deepest explanation (that is, it explains multiple things, the way Newton's laws explained the movements of the planets and the movement of objects with a single unified theory)
  • that the explanation be testable, that is, that it make predictions that could be proven false
Given these principles, God is very rarely the best explanation. When we build a bridge, we do not depend on faith, we depend on the principles of engineering. When we cure the sick, we do not rely on prayers, but on modern medicine.

The result is what is sometimes called 'God of the Gaps' whereby God is used to explain a smaller and smaller set of unexplained phenomena. At a certain point, we may run out of gaps; either we'll know the explanation, or we'll know why it's unexplainable.

Now I'm going to pick up the numbering from the second article.

5. God is the best explanation of intentional states of consciousness.

The problem of consciousness is what philosopher David Chalmers calls the hard problem. This this problem isn't just about the problem of consciousness itself (which I argue elsewhere is nothing more than experience itself) but about intentionality.

"Intentionality is the property of being about something or of something. It signifies the object-directedness of our thoughts." How can we mean anything? A lot has been written over the years about intentionality, ranging from Edmund Husserl's description of phenomenology to Jerry Fodor's account of representation. We can get a sense of how difficult this problem is by reading Saul Kripke on naming and necessity.

According to this argument, no physical object has intentionality, while intentional states fit comfortably into a theistic worldview, and so, God is the best explanation for intentionality.
  
The core problem (to my mind) of intentionality is that for one thing to stand for another, there must be a third thing - a perceiver - that recognizes it as such. So if an experience - a sensation or whatever - stands for an object or state of affairs in the world, there must be a third thing - a mind - that makes this connection. And this is what fits comfortably into a theistic worldview.

However, none of this proves that God exists. Perhaps the concept of God explains intentionality, but it is unlikely to be the best explanation. Our experience of, and understanding of, intentionality is the same whether or not we believe that God exists in order to explain it.

For my own part, my own theory of mind is a non-representational theory of mind. That is, I don't think that our conscious thoughts actually stand for anything. They just are what they are. The article suggests, "for atheists, there really are no intentional states." Quite so. It is very possible that we are fooled into believing we have intentional states or that we falsely believe there are intentional states.

6. God is the best explanation of objective moral values and duties.

Again we have an argument of the form "God is the best explanation for..." and so I would apply all the arguments from above to this argument here.

That said, this is known as the argument from morality and is a very common argument for the existence of God and is statement in its most famous recent formulation by C.S. Lewis (yes, the same person who wrote Chronicles of Narnia).

The form of the argument is this: first, there is a universal objective moral law that applies to all. But if God did not exist, objective moral values and duties would not exist. Therefore, God exists.

We can read a lot or argumentation trying to show that there is, indeed, one universal moral law; it's the type of argument that appears on a regular basis in newspapers, magazines and even academic journals. Just the other day I read an article about Oxford philosopher Oliver Scott Curry's research suggesting there are seven underlying moral principles in all societies.

Are there objective moral values common to all societies? I have my doubts. Even Curry admits that these seven principles are prioritized in different ways by different societies. Some societies value loyalty over honesty, while others value the reverse. Even with only seven moral values there are 127 possible moral codes that result.

Others say that there is a single moral code common to all, that we should treat others as we, ourselves, would wish to be treated. Perhaps - though in a world of narcissists, masochists, exhibitionists and more, I'm not sure such a rule could be coherently formulated, let alone applied. In fact, we all want to be treated very differently, which makes the golden rule fundamentally incoherent.

That said, let's suppose that there is such a moral code, whatever it is. Does it follow that God exists? No, it does not. Numerous other alternative explanations exist, ranging from the suggestion that we just invent moral principles (J.L. Mackie) to the idea that we have a social need for them (Kai Nielsen) to the idea that we have a moral 'sentiment' in the same way we have a sense of balance or a sense of pleasure and pain (David Hume).

For myself, I believe that I am a moral person, but I believe that my own morality is based partially on my own sense of compassion and empathy, and my own choice to live in a world where these matter.

7. The very possibility of God’s existence implies that God exists.

This is Plantinga's argument, and is a variation on the ontological argument for the existence of God, originally formulated by Thomas Anselm.

Anselm's argument is this: In our mind, we can imagine the greatest being. It could just exist in our mind. But existing in the world is greater than existing in the mid alone. So, we cannot imagine the greatest being without the greatest being actually existing.

This is similar to a set of arguments questioning whether we can grasp certain concepts in the mind without outside help. Take the concept of infinity, for example. We all have an idea of infinity (just start counting, and keep going...) but could we have that idea without infinity actually existing?

The difficulty with this sort of argument is that there seems to be no limit to what we can imagine. It seems to be very easy to imagine things that don't exist. The fact that something is possible doesn't make it true.

This is where Plantinga comes in. His arguments are based in modal semantics. The idea is, if there is a statement that is 'possibly true', then there is a 'possible world' in which the statement is true. Meanwhile, a statement is 'necessarily true' if it is true in every possible world. So Plantinga's argument is that if it is possible that a statement is necessarily true (that is, it is true in one possible world) then it is true in all possible worlds. In other words, any possible necessary truth is necessarily true.

God's existence, it is argued, is a possible necessary truth. Therefore, God's existence is necessarily true.

We need to be careful here (in a way this argument is not careful). The question is not "is it possible that God exists?" The question is "is it possible that it is necessarily true that God exists?"

That's where we are being misled by this article: "So the question is, is God’s existence possible? Well, what do you think? The atheist has to maintain that it’s impossible that God exists. That is, he has to maintain that the concept of God is logically incoherent, like the concept of a married bachelor or a round square."

No. It's the other way around: is denying the existence of God like saying that there are unmarried bachelors or round squares. Is denying the existence of God possible?

I think it is, and I think the proof of this lies in the question itself. We don't need to argue that there are no unmarried bachelors, or that there are no round squares. But we do need to argue (evidently) for the existence of God. Therefore, denying the existence of God is indeed possible.

Indeed, there are atheists who take this argument a step further, and argue that it is not possible that God exists! We are told "The idea of a being who is all-powerful, all-knowing, and all-good in every possible world seems perfectly coherent," but to many people, it does not seem coherent at all. Could God make a stone so heavy he could not lift it? Could God do something that is not good? This is known as the omnipotence paradox. These questions linger, and seem to speak not for the possibility of the existence of God, but against it.

8. God can be personally known and experienced.

This is known as the argument from religious experience, and it is discussed in numerous works over the years, the best known of which is probably William James's The Varieties of Religious Experience.

I don't doubt that people have religious experiences. I've personally known people who have had them - one person I knew saw God in the second level commissary, and another saw his own angel in the window. I don't doubt either experience, and more, there's no doubt that they were transformative and in at least one case led to a deep religious faith.

But, you know, just because we think we saw something doesn't mean we saw it, at least, not in the sense that it is sufficient evidence for other people to believe you saw it. Indeed, the problem with religious experiences is that they're just the sort of thing that can't be used as evidence. They're transient. They're personal. They require interpretation.

What makes me take religious experience seriously is the impact they have on people. They may not prove that God exists, but they have a characteristic impact on people. They are what Rudolf Otto called 'mysterium tremendum et fascinans' - as mystery that is at once awe-inspiring or even fearful, and which is fascinating and draws us toward it.

But again, such experiences are not a proof of the existence of God. As Scrooge says, it "may be an undigested bit of beef, a blot of mustard, a crumb of cheese, a fragment of underdone potato."
 
On yet another one of Google's first page results there's another set of arguments that need to be considered.

Reason 1: Life is Ultimately Meaningless Without God

This is a commonly heard argument. "If God does not exist, life is ultimately meaningless. If your life is doomed to end in death, then ultimately it does not matter how you live. In the end it makes no ultimate difference whether you existed or not."

The problem with this argument is that there might not be a reason why we exist. The embrace of this (unpleasant) conclusion is called existentialism, and it is essentially the philosophy that there is no reason for existence. We just exist; that's all there is to it.

As Wikipedia says, "While the predominant value of existentialist thought is commonly acknowledged to be freedom, its primary virtue is authenticity. In the view of the existentialist, the individual's starting point is characterized by what has been called 'the existential attitude', or a sense of disorientation, confusion, or dread in the face of an apparently meaningless or absurd world."

It is worth noting that this freedom ultimately makes religion a choice, and that you can gradually come to believe that something is true by making the decision to believe that it is true. Søren Kierkegaard called this the 'qualitative leap', or as we know it today, the 'leap of faith'.

For my own part, I have said in the past that I think that the reason we are alive is because it's possible, and the reason we die is to continue to allow it to be possible, by allowing our form of existence to grow and develop and adapt and flourish.

Reason 2: Without God We Live Without Hope 

The argument here is that "If there is no God, then there is ultimately no hope for deliverance from the shortcomings of our finite existence." For example, "there is no hope for deliverance from evil... we are locked without hope in a world filled with gratuitous and unredeemed suffering (and) there is no hope of deliverance from aging, disease, and death."

The appeal here is partially to the idea of an ideal life after death, in heaven, and partially to the ideal of a heaven on earth. The argument is that, without God, these ideals are unreachable.

The first response is that it may just be that these ideals are unreachable. We may dislike the idea that there may be no life after death (I know that I do) for example, but our dislike for something doesn't make the opposite possible. There may actually be no hope. Indeed, religion may just be one manifestation of the denial of death, the denial of our inevitable fate, as the only way to make day-to-day life bearable.

The second response is to make the point that the only real hope for any of these things is the hope we create for ourselves. As the saying goes, God helps those who help themselves.

To the extent that we have been able to reduce evil and suffering on earth, and even to make modest advances against death, I credit not the existence of God, but the work of dedicated and selfless doctors, scientists and public servants (including, I hope, myself) through history.

Reason 3: If God Exists, You Can Know His Love Personally

This argument speaks to the heart of human longing and desire. "Think of it! That the infinite God should love you and want to be your personal friend! This would be the highest status a human being could enjoy!"

It would indeed, but again, it may be the sort of thing that's unattainable. We can imagine love and friendship, even if we don't have these in our own lives, and for those without that, religion has an undoubted appeal.

But as even the arguer admits, "none of this shows that God exists."

The suggestion is that "it makes a tremendous difference whether God exists." But that's not what makes the difference. What makes the difference is whether you believe that God exists. If you can believe it, and if you can believe God loves you, it helps you manage even if you are otherwise friendless and unloved.

I'm not going to argue against that. Indeed, it points to some of the good that religion can do. But I want to be equally clear about the risk here that people purporting to be religious use the need for love and friendship to prey on those in need.

There can be false Gods and false prophets., There can be people who falsely proclaim that you are loved and needed while at the same time manipulating that love and need to their own ends, to the detriment of both the genuinely religious and to society at large.

The article continues with some additional arguments - the cosmological argument, the teleological argument, the argument from morals, which I'll skip because I've covered them above (though I do like the duiscussion of J.L. Mackie and Michael Ruse in this particular article).

God makes sense of the historical facts concerning the life, death, and resurrection of Jesus.

This was essentially the creed I repeated when in church as a child.  It is known as the Christological argument. Essentially the argument is that Jesus was executed, buried, and resurrected from the dead, and the only way this could have happened is if God existed to make it happen.

It is difficult to know precisely what happened roughly 2,000 years ago, but even if we accept the minimal facts version offered by Gary Habermas, it would be a remarkable occurrence.

The first question to is is whether it actually happened. There are many other explanations that have been offered over the years to the effect that (say) people were told Jesus was executed, but it didn't happen, or, that a body double was used, or that Jesus was taken down before he actually died, etc. I am not in a position to judge whether any of these is true.

But it is noteworthy that it is not unambiguously true - after all, if I had come back from the dead to prove my divinity, I would have paraded my living flesh up and down the main road in Jerusalem and dared the Romans to do it again. But there are many ways all of these events could have taken place.

A second question to ask is whether Jesus could, in fact, have come back from the dead. It had already happened before, according to Biblical accounts, in the raising of the son of the widow of Nain. In fact, the Bible records that Jesus raised three people from the dead: Jairus daughter (Mark 5:22-43);the widow's son (Luke 7:11-15), and his friend Lazarus (John 11:1-44). It may be, as some argue, that being 'raised from the dead' was quite common in Biblical times.

So let's assume Jesus was raised from the dead. Does this prove that God exists?

Again, it comes back to the question of whether the existence of God is the best explanation for the resurrection of Jesus. And, arguably, it does not pass the test. The very fact that resurrection was so common speaks against it being extraordinary, which in turn speaks against it being the exceptional sort of event that could only be explained by God's existence.

In fact, there have been numerous cases of people being 'risen from the dead' in post-Biblical times. In some of these cases, a religious explanation is offered. But many others are explained more scientifically, sometimes as cases of what has come to be known as the Lazarus phenomenon.

In short, if you don't already believe in God, you aren't likely to believe in the resurrection. Even if you do believe in God, you might not believe the resurrection. And you can believe in the resurrection even if you don't believe in God.

Conclusion

I don't have much more to say about the question of whether God exists than this. Google's front page may offer a bunch of arguments for God's existence, but they are, on the whole, not very good arguments. We wouldn't accept them in other aspects of our life.

The arguments for the existence of God (like the arguments for so many things) are based in general on some sort of understanding that we think we have of the world - that complex things must be designed, that there must be a cause for everything, that the laws of nature are universal truths, that what we see or feel exists, that we can know that some things must be true, and so on.

But we are learning today that many of these truisms aren't true. We know that time moves backwards, that complex things organize themselves, that objective reality is an illusion - we know that the world, far from being understood, is far stranger than we can imagine.

That we can claim to have proven the existence of God in a world where we can't even prove the existence of the cup on my desk in front of me seems to be unreasonable. And so I conclude that we haven't proven that God exists, nor that there is any prospect of our doing so without a substantial revision to our understanding of the world.

p.s.

I know that these arguments have focused on a Christian God. This is because the Christian God is the focus of most of the arguments I have seen offering proofs for the existence of God.

I know there are many religions and many conceptions of God. My objective here was not, and is not, to argue that any one or another of them is true or not true. I am specifically and only interested in the question of whether these arguments are successful in their stated intent of proving the existence of God.

And let me reiterate from above that I take religion very seriously. I take your religion very seriously, and I celebrate and honour your faith. My academic studies in philosophy were supplemented with numerous courses in religious studies (enough to have constituted a minor has I declared it). I have read your religious texts and visited your places of worship. I will probably wrestle with these questions as long as I live, and I am happy for those who have found comfort and peace in their own faith.


30 Mar 05:20

Transit Line Usage

by Stephen Rees

Translink usage diagram

This diagram was created by Mark Pope who posted it to the Facebook group Expo Line Memes for TransLink Oriented Teens (ELMTOT). He has given me permission to use it here and he has also provided links to the original data and his spreadsheet.

This is a very good way to understand how the transit system works, and changes one’s perception of the relative importance of the lines. I think the thing that surprised me the most was the difference between the 99 B-Line and the Millennium Line – and also how ridership quickly tapers off on the west side of Vancouver.

West Coast Express is not shown but had 2.3 million boardings in 2017 compared to 105m on the combined Expo and Millennium Lines.

I am not going to close comments, but I think it would be a good idea, if there are any questions, to ask them on the Facebook group rather than here.

30 Mar 05:20

Chromedown

I am beginning to get more serious about building a Chrome extension, provisionally called...
30 Mar 05:20

Turn Knob to Start

by peter@rukavina.net (Peter Rukavina)

The Rice Northwest Museum of Rocks & Minerals is located in a purpose-built ranch-style house west of Portland.

The washroom near the phosphorescence room is a bona fide residential washroom, in resplendent pink, complete with shower, tub, and dual sinks.

And an Automatic Bathroom Ventilator.

30 Mar 05:20

Grabbing Screengrab Images Using Selenium (Also Works in MyBinder)

by Tony Hirst

It being roundy-roundy motorsport season again, here’s a recipe for grabbing a screenshot of a live timing screen and then emailing it to one or more people.

One of the reasons for using Selenium is that timing screen pages are often updated using data received over a live websocket. There’s no real need to keep shipping all the timing data, just the bits that change. Using a browser to grab the screenshot rather than having to try to figure out the data can make life easier if you don’t want to manipulate the data at all. For some background about such Javascript rendered pages, see here. Of course, we could also use selenium to give us access to the “innerHTML” as rendered by the Javascript. I’ll maybe have a look at that in a future post…

The recipe uses a headless version Firefox automated using selenium and can run in a MyBinder container.

A Dockerfile that can load in the necessary bits looks like this:

#Use a base Jupyter notebook container
FROM jupyter/base-notebook

#We need to install some Linux packages
USER root

#Using Selenium to automate a firefox or chrome browser needs geckodriver in place
ARG GECKO_VAR=v0.23.0
RUN wget https://github.com/mozilla/geckodriver/releases/download/$GECKO_VAR/geckodriver-$GECKO_VAR-linux64.tar.gz
RUN tar -x geckodriver -zf geckodriver-$GECKO_VAR-linux64.tar.gz -O > /usr/bin/geckodriver
RUN chmod +x /usr/bin/geckodriver
RUN rm geckodriver-$GECKO_VAR-linux64.tar.gz

#Install packages required to allow us to use eg firefox in a headless way
#https://www.kaggle.com/dierickx3/kaggle-web-scraping-via-headless-firefox-selenium
RUN apt-get update \
    && apt-get install -y libgtk-3-0 libdbus-glib-1-2 xvfb \
    && apt-get install -y firefox \
    && apt-get clean
ENV DISPLAY=":99"

#Copy repo files over
COPY ./notebooks ${HOME}/work
#And make sure they are owned by the notebook user...
RUN chown -R ${NB_USER} ${HOME}

#Reset the container user back to the notebook user
USER $NB_UID

#Install Selenium python package
RUN pip install --no-cache selenium

With everything installed, we can create a headless Firefox browser as follows:

from selenium import webdriver
from selenium.webdriver.firefox.options import Options

options = Options()
options.headless = True

driver = webdriver.Firefox(options=options)

In the page I am interested in, a spnny thing is displayed in an HTML tag with id loading whilst a web socket connection is set up and the timing data is loaded for the first time.

undesiredId = 'loading'

I also create a dummy filename into which to save the screenshot:

outfile = 'screenshot.png'

Grabbing a screenshot of a page at a particular URL can be achieved using the following sort of approach, which waits for the spinny thing tag to disappear before grabbing the screenshot.

from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By

#Set a default screensize...
#There are other ways of setting up the browser so that we can grab the full browser view,
#even long pages that would typically require scrolling to see completely
#For example: https://blog.ouseful.info/2019/01/16/converting-pandas-generated-html-data-tables-to-png-images/
driver.set_window_size(800, 400)

#Load a webpage at a specified URL
driver.get( URL )

#Handy bits...
#EC.visibility_of_element_located
#EC.presence_of_element_located
#EC.invisibility_of_element_located

#Let's wait for the spinny thing to disappear...
element = WebDriverWait(driver, 10).until( EC.invisibility_of_element_located((By.ID, undesiredId)))

#Save the page
driver.save_screenshot( outfile )
print('Screenshot saved to {}'.format(outfile))

If I need to select a particular tab in a tabbed view, I can also do that. In the screen I am interested, the different tabs have different HTML tag id values:

tabId = "Classification"

element = browser.find_element_by_id(tabId)
element.click()
element = WebDriverWait(browser, 10).until( EC.visibility_of_element_located((By.ID, tabId)))

I can then grab the screenshot…

Having saved an image, I can then email it.

If you have a Gmail account, sending an email is quite straightforward because we can use the Gmail SMTP server:

import smtplib, ssl, getpass

port = 465  # For SSL

sender_email = input("Type your GMail address and press enter: ")
sender_password =  getpass.getpass(prompt='Password: ')

# Create a secure SSL context
context = ssl.create_default_context()

receiver_email = "user@example.com"  # Enter receiver address
message = """\
Subject: Timing Screen

Here's some email; but what about the attachment?"""

with smtplib.SMTP_SSL("smtp.gmail.com", port, context=context) as server:
    server.login(sender_email, sender_password)
    server.sendmail(sender_email, receiver_email, message)

A recipe I found here describes how to add an image file as an attachment to an email; and one I found here describes how to use images embedded in an HTML email.

A copy of a notebook associated with this recipe, along with the example email’n’images code, as applied to TSL live timing, can be found here.

What I need to do next is a bit more selenium scraping to pull out metadata from the timing screen itself, such as the race it applies to. It would also make sense to grab all the screen tabs on a particular timing screen.

The next step would be to set something running so that the script could watch the timing screen and then email out the final results screen for each race. I’m not sure if the selenium browser is continually updated by the socket connection that drives the timing screen page, and whether it can watch for the race status to change to FINISHED, and then away from it to reset the script so it is ready to email out the next final classification.

But I can’t try that or test it right now. The timing screens have shut down for the day, and I’ve also spent the whole of this beautiful day in front of a screen rather than in the garden. Bah…:-(

PS By the by, we could also load the geckodriver in directly from a Python script:

#By the by, there is also a Python package for installing geckodriver
! pip install --no-cache webdriverdownloader
#This can be used as follows within a notebook
from webdriverdownloader import GeckoDriverDownloader
gdd = GeckoDriverDownloader()
geckodriver, geckobin = gdd.download_and_install("v0.23.0")

#If required, the path to the drive can be set explicitly:
from selenium import webdriver
browser = webdriver.Firefox(executable_path=geckobin, options=options)
30 Mar 05:19

My ChromeOS apps and extensions

by Doug Belshaw

I came across a pretty nifty service called Loom yesterday that allows you to record both your screen and webcam in the browser. Perfect for ChromeOS, which is the operating system I’m using most of the time at the moment.

To give it a test drive, I recorded a video showing the ChromeOS apps and extensions I use on the Chromebox in my home office.

Between this and WeVideo, I reckon everything apart from really high-end video editing can be done in the browser if you’ve got a decent internet connection. I can definitely see me using this for creating quick tutorial videos and I’ve already used WeVideo to edit green screen videos for clients!

30 Mar 05:19

VHF Walking Tours with John Atkin

by Gordon Price

From the Vancouver Heritage Foundation: 2019 Walking Tours with John Atkin.

Starting in May, John will explore the industrial heritage and history found across Vancouver. John’s walks are extremely popular so we recommend signing up early if you’d like to attend. Both May dates are filling quickly and are close to capacity. A full list of May to October dates and topics is now up on the Walking Tour page.

Select Saturdays from 10am to 12pm

Register for all walks here, $16

 

‘AN INDUSTRIAL CITY’

In 2019 join John Atkin to explore Vancouver’s industrial heritage and history

 

June 8: Vernon Street

A lost waterfront, duck hunting ground, indigenous portage route and home to the arts and taxis.

 

July 6: From Creek to Trains

The eastern reaches of False Creek were filled for rail yards, passenger depots and a home for industry in the early years of the 20th Century and change is once again on the horizon.

 

July 20: Shipyards, Salt and the Olympics

The southeast corner of False Creek has become one of the city’s newest residential neighbourhoods leaving behind its heavy industrial past.

 

August 10: Beer, Boxes and Tents

Once home to a number of industries including a brewery, Jones Tent and Awning and a host of other firms attracted by the rail access, the district today is an interesting mix of modern construction and heritage buildings.

 

August 31: Vegetables, Furniture and Flowers

Chinese vegetable wholesalers and retailers rubbed shoulders with other small scale industry on the edge of Mount Pleasant and the fertile valley between Main St and Fraser St.

 

October 5: Foundries, Lumber and Baseball

Before the construction of the Granville Street Bridge, the area was home to the Capilano Stadium and the local baseball team. Foundries and lumber yards were mixed in with a collection of houses and churches in the surrounding neighbourhood.

 

October 19: Take Me to the River

For thousands of years the Fraser River and its shoreline has been an important food source and transportation corridor. It has long been a major industrial
artery and is now an emerging residential area.

30 Mar 05:19

Pixels Camp 3.0

by Rui Carmo
It was an awesome event, with an even better team. (Photo credit: tofran on Twitter)

Wow, the past three days were a blast. In case you’re just tuning in, this year I was back at Pixels Camp (along with roughly 1600 other people) wearing many hats, and we all had an amazing time. And like last year, I decided to do a litte summary of what went on from my perspective–except that this time I’m doing it a little bit earlier.

Wearing Our Party Hats

Me and Carlos, minus the hats.

First off, myself and Carlos Morgado (the former evil Quizmaster, now retired–from being Quizmaster, that is) were invited to run two of the “fun” evening events (Chasing Ghosts and Presentation Karaoke) as well as providing live commentary on Code In The Dark, which meant:

  • putting together a bunch of utterly insane presentations on video (which saved us the trouble of having a computer on stage) the week before, amidst business trips and “regular work”
  • popping over to the venue the evening before to set up and configure two Pis with Lakka (the real challenge was getting the controllers to work)
  • and just after dinner on the first day, taking off our “sponsor hats” and running around three different stages in various stages of mild panic

That meant setting things up, tearing them down (always with the help of Hipnose, who are simply the best production company in town), keeping notes on each contest and, above all, keeping the audience entertained with various forms of witticism (which, if you know us, was utterly hilarious for both ourselves and the audience, although I suspect we had marginally more fun).

Finally, for good measure, we ended up bringing Celso and Paulo Laureano (the former Arcade Master) to the stage on the last day to play in front of everyone while we waited for the hackathon votes to come in:

The moment when Celso finally stopped complaining about the controllers (which he picked, incidentally) not working.
He's also about to lose another life in DigDug. (Photo credit: Delfim Machado)

I didn’t have the time to help figure out this year’s T-Shirt challenge (which was both insane and awesome, and involved using a ZX Spectrum), sit down with the Lobsters (you know who you are, you lovable fiends) or go up on the infamous Quiz (although Carlos played a round), but I had a lot of fun.

Oh, and this year we had actual physical badges, too:

Badges? We don't need no... Oh, well, maybe we do.

Representing Microsoft

Since my company was one of the sponsors, during the day time I spent a good while in the booth and among project tables talking to participants and helping them with their projects:

There are quite a few people missing from this shot, but it's the best one I have.

I also got to be up on stage a few times officially, the first of which was to introduce our challenge, which this year was all about using the MxChip 3166 to build IoT solutions.

As it happened, it dovetailed nicely with Gulbenkian’s Hack For Good challenge, and I was able to do the pitch right on time:

The clock was ticking, and (by design) sponsors couldn't see it...

To my great personal satisfaction, many projects decided to tackle both challenges–and the best-scoring IoT project (a smart device for fall detection and medication reminders for the elderly) was neck-and-neck with the winner until the last minute, losing only by a meagre 100 kai (which was the new currency for the event):

A snapshot of the hackathon leaderboard

And guess what, the vast majority of projects in the Top 10 used Azure in one way or another (and 4 of those 10 used the IoT Kit), so I was pretty happy with the way things turned out overall, especially considering that at least two of those teams (which I interacted with directly) started pretty much from scratch (without prior knowledge of either the IoT Kit or Azure) and still managed to build working prototypes under 48 hours.

I was also specially pleased by Kind (a project from University of Aveiro, and staffed by people I know) having won an extra award for their anti-cyber-bullying chat bot.

My last official act was to hand out the 4th place award, and by that time my feet were officially killing me too:

Up on stage again with the 4th place winners

But I’d do it all again without hesitation, and am already looking forward to the next edition…

Like I said to quite a few people over the past few days, it’s like our very own Christmas party, for an ever-expanding extended family and with great traditions–like this one:

(Video Credit: Fernando Miguel)

30 Mar 05:19

Week Notes 19#12

by Ton Zijlstra

As we near the end of Q1, this was a week that felt sluggish, slow like swimming in syrup.

  • Created some rolling forecasts (liquidity, acquisition, time allocation, and projects) with my colleague Jochem. As we are entering a different phase with my company (e.g. more people), it is becoming more important to have some key things easily visible to my partners.
  • Worked on a project plan for a Malaysian client, current starting data estimated to be in June
  • Provided some input on data granularity to that client, for training they were providing this week to data holders
  • Monthly phone conference with the director and deputy director of Open State Foundation (of which I’m the chairman of the board)
  • Decided on a location for the IndieWebCamp Utrecht in May
  • Spent a day with my company’s partners discussing our course for the next nine months
  • Worked on a project for a Dutch province
  • Voted in the provincial elections and the water authority elections ( Netherlands’ oldest democratic institutions). These were the first elections since we moved into this region 2 years ago, so had to orient myself on what’s what and who’s who.
  • Loaded up on new books, as it is national book week.
  • As weekly hack or rather odd job, with help of the little one, I repaved the roof terrace where most tile stones were askew
30 Mar 05:19

Spring has sprung: dynamo lighting upgrade part 2

by jnyyz

Well spring is here according to the calendar, and this weekend was the first one where it actually felt like it. It was time to put the winter bike to bed.

According to my records, it looks like I’ve logged about 122 rides on it this past winter (brings me to 588 rides on this bike). There were some major upgrades this year: Schwalbe Winter Marathons, and dynamo lighting.

Also time to take the studded tires off of the Haul a Day. Note the Mr Tuffy tire liners.

I have a replacement front wheel with an Alfine dynamo hub, courtesy of Hoopdriver.

The rim is a Sun Rhyno Lite, which is double wall and much stouter than the old rim. You can see that it is wider also.

Mounting it on the bike, I find out that there is no disc brake adjustment required. Sweeeeet!

At the same time, I notice that there is a little rust on the Connex “stainless steel” 8SX speed chain, mostly around the pins. I only put this on the bike a little over a month ago, so I’m not impressed.

Contrast this to the 100% stainless chain from KMC that is on the winter bike. (this chain is several seasons old)

The parts guy at Urbane cyclist advised me that this particular KMC chain is now out of production, so there aren’t too many more to be had.

Now time to install the headlight, a B&M Eyc N Plus. Martin @Hoopdriver found me a little standoff so that I could mount the light on my fork. I had considered mounting it on the front basket, but then it wouldn’t turn with the front wheel.

Proof that the light works. The lighting pattern has a dark shadow to the left that is cast by the wheel that is just beside the headlight.

Here’s the standlight feature.

and here’s what I look like on the move. Nice side visibility.

30 Mar 05:19

What are first-class functions?

by Eric Normand

First-class functions are functions that can be treated like any other value. You can pass them to functions as arguments, return them from functions, and save them in variables. In this episode, we talk about why they are important for functional programming and what features we require of them.

Transcript

Eric Normand: Our first-class functions. By the end of this video, you will know what they are, you will know some of the required features that we need for functional programming, and why they are important for functional programming. My name is Eric Normand, and I help people thrive with functional programming.

First-class functions are important because they’re a basic requirement for writing higher-level abstractions with functions. You could do it with classes, but that’s a different paradigm.

Without them, we wouldn’t have tools like map, filter and reduce, and we wouldn’t be able to compose functions up into new functions. This is something that is one of the main benefits of functional programming. Not the primary benefit, but I guess you could call it the main secondary benefit.

Let’s go over a few points about first-class functions. What does it mean? A first-class function, first-class anything, means that the function can be, if it’s first class, it means it can be treated like a value.

Anything you can do to a value such as a number or an array or vector, a list, a string, any of those values, what can you do with them? You can pass them to functions, you can store them in variables, you can return them from functions. All of those things make it first class. It means it has the same status.

Think about second-class citizens, they don’t have the same status as the first-class citizens. That’s the idea here, that a first-class function has the same status as other values. Functions are just values.

We can do all those things. We can put them in a variable, we can pass them as arguments to other functions, we can return them from other functions. This makes it so that we can manipulate functions like you would manipulate numbers or strings, and things like that.

This means you can start doing what is often called metaprogramming. You’re programming your programs. We’ll talk a little bit more about that in a minute.

You want your first-class functions to also be what are called closures. That’s closure with an s. What this means is that the function can refer to variables in the scope where the function was defined.

You have some variable, let’s call it x. In that scope where x is defined, the next line, you define a function, you can refer to x in the body of the function. Even if you return that function from wherever that scope is, that function somehow gets out of the scope. When you call that function, it’s still referring to the same x that you had before. That’s what it means.

We do this in JavaScript. We probably don’t even think about it, but when you define a function inside of another function, it has access to the arguments, to the local variables that are defined there in JavaScript.

For instance, as an example, Java for the longest time did not have closures. You could define an anonymous class that had a method, but that method couldn’t refer to variables in the scope where that class was defined. Now it has lambdas, those are closures, and so everything’s all right.

Without them, it makes it very difficult. You have to make a lot of leaps and do a lot of gymnastics to get the same functionality. You basically have to build an object — this is in Java — you’d have to build an object and assign all of the variables you might need later, all the values you might need later, into that object. It’s a lot of ceremony for what should be syntactically very easy.

Another thing is, when you have first-class functions, we were talking about metaprogramming, one thing you want to do is to separate out concerns so that you can reuse part of the concern in another place.

One thing I find in languages that don’t allow such abstraction, or where it’s not very common at least, is you’re writing a lot of low-level code. People call it boilerplate. You’re writing for-loops all the time, or where you’re repeating yourself over and over. How can you possibly turn that into a first-class operation?

In Java, let’s give an example in Java, you can make a for-loop first-class. The way in Java you make things first class is you turn them into a class. You make a class and now you can instantiate it, and now you have an object. It’s a value, like other objects. You can pass it around, it can be an argument to a function, etc.

You make an object called for-loop, a public class for-loop, and it takes some kind of operation to do at each step, and then when to end. You can make that, and then it’s first-class, so you can pass it to something else, and you can reuse the functionality.

The problem is in Java, reusing the functionality usually uses more lines of code than doing it with a for-loop the first time, whereas if you have something like, in JavaScript, you can take the for-loop, and you realize, “OK, a lot of times the for-loop is creating a new array from this existing array. Why don’t we use map?

“We make a function called map that is this one use for a for-loop, and we have to pass it to function. The functions are pretty easy to define, and so now we’ve eliminated a whole bunch of moving parts, or they’re taken care of automatically by map. We don’t have to initialize the index variable, we don’t have to increment it, we don’t have to remember how to end the loop.

“All of that’s taken care of for us, and all we get is the values. We tell it how to transform the value. We don’t even have to initialize the array or anything, the thing that’s returned. All of that stuff is handled for us.”

This is what I mean by being able to have higher-level abstractions. The ability to pass functionality, which is what a function is, is a way of encapsulating code, some procedure or some calculation, into a little package, and that you can pass that package around.

Now you can say, “This is what I want you to do to my array,” for instance. That gives us map, filter and reduce. Without higher-order functions, we couldn’t have them. I don’t know what else to say. It’s functionality that is repeated, it’s boilerplate, we get to get rid of it.

Another thing is something like, what are called combinators. Combinators, there’s a technical definition for it, but it’s mostly used as a function that will take one or more functions and transform them into a new function. There is a technical term in lambda calculus, a technical usage for it, but in practice, in the industry, that’s what people use combinators for.

What would this be like? A good example is a memoize function. This is a function that memoizes another function.

There’s a function called memoize. You pass it a function, and it will memoize it, meaning it will cache the results so that you don’t have to call the function twice for the same results. It has a little object in there that stores the cache, and it checks in the cache before it calls the function. It does that by wrapping this function in another function. It’s pretty simple to write.

There’s another combinator that you might have where, let’s say you have a function that makes a Web request, and that Web request could fail. What do you do?

You make another function that takes the function, and it will call it three times. It returns a new function that calls it three times. This will automatically retry if there’s a failure. Of course the third time if it fails, then it will fail for real.

This is a way of capturing these concerns and separating them out from the specifics of the functionality. You’re able to, say, try three times as separate from what you’re trying three times, and now there’s a way to combine them back together.

The last thing I want to talk about is you can do what I’m going to call basic functional programming, without first-class functions. What I mean by that is there is a lot of value in simply thinking about the difference between actions, calculations and data.

Actions are things that have an effect on the world, or it matters how many times you call them or when you call them. Calculations are timeless relationships between inputs and outputs. They’re just computations. Data is inert stuff with structure and meaning that you can apply to it.

Just that, I believe, will give you a lot of value. Knowing that, “I have to be careful when I call this, but I can call this as many times as I want.” That will tremendously improve your software.

There’s another level which is to be able to get these benefits of using higher-order programming. That’s not just using map, filter and reduce, but building your own. Realizing that there’s a lot of benefit to reusing this one piece of functionality.

That’s when you pull things apart, you can see how they work a little bit better. Higher-order functions let you pull things apart. You don’t have to write them all together in continuous code. You can put stuff into a function and pass it to something else.

Let’s recap. First-class functions are functions that we can treat like values, like strings or numbers. They need to be closures, closures with an s, meaning they can refer to variables in the scope that they’re defined in. These are what led us to map, filter and reduce, and also developed combinators, which transform functions from one thing to another.

We can do basic FP, but we can’t do more advanced functional programming, which is where it gets really interesting, the idea of being able to separate out this, I guess I want to call it boilerplate. [laughs] That’s the term people use. Separate out all this boilerplate stuff, nail it down, capture it as a small piece of functionality that’s totally reusable.

Do yourselves a favor. Have a look at your code and see if there’s any places where you couldn’t pull out first-class functions. See if there’s things where you already used first-class functions. They’re very powerful, and you should be using them more. Everybody should.

Do me a favor. If you liked this, I try to go deep on these topics where I could just give the definition, but I like to make it practical, bring in some deeper thinking on the idea. If you like this one, then you should subscribe, because there’s more like it coming down the pipe.

If you have a question, a comment, you want me to talk about something, you want me to go deeper on something, or you disagree with me, that’s cool too, email me at eric@lispcast.com. You can find me on Twitter, I’m @EricNormand with a d, or find me on LinkedIn and we can talk there. Awesome. See you later.

The post What are first-class functions? appeared first on LispCast.

25 Mar 21:47

2019 BMW iDrive 7.0 Review: Going deeper and deeper

by Ted Kritsonis
MWW X5

BMW has tried to make its iDrive infotainment system feel more streamlined, and while there’s still plenty of work to do, the latest changes are starting to make a difference.

Not every model the automaker makes is running iDrive 7.0 right now, but more are coming, especially this year. I test drove the system on two separate weeklong drives in the 2019 X5 crossover SUV, along with the deeper app integration it offers.

Some things have changed, while others stayed the same. Android users are still left out of the mix, as there’s no support for Android Auto, or even Google Assistant via Bluetooth. If you’re an iPhone user, however, there’s plenty here to work with.

The basics

BMW iDrive wireless charging

The X5 features an elegant interior all around. It’s the sort of cabin you can drive in for long stretches and never feel really uncomfortable. The ergonomics of everything inside is one aspect, but the other is in how the different pieces work together.

As has been standard to this point, iDrive continues to function through the rotary dial and shortcut buttons surrounding it. The German automaker has flirted with touchscreens before but seems to be all in more often now. The 12.3-inch display is big, vibrant and responsive, should you want to lay a finger or two on it.

Much of what’s inside the system is based on a hybrid approach. If not touching the screen, there’s the wheel. If not the wheel, there are buttons or gestures. If not those, then the steering wheel or voice control could help.

BMW iDrive gesture controls

Punctuating all that is the connectivity involved. The in-car Wi-Fi hotspot and Qi wireless charging pad are included. You get 3GB for the first three months (whichever expires first) and then go prepaid under the service AT&T offers for BMW ConnectedDrive.

Apple CarPlay is now included with the system from the factory, but you’ll have to pay for it following the first year. The first 12 months come with the car, and after that, you have to subscribe again via BMW’s ConnectedDrive online. The options are for one year or 20 years.

Connections and layout

BMW iDrive media menu

BMW ultimately included different elements it had previously introduced in different models. For example, gesture controls were first added to the 7 Series a couple of years ago, only to be held back from other models. The X5 has them, and they work far better now than they did before.

When I pointed my finger in mid-air about halfway down the dash (in view of a small infrared camera), and rotated it clockwise or counter-clockwise, I raised and lowered the volume, respectively. If I made a thumbs up sign, tilted it sideways and swiped right, I would skip a track. If I tilted it back and went left, I would repeat one. If I held up two fingers, I could play or pause audio.

I was never sold on this when it first launched because it was awkward and gimmicky. Not that it still isn’t, to some degree, but I found myself kind of liking them after a while. The volume controls were sometimes easier than reaching for the volume knob. Skipping tracks was even more convenient, given where the physical track navigation buttons were.

All the other connections are pretty standard for BMW, at this point. USB, 12-volt, Aux-In, Bluetooth, Wi-Fi — they’re all there. Adding a USB-C port in the centre console storage compartment modernizes the ports a little, though the USB-A port is more conveniently located at the front.

The wireless charger is nestled underneath, deeper into the dash. It’s almost as if BMW did that to dissuade drivers from even reaching for the phone.

CarPlay on a big screen

BMW iDrive CarPlay

CarPlay’s integration is basically the same, save for the larger screen that makes every part of it visually stand out more. Icons are big and bright, adding to the convenience of touching the screen. Still, the platform integrates well with the rotary dial, too.

It does take time to learn the timing. Unlike the touchscreen’s instant feedback, the dial needs to cycle through the menu. Each click becomes an audible and visual measure of where you’re at. It may not feel intuitive at first, but having used it over a few test drives now, I personally feel acclimated with it.

I do like that Siri can at least launch apps by voice, and Apple Music is better with voice integration when compared to Spotify, Tidal or Google Play Music. Here’s hoping that Apple might open up indexing the Spotify library to get to a point where Google Assistant and Alexa are now.

BMW X5 centre controls

Most automakers supporting CarPlay still don’t offer it wirelessly. BMW has done so since first adopting it, and I’ve loved it every time since. Other than charging it, I never really had to take it out of my pocket. Siri works very well in tandem with BMW’s own voice activation system, requiring a long press to trigger it. A short press will always bring up BMW’s.

The physical map button on the centre console goes to whichever mapping app was last opened on the iPhone. It’s a subtle way of cutting out Apple Maps — unless, of course, you happen to like using it. If you last used Waze or Google Maps, it will open that up. The catch is that you need to have the app still open. It doesn’t work if you quit it completely.

Where Android fits in

BMW iDrive interface

Android Auto has no presence whatsoever in iDrive, and it’s not clear when that will change. The automaker has previously expressed concern for privacy based on how Google collects drivers’ data, so we’ll see how that impasse gets solved if it ever does.

One option might be to bake a VPN into the system to cover Android users, but that seems unrealistic on such a large scale. Plus, BMW would probably want to offer that as a subscription service. Android users could also use a VPN of their own on their phones, but that’s beside the point. There’s simply no level of integration that rivals what iPhone users get.

The Screen Sharing feature is one of those that is distinctively non-Apple. It works with devices supporting Miracast, which sometimes comes built-in to some phones. For example, Samsung has long offered Smart View as a way to screenshare with compatible devices, and it works with BMW’s system as well.

It’s cool that it’s there, though it’s limiting when you don’t have screens for the back seats. The Galaxy Note 9 and Galaxy S10+ I tested it with worked fine on the display in front. I used the in-car Wi-Fi and played video from Netflix, YouTube, NHL, and DAZN, but could only actually watch when in park. For safety reasons, it won’t play any video while the car is moving.

That negates using the larger screen for mapping apps, too. Nothing on the phone’s screen will show when not in park. The one alternative would be to use the standalone Android Auto app on the phone and mount it on the dash or vent.

ConnectedDrive app

BMW iDrive Connected app

For a long while, Canadian BMW drivers were left out on a lurch with the ConnectedDrive app. It was even worse for Android users. Now, the gap’s finally closing with U.S. counterparts, thanks to a suite of useful features with the current app.

For BMW models with in-car SIMs (of which there are many), the app can control or access certain functions remotely. For instance, remote start, lock/unlock, lights and the horn are all accessible. You can set the climate inside for a set time every day — perfect for starting a morning commute before even entering the vehicle. It may not be as instantaneous as a physical fob, but it was pretty neat that I could remote start, unlock, and then drive the car without the fob at all.

Send a destination from the phone to the in-car navigation map, and see the car in Remote 3D View, giving you a perspective around it. It’s not integral, but it was yet another feature Canadians were waiting for.

The app is pretty deep otherwise, too. It offers the car’s manual, sections for recalls and diagnostics, roadside assistance, dealership appointments, and more. It’s particularly good at helping to navigate the array of menus and sub-menus within the system. For example, since Remote 3D View isn’t enabled at first, the app lists the steps to do so.

BMW iDrive Screen Mirroring

BMW’s voice activation is useful in the same way. When I said, “Hey BMW, hotspot,” it showed the SSID and password for the in-car Wi-Fi. If I was looking for a specific feature or mode, it wasn’t hard to find it by voice.

BMW also added sections to learn about Apple Watch and Samsung SmartThings integration. I don’t have either product right now, so couldn’t fully test how they would work. Unfortunately, there’s no dedicated app for Samsung smartwatches. Hardly surprising, considering Android is still on the ‘classic’ Connected app, which was woefully underserved to begin with. Now, it’s terribly obsolete.

The good news is there’s a U.S. version of the current app. Use a VPN to get it and you shouldn’t have a problem connecting it with your car and using it thereafter.

The post 2019 BMW iDrive 7.0 Review: Going deeper and deeper appeared first on MobileSyrup.

23 Mar 21:04

Brexit: What's the f**k is going on?

mkalus shared this story from tomwalker78's YouTube Videos.

From: tomwalker78
Duration: 07:43

By taking back control the UK has shown that it's out of control.

For more info go to: jonathanpie.com

23 Mar 20:50

Why Apple AirPods Came to Be Everywhere :: GQ

by Volker Weber

ZZ16FD4B70

AirPods have also altered the expectations of how increasingly complex headphones and intensely complex smartphones should work together, on your behalf. They’ve done what no other Bluetooth headphones ever had: make Bluetooth not suck (assuming you have an iPhone). They connect, immediately. They hiccup less. They require almost none of your attention for annoyances and instead deliver little moments that feel, to get a little Disney World here, delightful. They’re awkward and magical in equal measure.

If you have an iPhone and no AirPods, you are missing out.

More >

23 Mar 20:49

Zane Lowe on Why Apple Music Is in the Storytelling Business

by Federico Viticci

Speaking of Apple Music and Billie Eilish, Tim Ingham, writing at Music Business Worldwide, has an interview with Zane Lowe. It's a good interview that covers a range of topics from how Lowe builds relationships with artists to what differentiates Apple Music and what they see in Billie Eilish.

An artist like Billie Eilish thinks in sounds, she thinks in colors, she thinks in visuals, she thinks in collaborations, she thinks in all kinds of different forms of creativity. When you’re dealing with an artist like that, it opens all these other areas that you can help build things around.

With Billie, there’s color everywhere, this attitude and it’s like, ‘Wow, this is really interesting.’ At Apple, because of where we’ve all come from, we understand streaming, but [we’re thinking], ‘How can we make a streaming service that is deeper and more layered and speaks to the aspects of music we grew up loving?’

I don’t ever want to look back on my time in the streaming era and think, ‘Yeah man, great job at just building a utility.’

Functionality is so important; [a service] needs to work and it needs to be intuitive. But there should 100% be room for creative discovery and it should be 100% driven by the artists, or at least in collaboration with artists.

See also: this interview with Billie Eilish and her brother/co-writer Finneas and Zane Lowe from last month. It was originally posted on Beats 1 but you can also watch the YouTube video below.

→ Source: musicbusinessworldwide.com

23 Mar 07:27

Thoughts on Apple's Revised iPad Line

by Neil Cybart

In what has become something of a trend, Apple once again unveiled a few iPad strategy adjustments in March. This year’s changes include an update to the 7.9-inch iPad mini and altering the 10.5-inch iPad Pro to arrive at a lower-priced and rebranded 10.5-inch iPad Air. The best way to analyze these updates is to look at Apple’s broader iPad strategy and the significant amount of change that the product category has undergone in just the past two years.

Changes

iPad mini. The most noteworthy change to the iPad mini was that it received an update in the first place. The last time the iPad mini received an update was in September 2015. Over the subsequent three years, iPad mini sales have steadily declined and now represent a small fraction of overall iPad sales. As smartphone screen sizes increased, the market for a tablet with a 7.9-inch screen shrunk. Sales for the iPad mini won’t surpass record level put in years ago, a claim referred to as Peak iPad mini. However, there was likely still enough demand for a 7.9-inch iPad to warrant an update.

The most noticeable update to the iPad mini will be found on the performance front related to the A12 Bionic chip. The iPad mini 4 had an A8 chip. The new iPad mini also has an improved display and Apple Pencil support (1st generation). Apple maintained the $399 price for iPad mini while cutting entry-level storage in half to 64GB. In addition, Apple removed the number nomenclature, instead opting for the much simpler and cleaner “iPad mini.”

iPad Air. Apple positioned the new 10.5-inch iPad Air as the successor to the 9.7-inch iPad Air 2 that was discontinued back in early 2017. In reality, the new iPad Air is more of a 10.5-inch iPad Pro successor that had components removed in order to have a lower price. The new iPad Air retails for $499 while the 10.5-inch iPad Pro went for $649.

  • Primary addition (from the 10.5-inch iPad Pro): A12 Bionic chip

  • Primary subtractions (from the 10.5-inch iPad Pro): 12MP camera, quad speakers, ProMotion, less RAM, 4K video recording.

Another minor change includes Apple removing the 512GB capacity option.

Three Sales Phases

When looking at the broader iPad category, there have been three distinct sales phases over the years:

  1. Rocket launch

  2. Implosion

  3. Stabilization

Exhibit 1: iPad’s Three Sales Phases

iPad's There Sales Phases

Rocket launch. The iPad was Apple’s best-selling product out of the gate with 22M units sold in the first twelve months. It is going to be difficult for another Apple product to come close to achieving iPad’s early sales success. While there were likely a number of factors that came together to produce a perfect storm for iPad’s record launch, fascination with iOS on a large screen (the iPhone had a 3.5-inch screen when the iPad launched) and a thriving iOS app ecosystem provided plenty of fuel for the iPad rocket.

Implosion. iPad sales peaked at the end of 2013 at 74M unit sales on a trailing twelve months (TTM) basis. Three years later, the iPad sales runrate stood at 41M units. Three factors are behind the dramatic decline in sales: less demand for iPad mini, a longer upgrade cycle, and the broader iPad category being cannibalized by more capable iPhones.

Stabilization. The iPad business has been trending at a 44M annual unit sales run rate for the past two years. The combination of sales to new users and sales to existing users is roughly flat year-over-year. Apple’s decision to bifurcate the iPad line with more capable and powerful models at the high end and increasingly lower-priced models at the low end has played a major role in stabilizing sales. It also hasn’t hurt that the sales headwind associated with declining iPad mini demand has ended.

Current Line

The iPad line currently consists of five models and a few dozen SKUs when considering storage options and case colors.

  • iPad Pro (11-inch and 12.9-inch)

  • iPad Air (10.5-inch)

  • iPad (9.7-inch)

  • iPad mini (7.9-inch)

It may be easy to look at the five preceding models and conclude that Apple is aiming to copy the Mac line with a few “Pro” models at the top end and lower-priced models branded as “Air” and “mini” at the other end. Some may even think Apple is trying to recreate the 2x2 matrix Mac quadrant from the late 1990s in which Apple sold four Macs, two portables, and two desktops, targeting the consumer and professional markets.

However, there is one critical error in the preceding assumption.

Touch-based computing has blurred the line between consumer and professional devices. Each iPad model is used by a wide range of users. In addition to being a content consumption device, the iPad mini is utilized in various enterprise settings. Meanwhile, the 12.9-inch iPad Pro, combined with the Apple Pencil, can be either used for a wide range of content creation tasks or simply web browsing and content consumption. There isn’t one device that ultimately targets just consumer segments or enterprise use cases.

Instead, Apple’s iPad strategy seems to be following more of a hybrid approach, taking elements of both the Mac and iPhone lines.

In terms of nomenclature, there is no question that Apple is borrowing from the Mac. The MacBook Air is the best-selling and most popular Mac. The popularity is one reason why Apple decided to stick with the Air branding following last year’s update. Similarly, Apple is likely positioning the iPad Air at $499 to be one of the better-selling iPad models. Similar to the Mac mini, the iPad mini will then likely represent a smaller percentage of overall sales while handling a variety of enterprise use cases.

The strategy found with taking the 10.5-inch iPad Pro form factor and removing components and technology to lower the price and arrive at the 10.5-inch iPad Air is reminiscent of the iPhone SE strategy. The move to unveil the latest industrial design with the Pro models at the top is also something seen with the iPhone.

Borrowing from both the Mac and iPhone playbooks make sense when considering the iPad has a user base that measures in between that of Mac and iPhone. At end of the 2018, the iPhone, iPad, and Mac user bases were as follows:

Consumer Choice

One of the largest complaints facing the iPad line over the years has been the complexity and confusion in terms of the number of models available for purchase. Apple has done a few things to add clarity. Instead of keeping older models in the lineup at lower prices, management has moved to having a few new iPad models at prices ranging from $329 to $999. In addition, Apple has worked on reducing price gaps between models. The $250 price gap that had existed between the 10.5-inch iPad Pro and iPad mini 4 has been reduced to $100 with the new iPad Air and iPad mini.

  • iPad Pro (12.9-inch): $999

  • iPad Pro (11-inch): $799

  • iPad Air (10.5-inch): $499

  • iPad mini (7.9-inch): $399

  • iPad (9.7-inch): $329

There is no question that some customers use price to select the best iPad. Accordingly, the $329 iPad and $499 iPad Air will likely be strong sellers. In order for Apple to reach these lower prices, the company had to make some difficult product marketing decisions in terms of components, industrial design, and subsequently, Apple Pencil support. The non-Pro models work with Apple Pencil V1 while the Pro models are designed to work with Apple Pencil V2.

Another variable that may guide a customer’s buying decision is screen size. As with price, Apple has done a good job of covering the screen range from 7.9 inches to 12.9 inches.

  • iPad Pro 12.9-inch

  • iPad Pro 11-inch

  • iPad Air 10.5-inch

  • iPad 9.7-inch

  • iPad mini 7.9-inch

Apple continues to position the larger 9.7-inch iPad, instead of the new, smaller iPad mini, as the entry-level option. This is done because larger iPads have become vastly more popular than the iPad mini. Apple did not want to sacrifice that popularity just to have screen size correlate directly to price. In addition, the larger 9.7-inch iPad is marketed to educational institutions (special pricing brings the 9.7-inch iPad to $299).

Ready for WWDC

In recent years, the iPad line has undergone transformational changes. Apple management has not only bet on higher-priced, larger iPads with the Pro segment, but also doubled down on lower-priced iPads in an attempt to compete against Chromebooks and even hand-me-down iPhones.

From a unit sales perspective, the iPad mini’s best days are clearly behind it, and a $999 iPad Pro will likely end up representing a small fraction of overall iPad sales. However, from a hardware perspective, it’s hard to argue we aren’t looking at the strongest iPad line to date. Apple has spent the past three years expanding the iPad line in order to appeal to hundreds of millions of people.

This takes us to software - the missing link. All of the signs point to Apple getting the iPad line ready for new software features unveiled at this year’s WWDC. This week’s hardware updates cap off the first half of Apple’s two-part iPad show.

Receive my analysis and perspective on Apple throughout the week via exclusive daily updates (2-3 stories per day, 10-12 stories per week). Available to Above Avalon members. To sign up and for more information on membership, visit the membership page.

23 Mar 07:05

NAHBS staff pic(k)s.

by brandon

As many of you may or may not know, last Saturday our staff had the chance to take a field trip up to Sacramento and witness the wonder that is NAHBS (North American Handbuilt Bicycle Show.) We saw old friends, drooled all over new bikes, and greased many, many, palms along the way. Literally, we had greasy hands from the burger spot we hit just before entering the venue.

The show itself was nothing short of amazing. Artisan builders from as near as our neighborhood and as far as Japan, all in one space to show off the best of the best of whatever bicycle beauty they're able to conjure up with their own two hands. 

There were, of course, oodles of different awards being given out for number of categories...but there are simply none more prestigious than those of the coveted Mission Bicycle Company staff picks.

Let us begin... 

Nick's Pick: Weis Cycles "Super Magnesium" Track

Nick's pick for top prize at NAHBS is an unconventional (in more ways than one) build from Weis Cycles, based out of Brooklyn, NY. This is their signature Hammer Track frame, which has raised eyebrows for its asymmetrical rear triangle, but built out of an intriguiging new alloy – "super magnesium." 

Joe's Pick: Gaulzetti "Mama Duck" Track

One would be obliged to believe Joe picked his favorite bike of the show based purely off its name if we didn't have photo evidence of how next level the paint job was on this Gaulzetti track machine. Flaunting a gold disco ball-esque chainring and a #matchymatchy Silca pump, the Mama Duck looked like it was just as well suited for the art gallery as it was the velodrome.

Josh's Pick: Stinner "Lemond Homage" Road

The last two bikes in our staff picks were found at the same Team Dream/Mavic shared booth, which was a crowd pleaser in and of itself. Josh's pick of the pack is a modern steel frame roadie built by Stinner Frameworks of Santa Barbara, CA. The build pays homage to one of the most classic paint jobs ever (90's Lemond Team Z colorway) and spared no expense on the components set. This is one of those kinds of builds that makes you want to sell your car and put a deposit down on a new bike.

Brandon's Pick: Fat City Cycles "Slim Chance" Road

Far from new, Brandon's pick of the litter was a mega-rare Fat City Cycles "Slim Chance" absolutely dripping in vintage Mavic components – you see that starfish crank? Not a build for everyone, and in fact only 11 or so were made according to the little placard sitting below the bottom wheel. This one is for all the vintage heads out there.

23 Mar 07:05

Philosophers On a Physics Experiment that “Suggests There’s No Such Thing As Objective Reality”

Justin Weinberg, Daily Nous, Mar 22, 2019
Icon

MIT Technology Review recently published an article entitled “A quantum experiment suggests there’s no such thing as objective reality. Of course, the suggestion fell far short of a proof, but that didn't stop people from speculating. I personally fall into the 'no objective reality' camp, but not because of quantum physics. Anyhow, what's interesting about this set of short articles is that they make clear how important is the interpretation of any objective evidence. No data, no matter how concrete, speaks for itself; what it means depends on what we recognize it to be.

Web: [Direct Link] [This Post]
23 Mar 07:05

Who will really determine our response to climate change

by Gordon Price

 

Munich Re (the insurer’s insurer) may have more impact on society’s response to climate change than scientists and legislators.

From The Guardian:

Insurers have warned that climate change could make cover for ordinary people unaffordable after the world’s largest reinsurance firm blamed global warming for $24bn (£18bn) of losses in the Californian wildfires.

Ernst Rauch, Munich Re’s chief climatologist, told the Guardian that the costs could soon be widely felt, with premium rises already under discussion with clients holding asset concentrations in vulnerable parts of the state. …

After comparing observational data spanning several decades with climate models, the report concluded that the wildfires, which killed 85 people, were “broadly consistent with climate change”.

Nicolas Jeanmart, the head of personal insurance, general insurance and macroeconomics at Insurance Europe, which speaks for 34 national insurance associations, said the knock-on effects from rising premiums could pose a threat to social order. … 

“The sector is concerned that continuing global increases in temperature could make it increasingly difficult to offer the affordable financial protection that people deserve, and that modern society requires to function properly,” he said. …

Dr Ben Caldecott, the director of Oxford University’s sustainable finance programme, said: “Company directors and fiduciaries will ultimately be held responsible for avoidable climate-related damages and losses and urgently need to up their game to avoid litigation and liability.”

Munich Re has divested its large thermal coal holdings. However, it maintains some gas and oil investments.

 

23 Mar 07:05

2018 iPad Pro to Add Support for the Logitech Crayon in iOS 12.2

by Federico Viticci

In addition to the new iPad Air and iPad mini, it looks like Logitech's Crayon stylus, first introduced with the 6th generation iPad last year, will be compatible with the 2018 iPad Pro line too thanks to the upcoming iOS 12.2 software update. Jason Snell writes:

Over at 9to5 Mac, Zac Hall noticed that a few of us—at least myself and Nilay Patel from the Verge, and possibly others—have been passing along an interesting new iPad tidbit after meeting with Apple about the new iPad models this week. I realize that people may have missed the brief parenthetical in my Macworld story this week, so it’s worth restating here…

Logitech’s $70 Crayon, an interesting stylus that originally was available for education only and worked only with the sixth-generation iPad, will now be supported by all of Apple’s current iPad models. So not only do the new iPad Air and iPad mini work with the Crayon, but so does my 12.9-inch iPad Pro running a beta version of iOS 12.2, which should be released next week.

(I haven’t been able to test if earlier iPad Pro models will also add compatibility via this update, or if compatibility is limited to the 2018 and 2019 models.)

If you don't like the design of the new Apple Pencil and would rather use a thicker stylus based on the same drawing tech but that charges via Lightning, the Crayon is a very good alternative to Apple's device. Just keep in mind the differences between them.

→ Source: sixcolors.com

23 Mar 07:05

What Happened Next, Apparently

by Dave Pollard


image by amira_a from flickr, via pixhere, cc by 2.0

What apparently happened was that among the eight humans who had seemingly gathered on the beach to watch the sunset, it was suddenly realized that there was no one. That nothing was real, or unreal. That there was only everything — everything apparently happening.

At first, nothing was said about this. There was just looking in awe at everything, that had always been there but never seen. This was not an awkward silence, as there was no one left to be awkward.

There was much smiling, but not by anyone, or towards anyone or anything in particular, since there was nothing particular to smile at.

No one remarked about how astonishing it was that everything could not have been seen before when it was now so obvious, because there was no one to remark about it, and never had been. Everything had seemingly changed, but it was actually quite ordinary, and nothing had actually changed at all. Just some illusions had disappeared.

The behaviour of the humans did not seem to change at all. As before, the eight humans did what they were conditioned to do, the only things they could have done given the circumstances of the moment, or so it appeared. A careful observer might have detected more (or fewer) far-away looks, less urgency, less anxiety, but the two couples still acted like couples, and the others still acted very much as they seemed to have before, even though there was no longer anyone purporting to inhabit these humans’ bodies.

There was no inclination to start a movement to tell people how awesome it was to see everything, and how tragic it was that, being people, they could never hope to see it. There was no need to do anything. It was just suddenly obvious, but not worth talking about, and besides, there was no one to talk about it, or talk about it with.

None of this happened for a reason. There was nothing special about these particular eight humans, or where they were, or what they were doing, or had been doing in past, when it was realized there was no one. It just happened, apparently. Nothing remarkable at all.

When nothing is real, anything is possible.

23 Mar 07:05

NetNewsWire Sync Diary #1: It Starts with NSBezierPath

In my Vesper Sync Diary I wrote about designing and writing both sides of a syncing system. I could make syncing work however I wanted it to work, and I had control of all of it.

Which is a great way to go. But it’s also terrible, because it means writing and running a server.

With NetNewsWire, I’m lucky in that there are existing systems — such as Feedbin, Feedly, Newsblur, and others — to use. I only have to write the client side.

I’m starting with Feedbin as the first syncing system. The first one is the hardest, of course — since there are a bunch of things the app needs for syncing that can be written once, but that do still need to be written.

How syncing will work

Users will add accounts to NetNewsWire — much as you do in Mail. Each account will have its own section in the sidebar (again, like Mail), which means you could have an On My Mac and a Feedbin account both active at the same time. (Just like you might have work and home email accounts active at the same time in Mail.)

You could even have multiple On My Mac and multiple Feedbin accounts. And, later, accounts with other systems.

When you make a change to the structure of your feeds and folders, the app will communicate immediately with the syncing system to perform the appropriate action. When you make a change to the metadata of an article (such as read/unread/starred status), the action will be coalesced and periodically (though fairly quickly) sent with other actions to the syncing system.

NSBezierPath

So I got started working on this, and almost immediately I found myself doing some custom drawing using NSBezierPath (which is a thing you use to fill and stroke lines, rectangles, circles, and other shapes).

Which sounds crazy, right? NetNewsWire has almost no custom drawing — in fact, before this, the only custom drawing was for the unread indicator (a circle).

And — bigger point — what does drawing have to do with syncing, anyway?

Well. There’s UI. Of course there’s UI — there’s always UI.

Users need to be able to add and edit their sync accounts, and I decided to do it the same way (surprise!) as in Mail — because this way the UI will be familiar to people who use Mail, which is surely a lot of Mac users.

I added a preferences pane called Accounts, and it uses the system-supplied icon for this exact case, and it has a thing like this on the left side…

Screenshot of the table and buttons on left side of the Account preferences

…or…

Screenshot, in dark mode, of the table and buttons on left side of the Account preferences

Looks much like Mail, right? (Not exactly the same, but it’s not important to make it exactly the same.)

The big space on top is a standard NSTableView, and the two buttons underneath are standard gradient buttons.

But what about that bordered gray thing to the right of the buttons? It has a background color and a border on top, right, and bottom edges — but not on the left edge, because that border belongs to the button.

There are a bunch of different ways I could have composed this whole thing, but in the end I just made that a custom view — AccountsControlsBackgroundView.swift — that draws its background and draws those three lines as a border.

(There’s probably an even simpler way using just one NSBezierPath instead of three. Or even a few NSBoxes used as lines. Whatever.)

My point isn’t that there’s anything interesting about this drawing — it’s that, when you go to work on a feature like syncing, the actual meat of the feature (communicating with sync servers) is often very small and easy.

User interface — design and implementation — tends to take up the bulk of the time, by far. By an amount that would surely surprise the heck out of people who don’t make apps.

In other words, it should never be surprising that work on a feature like syncing starts with an NSBezierPath.

Next step

What you see in the screenshots above is as far as I’ve gotten so far. The table view is empty; the buttons aren’t hooked up to anything.

The next step is to make that table view show a list of accounts, which, at the moment, is just the default On My Mac account. It should show the name and type of the account, along with an icon which represents the fact that it’s local-only and not synced.

23 Mar 07:05

A Quick and Tidy Look at the 2018 GSS

by Kieran Healy

The data from the 2018 wave of the General Social Survey was released during the week, leading to a flurry of graphs showing various trends. The GSS is one of the most important sources of information on various aspects of U.S. society. One of the best things about it is that the data is freely available for more than forty years worth of surveys. Here I’ll walk through my own quick look at the data, in order to show how R can tidily manage data from a complex survey.

I decided to revisit a topic that came up a few years ago, in the New York Times and elsewhere, regarding the beliefs of young men about gender roles. The idea was that several surveys seemed to point to some increasing conservatism on this front. The GSS has a longstanding question named fefam:

It is much better for everyone involved if the man is the achiever outside the home and the woman takes care of the home and family.

Respondents may answer that they Strongly Agree, Agree, Disagree, or Strongly Disagree with the statement (as well as refusing to answer, or saying they don’t know).

We’ll grab the GSS Cumulative Data File in Stata’s .dta format, and work from there in R, using the Tidyverse tools, Thomas Lumley’s Survey package, and Greg Freedman Ellis’s srvyr package, which provides a set of wrappers to survey functions that allow them to be piped and worked with in a way familiar to tidyverse residents.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13


library(tidyverse)

library(forcats)
library(ggrepel)
library(haven)

library(survey)
library(srvyr)

library(tools)

We also load some libraries that aren’t strictly needed, but that will make our plots conform to the house style.

1
2
3
4
5
6
7
8


library(showtext)
showtext_auto()

library(myriad)
import_myriad_semi()

This is a quick-and-dirty function we’ll use to clean some age group labels we’ll create in a minute.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29


convert_agegrp <- function(x){
    x <- gsub("\\(", "", x)
    x <- gsub("\\[", "", x)
    x <- gsub("\\]", "", x)
    x <- gsub(",", "-", x)
    x <- gsub("-89", "+", x)
    regex <- "^(.*$)"
    x <- gsub(regex, "Age \\1", x)
    x
}


my_colors <- _function (palette = "cb"){
    cb.palette <- c("#000000", "#E69F00", "#56B4E9", "#009E73", 
        "#F0E442", "#0072B2", "#D55E00", "#CC79A7")
    rcb.palette <- rev(cb.palette)
    bly.palette <- c("#E69F00", "#0072B2", "#000000", "#56B4E9", 
        "#009E73", "#F0E442", "#D55E00", "#CC79A7")
    if (palette == "cb") 
        return(cb.palette)
    else if (palette == "rcb") 
        return(rcb.palette)
    else if (palette == "bly") 
        return(bly.palette)
    else stop("Choose cb, rcb, or bly only.")
}

The names of some of the weighting and stratifying variables.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17


cont_vars <- c("year", "id", "ballot", "age")

cat_vars <- c("race", "sex", "fefam")

wt_vars <- c("vpsu",
             "vstrat",
             "oversamp",
             "formwt",              # weight to deal with experimental randomization
             "wtssall",             # weight variable
             "sampcode",            # sampling error code
             "sample")              # sampling frame and method

vars <- c(cont_vars, cat_vars, wt_vars)


Load in the data to gss_all and create a small subset of it, gss_sm containing just the variables of interest.

1
2
3
4
5
6
7


gss_all <- read_stata("data/GSS7218_R1.DTA")

gss_sm <- gss_all %>%
    select(one_of(vars)) 

Let’s take a look at it:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21


gss_sm

## # A tibble: 64,814 x 14
##     year    id      ballot   age    race     sex       fefam        vpsu
##    <dbl> <dbl>   <dbl+lbl> <dbl> <dbl+l> <dbl+l>   <dbl+lbl>   <dbl+lbl>
##  1  1972     1 NA(i) [IAP]    23 1 [whi… 2 [fem… NA(i) [IAP] NA(i) [IAP]
##  2  1972     2 NA(i) [IAP]    70 1 [whi… 1 [mal… NA(i) [IAP] NA(i) [IAP]
##  3  1972     3 NA(i) [IAP]    48 1 [whi… 2 [fem… NA(i) [IAP] NA(i) [IAP]
##  4  1972     4 NA(i) [IAP]    27 1 [whi… 2 [fem… NA(i) [IAP] NA(i) [IAP]
##  5  1972     5 NA(i) [IAP]    61 1 [whi… 2 [fem… NA(i) [IAP] NA(i) [IAP]
##  6  1972     6 NA(i) [IAP]    26 1 [whi… 1 [mal… NA(i) [IAP] NA(i) [IAP]
##  7  1972     7 NA(i) [IAP]    28 1 [whi… 1 [mal… NA(i) [IAP] NA(i) [IAP]
##  8  1972     8 NA(i) [IAP]    27 1 [whi… 1 [mal… NA(i) [IAP] NA(i) [IAP]
##  9  1972     9 NA(i) [IAP]    21 2 [bla… 2 [fem… NA(i) [IAP] NA(i) [IAP]
## 10  1972    10 NA(i) [IAP]    30 2 [bla… 2 [fem… NA(i) [IAP] NA(i) [IAP]
## # … with 64,804 more rows, and 6 more variables: vstrat <dbl+lbl>,
## #   oversamp <dbl>, formwt <dbl>, wtssall <dbl+lbl>, sampcode <dbl+lbl>,
## #   sample <dbl+lbl>

The read_stata() function has carried over the labeling information from Stata, which might be useful to us under other circumstances. Columns with, e.g., <dbl+lbl> designations behave like regular <dbl> (double-precision floating point numbers), but have the label information as metadata.

Now we clean up gss_sm a bit, discarding some of the label and missing value information we don’t need. We also create some new variables: age quintiles, a variable flagging whether a respondent is 25 or younger, recoded fefam to binary “Agree” or “Disagree” (with non-responses dropped).

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28


qrts <- quantile(as.numeric(gss_sm$age), na.rm = TRUE)

quintiles <- quantile(as.numeric(gss_sm$age), probs = seq(0, 1, 0.2), na.rm = TRUE)

gss_sm <- gss_sm %>%
    modify_at(vars(), zap_missing) %>%
    modify_at(wt_vars, as.numeric) %>%
    modify_at(cat_vars, as_factor) %>%
    modify_at(cat_vars, fct_relabel, toTitleCase) %>%
    mutate(ageq = cut(x = age, breaks = unique(qrts), include.lowest=TRUE),
           ageq =  fct_relabel(ageq, convert_agegrp),
           agequint = cut(x = age, breaks = unique(quintiles), include.lowest = TRUE),
           agequint = fct_relabel(agequint, convert_agegrp),
           year_f = droplevels(factor(year)),
           young = ifelse(age < 26, "Yes", "No"),
           fefam = fct_recode(fefam, NULL = "IAP", NULL = "DK", NULL = "NA"),
           fefam_d = fct_recode(fefam,
                                Agree = "Strongly Agree",
                                Disagree = "Strongly Disagree"),
           fefam_n = car::recode(fefam_d, "'Agree'=0; 'Disagree'=1;", as.factor=FALSE))

gss_sm$compwt <- with(gss_sm, oversamp * formwt * wtssall)
gss_sm$samplerc <- with(gss_sm, ifelse(sample %in% 3:4, 3,
                         ifelse(sample %in% 6:7, 6,
                               sample)))

Now we need to take this data and use the survey variables in it, so we can properly calculate population means and errors and so on. We use svyr's wrappers to survey for this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14


options(survey.lonely.psu = "adjust")
options(na.action="na.pass")

gss_svy <- gss_sm %>%
    filter(year > 1974) %>%
    drop_na(fefam_d) %>%
    mutate(stratvar = interaction(year, vstrat)) %>%
    as_survey_design(id = vpsu,
                     strata = stratvar,
                     weights = wtssall,
                     nest = TRUE)

Now gss_svy is a survey object:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14


## Stratified 1 - level Cluster Sampling design (with replacement)
## With (3585) clusters.
## Called via srvyr
## Sampling variables:
##  - ids: vpsu
##  - strata: stratvar
##  - weights: wtssall
## Data variables: year (dbl), id (dbl), ballot (dbl+lbl), age (dbl+lbl), race (fct), sex (fct), fefam
##   (fct), vpsu (dbl), vstrat (dbl), oversamp (dbl), formwt (dbl), wtssall (dbl), sampcode (dbl),
##   sample (dbl), ageq (fct), agequint (fct), year_f (fct), young (chr), fefam_d (fct), fefam_n
##   (dbl), compwt (dbl), samplerc (dbl), stratvar (fct)
  

We’re in a position to draw some pictures of fefam trends now.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52


out_ff <- gss_svy %>%
    group_by(year, sex, young, fefam_d) %>%
    summarize(prop = survey_mean(na.rm = TRUE, vartype = "ci"))

out_ff


## # A tibble: 168 x 7
##     year sex    young fefam_d   prop prop_low prop_upp
##    <dbl> <fct>  <chr> <fct>    <dbl>    <dbl>    <dbl>
##  1  1977 Male   No    Agree    0.726    0.685    0.766
##  2  1977 Male   No    Disagree 0.274    0.234    0.315
##  3  1977 Male   Yes   Agree    0.551    0.469    0.633
##  4  1977 Male   Yes   Disagree 0.449    0.367    0.531
##  5  1977 Female No    Agree    0.674    0.639    0.709
##  6  1977 Female No    Disagree 0.326    0.291    0.361
##  7  1977 Female Yes   Agree    0.415    0.316    0.514
##  8  1977 Female Yes   Disagree 0.585    0.486    0.684
##  9  1985 Male   No    Agree    0.542    0.496    0.587
## 10  1985 Male   No    Disagree 0.458    0.413    0.504
## # … with 158 more rows

facet_names <- c("No" = "Age Over 25 when surveyed", "Yes" = "Age 18-25 when surveyed")


p <- ggplot(subset(out_ff, fefam_d == "Disagree"),
            aes(x = year, y = prop,
                ymin = prop_low, ymax = prop_upp,
                color = sex, group = sex, fill = sex)) +
    geom_line(size = 1.2) +
    geom_ribbon(alpha = 0.3, color = NA) +
    scale_x_continuous(breaks = seq(1978, 2018, 4)) +
    scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
    scale_color_manual(values = my_colors("bly")[2:1],
                       labels = c("Men", "Women"),
                       guide = guide_legend(title=NULL)) +
    scale_fill_manual(values = my_colors("bly")[2:1],
                      labels = c("Men", "Women"),
                      guide = guide_legend(title=NULL)) +
    facet_wrap(~ young, labeller = as_labeller(facet_names),
               ncol = 1) +
    coord_cartesian(xlim = c(1977, 2017)) +
    labs(x = "Year",
         y = "Percent Disagreeing",
         subtitle = "Disagreement with the statement, ‘It is much better for\neveryone involved if the man is the achiever outside the\nhome and the woman takes care of the home and family’",
         caption = "Kieran Healy http://socviz.co.\nData source: General Social Survey") +
    theme(legend.position = "bottom")

ggsave("figures/fefam_svy.png", p, width = 8, height = 6, dpi = 300)

Let’s take a closer look at the age breakdown.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42


out_ff_agequint <- gss_svy %>%
    group_by(year, agequint, fefam_d) %>%
    summarize(prop = survey_mean(na.rm = TRUE, vartype = "se")) %>%
    mutate(end_label = if_else(year == max(year),
                               socviz::prefix_strip(as.character(agequint), "Age "), NA_character_),
           start_label = if_else(year == min(year),
                                 socviz::prefix_strip(as.character(agequint), "Age "), NA_character_))
                                 
## Warning: Factor `agequint` contains implicit NA, consider using
## `forcats::fct_explicit_na`

p <- ggplot(subset(out_ff_agequint, fefam_d == "Disagree"),
            aes(x = year, y = prop, ymin = prop - prop_se, ymax = prop + prop_se,
                color = agequint, group = agequint, fill = agequint)) +
    geom_line(size = 1.2) +
    geom_ribbon(alpha = 0.3, color = NA) +
    scale_x_continuous(breaks = seq(1978, 2018, 4)) +
    scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
    scale_fill_manual(values = man_cols) +
    scale_color_manual(values = man_cols) +
    guides(fill = FALSE, color = FALSE) +
    annotate("text", x = 1974.5, y = 0.58, label = "Age at time\nof survey", size = 3, hjust = 0, fontface = "bold", lineheight = 0.9) +
    annotate("text", x = 2020.8, y = 0.95, label = "Age at time\nof survey", size = 3, hjust = 1, fontface = "bold", lineheight = 0.8) +
    geom_label_repel(aes(label = end_label), color = "white", nudge_x = 1) +
    geom_label_repel(aes(label = start_label), color = "white", nudge_x = -1) +
    coord_cartesian(xlim = c(1976, 2019)) +
    labs(x = "Year",
         y = "Percent",
         title = "Changing Attitudes to Gender Roles, by Age Quintiles",
         subtitle = "Percent Disagreeing with the statement, ‘It is much better for everyone involved if the man is the\nachiever outside the home and the woman takes care of the home and family’",
         caption = "Kieran Healy http://socviz.co.\nData source: General Social Survey. Shaded ranges are population-adjusted standard errors for each age group.") +
    theme(legend.position = "right")



ggsave("figures/fefam_age_quin_svy.png", p, height = 7, width = 12, dpi = 300)

## Warning: Removed 100 rows containing missing values (geom_label_repel).
## Warning: Removed 100 rows containing missing values (geom_label_repel).

Finally, we can make a plot to get a sense of generational replacement and cohort effects. We’ll make two panels. First, a comparison of more or less the same cohort (though not of course the same individuals): these are people who answered the fefam question in 1977 when they were aged 18-25 and those who answered in 2018 and were aged 63 or older. We’ll also look at two very different cohorts: people who were over 63 in 1977, and people who were aged 18-25 in 2018.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44


cohort_comp <- gss_svy %>%
    filter(year %in% c(1977, 2018) &
           agequint %in% c("Age 18-29", "Age 63+")) %>%
    mutate(cohort = interaction(agequint, year),
           cohort = droplevels(cohort)) %>%
    group_by(cohort, fefam) %>%
    summarize(prop = survey_mean(na.rm = TRUE, vartype = "se")) %>%
    mutate(cohort = fct_relabel(cohort, ~ gsub("\\.", " in ", .x)),
           cohort = factor(cohort,
                           levels = c("Age 18-29 in 2018", "Age 63+ in 1977",
                               "Age 18-29 in 1977", "Age 63+ in 2018"),
                           ordered = TRUE),
           compare = case_when(cohort %in% c("Age 18-29 in 1977",
                                          "Age 63+ in 2018") ~ "Comparing Approximately the Same Cohort in 1977 and 2018",
                            cohort %in% c("Age 18-29 in 2018",
                                          "Age 63+ in 1977") ~ "Comparing the Old in 1977 vs the Young in 2018"),
           end_label = if_else(fefam == "Strongly Disagree",
                               socviz::prefix_strip(as.character(cohort), "Age "), NA_character_))


p <- ggplot(cohort_comp,
            aes(x = fefam, y = prop, group = cohort,
                color = cohort, fill = cohort, ymin = prop - prop_se, ymax = prop + prop_se)) +
    geom_point(size = 3) + geom_line(size = 1.2) +
    geom_ribbon(alpha = 0.2, color = NA) +
    scale_color_manual(values = my_colors()) +
    scale_fill_manual(values = my_colors()) +
    guides(fill = FALSE, color = FALSE) +
    scale_y_continuous(labels = scales::percent_format(accuracy = 1)) +
    geom_label_repel(aes(label = end_label), fill = "white",
                     size = 2.2, segment.colour = NA, nudge_x = 0.6) +
    facet_wrap(~ compare) +
    labs(y = "Percent", x = NULL,
         title = "Generational Replacement, or, People Don't Change Much, They Just Get Old",
         subtitle = "Responses to the statement ‘It is much better for everyone involved if the man is the\nachiever outside the home and the woman takes care of the home and family’",
         caption = "Kieran Healy http://socviz.co.\nData source: General Social Survey. Shaded ranges are population-adjusted standard errors for each age group.")

ggsave("figures/fefam_age_quin_svy_synth.png", p, height = 7, width = 13, dpi = 300)

## Warning: Removed 12 rows containing missing values (geom_label_repel).


23 Mar 07:04

SUMO A/B Experiments

by Madalina

This year the SUMO team is focused on learning what to improve on our site. As part of that, we spent January setting support.mozilla.org up for A/B testing and last week we ran our first test!

The goal of the test was to run a series of experiments on individual Knowledge Base articles to:

  • Improve navigation from KB article to KB article (in-article suggestions)
  • Improve design of KB articles to ensure users better understand content and can engage with content faster

The two tests we are running are trying a bunch of different things, such as screengrabs, video clips, highlights, better feedback options on articles, and better navigation.

Version A: Breadcrumbs

  • Screengrabs
  • Ratings at different parts of the page
  • Highlights
  • On both experiments we have a section of related articles at the bottom.

 

 

A breadcrumb menu should make it clearer to users where they are.

 

 

 

 

Feedback points through up/down icons with a follow up question to understand to allow for more feedback.

 

 

 

 

Highlights in the text to help the user see the important areas.

 

Version B: Hamburger menu – Categories

  • One rating at the end of the page
  • No highlights in text
  • On both experiments we have a section of related articles at the bottom.

 

Hamburger menu to allow for users to focus on the content not the menu.

 

 

 

 

Drop down to see wider menu.

 

 

 

The test will run for the next 2-3 weeks and we will report back on here and our weekly SUMO meeting on the results and next steps.

The test is currently serving for 50% of visitors and you can ‘maybe’ see the tests by going here or here.

SUMO staff team

23 Mar 07:03

B.C. Supreme Court says having a phone in sight not distracted driving

by Brad Bennett
distracted driving

A British Columbian Supreme Court Judge ruled on March 1st that the “mere presence of a cell phone within sight of a driver is not enough to secure a conviction,” according to court documents from the ruling. 

This case sets a precedent in B.C. and possibly the rest of Canada that merely having your phone or some other kind of electronic device on the seat of your car within line of sight doesn’t constitute a distracted driving charge.

It’s still illegal to “use” your phone while driving, according to section 3.1 of the B.C Motor Vehicle Act.

B.C.’s Traffic Court initially found Philip Partridge guilty. He then brought the case before a B.C. Supreme Court judge and won, according to Global News.

A police officer charged Partridge with distracted driving when the officer saw him looking down.

When the officer charged him his phone was wedged in the passenger seat, according to the court documents, but he was never actually seen using it.

If drivers want to use their phones in B.C. and they’re not legally parked they have to make sure “that is configured and equipped to allow hands-free use in a telephone function, is used in a hands-free manner and is used in accordance with the regulations, if any,” according to the B.C. Motor Vehicle Act.

While that line of the law is very vague, it means you can have your phone mounted to the dashboard of your vehicle, but you can’t physically interact with it.

Failure to comply with these rules nets you a $346 fine in B.C. and three penalty points.

Source: Supreme Court of British Columbia, Global News

The post B.C. Supreme Court says having a phone in sight not distracted driving appeared first on MobileSyrup.

23 Mar 07:03

Panama Canal

mkalus shared this story from xkcd.com.

Once they selected the other proposal, we could have kept shopping ours around, but we would had to modify it include an aqueduct over their canal, which would be totally unreasonable.
23 Mar 07:03

Zoning Walls Going Up

by Gordon Price
mkalus shared this story from Price Tags.

 

By the post-election decisions being made by some of the smaller, more affluent municipalities in Metro, the messages seem to be: no more density, no more height, no more affordable housing (and, rarely stated but assumed: the people who might live in it if they come from ‘outside’).

In North Vancouver District, as previously reported in PT:

District of North Vancouver council has spiked another affordable housing project, this time before plans for it were released to the public.

Council voted behind closed doors in January to terminate a proposal from the non-profit Hollyburn Family Services Society for a 100-unit, all-below market rental building on a piece of district-owned land on Burr Place.

In Port Moody:

A proposal to build 45 townhomes on six properties along St. George Street in Port Moody is “far too dense,” with not enough green space, said city councillors who rejected the project at their meeting last Tuesday. …

Mayor Rob Vagramov criticized the proposal for being too dense even though it’s located in Port Moody’s Transit Oriented Development (TOD) zone, which encourages higher density living.

In White Rock:

Brent Toderian comments here.

 

Leaving aside issues of fairness, openness and good planning, small communities failing to take their share of growth, particularly in relation to the Frequent Transit Network, assume that other parts of the region will take commensurately more, even as more vehicle traffic is generated as a consequence.  (Irony altert: one of the most frequent arguments against denser development is the assumed traffic it will generate.)

23 Mar 07:02

Why Python uses 0-based indexing

by Guido van Rossum
This is a repost of something I wrote on Google Plus long ago, in October 2013. Thanks to https://pycoders.com/issues/360 for reminding me of it before G+ goes down for good!

I was asked on Twitter why Python uses 0-based indexing, with a link to a new (fascinating) post on the subject (http://exple.tive.org/blarg/2013/10/22/citation-needed/). I recall thinking about it a lot; ABC, one of Python's predecessors, used 1-based indexing, while C, the other big influence, used 0-based. My first few programming languages (Algol, Fortran, Pascal) used 1-based or variable-based. I think that one of the issues that helped me decide was slice notation.

Let's first look at use cases. Probably the most common use cases for slicing are "get the first n items" and "get the next n items starting at i" (the first is a special case of that for i == the first index). It would be nice if both of these could be expressed as without awkward +1 or -1 compensations.

Using 0-based indexing, half-open intervals, and suitable defaults (as Python ended up having), they are beautiful: a[:n] and a[i:i+n]; the former is long for a[0:n].

Using 1-based indexing, if you want a[:n] to mean the first n elements, you either have to use closed intervals or you can use a slice notation that uses start and length as the slice parameters. Using half-open intervals just isn't very elegant when combined with 1-based indexing. Using closed intervals, you'd have to write a[i:i+n-1] for the n items starting at i. So perhaps using the slice length would be more elegant with 1-based indexing? Then you could write a[i:n]. And this is in fact what ABC did -- it used a different notation so you could write a@i|n.(See http://homepages.cwi.nl/~steven/abc/qr.html#EXPRESSIONS.)

But how does the index:length convention work out for other use cases? TBH this is where my memory gets fuzzy, but I think I was swayed by the elegance of half-open intervals. Especially the invariant that when two slices are adjacent, the first slice's end index is the second slice's start index is just too beautiful to ignore. For example, suppose you split a string into three parts at indices i and j -- the parts would be a[:i], a[i:j], and a[j:].

So that's why Python uses 0-based indexing.
22 Mar 17:53

Friday Funny

by Gordon Price

From Durning, of course:

That feeling you get when you go out for a private meal and someone at the next table starts painting you …

22 Mar 17:53

pic.twitter.com/3rvja4inkK

by HumansOfLate
mkalus shared this story from HumansOfLate on Twitter.



Posted by HumansOfLate on Friday, March 22nd, 2019 8:48am


263 likes, 73 retweets