Shared posts

01 Sep 00:10

Prior Probability in Logistic Regression

by Will Kurt

In the last post we looked at how we can derive logistic regression starting from Bayes' Theorem. In this post we're going to explore this a bit further by looking at how prior probabilities are learned by our logistic model. The prior probability for our \(H\) is directly related to the class balance in our training set. This is important because it can lead to logistic regression models behaving in unexpected ways if we are trying to predict on data with a different class imbalance than we trained on. Luckily, because at its heart logistic regression in a linear model based on Bayes’ Theorem, it is very easy to update our prior probabilities after we have trained the model.

As a quick refresher, recall that if we want to predict whether an observation of data D belongs to a class, H, we can transform Bayes' Theorem into the log odds of an example belonging to a class. Then our model assumes a linear relationship between the data and our log odds:

$$lo(H|D) = \beta D + \beta_0$$

Which, when transformed back into a probability gives us the familiar form of logistic regression:

$$P(H|D) = \frac{1}{1+e^{-(\beta D + \beta_0)}}$$

If this refresher is not clear, definitely go back and read through the first post.

Prior probabilities and logistic regression

To demonstrate how useful understanding the relationship between Bayes' Theorem and logistic regression is, we'll look at a practical problem that this insight helps us solve. The previous post on this topic had us using logistic regression to predict whether the setup for brewing a cup of coffee would lead us to a good cup. Suppose when I started training my coffee model I was pretty awful at coming up with brewing setups and only 1 in 10 of my cups of coffee was really great. This means that in the training data we had an imbalance in the number of positive to negative examples. What impact is this going to have on our model?

Imagine this setup. I have 100 training examples of my data \(D\), 10 observations of 1 (good cups of coffee) and 90 observations of 0 (bad cups of coffee). This is going to impact what the model learns in a very predictable way. If you go back to our odds version of logistic regression we were trying to learn:


The \(O(H)\), is our prior odds, which means "given we know nothing else about the problem, what are the odds of H". Intuitively if we train the model on 10 examples of \(H\) and 90 examples of \(\bar\), then we expect:

$$O(H) = \frac{10}{90}$$

And of course we can convert this into a probability using the rule mentioned earlier:

$$P(H) = \frac{O(H)}{1+O(H)} = 0.1$$

This result isn't surprising since we know 10 out of 100 cases was positive, so 0.1 seems like the best estimate for our prior probability.

This also means that \(\beta_0\) in our log odds model then corresponds to the log odds of the prior since it takes the place of \(O(H)\) when we finally log transform our problem. The result of this is that whenever you train a logistic model, if you have \(N_1\) observations of class 1 and \(N_0\) observations of class 0, then \(\beta_0\) should be approximately:

$$\beta_0 = log \frac{N_1}{N_0}$$

Or another way to say this is that:

$$P(H) = \frac{N_1}{N_1+N_0}$$

So...

$$\beta_0 = log \frac{P(H)}{1-P(H)}$$

However we look at it, the best estimate for the prior probability of H is just to look at the ratio of positive observations in our training data, and since \(\beta_0\) is literally the log odds of our prior, we know that this estimate will the log odds of the ratio of positive examples in the training data.

A proof and some practical details

In practice (and theory!) you'll need to center your training data for this relationship between \(\beta_0\) and log odds prior to hold. Centering means that the mean of of each column of \(D\) is 0 (this is achieved simply by subtracting the mean of each column from each value column in your training data). As a quick, intuitive proof we can look at what happens when we compute the expectation of our log odds model. If we have centered our data the expectation is what we would expect to happen on average given we know nothing else about our problem. This is also a great definition for the concept of prior probability: what we expect to happen given we know nothing else about our problem. In the case of making cups of coffee, if we know that only 1 in 10 are good, and we know nothing else about our brewing set up, we would expect the probability of a good cup is 0.1.

We can see that this is also mathematically the case when we compute the expectation for our centered data. Expectation for our logistic model is:

$$E[lo(H|D)] = E[\beta D+\beta_0]$$

We can expand the right side of this equation in the following way.

$$E[\beta D+\beta_0] = E[\beta D] + E[\beta_0]$$

$$E[\beta D] + E[\beta_0] = \beta E[D] + E[\beta_0]$$

And recall that \(\beta_0\) is a constant so \(E[\beta_0] = \beta_0\)

Now since we centered our data, by definition \(E[D] = 0\), which leaves us with:

$$E[lo(H|D)] = \beta E[D] + \beta_0 = \beta \cdot 0 + \beta_0 = \beta_0$$

So, if we centered our data, the expectation for our model, which is the same thing as what we mean by "the prior probability" for our model, is just the constant \(\beta_0\). And, given our training data, we know that the best estimate for \(\beta_0\) is the log ratio of positive to negative training examples.

Changing the prior after training the model!?

We now know how prior information about a class will be incorporated into our logistic model. Assume that I've been using this model trained on 100 examples with 10 positive and 90 negative examples. However, with time, my knack for making coffee really improves and now I feel that my prior probability for making a great cup of coffee is 0.5, not 0.1.

I want to try a new brewing setup and I put my configuration into my model and I get this:

$$P(H|D) = 0.3$$

I trust my model, but I know that my model has also incorporated an older prior which I personally no longer believe in. This means that my model must be underestimating the probability that this will be a great cup of coffee. And unfortunately, I've decided to host my model in some cloud service so I no longer have access to any of it's parameters, I can only give it input and receive its output.

I no longer trust the output of this model because my prior beliefs have changed. Since logistic regression is just an application of Bayes' Theorem, shouldn't I be able to update my prior probability?

We have in our hand \(P(H|D)\) which is 0.3, and all we want to change is our prior, which we know is \(\beta_0\). Recall that according to our logistic model, \(P(H|D)\) is defined as follows:

$$P(H|D) = \frac{1}{1+e^{-(\beta D + \beta_0)}}$$

All we need to do is to somehow replace \(\beta_0\) with the updated prior log odds, which we'll call \(\beta'_0\). If we had access to our coefficients \(\beta \) then we could simply recompute everything, but we only have the model's prediction of 0.3. It turns out there is an easier way to solve this than recomputing our model's prediction, that doesn't require us to know \(\beta\), we just need to know \(beta_0\) the original log odds prior (or we can estimate it as the log odds ratio of training examples). Let's look at the log odds form of our model, which we can use when our probabilities are not at the extremes of 0 or 1.

$$lo(H|D) = \beta D + \beta_0$$

We don't care about \(\beta D\), all we want to do is change \(\beta_0\) to \(\beta'_0\), and since this is just a linear equation, this is very easy:

$$\beta D + \beta'_0 = \beta D + \beta_0 + (\beta'_0 - \beta_0) = lo(H|D) + (\beta'_0 - \beta_0) $$

So if we add the \(\beta'_0 - \beta_0\) to our log odds of our class then we get an updated posterior log odds reflecting our new prior!

Let's update that prior!

First let's figure out what our value for \(\beta'_0\), should be. We just need to translate our new prior into log odds (and we'll be using natural log since our model is using \(e\)):

$$\beta'_0 = ln \frac{0.5}{1-0.05}= ln\text{ 1} = 0$$

Ah! Our new prior in log odds form is just 0, this makes our math very easy. We know the previous value for \(\beta\) should be roughly equivalent to the log of the class ratio in the training data:

$$\beta = log(\frac{10}{90}) = -2.2$$

So now we just have to subtract -2.2 from our the log odds result from our model, which is the same as adding 2.2. Right now we only have the output of our model as \(P(H|D) = 0.3\) and we need the log odds. But this is pretty easy to compute as well.

$$log(\frac{0.3}{1-0.3}) = -0.85$$

Now we just add 2.2 to this and see that

$$\beta D + \beta'_0 = -0.85 + 2.2 = 1.35$$

So the log odds that we'll make a good cup of coffee is 1.35! We want our answer in the form of a probability. We've gone back and forth between log odds, odds and probabilities so this should be getting a bit familiar. Our new P(H|D) is:

$$P(H|D) = \frac{e^{1.35}}{1+e^{1.35}} = 0.79$$

When we update our prior we get a new prediction that says we're much more likely to get a great cup of coffee out of our brew! The amazing thing here is that we were able to update our prior after the model made a prediction simply by knowing what our original prior was and understanding how the logistic model works!

Next we'll look at another example were we can change an entire group of predictions from a model. We'll also see how the distribution of predictions changes when we do prior updating in bulk.

Bayes' Pox and Frequentist Fever!

We saw how to fix the case of an individual estimate from a model, but now let's look at what happens to a larger collection of estimates when a model is trained with one prior and predicted on a population with a different prior. In this example we'll use real (simulated) data and train an actual logistic model in R to see how all of this works.

Everyone gets sick of statistics sometimes and this can result in two major illnesses: Frequentist Fever or Bayes' Pox. Each disease shares common symptoms but with different rates.

  • Fever

  • Runny Nose

  • Cough

  • Headache

  • Bayes bumps (easily mistaken for a pimple)

We're going to be generating data with the rates shown in the table for each of the symptoms, but we only know these true rates because we are in control of the simulated data.

Using these rates for symptoms we are going to generate a train data set and a test data set. Now we’re going to assume that our training data, train.data comes from the Institute of Statistical Illnesses and has 1000 examples. However, the Institute of Statistical Illnesses tends to be a bit over eager in their recordings of Bayes' Pox so 90% of the sample data is cases of Bayes' Pox.

We want to build a model that learns to predict Bayes' Pox given the data we have. Here is the R code for a logistic model using the glm function. We've also already gone ahead and centered our training data (and recorded the column means so we can center our test data in the same way):

bayes.logistic <- glm(bayes_pox ~ 1 + fever + runny_nose + 
                      cough + headache + bayes_bumps,
                      data=train.data,family=binomial())

Now that we've trained our model we can inspect it to see that it has learned what we would expect it to have learned regrading the prior.

model.summary <- summary(bayes.logistic)

The first coefficient tells us what our model's estimate for the intercept, \(\beta_0\) is. We can see that model.summary$coefficients[1][1] = 1.8. Remember that this value represents the log odds of our prior. If we want to convert this back to a probability we just need to use the logistic function. We can see that logistic(model.summary$coefficients[1][1]) = 0.86 which is pretty close to our 90% prior probability of Bayes' Pox that is represented in the data.

Assumptions about Beta_0 and Priors

Why isn't it exactly 0.9? This is for a couple of reasons. Our model is not a perfect representation of our problem. Remember that we must center our data in order for \(\beta_0\) to truly represent our prior. This is because we want the expectation of our data to be 0. If all of our data was normally distributed continuous values then we should see \(\beta_0\) be very close to the true prior. However, when we represent our symptoms they only take on values of 1 or 0. When we center our data we subtract the means for these but we still only have two values. This leads to the model not quite making perfect estimates as far as prior probabilities go. We also have to think of what it means for all of our data to be 0, even when scaled. Does this really represented the “average” case? What is an “average” symptom?

Nonetheless, our model learned prior, \(\beta_0\), is pretty close to what we would expect it to be. This means we can go ahead and update it with a new prior if we need to.

But Bayes' Pox is rare!

So far we have used the training data to come up with a model to detect whether or not a sick statistician has Bayes' Pox or Frequentist Fever. But there's a problem. Unsurprisingly, people get sick far less frequently from Bayesian statistics than Frequentist statistics and so Bayes' Pox is actually much less common. Only 0.01 of the sick statisticians have Bayes' pox, but our model has learned a prior probability that Bayes' Pox is more likely. Let's see how our model predicts on a set of test.data that has only about 1% of the population having Bayes' pox.

We can use R to make new predictions on the 100,000 test cases of sick statisticians:

model.preds <- predict(bayes.logistic,test.data,type="response")

If we plot these predictions out we can see the distribution of what we think is happening:

The distribution of the prediction for our logistic model given the prior in the training data.

It does look like most statisticians are still being diagnosed as not having Bayes' Pox, but how does our model predict when trained on the wrong prior? Here is a plot showing what the observed rate of Bayes Pox are when we look at different thresholds for determining "has Bayes' Pox". In the ideal case this would be a straight line with a slope of 1, indicating that our model's certainty corresponds with the empirical ratio of Bayes' Pox and Frequentist Fever. That is, if the model is making a prediction of 0.5 we would hope that roughly half the time it's right, if the model predicts 0.99 we would hope that 99% of those predictions are, in fact, Bayes' Pox.

Because it is trained on the wrong prior, the model drastically overestimates the empirical rate of Bayes’ Pox.

We know our model isn't perfect and we also know that you can't always be right in probability. However, what we can see clearly here is that our model, with the original prior, wildly overestimates the chance of having Bayes' Pox. Take for example the 0.5 model probability. This is the point where the model is telling us that it is equally likely that the observation is Bayes' Pox as it is Frequentist Fever. We can clearly see that in the cases where the model is uncertain, Bayes' Pox is far less likely than Frequentist Fever. In many software packages 0.5 is the default threshold for deciding on a class, and in this case we would be wildly over predicting Bayes' Pox.

Adjusting our prior

The problem here is that our model assumes that the prior probability of having Bayes' Pox is very high based on an inaccurate distribution of Bayes' Pox cases in our train.data. We can correct this the same way we solved our coffee model problem. This time, rather than walk through the process of transforming probability to odds and odds to log odds (and back), we'll use the logit function to transform probabilities to log odds and logistic to turn them back (we're using these functions as defined in the rethinking package).

Let's start fixing our problem by transforming our model.preds back into the log odds form:

lo.preds <- logit(model.preds)

From our earlier notation, lo.preds are the \(lo(H|D)\) or \(\beta D + \beta_0\).

If we have access to the actual model and it's parameters we can get \(\beta_0\) directly:

model.prior.lo <- model.summary$coefficients[1][1]

The next step is that we need to calculate what the correct log odds should be. If we know that the probability of having Bayes' Pox among sick statisticians is only 0.01 we can represent this as, our \(\beta_0'\) from earlier:

correct.lo <- logit(0.01)

With this information we can update our log odds predictions as we did before, \(lo(H|D) + (\beta'_0 - \beta_0)\)

updated.lo.preds <- lo.preds  +  (correct.lo -  model.prior.lo)

All that's left now is to convert this log odds updated predictions back to probabilities using logistic:

updated.preds <- logistic(updated.lo.preds)

The update.preds represents our model with the correct prior probability used to calculate whether or not a sick statistician has Bayes' Pox. Plotting this out we can see that the impact on the distribution of predictions is striking:

Distribution of predictions after updating our prior to the correct one.

Our change didn't just shift our predictions over, it completely changed the shape of the distribution! This is because we did our transformation in log space and then transformed the data back. So using the wrong prior doesn't simply make our predictions off by a constant factor but really changes the shape of our distribution.

Improved predictions

We can now revisit the empirical ratio of Bayes' Pox to Frequentist Fever with our new thresholds:

With our updated prior, our model’s beliefs are much closer to the empirical ratio of Bayes’ Box to Frequentist Fever.

Here we see that our model's adjusted predictions are much closer to its actual rate of being correct. Our model, of course, isn't perfect, but we'll be scaring far less people with a false diagnosis of Bayes' Pox.

Even though the shape of our distribution changed quite a bit with our updated prior, the ordering of our predictions did not. In practice we would likely want to choose a threshold for our model that optimized trade offs between precision and recall (our plot here only shows the precision). Still this serves as a practical example of how a prior learned in training can impact the way our model interprets the world. Using the correct prior is especially important if we want to interpret the output of a logistic model as an actual degree of belief in our hypothesis (as opposed to just an arbitrary prediction threshold).

Conclusion

In industry it is very often the case that logistic models are a great solution for a classification problem, and almost always a good place to start. It is common practice to train logistic models on balanced training sets even when it is known that one class is far less likely to occur than the other. What many people using logistic models fail to recognize is that the training data will have an impact on what your model learns is the prior probability of each class. Luckily it is very easy to transform prediction from a model to use a different prior than the model was trained with. This adjustment will aid in the interpretability of model predictions.

A special thanks for this post goes out the a former coworker of mine John Walk who got me thinking about this problem with a very interesting interview question!

Bayesian Statistics the Fun Way is out now!

If you enjoyed this post please subscribe to keep up to date and follow @willkurt!

If you want to learn more about Bayesian Statistics and probability: Order your copy of Bayesian Statistics the Fun Way No Starch Press!

If you enjoyed this writing and also like programming languages, you might enjoy my book Get Programming With Haskell from Manning.

01 Sep 00:10

Book Review – First Man

by Martin

There’s quite a bit of a gap between this and the previous book review mainly due to the 50th anniversary of Apollo 11 in July that has kept me busy with re-reading a number of books I’ve had for many years and spending many hours with ApolloInRealtime. Anyway, the book review today, is a follow-up to this activity. Neil Armstrong certainly was an interesting and deeply inspiring person, so after watching the move ‘First Man’ on a plane to Chicago, I decided to pick up the book of the same title by James R. Hanson on which the movie was based.

‘First Man’ is not just any biography on Neil Armstrong but has been authorized and supported and was initially published in 2005. As biographies usually do, the book starts with the family tree, works through Armstrong’s childhood and then starts to expand in his teenage years and flying, his years in the Navy and the Korean war and his years as a test pilot for experimental ultra-sonic jets. The part on his time as test pilot had me worried for a bit because the author mentions a seemingly endless number of experimental flights run there and mentions a lot of people with whom Neil had worked together. As I didn’t know any of them, I could not see how that helped the storyline or why this was important enough to spend so many pages on. Fortunately, the narrative changed after that chapter and I began to thoroughly enjoy the book!

Neil Armstrong was an intensively private person so I wondered for a while if the book would only look at him from a thousand miles up as it did at the beginning. But fortunately, the further I got into the book, the closer it approached Armstrong as a person, his values, his beliefs, his approach to flying, to NASA, to life, to other people and to many other things. Also, I found it quite interesting to learn a bit about the relationship between him and the other two astronauts on Apollo 11. Michael Collins, Command Module Pilot, once described the three as ‘amiable strangers’.

A good quarter of the book describes Neil’s life after the moon landing, which, for me, was the most interesting part, because I wondered how astronauts in general and Neil Armstrong in particular dealt with their fame and the challenge that the most outstanding and adventurous part of their lives came early rather than having been a culmination of it.

A very interesting and enjoyable book that tells far more than only the story of Neil Armstrong!

01 Sep 00:08

On me, and the Media Lab

by Ethan

(Please be sure to read the addendum at the end of this post.)

A week ago last Friday, I spoke to Joi Ito about the release of documents that accuse Media Lab co-founder Marvin Minsky of involvement in Jeffrey Epstein’s horrific crimes.* Joi told me that evening that the Media Lab’s ties to Epstein went much deeper, and included a business relationship between Joi and Epstein, investments in companies Joi’s VC fund was supporting, gifts and visits by Epstein to the Media Lab and by Joi to Epstein’s properties. As the scale of Joi’s involvement with Epstein became clear to me, I began to understand that I had to end my relationship with the MIT Media Lab. The following day, Saturday the 10th, I told Joi that I planned to move my work out of the MIT Media Lab by the end of this academic year, May 2020.

My logic was simple: the work my group does focuses on social justice and on the inclusion of marginalized individuals and points of view. It’s hard to do that work with a straight face in a place that violated its own values so clearly in working with Epstein and in disguising that relationship.

I waited until Thursday the 15th for Joi’s apology to share the information with my students, staff, and a few trusted friends. My hope was to work with my team, who now have great uncertainty about their academic and professional futures, before sharing that news widely. I also wrote notes of apology to the recipients of the Media Lab Disobedience Prize, three women who were recognized for their work on the #MeToo in STEM movement. It struck me as a terrible irony that their work on combatting sexual harassment and assault in science and tech might be damaged by their association with the Media Lab. The note I sent to those recipients made its way to the Boston Globe, which ran a story about it this evening. And so, my decision to leave the Media Lab has become public well before I had intended it to.

That’s okay. I feel good about my decision, and I’m hoping my decision can open a conversation about what it’s appropriate for people to do when they discover the institution they’ve been part of has made terrible errors. My guess is that the decision is different for everyone involved. I know that some friends are committed to staying within the lab and working to make it a better, fairer and more transparent place, and I will do my best to support them over the months I remain at the Lab. For me, the deep involvement of Epstein in the life of the Media Lab is something that makes my work impossible to carry forward there.**

To clarify a couple of things, since I haven’t actually been able to control the release of information here:

– I am not resigning because I had any involvement with Epstein. Joi asked me in 2014 if I wanted to meet Epstein, and I refused and urged him not to meet with him. We didn’t speak about Epstein again until last Friday.

– I don’t have another university that I’m moving to or another job offer. I just knew that I couldn’t continue the work under the Media Lab banner. I’ll be spending much of this year – and perhaps years to come – seeing if there’s another place to continue this work. Before I would commit to moving the work elsewhere at MIT, I would need to understand better whether the Institute knew about the relationship with Epstein and whether they approved of his gifts.

– I’m not leaving tomorrow. That wouldn’t be responsible – I have classes I am committed to teaching and students who are finishing their degrees. I plan to leave at the end of this academic year.

– My first priority is taking care of my students and staff, who shouldn’t have to suffer because Joi made a bad decision and I decided I couldn’t live with it. My second priority is to help anyone at the Media Lab who wants to turn this terrible situation into a chance to make the Lab a better place. That includes Joi, if he’s able to do the work necessary to transform the Media Lab into a place that’s more consistent with its stated values.

I’m aware of the privilege*** that it’s been to work at a place filled with as much creativity and brilliance as the Media Lab. But I’m also aware that privilege can be blinding, and can cause people to ignore situations that should be simple matters of right and wrong. Everyone at the Media Lab is going through a process of figuring out how they should react to the news of Epstein and his engagement with the Lab. I hope that everyone else gets to do it first with their students and teams before doing it in the press.

Addendum, August 21, 2019:

* A friend of Marvin Minsky’s objected to this sentence opening this post, noting that Marvin, who died in 2016, cannot respond to these accusations. While that is true, the accusations made by Virginia Giuffre are a matter of public record and have been widely reported. I mention these accusations both because they were what motivated me to speak with Joi about Epstein and, more importantly, because unanswered questions about Minsky are part of the horror of this situation for some of my colleagues at the Media Lab. To be clear, I have no knowledge of whether any of these charges are true – they happened long before my time at the Media Lab.

I changed the word “implicate” to “accuse” as a result and added “of involvement” before the phrase about Epstein’s crimes.

** My original version of this post had two additional sentences here, describing my dismay about the implications of the Epstein revelations for one of my students and her research. She is not ready to talk about that subject, and I’ve withdrawn those sentences at her request.

*** A friend pointed out that I was able to choose to step away from the Media Lab because of my privilege: I’ve got money in the bank, I’ve got a supportive partner, I am at a stage of my career where I can reasonably believe I’ll find another high prestige job, I’m a cis-gendered straight white dude. She wanted me to be clearer about the fact that not everyone is going to be able to make the same decision I did.

She’s right. There are people who are going to remain working at the Media Lab because they sincerely believe that we finally have the opportunity to fix some of the deep structural problems of the place – I respect them and I will work hard to support them. But there’s also people who are going to continue at the lab because it’s the best opportunity they have to develop their own careers and reach a point where they’ve got more flexibility to make decisions like the one I made. I respect them too – they are the people doing the work that makes institutions work, but they rarely have the power to make decisions that steer an institution towards its values.

So thank you for all the kind words about bravery. Truth is I’m privileged enough to afford to be brave. For those of you who love the Media Lab and want to see it sail through these rough waters, please take time to reach out to people who may not be able to be as visible in their next steps. Make sure they’re doing okay. Support them whether their decision is to leave or to stay. So many of my colleagues at the Media Lab right now are hurting, and they need your support and love too. Hope we can redirect some of that love folks are sharing with me to them too.

01 Sep 00:08

Don’t tell a Jew what to do

by Josh Bernoff

President Trump says that it’s “disloyal” for a Jew to vote for a Democrat. The Jews I know think before they vote. That’s not disloyalty, it’s democracy. Here’s how the New York Times reported his public remarks. “Where has the Democratic Party gone?” Mr. Trump said at the tail end of freewheeling comments during a … Continued

The post Don’t tell a Jew what to do appeared first on without bullshit.

01 Sep 00:08

Mozilla takes action to protect users in Kazakhstan

by Mozilla

Today, Mozilla and Google took action to protect the online security and privacy of individuals in Kazakhstan. Together the companies deployed technical solutions within Firefox and Chrome to block the Kazakhstan government’s ability to intercept internet traffic within the country.

The response comes after credible reports that internet service providers in Kazakhstan have required people in the country to download and install a government-issued certificate on all devices and in every browser in order to access the internet. This certificate is not trusted by either of the companies, and once installed, allowed the government to decrypt and read anything a user types or posts, including intercepting their account information and passwords. This targeted people visiting popular sites Facebook, Twitter and Google, among others.

“People around the world trust Firefox to protect them as they navigate the internet, especially when it comes to keeping them safe from attacks like this that undermine their security. We don’t take actions like this lightly, but protecting our users and the integrity of the web is the reason Firefox exists.” — Marshall Erwin, Senior Director of Trust and Security, Mozilla

“We will never tolerate any attempt, by any organization—government or otherwise—to compromise Chrome users’ data. We have implemented protections from this specific issue, and will always take action to secure our users around the world.” — Parisa Tabriz, Senior Engineering Director, Chrome

This is not the first attempt by the Kazakhstan government to intercept the internet traffic of everyone in the country. In 2015, the Kazakhstan government attempted to have a root certificate included in Mozilla’s trusted root store program. After it was discovered that they were intending to use the certificate to intercept user data, Mozilla denied the request. Shortly after, the government forced citizens to manually install its certificate but that attempt failed after organizations took legal action.

Each company will deploy a technical solution unique to its browser. For additional information on those solutions please see the below links.

Mozilla
Google

Russian: Если вы хотите ознакомиться с этим текстом на русском языке, нажмите здесь.

Kazakh: Бұл постыны қазақ тілінде мына жерден оқыңыз.

 

 

 

 

The post Mozilla takes action to protect users in Kazakhstan appeared first on The Mozilla Blog.

01 Sep 00:08

Protecting our Users in Kazakhstan

by Wayne Thayer

Russian translation: Если вы хотите ознакомиться с этим текстом на русском языке, нажмите здесь.

Kazakh translation: Бұл постыны қазақ тілінде мына жерден оқыңыз.

In July, a Firefox user informed Mozilla of a security issue impacting Firefox users in Kazakhstan: They stated that Internet Service Providers (ISPs) in Kazakhstan had begun telling their customers that they must install a government-issued root certificate on their devices. What the ISPs didn’t tell their customers was that the certificate was being used to intercept network communications. Other users and researchers confirmed these claims, and listed 3 dozen popular social media and communications sites that were affected.

The security and privacy of HTTPS encrypted communications in Firefox and other browsers relies on trusted Certificate Authorities (CAs) to issue website certificates only to someone that controls the domain name or website. For example, you and I can’t obtain a trusted certificate for www.facebook.com because Mozilla has strict policies for all CAs trusted by Firefox which only allow an authorized person to get a certificate for that domain. However, when a user in Kazakhstan installs the root certificate provided by their ISP, they are choosing to trust a CA that doesn’t have to follow any rules and can issue a certificate for any website to anyone. This enables the interception and decryption of network communications between Firefox and the website, sometimes referred to as a Monster-in-the-Middle (MITM) attack.

We believe this act undermines the security of our users and the web, and it directly contradicts Principle 4 of the Mozilla Manifesto that states, “Individuals’ security and privacy on the internet are fundamental and must not be treated as optional.”

To protect our users, Firefox, together with Chrome, will block the use of the Kazakhstan root CA certificate. This means that it will not be trusted by Firefox even if the user has installed it. We believe this is the appropriate response because users in Kazakhstan are not being given a meaningful choice over whether to install the certificate and because this attack undermines the integrity of a critical network security mechanism.  When attempting to access a website that responds with this certificate, Firefox users will see an error message stating that the certificate should not be trusted.

We encourage users in Kazakhstan affected by this change to research the use of virtual private network (VPN) software, or the Tor Browser, to access the Web. We also strongly encourage anyone who followed the steps to install the Kazakhstan government root certificate to remove it from your devices and to immediately change your passwords, using a strong, unique password for each of your online accounts.

The post Protecting our Users in Kazakhstan appeared first on Mozilla Security Blog.

01 Sep 00:08

How China Reduces Automobile Usage

by Barry Rueger

Beijing Traffic

Beijing Traffic

Prior to the 2008 Beijing Olympics, it was generally acknowledged that both the traffic and the pollution in the city was out of control; in 2010, a traffic jam on the China National Highway 110 slowed traffic for 100 kilometres, and lasted for most of two weeks.

China Toll Plaza
China Toll Plaza China Toll Plaza

The Chinese government is still building and maintaining an impressive network of multi-lane freeways, highways, and flyovers — with regular toll plazas — to move large volumes of automobiles relatively efficiently, but the Chinese government has also tried to move the country (or at least the major cities) away from internal combustion engines.

As well as making lots of safe space for transit users, bikes, electric motorbikes, and pedestrians, the Chinese have done one other thing to improve the traffic mix in Chengdu and Beijing: they’ve made it really hard to own a car. Much like the licences and charges in London and Singapore, rules in China pretty much limit car use in the city to the very wealthy.

Earlier this year Bloomberg Business week described the process:

It’s not the half-million-yuan price tag keeping Beijing resident Sandra Zhao from buying her dream car, a BMW X4 SUV. It’s the license plate she needs to have a conventional gasoline car. She’s been in a lottery pool for five years, competing with more than 3 million fellow residents for one of the plates. The complicated bimonthly drawing awards about one plate for every 2,000 applications.

Meanwhile, her husband has been on line since the end of 2017 with 420,000 others for a license to own a supposedly easier-to-acquire electric vehicle. He’s hopeful he’ll get it in another two years—those at the back of the line may have to wait eight.

China Green Licence Plate
China Green Licence Plate Plate for green energy vehicles.

The plates are actually auctioned to the highest bidder, and added to that, your shiny new Bentley, Lambo or (inexplicably) Buick can only be driven on six days of the week – on the seventh, as determined by your licence plate number, you need to park it.

Fortunately Chengdu is one of those great cities with a wealth of speedy green taxis that can be flagged from the curb, as well as ride share companies like Uber. The result is a city where being forced to park your car isn’t really a big hardship.

Despite all of this, car traffic does slow to a crawl more often than not, and within the city region, car volumes predictably grow to fill available road lanes.  Still, the Chinese government is taking real steps to constrain automobile traffic, most significantly by making alternate travel modes as easy and affordable as possible.

Note from the author: Any discussion of China invariably leads to questions involving human rights, Hong Kong, and the surveillance state in the country. My two week visit to Chengdu and Beijing does not make me an expert; for a more informed perspective on policy and politics in China, check out episode 48 of Price Talks, featuring Beijing native Vivienne Zhang speaking with Gordon, along with Peter Ladner.

01 Sep 00:07

Why we should pay attention to Extinction Rebellion

by peter@rukavina.net (Peter Rukavina)

I skipped supper last night and attended a meeting of Extinction Rebellion at Trinity United Church.

Extinction Rebellion sign at Trinity United Church

My reason for going was simple: Extinction Rebellion has three demands, one of which is:

Act Now: Government must act now to halt biodiversity loss and reduce greenhouse gas emissions to net zero by 2025.

I wanted to find out more about how they propose to do that.

The current timetable here on PEI is to be net zero by 2050, far enough away so that it’s possible to have “TBD” as a placeholder for a substantial part of our Climate Action Plan. If there’s a way of getting there in 5 years instead of 30, I want to know what it is, and get right on it.

Those answers were not forthcoming.

What emerged was that Extinction Rebellion is as much about responding to a mental health crisis as it is about responding to a climate crisis, and last night’s meeting was much more about the former than the later.

The mental health challenges of having insight into a global catastrophe while the world sits idly by, as though nothing’s happening, is not completely unexplored terrain: anyone who lived through the 1960s and 1970s, and the ever-present fear of imminent nuclear war, can recognize the phenomenon. And the feelings.

I emerged from last night’s meeting realizing that, while I share the underlying scientific concerns of Extinction Rebellion, I am not one of them.

For the time being I want to focus my energies on insulating my house and getting cycle paths built, not stopping traffic on bridges.

At the same time, I was confronted with a group of people with unusually fine-tuned empathy; spiritual canaries in the climate crisis coal mine, so to speak.

And that, to my mind, is reason enough to pay attention to Extinction Rebellion: they are grappling with the psychological effects of climate crisis, and this is something we’re all going to have to come to terms with, sooner than later.

To understand more about our near-future selves, to understand more about the stresses we are all under from the cognitive dissonance of living one way while logic dictates we live another, to see what happens when remorse and anger and confusion and planetary grief boil over into direct action, we should look to our Extinction Rebellion forerunners.

01 Sep 00:07

How to do twice as much with half the keystrokes using `.bashrc`

by hello@victoria.dev (Victoria)

In my recent post about setting up Ubuntu with Bash scripts, I briefly alluded to the magic of .bashrc. This didn’t really do it justice, so here’s a quick post that offers a bit more detail about what the Bash configuration file can do.

My current configuration hugely improves my workflow, and saves me well over 50% of the keystrokes I would have to employ without it! Let’s look at some examples of aliases, functions, and prompt configurations that can improve our workflow by helping us be more efficient with fewer key presses.

Bash aliases

A smartly written .bashrc can save a whole lot of keystrokes. We can take advantage of this in the literal sense by using bash aliases, or strings that expand to larger commands. For an indicative example, here is a Bash alias for copying files in the terminal:

# Always copy contents of directories (r)ecursively and explain (v) what was done
alias cp='cp -rv'

The alias command defines the string we’ll type, followed by what that string will expand to. We can override existing commands like cp above. On its own, the cp command will only copy files, not directories, and succeeds silently. With this alias, we need not remember to pass those two flags, nor cd or ls the location of our copied file to confirm that it’s there! Now, just those two key presses (for c and d) will do all of that for us.

Here are a few more .bashrc aliases for passing flags with common functions.

# List contents with colors for file types, (A)lmost all hidden files (without . and ..), in (C)olumns, with class indicators (F)
alias ls='ls --color=auto -ACF'
# List contents with colors for file types, (a)ll hidden entries (including . and ..), use (l)ong listing format, with class indicators (F)
alias ll='ls --color=auto -alF'
# Explain (v) what was done when moving a file
alias mv='mv -v'
# Create any non-existent (p)arent directories and explain (v) what was done
alias mkdir='mkdir -pv'
# Always try to (c)ontinue getting a partially-downloaded file
alias wget='wget -c'

Aliases come in handy when we want to avoid typing long commands, too. Here are a few I use when working with Python environments:

alias pym='python3 manage.py'
alias mkenv='python3 -m venv env'
alias startenv='source env/bin/activate && which python3'
alias stopenv='deactivate'

For further inspiration on ways Bash aliases can save time, I highly recommend the examples in this article.

Bash functions

One downside of the aliases above is that they’re rather static - they’ll always expand to exactly the text declared. For a Bash alias that takes arguments, we’ll need to create a function. We can do this like so:

# Show contents of the directory after changing to it
function cd () {
builtin cd "$1"
ls -ACF
}

I can’t begin to tally how many times I’ve typed cd and then ls immediately after to see the contents of the directory I’m now in. With this function set up, it all happens with just those two letters! The function takes the first argument, $1, as the location to change directory to, then prints the contents of that directory in nicely formatted columns with file type indicators. The builtin part is necessary to get Bash to allow us to override this default command.

Bash functions are very useful when it comes to downloading or upgrading software, too. I previously spent at least a few minutes every couple weeks downloading the new extended version of the static site generator Hugo, thanks to their excellent shipping frequency. With a function, I only need to pass in the version, and the upgrade happens in a few seconds.

# Hugo install or upgrade
function gethugo () {
wget -q -P tmp/ https://github.com/gohugoio/hugo/releases/download/v"$@"/hugo_extended_"$@"_Linux-64bit.tar.gz
tar xf tmp/hugo_extended_"$@"_Linux-64bit.tar.gz -C tmp/
sudo mv -f tmp/hugo /usr/local/bin/
rm -rf tmp/
hugo version
}

The $@ notation simply takes all the arguments given, replacing its spot in the function. To run the above function and download Hugo version 0.57.2, we use the command gethugo 0.57.2.

I’ve got one for Golang, too:

function getgolang () {
sudo rm -rf /usr/local/go
wget -q -P tmp/ https://dl.google.com/go/go"$@".linux-amd64.tar.gz
sudo tar -C /usr/local -xzf tmp/go"$@".linux-amd64.tar.gz
rm -rf tmp/
go version
}

Or how about a function that adds a remote origin URL for GitLab to the current repository?

function glab () {
git remote set-url origin --add git@gitlab.com:"$@"/"${PWD##*/}".git
git remote -v
}

With glab username, we can create a new origin URL for the current Git repository with our username on GitLab.com. Pushing to a new remote URL automatically creates a new private GitLab repository, so this is a useful shortcut for creating backups!

Bash functions are really only limited by the possibilities of scripting, of which there are, practically, few limits. If there’s anything we do on a frequent basis that requires typing a few lines into a terminal, we can probably create a Bash function for it!

Bash prompt

Besides directory contents, it’s also useful to see the full path of the directory we’re in. The Bash prompt can show us this path, along with other useful information like our current Git branch. To make it more readable, we can define colours for each part of the prompt. Here’s how we can set up our prompt in .bashrc to accomplish this:

# Colour codes are cumbersome, so let's name them
txtcyn='\[\e[0;96m\]' # Cyan
txtpur='\[\e[0;35m\]' # Purple
txtwht='\[\e[0;37m\]' # White
txtrst='\[\e[0m\]' # Text Reset
# Which (C)olour for what part of the prompt?
pathC="${txtcyn}"
gitC="${txtpur}"
pointerC="${txtwht}"
normalC="${txtrst}"
# Get the name of our branch and put parenthesis around it
gitBranch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
# Build the prompt
export PS1="${pathC}\w ${gitC}\$(gitBranch) ${pointerC}\$${normalC} "

Result:

~/github/myrepo (master) $

Naming the colours helps to easily identify where one colour starts and stops, and where the next one begins. The prompt that we see in our terminal is defined by the string following export PS1, with each component of the prompt set with an escape sequence. Let’s break that down:

  • \w displays the current working directory,
  • \$(gitBranch) calls the gitBranch function defined above, which displays the current Git branch,
  • \$ will display a “$” if you are a normal user or in normal user mode, and a “#” if you are root.

The full list of Bash escape sequences can help us display many more bits of information, including even the time and date! Bash prompts are highly customizable and individual, so feel free to set it up any way you please.

Here are a few options that put information front and centre and can help us to work more efficiently.

For the procrastination-averse

Username and current time with seconds, in 24-hour HH:MM:SS format:

export PS1="${userC}\u ${normalC}at \t >"
user at 09:35:55 >

For those who always like to know where they stand

Full file path on a separate line, and username:

export PS1="${pathC}\w${normalC}\n\u:"
~/github/myrepo
user:

For the minimalist

export PS1=">"
>

We can build many practical prompts with just the basic escape sequences; once we start to integrate functions with prompts, as in the Git branch example, things can get really complicated. Whether this amount of complication is an addition or a detriment to your productivity, only you can know for sure!

Many fancy Bash prompts are possible with programs readily available with a quick search. I’ve intentionally not provided samples here because, well, if you can tend to get as excited about this stuff as I can, it might be a couple hours before you get back to what you were doing before you started reading this post, and I just can’t have that on my conscience. 🥺

We’ve hopefully struck a nice balance now between time invested and usefulness gained from our Bash configuration file! I hope you use your newly-recovered keystroke capacity for good.

01 Sep 00:06

Liked Why we should pay attention to Extinction...

by Ton Zijlstra
Liked Why we should pay attention to Extinction Rebellion by Peter RukavinaPeter Rukavina
What emerged was that Extinction Rebellion is as much about responding to a mental health crisis as it is about responding to a climate crisis, and last night’s meeting was much more about the former than the later.

Good observation by Peter.

01 Sep 00:06

It's The Little Details That Count

by noreply@blogger.com (VeloOrange)
By Scott

In a past life, I worked for a company that made folding sea kayaks. We'd go to consumer shows a couple times a year and you'd see the same folks from other kayak manufacturers at the shows. One of the people we'd see was a wonderful British paddler and kayak designer named Derek Hutchinson.  Derek was a lovely man and always a joy to speak to and to listen to. One of my best memories about Derek was a discussion he had with a colleague of mine about pocket watches. Derek and Sandy were talking about pocket watches and how they were similar to our folding kayaks. The outside of the kayak (or the watch) was a beautiful thing and it was what garnered a lot of attention from people as they walked past our booth. But when you looked inside the kayak (or the watch) you saw all sorts of things that were certainly worthy of a second look. Our kayaks had lots of little pieces that when fitted to the internal frame of the kayak, took on a new life and became a wonder to look at and touch. Similar with the inside of a watch. The gears, springs and wheels all working together is the reason a lot of watch makers have an open case back, so one can admire the inner workings of it.

What got me thinking about this was the similarity to the little details that go into our frames and parts.  The devil is in the detail of frame design and I think some of these cool features need to be shown off a bit.


A good example would be the rear brake cable routing on the Polyvalent.  You look at it from the outside and it looks pretty simple- a nice, slender hole at the top and bottom of the down tube. But what is hidden from view is the tube connecting the two. Big deal? Actually yes. Ask anyone who has inserted cables and housing into the void of a carbon frame. Be sure to bring a bent coat hanger, dental floss, and double sided tape. With the brazed-in tube, housing goes in and comes out with ease.




The rear wishbone/seat stays on the Neutrino is a great case of our design work combined with the incredible crafts people at our frame builders creating a captivating curve. The flattened wishbone, welded to two pieces of precisely bend tubing to create the seat stays is beautifully executed and a similar concept to one we'll be using on an upcoming bike you'll see at Philly.


The most difficult thing to see is the triple butting of the Piolet fork. Designed to help dampen some of the bumps and buzz of riding off road and reducing weight this feature is known only to those who make the forks for us. You know it because of the feel of the fork over rough terrain, you just may not know why. The segmented look may be the part that grabs your eye, but the internal butting is something that you appreciate.

Is there some detail of a bike or product that stands out to you in a similar way? Let the world know in the comments.
01 Sep 00:05

"Try not to become a man of success, but rather try to become a man of value."

“Try not to become a man of success, but rather try to become a man of value.” - |...
01 Sep 00:05

Monads in the real world

by Eric Normand

Monads are real, y’all. They are all around us. In this metaphor-free episode, I’ll share two real-world monads you interact with all the time. No burritos or space suits, I promise! Plus, we’ll see why monads are useful in Haskell.

Video Thumbnail
Monads in the real world

Monads are real, y'all. They are all around us. In this metaphor-free episode, I'll share two real-world monads you interact with all the time. No burritos or space suits, I promise! Plus, we'll see why monads are useful in Haskell. https://share.transistor.fm/s/0e44eebd https://www.youtube.com/watc

Transcript

Eric Normand: Today, we’re looking at monads in the real world. By the end of this episode, we will have a pretty good idea of what they are based on real, concrete, actual, real world stuff. I hope we can see a little bit of how they’re defined mathematically.

I just want to also say that this is going to be a completely metaphor-free monad explanation. These are not metaphors. I am trying to look for monads in the real world.

We can talk about other categories and how we see them in the real world, for instance, monoids. Lots of monoids in the real world, so when you have a toy train set, you can detach them and then reattach them, and they maintain the order when you reattach them, so it’s a monoid. It’s an associative. It has an identity.

There’s a whole episode on that. If you want to learn about monoids, which are cooler than monads, by the way, go check out the monoid episode. This one’s all about monads though. Metaphor-free, the real monads that you have dealt with before.

Before I get to the real-world things, I want to briefly talk about what a monad is in the abstract. We’ll touch on these and explain this through real-world examples.

Monads are mathematical objects. They’re values that have a couple of properties. One is that they’re functors. I have a whole episode on functors. Basically, it means you can map over them.

Some people think of functors as containers, but don’t do that, that’s a metaphor. I’m not doing that in this one. A functor is something that you can map over, so a list, obviously, an array, you can map over an array.

You can map over a maybe, meaning you apply the function if it has a value. If it doesn’t have the value, if it’s nothing or none, then you don’t apply that function.

Now, the second thing, so all monads are functors. Let’s just get that out of our way. There’s a whole episode on functors, you should watch that.

In addition to being a functor, a monad has a join operation, and that’s the one we are going to go deeply into in a couple of real-world examples. So why are monads important? I’m going to try to explain this with an example you might be familiar with.

Let’s say I was giving a gift to my friend, and I told my friend, his name is Bill. “Bill, I’m giving you a box of chocolates, happy birthday.” He takes the box, you know, kind of a sizable box, and he thinks, “Wow thank you.”

He goes home, and at home, he opens the box, and inside are lots of little boxes, boxes that fit inside the bigger box. He opens those boxes up, and inside of those boxes are the chocolates. Now, is he going to call me and say, “Hey Eric, you said it was a box of chocolates, but it was actually a box of boxes of chocolates.”

No, he is not going to do that, he’s going to eat the chocolates and just be happy. A type checker would balk at you. It would say, “Wohoho, you said a box of chocolates, but there is an extra nesting of boxes in there, that you forgot to mention.”

What do you do when you have this type error? It is a type error. I was not very specific. I was not as pedantic as a type checker needs to be. I’m admitting that. I was acting [laughs] as a birthday gift, this was like very human level.

That’s what this join operation does. It allows you to go from box of boxes of chocolates, to box of chocolates. Removes one level of nesting in a structured way that makes sense for that monad. That’s all it is. It just removes that one level of nesting. In Scala and probably other languages I am not familiar with, functor is called mappable because it has the map method on it.

Monad, it also has the map. Remember, all monads are functors, but it has flat mappable. That flat is like you’re flattening one level of nesting. That’s called join. Let’s look at another example. Let’s have a to-do list.

You know it’s like household chores and stuff, but then I get to one thing that is actually a big enough task that it has five subtasks. I want to make sure to get all of it done.

As I’m going through, I just go through one, two, three, four and then when I get to five, I have to do 5.1, 5.2, 5.3 etc. I’m still doing them in order. It’s just they’re nested in one list more.

I can do a join operation to flatten it into a single list, which is what I’m doing in my mind. As I read it, I flatten it. I read them sequentially from top to bottom. I ignore the nesting.

This join operation lets us do the nesting in the structure of our data, but then undo it when we want it to be flat. That’s what join is all about. This to-do list example gives a clue about why something like Haskell uses monads for sequencing I/O operations.

Sometimes, an I/O operation actually has several steps in it. What it needs to do is flatten them all out into just like a long string of things to do. It doesn’t want to have to go nesting there and become like a stack, as a tree, because it would turn into a tree, it can flatten it all out and just run straight down.

That’s one part of the monad that Haskell uses. I hope that by showing this as a real-world example that you see that these aren’t that hard to understand. Now, when you take them out of the real world and into a very abstract expression, there’s not much to them because every monad is different really.

Every monad has a different structure and different way of joining different semantics for how they join. There’s not that much in common, except that it’s a functor.

It has a join operation. There’s a few monad laws because it has to be associative and it has to have an identity. Those usually are pretty straightforward. Now, in Haskell and in Scala with flat map, remember I talked about flat map, the equivalent in Haskell is called “bind.”

What bind does is it’s really joining the map from the functor joining. It’s composing the map with a join. It’s sometimes more convenient to use bind than to use the map and join. It’s more convenient to use flat map than the map and flatten.

That’s why we see bind together defined as one of the two operations of monad, but really, I think that the join is easier to work with from real-world stuff. The map already comes from it being a functor, so you don’t have to define two different operations. I want to go over Maybe, which is a type in Haskell. It has equivalents in other languages.

It’s called Option in Scala, but it’s really got the same semantics. Maybe as a type that has two possible cases two constructors. One is when you have a value and one is when you don’t.

It’s used for representing optional values. I either have the value or I don’t. This has the two cases. In a lot of languages, you might use a value or null to represent I don’t have it. In Haskell, there’s a type that represents this.

That helps you, if you don’t have a Maybe, you know you will not get null. There’s only certain cases that you have to specifically call out. I may or may not have an answer on this function.

In that case, the two cases are called just and nothing. Just is when you have the value. You might say, “I have just five. It’s just five.” There’s no other meaning behind it besides I have it and the nothing is when you don’t have the answer.

How does join work on a Maybe because Maybe is a monad? First, let’s do the functor. How does map work on a monad?

Let’s say I want to have five and I want to map increment over that just five. We have to cover the two cases, let’s do that just case first. I want to map increment over this value and it’s a just. It’s just five.

What it’s going to do, because it’s a just, it’s going to return five plus one in a new just. It’s going to make a new Maybe with a just constructor. That’s got the answer to reaching into the Maybe, grabbing the value, calling the function on it, get an answer, put it back in the type.

It’s a just with six. If it has a nothing, that’s easy, there’s nothing to call the function on so you just return a nothing again. Those are the two cases. You’ve covered it all. That’s what map does over Maybe.

Now, what about join? In join, we have to deal with the nesting. I’ll handle the easiest case first. This is the type, signature would be Maybe/Maybe Int. Nested inside the Maybe is a Maybe Int.

The easiest form of this type, the easiest value of this type, is if the outer maybe is a nothing. There’s actually several cases that we have to deal with now because we have the nesting. The outer Maybe is a nothing, so that’s easy.

I just return nothing. That’s what the join us. Now, the other cases if the outer one is a just and the inner one is a nothing, we have to get rid of the nesting. I don’t have a value. That’s also nothing.

We have two cases that result in nothing, but if I have a just, just five, then when I join that, it becomes just five. It gets rid of one of the layers of Maybe on it. Those are the three possible cases.

If the outer one is nothing, it returns nothing. If the inner one is nothing, it returns nothing. Otherwise, it just collapses it into a single just instead of two justs. That’s it. That’s monad.

They’re used a lot in Haskell because of this property of being able to unnest stuff in a way that you can expect and reason about. If I have a calculation that returns a Maybe and then I want to do something to the thing inside of it, but sometimes it’s nothing, I don’t have to think about that.

I don’t have to put an if statement that says, if it’s nothing then do this, but if it’s something, do this. I don’t have to write that anymore. It’s that conditional that those two cases are handled automatically by the join.

That is why they use it in Haskell because it makes it easy to write the nice case where everything is returning values and the case where something returns a nothing happens automatically for you. That’s why they do that.

This has been a deeper episode than I thought it would be. We’ve got into what a monad is mathematically. It’s a functor with a join operation. We went over two real-world examples, “A box of boxes of chocolates,” and also a to-do list where there’s like nested lists in there.

We also saw how Maybe works in Haskell, and why it’s used in Haskell, what it’s useful for. Awesome. I hope this helped. If it did, you might want to see other episodes.

You can go to lispcast.com/podcast, and see all the old episodes. Each one includes audio, video, and text. You can also find links to subscribe wherever you want to subscribe and social media so you can get in touch with me and complain that I’ve created yet another monad tutorial.

This has been my thought on functional programming. My name is Eric Normand. Thank you for being there. Rock on.

The post Monads in the real world appeared first on LispCast.

31 Aug 23:59

✚ How to Make a Polar Density Plot in R

by Nathan Yau

With cyclical data, a circular format might be useful. Combine that with a smooth density to reduce noise, and you got yourself a plot. Read More

31 Aug 23:59

You Can’t Solve Problems You Don’t Understand

by Richard Millington

“My members have become really negative and confrontational recently, how do we stop it?”

That’s the wrong question. The right question is why have members become negative recently?

Until you diagnose the problem, you won’t be able to develop the solution.

Have members become negative recently because of a platform change or the way the community has been managed?

Has negativity been growing steadily for a while but only recently become visible?

Is negativity stemming from lots of different members or a handful of members?

If it’s the former, are they always negative or only in specific topics? If it’s the latter is this a group which agrees with each other or do they only target specific members?

This isn’t an exhaustive list of questions, but every answer will lead you to a completely different solution.

In my experience, getting the right diagnosis is a lot more difficult than getting the right answer.

31 Aug 23:59

Apple Watch :: Wie geht es weiter?

by Volker Weber
“If I had asked people what they wanted, they would have said faster horses.”
- Henry Ford

Für mich ist die Apple Watch derzeit das spannendste Apple-Produkt. Sie dominiert alle anderen Konkurrenzprodukte so sehr, dass es fast peinlich ist. Und wenn die Konkurrenz so schlecht ist, dann könnte Apple nachlassen. Darum denke ich ein wenig darüber nach, was Apple dieses Jahr ankündigen könnte.

Mittlerweile ist wahrscheinlich, dass Apple die Produktpalette weiter auffächert. Neben Alu und Stahl wird es wahrscheinlich Titan und wieder Keramik als Gehäusevarianten geben. Das eröffnet dann zwei weitere Preispunkte: 500, 800, 1100 und 1400 Euro zum Beispiel. Nach unten hin kann Apple weiterhin alte Modelle als Einstieg anbieten.

Deutlich erkennbar ist, dass sich die Watch zunehmend vom iPhone emanzipiert. Der App Store kommt mit watchOS 6 und Updates der Beta lassen sich bereits direkt über Wifi einspielen. Auch dafür benötigt man das iPhone nicht mehr. Seit der Watch 3 vor zwei Jahren lasse ich das iPhone oft zu Hause und bleibe dank LTE auch so erreichbar, aber das geht noch nicht den ganzen Tag.

Eine vom iPhone unabhängige Watch heißt nicht etwa "Android-Unterstützung" sondern einfach die Freiheit von einem anderen Gerät. Früher brauchte man iTunes, um das iPhone in Betrieb zu nehmen und zu betreiben. Das geht längst ohne. Apple Watch wird den gleichen Weg gehen.

Was glaubt ihr? Was wird Apple in drei Wochen angekündigt haben?

29 Aug 18:30

Recommended on Medium: Letter to the editor of The Atlantic, Jeffrey Goldberg

Dear Jeffrey Goldberg,

Thank you for firing my ex-husband Kevin D. Williamson.

What Kevin Tweeted about how women who have abortions should be hanged, and what he said in the MediaMatters podcast, are his true beliefs.

Other commentators were right to identify a deeper, underlying misogyny here. These remarks were not, as Kevin would later characterize them in his WSJ piece, merely “trollish and hostile.” They were wrathful and malicious, rooted in a subjective self-loathing that has been characterized as “aggrieved white male syndrome.”

They do not surprise me because Kevin once threatened to kill me just for wanting to leave him. “The day you divorce me will be your last day breathing” were his exact words.

As you can read, I am still alive.

It took another seven years, and I dated him twice afterwards, but I did successfully divorce him. I took nothing in our divorce settlement. I asked for nothing, except the right to revert back to the use of my maiden name. It was a point of honor with me. He supported me through college, but I assumed responsibility for my own student loans.

Knowing Kevin the way I do, and being as annoyed with the artisanal liberalism that is “woke speak” in the age of Trump as you apparently are, I can easily understand how you would be swept away by his charisma, his faux underdog appeal, and for your wanting to become a maverick in your undoubtedly smothering East Coast milieu by hiring him.

I owe #MeToo a big thank you if it had anything to do with making Kevin’s editors at NR view him as a liability, but I also am weirded out by the movement.

I was once a crime reporter, and for a year or two I used my charms to get information. I never slept with anyone, except a prosecutor on St. Thomas, but then I had to subsequently recuse myself from certain trials. However, I wasn’t above courting harassment if it meant I could get a document leaked. The last time I was a reporter, this old geezer, a billionaire former real estate developer in his 70s, grabbed my crotch in my car, and I was explicitly propositioned by a married Virgin Islands senator. On neither occasion did I consider myself the victim of assault or harassment, but these men were not my superiors in the newsroom. I have no idea how I would do the same job now, though, as everyone would be so tense that just being a female on the crime beat would make all my former male sources hold me at arm’s length. Then again, so many of my sources were law enforcement that they were hip to such tactics, so I can rightfully say that I had to rely more on my wits than my ass.

Where does it go from here?

I have some caveats to offer the movement. “Restorative justice” has always seemed to me a false term, a slippery slope, and #MeToo is more getting retributive than restorative. I see too many women bypassing the legal system altogether in decades old complaints, or complaints without legal documentation, if not merit, and using career sabotage as an alternative means of recourse.

I protested at the first Bill Cosby trial, but now I am like, oh, hell, what have we unleashed? It seems to me that the movement has become like a circular firing range. Having an ethical dilemma at work does not make one the victim of a crime. Each case is a separate set of events and deserves an equal amount of legal scrutiny.

What #MeToo, Black Lives Matter and, sadly, the massive wave of school shootings in this country all have in common is that the Internet has so changed reporting styles in favor of linkable material that now we are witnessing a vicious feedback loop, where social media and the actual media intersect and intermingle too rapidly for there to be an arc of containment around stories. Then the stories actually inspire more of the same in actual behavior on the ground. Further stories are shunted into a dominant narrative with luge-like efficiency, because they are now judged on the number of “hits” they gather rather than the quality of the reporting, and there’s an overall decline in the editorial standards that are used to vet sources and to manufacture the “facts.” Thus, a retroactive allegation lodged outside the judicial system is as much a newsworthy “event” as a copycat killer in a school.

Now, in part because my ambivalence toward the #MeToo movement appears to echo your broader discomfort with the Jacobin, shrieking and histrionic atmosphere that has become the left in opposition to Trump, it pains me to have to write this to you. Here I am making an assumption that he accurately quoted you in his rebuttal piece.

Consider, for example, the back and forth over Junot Diaz. As a former crime reporter, I know how badly male on male rape affects our culture, and how underreported and underprosecuted it is, so articles decrying Diaz’s intensely remorseful, brave and introspective piece about how being raped, as a child no less, may have affected his behavior toward women and stunted his relationships as a “pre-emptive strike” designed to deflate their own #MeToo-empowered victim stump sicken and appall me. He was raped! As a child! And one woman says he “forcibly kissed” her when she was a “wide-eyed” 26 year old graduate student. And another woman says he was a bad boyfriend, and she was his side piece. Boo hoo.

For years I have been writing under a pen name. In part, I wanted to avoid this moment.

I am not proud of the person I was when I married Kevin and have since often seen his misogyny identified and attacked in the press and blamed myself for it. For example, the week that Kevin went to bury his mom in Texas, I stayed home, got high for the first time, painted our apartment all kinds of bright colors, and had sex with an Indian man who frequented the health food store where I worked. I once hit Kevin twice in the face during an argument. I did all this after he threatened to kill me if I ever left him, and, if it matters, I took my infidelity with the Indian man to be the psychological genesis of his “sand nigger” comment which I will explain below.

I seldom read Kevin’s work and haven’t read his books since The Politically Incorrect Guide to Socialism. The only times I am ever even tempted to weigh in are when it reaches this frothing cyclical reaction-to-the-reaction level. I have friends with Twitter, okay? The only thing more of a pain in the ass than having a minorly famous right wing commentator for an ex-husband would be having and using a Twitter account myself.

That said, my final conclusion is that Kevin’s misogyny predates me. It has roots in his childhood, for which he deserves the utmost compassion, but it has outlasted me. I am caught up in the ethical dilemma of deciding when to say anything because I do not think our personal lives germane to our careers, but I also do not want to see a woman actually seriously hurt by him. I doubt that will ever occur, outside of consensual sexual encounters, because he is too much of a narcissist. Narcissists are sissies when it comes to actually delivering on their threats. They have abhorrent, inaccurate beliefs about the low value of everyone else around them, but they tend to be good risk-benefit calculators.

So thank you again for coming to your senses even if your due diligence was three days too late for the tastes of the Twitter “mob.”

All that said, when Kevin turned my head, I was a senior in high school, and I came from a very dark, violent family where no one genuinely loved me, and he was the first man I ever slept with and he was nine years older than me. What’s your excuse?

My allegations of spousal abuse were shot down when I filed a protection from abuse form. I was mouthy and disheveled in court because I had to go to a women’s shelter and it was my day to cook breakfast for everyone and I wore a hat, and the judge asked me why I was wearing a hat, and I said, “I didn’t have time to do my hair.”

Kevin got his due process. I lost that case, and I got kicked out of the shelter because the judge asked me when I was on the stand where I was staying, and I answered honestly, and that was enough of a disclosure to violate the shelter’s confidentiality rules. All of this is a matter of record within our court system which used to dog my ex-husband from time to time, back when he was just a newspaper editor in Montgomery County and had nasty things to say that irked the League of Women Voters, but it also pains me because I kind of can’t believe, on entirely separate intellectual grounds, that you would go so far in the direction of appeasement and accommodation as to hire him in the first place.

Here are the brass tacks disclosures. What Kevin and I have in common are that we are both from Lubbock, Texas, both grew up in incredibly violent, chaotic households, both like to read and write, and both offered to write for your magazine. What Kevin and I no longer have in common is that I am still a member of the white working class he actually despises and disparages in his anti-Trump writings. You hired him after your magazine turned down a piece I wrote about organizing my fellow servers at a restaurant last year. (Mobius picked up a better version.)

Unlike Kevin, I did not become desensitized to violence because of having seen my mother and stepmothers beaten by a man. Unlike Kevin, I have actually moved to a small town in Appalachia because I was living in a boarding house in a slum outside of Philadelphia, and I could not take the drugs nor the crime nor the cost of living in my neighborhood any longer. A quarter of the ceiling in my room caved in two winters ago. I did not have a stove, and for three years I had to wash my dishes in the sink of a bathroom barely more presentable than that in a truck stop. I lived next door to the same women’s shelter I had gotten kicked out of. This past winter, I was without power frequently because of how ill-equipped the old housing stock was to deal with multiple tenants. (It was a Victorian era building). After a snowstorm, I went two and a half days without running water, and in December a meth-addled prostitute who lived on a floor above me took an ax to a man’s head.

Until last winter, when the house became really unsafe, I pretty much woke up every day and thanked God that I was there, instead of still married to Kevin, because he was just that mean.

Now that I have moved to a small military town between Philly and Pittsburgh, I feel that I understand conservatives in a way that I never have. The town is so beautiful and affordable. People are just so terrified it will change. It is also full of snaggle-toothed, mullet-sporting Confederate flag-flying freaks and plenty of people who want to assure me that the military is out there “fighting for our freedom.” This in spite of the fact that they fought only for enhanced state power, and since they have been over in Afghanistan and Iraq, I have lost habeus corpus, any expectation of privacy online or otherwise, and all of my income to student loan or medical debt and predatory auto loans. I have never had a credit card with more than a $500 limit. I haven’t gone anywhere on vacation since I was 13 years old, except maybe attending a wedding with Kevin in Austin. My credit score is 185. During the Recession, I lost my job three times in five years. I am economically dead. I don’t even have a pulse.

I didn’t come here on assignment; my assignment is my life.

Bang up job they’re doing, those soldiers, protecting my freedom.

My downward mobility issues aside, I also moved here to be closer to the best friend of my late stepmother, an exquisitely kind, married, pro-life evangelical Christian. She is a survivor of severe incest, raped two or three times a week starting from when she was 11 until she was 13 by her stepfather. Her psychopath first husband shook her infant son to death and served only three years in prison for it. The week of my stepmother’s funeral, my father groped her breasts, harassed her and tried to get her to have sex with him. She and I didn’t know each other before these incidents. We have grown very close.

I am not making this shit up.

My transgender roommate works two full-time jobs, one as a cashier at a convenience store, the other as a custodian at a local school, just to have a car and split the rent with me.

I am not making this shit up.

The fact that you spurned my piece then hired Kevin makes me question your editorial judgment when it comes to class, not gender, lines. If you had offered me exactly no money for an edited version of my essay, I would have leaped for joy. These people out here in Appalachia do not deserve to die, or to go by the wayside with their obesity and opioids and lack of white collar service industry skills. Even if everyone could get out of Garbutt, we can’t get Garbutt out of America They do not deserve such excoriation even for their goonish, myopic, Imperial entitlement.

Neither does Kevin nor any other NeverTrumper deserve to drive a wedge between himself and them with their fallacious insistence that they can better manage the masses with a more doctrinaire, genteel conservatism, for there is no valid distinction here.

When Kevin ignited controversy with his article “Like a Boss” during the 2012 election season, a risible and contemptible piece of shit writing in which he misconstrued dubious to begin with anthropological research to bolster his claim that Mitt Romney would make a better leader than Obama because Romney had sired sons and Obama had two daughters, I whined to my friends that John Derbyshire got fired from NR for racism but misogyny was the last holdout. How could NR run such an intellectually flawed piece? Can’t anyone just say, this doesn’t make sense, even if the “research” weren’t total bullshit, the Obamas probably use birth control? Time and again, the lack of logic at the center of his writing undermined NR, and they rolled with it because of his boldness and ire, his relatively youthful verve, which some of them are now correctly calling “incoherent and cruel.”

In his response to the firing, he said that you said The Atlantic “wasn’t high church for liberals.”

Beg your pardon?

During the 2016 elections, your magazine was one of a handful of publications kept me sane, as I saw how intellectually shrinkwrapped the national media had become. (I had been living in the Virgin Islands for two years and was a little out of touch.) Myself and a lot of my liberal friends turned to your magazine because, frankly, we can’t trust The New York Times anymore. We needed timely and impeccable information about such matters as ISIS and Richard Spencer, etc. We prayed that Trump would get elected because it meant that we, as a society, would have hit rock bottom, so to speak, and real change could finally happen.

Just because Kevin is not ISIS, Richard Spencer or Trump does not make him okay, okay?

I find it ironic that in his WSJ rehash of events Kevin complains about how he would like to find a pro-choice advocate who admits that abortion is the taking of ‘innocent’ life because he was married to one−me−for some time. I do not sit comfortably among pro-choice advocates who do not want to admit that abortion is state-sanctioned killing. However, from a legal standpoint, it is not homicide. We must differentiate between the two. Otherwise, we’d have to jail many of our “freedom” fighters, errr, veterans.

Abortion is the taking of human life.

It is also a right women have. It is a right that should be defended. Full stop. Because women are the gatekeepers of the planet, and pregnancy and childbirth are active, deliberate events, not a passive happenstance. The terms “guilty” or “innocent” are likewise legal terms and can only be applied to life actors once they are, you know, of age to exist outside of another person’s body, so the sentimental rhetoric of religious types about such biological material as a first and second term fetus being “innocent” and therefore afforded protections that, say, people the government deems a terrorist through a secret, unsupervised and undemocratic court system are not, has not held any place in our legal system on this issue, nor should it be restored, ensconced and coddled in any way. Is the life a life? Yes. Is it innocent? Innocent of what, exactly?

I kind of can’t believe we are still talking about abortion in this country in 2017. The planet is dying. Humans across the globe are experiencing an unprecedented refugee crises. The Trump administration lost track of 1,475 child refugees. Sex and human trafficking are on the rise, as is fascism in multiple countries. And people like you are concerned about being “insufficiently intersectional”? What the fuck does that even mean?

Similarly, I can’t believe that anyone actually bought the right wing NeverTrumpers’ spoilsport insistence that they deserve to be able to disavow Trump’s fascism and disregard for the rule of law. As I see it, Trump is their monster, and people like Kevin are Dr. Frankenstein. I listened to AM radio and tried to play the good wife for so long, but after I left my marriage, I felt like I had left a cult.

I have never heard Trump propose or seen him do anything that the shock jocks Kevin was addicted to in the early 2000s, and Kevin himself, haven’t trumpeted at length. What they don’t like is that Trump exposed how ugly, ignorant and entitled the base, i.e. their own fans, had become. Even Glenn Beck recanted. Personally, I think Trump exposed a lot of the kneejerk, idiotic racism and vitriol which people like Kevin used to air behind closed doors. Kevin aired it in full, but then sat down to write in the persona of some more enlightened character in order to court that same base’s adulation.

Then, somehow, the pied piper persona cracked, but not enough to prevent him from getting a gig as “dissent” at The Atlantic.

Believing you can civilize him is a fallacy of many a good wife, maybe even a good editor. Two terms among so many that I’d just as soon forget that I learned from my ex-husband: “sand nigger” and “bimbo chair.” The former he used in one of our many arguments about the wars in Afghanistan and Iraq and the Bush doctrine of preemptive war and presumed Al Qaeda abettors, as in “I say just kill the sand niggers.”

“Bimbo chair” is, according to Kevin, what the people who produce or star on that TV show “Red Eye” call the positioning of a token woman on their token panel in a chair screen right with extra body exposure so that the late-night audience can see her legs and tits and ass and be titillated. It doesn’t matter what she says, he implied; she is there primarily as eye candy.

At first, Kevin was a Catholic social conservative. I thought I had married the next T.S. Eliot; then he morphed into some bloviated Rush Limbaugh wannabe. Then he was a “libertarian” and a free market fundamentalist, an intellectual stance which I think is just fake through and through. Libertarianism is a hollow sidestep of every social issue that ails mankind, not a valid political designation, but, then again, I am a socialist, and the libertarians think that’s a copout cover for communism, which is itself just a reaction to capitalism. There really is nothing new under the sun.

Over the course of our marriage, Kevin changed his stripes to suit the field of job opportunities available to him and make more money. I changed my stripes to honor my more compassionate, humanitarian values and my higher level of education, i.e. I went to college.

I suspect that Kevin would be on the outs with NR anyway because Trump’s people probably saw that he and NR were perceived as elitist and tried to egg him on because if Kevin alienated people in Appalachia with his self-loathing classism and wordsmithing snobbery that would only draw more people into Trump’s tent. And now that the election is over, Kevin is not useful in that way, and maybe NR caved to the administration, and he has no home except his own “platform,” for the time being. (I really don’t know the ins and outs of what would have motivated him to leave his dream job at NR or even if it were voluntary; I can only speculate.)

When I was in Occupy, I bemoaned that we were non-violent. Now, there’s ANTIFA.

Be careful what you wish for, I guess. My main objection to ANTIFA is very Kevinesque. I have no qualms with the violence they deliver on the streets to these neo-Nazis, but rather with the rhetorical violence they do to free speech in comment threads that smack of compulsory Communist study sessions in Maoist China with their level of hipster, p.c. qualifications. Similarly, “trigger warnings” and “safe spaces” on college campuses don’t fool me a bit. The thing that makes fascism unique is that it arises from either side of the political spectrum.

Occupy was obviously the American incarnation of a utopian, romantic, early Marxist movement. ANTIFA is obviously a more militant faction that typically follows. History also suggests that the left fractures before it unifies and delivers its more powerful blows to a repressive regime. Then it goes through a phase of beatifying its leaders, then the clergy-bureaucrats, so to speak, move in and corrupt everything. My roommate is convinced there will be a second US civil war in our lifetimes. I thought this assertion was overblown, but, on further consideration, you know how “Muslim terrorist” wasn’t really a “thing” before 9/11? Well, neither was “the deep state” a “thing” before Trump.

I still don’t believe that Kevin deserves to lose job opportunities because of what is now, legally speaking, a non-issue, unless those job opportunities involve telling the rest of us how to live or think. People need to be held accountable for their actions, not necessarily just their words, and so I would not oppose Kevin getting any number of regular jobs, such as accountant or purchasing manager or waiter or media buyer.

I’m not buying his clever spin in the WSJ piece that make the remarks seem paltry compared to his voluminous oeuvre, wrenched out of context and blown out of proportion.

What is context anymore? Anyone? Really?

What is proportion anymore, either?

Kevin wrote it, and words are still words. Plus, words are his job. Even in the age of social media, and I do not believe that writers should be held any less accountable for their Tweets or social media postings than anyone else simply because other, non-writerly types abuse the platforms considerably, practically reducing the level of discourse in this country to the intellectual equivalent of lolzcats flinging turds outside the litter box then rolling around in the floor with them, taking selfies, and then hissing at those selfies later because they don’t even recognize themselves, and life still goes on. I was really late to get a Facebook account because I had been a newspaper reporter and the immediacy of publishing without an editor scared me. I went full circle, had a very bad FB meltdown, and killed my personal page at one point. I started over when I could trust myself again, under my pen name. If he wants to bury his Twitter, that’s fine. But I stand by what I said when I filed that protection from abuse form. (In fact, precisely because I filed it in a court of law, I have no choice but to stand by it for the rest of my life.) He had two guns, and he explained to me that because we were married in the big-C church, he didn’t have to follow the laws of man, only those of God. Killing me would be a sin, he said, but so was divorce, as if there were parity.

I am not making this shit up.

I was not physically abused by Kevin. However, that’s not the point.

Maybe it’s more germane that he bragged to me in the early 2000s about donating “our” money to Operation Rescue? Hundreds of Operation Rescue members throughout the late 80s and 90s were arrested for aggressive protest tactics. Some of them splintered off, forming groups such as the “Army of God” and the “Lambs of Christ”. These groups were devoted to the use of violence against abortion providers. They include such domestic terrorists as James Kopp, who murdered an abortion doctor, Rachelle “Shelley” Shannon, who shot another abortion doctor, and John Arena, who used butyric acid on abortion providers. Throughout the late 90s, it would be safe to say, Operation Rescue trained activists in violent tactics against abortion clinics, including blockades, occupations and encouraged even, yes, homicide.

Did anyone at The Atlantic or any one of the publications that spurned him by not interviewing him after the “Twitter mob” came for him ever think to ask him if he had ever knowingly funded a domestic terrorist group?

Maybe then it’s more germane that he bragged to me about seducing his NR bosses’ 24 year old assistant and then beating her all over in torrid, sado-masochistic sex acts?

Maybe it’s more germane that when he was almost 40 he dated one of his undergraduate students almost as soon as class was dismissed at King’s College?

The last time I dated Kevin he looked at the cracked ceiling in my apartment in Branford, Connecticut and rather laconically said, “I would kill you if I lived here.” He said it off-handedly, but as if we had zero history with this kind of comment. Because he didn’t like the neighborhood or the décor. Branford, he said, was too “suburban.” On another occasion, a lovely summer day−I guess he was annoyed at the chatter of my neighbors’ small children filtering in through the window screens−he referred to them as “monkeys.” One family was Korean, the other had two boys with a black father and a white mother. I was really disturbed by the fact that he would call the mixed race boys “monkeys.”

I have been sexually assaulted, not by Kevin, but by a roommate. He was a Haitian immigrant who came to the US when he was 14 because, as he told me, his family was on the outs with the prevailing regime; he worked at HomeDepot, and he did not make a livable wage. He did not understand that no matter how many times I explained that I was just interested in sharing an apartment, that he was just a tenant, I really meant it. He wanted to sleep with me so that he could skip out on rent, and get me to support him or at least cut him some slack, in my opinion. Kevin was dating me at the time. Before the assault, when I had to confront my roommate about his bounced rent checks and avoidance of tenant responsibility, Kevin literally cowered in the bedroom. Then he seemed annoyed that I was having to deal with the situation instead of just paying attention to him.

After my roommate entered my room while I was asleep, because he knew I had been drinking, and laid over me and groped my breasts, I went to the police the next day. He did not rape or injure me, but I needed a legal leg to stand on in order to have him evicted. I did not want to live every day in fear that the behavior would escalate. I did not want to see him have a lasting criminal record, and I made these desires known to a victim’s advocate. I suggested that he be mandated to have some sort of therapy whereby someone in authority could explain how to act, how consent works and that women have rights, here, in this country.

I have never, ever filed a false police report against any man. I have also never defamed or libeled anyone in my journalism. I have never sought compensation, only protection.

But nothing, no, nothing should have been more germane between April 2 and April 5 than how many contortions and lies Kevin is able to spin in his articles, to which you already had full access. Contortions and lies about the state of our nation, not necessarily women, abortion, our respective sex lives, and not our now defunct marriage.

Trump is for real; rock bottom is uncomfortable, but we lost our democracy when Obama signed off on the NDAA. China is the new America. America is the new Soviet Union, and the walls are closing in. Now we have no civil liberties to speak of, a supercharged surveillance state, and severe economic extraction. The freedom of movement, the freedom to criticize those in office, the freedom to have guns, and the freedom to choose our jobs are the only substantial freedoms that we have that people in Glasnost Russia did not, and Trump has managed to threaten every one of those except the right to bear arms.

Trump’s continued support for agricultural guest labor policies are actually a proposal for maintaining slave labor in our economy, which human trafficking is already doing on the black market. From a recent speech in Michigan: “They’re going to work on your farms, we’re gonna have the H-2Bs come in, we’re going to have a lot of things happening, but then they have to go out. But we’re gonna let them in because you need them. … Guestworkers, don’t we agree? We have to have them.” He proposes an actual wall along our southern border, and no one except maybe The Mandibles author Lionel Shriver, bats an eye at how its building will drain badly needed resources away from the fight against human trafficking and drugs, then trap actual Americans in; secret courts have full sway, and our left is so fractured that it is reminiscent of Franco’s Spain.

Kevin claims he was marginalized by you because you have more clout, blah, blah, blah. NARAL and the feminist coalition have corporate sponsors, but, wait? Does anyone see the contradiction here? Hasn’t Kevin defended the corporate person, the right of corporations to throw money towards whatever causes boost their profits, to cherrypick what gets heard and passed, and to literally write laws in their favor and hand them to our Congresspeople like homework assignments, to play the man behind the curtain as they see fit over and over?

Again and again, Kevin told me I was stupid to decry Citizens United; then he was in a snit about the 2008 TARP bailouts. How can anyone defend the legislation that enabled gross corporate entitlement and influence in our legislative branch, then fume at the natural, rent-seeking behavior that results? And then complain that career accountability is an offshoot of some twisted double standard that doesn’t even exist? Corporate sponsorship is fine for the gander when the gander is the Tea Party, but not for the goose when the goose is NARAL?

Being a hypocrite is the stock in trade of writers, all writers. Having anything at all to say about anything that matters hazards that you could be, not just wrong, but wrong in a way that exposes your deeper layers of subjective pain. Writers constantly write to get the characters out of their heads, then, once the work is finished, feel a sort of anguish that they can’t get their own heads out of the characters they took to be so crisply, distinctly, innocently other. It ain’t fun, and it ain’t easy, and, like abortion, it is a right every woman has and it is almost never undertaken lightly.

In the end, the best that any of us can hope for is that we go naked before God, go as ourselves and not any one of our many “accounts,” having fended off our very human frailty with the highest level of honor afforded us by the society we lived in.

Sincerely,

Amanda Norris, a.k.a Penelope Gristelfink

P.S. If I have an abortion, I’m agonna name it Kevin.

28 Aug 17:22

Yes, I Work at Wirecutter. No, We Don’t Get a Bunch of Free Stuff.

by Christina Colizza
Yes, I Work at Wirecutter. No, We Don’t Get a Bunch of Free Stuff.

Walk into a party as a Wirecutter staffer, and people are never shy about throwing questions at you. Like, “Can UPF clothing really save your skin from the sun?” (Sort of.) “What’s all this about air fryers?” (They blow.) “Should I get AirPods?” (Probably not.)

We love answering these questions. But the question that we get asked the most (and often with a tinge of envy) is: “Do you get to keep all the free stuff?”

No, we do not.

22 Aug 19:32

Microsoft’s Chromium based Edge browser is available for beta testing

by Qian Bao

Microsoft has been testing its next-generation Chromium-based Edge browser since April with ‘Canary’ and ‘Developer’ builds, updated daily and weekly respectively.

The Redmond-based company now says the reborn Microsoft Edge with Chromium is available for the public beta test, which is tuned toward regular users instead of developers. The ‘Beta’ build will be updated every six weeks in order to deliver a stable user experience.

Both Windows and macOS users can now download the beta build from the Microsoft Edge Insider page.

The beta version contains all of the major features that we expect from the next generation Microsoft Edge, including dark mode, online tracking prevention and a general speed boost from the Chromium platform.

Without specifying a future date, Microsoft says that this will be the last test version of Edge before the final release.

Microsoft Edge is the latest attempt by the company to move away from its ageing Internet Explorer browser. By hopping onto the Chromium platform, which is widely used by users around the world, Microsoft hopes to turn Edge into the Windows browser of choice instead of being a ‘Chrome Downloader.’

Source: Engadget

The post Microsoft’s Chromium based Edge browser is available for beta testing appeared first on MobileSyrup.

22 Aug 19:31

Yubico launches hardware security key with USB-C and Lightning

by Jinqiao Wu

Swedish company Yubico just launched the YubiKey 5Ci, the world’s first battery-less security key with USB-C and Lightning.

Because of its dual-connector design, the 5Ci offers hardware-based authentication to iPhones, iPads, Macs, Windows, Linux, Chrome OS and Android devices.

However, Yubico had clarified to The Verge “that services have to individually add support for Lightning connector on the 5Ci into their (iOS) apps.” Otherwise, the key wouldn’t unleash its full potential on iOS devices.

At $70 USD ($93.28 CAD), the 5Ci carries FIDO 2 as well as FIDO Universal 2nd Factor (U2F) certification, and it includes cryptographic specifications like the RSA 2048, RSA 4096 (PGP), ECC p256, and ECC p384.

On top of that, the key provides official compatibility with password managing software like Dashlane Premium, 1Password, Keepers and LastPass Premium.

It also supports online storage services like Google Drive, Dropbox and OneDrive. Social media sites like Facebook, Twitter and YouTube also work with the key.

For Canada, Yubico says “non-US orders placed on or after August 22nd, 2019, will not be processed until September 2nd, 2019.”

Source: Yubico Via: 9to5Mac

The post Yubico launches hardware security key with USB-C and Lightning appeared first on MobileSyrup.

22 Aug 19:31

Apple TV+ users will reportedly be able to download TV shows and movies for offline viewing

by Brad Bennett
Apple TV 4K

Apple TV+ users will be able to download content in order to watch it offline, according to a new leak.

Code found in a recent version of macOS’ Catalina beta reads as follows according to MacRumors:

“You have reached your limit of [the preset number of] downloads.”

The publication found a few other lines of code that outline the rules surrounding the downloading and viewing process featured in the upcoming service. Reportedly, there will be restrictions regarding how many times a user can download a show, how many items total can be downloaded at a time and restrictions related to downloading the same show on multiple devices.

Apple is also implementing a rule to limit simultaneous streaming, according to the leak. It’s unclear if the Aplle will also restrict users to only one device at a time or if there will be options for more. In comparison, Netflix allows users to watch content on up to four devices simultaneously depending on the plan tier. Bell’s Crave, on the other hand, limits users to only two devices at the same time.

It seems likely Apple will implement the use of its ‘Family Sharing‘ functionality to make it possible for more than one user to watch content from a single Apple TV+ subscription.

Other Apple TV+ rumours claim the service will launch in November for approximately $9.99 CAD per month.

Source: MacRumors

The post Apple TV+ users will reportedly be able to download TV shows and movies for offline viewing appeared first on MobileSyrup.

22 Aug 18:35

Next-gen Google Home Mini to add Nest branding, a 3.5mm audio jack

by Brad Bennett
Home Mini

It looks like Google is on track to rebrand its Google Home Mini to keep it in line with this year’s Nest Hub. Google is also adding some new features to the device.

The new features include a 3.5mm audio port, a higher quality speaker, new colours and some form of a wall mount.

The most significant addition out of these is the headphone jack. This port will bring the Nest Mini in line with Amazon’s Echo Dot and will easily allow people to connect it to larger speakers. Since Google discontinued the Chromecast Audio, this could make the new Mini a replacement for that.

This leak comes from 9to5Google, and the publication’s sources say that the new device will be roughly the same size as the old one, but maybe a tiny bit larger. This could help fit the new speaker, which is reportedly louder, has more bass and better sound quality.

The new wall mount is one feature that should help people fit the mini into more situations. 9to5Google’s theory is that it could be a small hole on the back where users could hang the device like a wall clock.

One weird feature that the device is rumoured to have is proximity awareness. This sensor would allow the device to know when someone was nearby and could then show things like volume.

We can expect the new device to come out sometime in the fall during the Google Pixel 4 launch.

Source: 9t05Google

The post Next-gen Google Home Mini to add Nest branding, a 3.5mm audio jack appeared first on MobileSyrup.

20 Aug 21:22

Immunization

Before every major release I like to try and think of everything mean that people might say about the app. It’s fun!

So we just went through this exercise on the NetNewsWire Slack group. Here’s a taste:

  • This took five years? I could write an RSS parser in a weekend.
  • Can’t get my Twitter and Facebook feeds. Whatever.
  • Doesn’t work with my Usenet host.
  • The information density of the timeline is… lacking. What the hell.
  • Not truly open source since it’s on a Mac.
  • Not truly open source since it’s not GPL.
  • No vim keys. Why bother.
  • Regular people will never use an RSS reader. What’s the point?
  • Brent’s last good idea was in 2002. Consider this a textbook case of coasting.
  • Great app. Too bad RSS died with Google Reader.
  • It totally didn’t pick up my subscriptions from the earlier version. How is this an upgrade?
  • When does a 5.0 have fewer features than a 3.0? When it’s NetNewsWire.
  • The echo chamber will love this app. They always do.
  • Free app. Continues the race to the bottom. Pour one out for Silvio Rizzi.
  • No way to send to Instapaper. Fuck it.
  • Brent Simmons can’t stop pursuing a technology that even Google famously admitted was not worth bothering with.
  • If this app took five years, imagine how long it will take before it will actually sync with Feedly.
  • Sure it’s free, but I bet the Feedbin people paid them off, because the only way to sync is to pay money to Feedbin.
  • No iCloud sync? Jerks.
  • No iOS app. The revolution happened on mobile, Brant. What the actual fuck.
  • Shoulda been Catalyst. Dinosaurs wrote this app.
  • Not on the Mac App Store? I guess they don’t want users.
  • I would totally use this if it had just this one [feature x], which I can’t believe they shipped without. (Multiply this comment by 100, with a different feature x each time.)
  • Area Man Can’t Let RSS Go

Some feedback will be factually inaccurate, but we like to imagine that too:

  • I remember using NetNewsWire on OS 9, and it hasn’t really improved since then. They should make it a Cocoa app.
  • Doesn’t work with web comics. POS
  • Doesn’t support 10.5.
  • It should be free.
  • You’d think they would have updated the design — but it looks exactly like NetNewsWire of old.
  • Why the hell would they build on that aging code base from Black Pixel? I heard it doesn’t even use ARC.
  • No way to sync? What’s their actual problem?

See? The actual feedback will be nicer than the stuff we thought up. This provides a bit of immunization. :)

But, also, there will be negative feedback we didn’t imagine. That’s the gold!

* * *

Bonus from Daniel Jalkut, but not actually a criticism:

Can’t innovate, my RSS.

20 Aug 18:57

Consumer Convenience & How It Relates to our Cities

by Sandy James Planner
woman in grey jacket sits on bed uses grey laptop
woman in grey jacket sits on bed uses grey laptop Photo by bruce mars on Pexels.com

Just as there is growing interest in slow cooking with meals made from scratch, is there a return to thinking about doing other things in a more 20th century and long hand way?

Gayle Macdonald in the Globe and Mail talks about the “convenience-driven quandary” and asks: “What if we become so accustomed to computers and other AI-driven technologies doing everything for us that we forget the joy of doing things slowly, meticulously and with our own two hands?”

Take a look at the data. Online purchases have increased to 2.9 trillion dollars in 2018, from 2.4 trillion in 2017. And Canadians, who have been late to the online purchasing party have now  doubled their expenditures online from sales reported in 2016 to a  a cool 39 Billion dollars in United States funds.

That sum is more than what the current American president was going to spend on the southern border wall (that clocked in at 25 Billion dollars).  And here’s a story of what 25 Billion dollars will buy. 

Something else happens when goods and services are ordered online and delivered to your door. That is the isolating experience when you don’t have to walk or bike  or even go to a store, or have any interactions with people on the street or in shops.

As Macdonald observes ” loneliness – a close cousin of isolation – seems to be on the rise, with the U.S. Surgeon-General recently warning it’s an “epidemic” in United States and Britain appointing its first “minister of loneliness.”

While online shopping speaks to comfort and convenience, anthropologist Grant McCracken is wary of the ease of it, stating: “The industrial revolution declared war on space and time … and right through the second half of the 20th century, this war had no skeptics. Convenience was king. But in the last few decades we have seen a counter revolution. We saw the arrival of slow food, meditation, mindfulness, artisanal economies and a more measured approach to life by many people. All of which is better for humans and better for the planet.”

Encouraging “artisanal” enterprises also means developing great walking environments and safely separated bike lanes so that people can access shops and services at a slower pace. That slower pace also demands a level of detail in the environment, making streets and sidewalks clean, appealing, with benches, public washrooms, good wayfinding and places to spend time.

 It is at the municipal level that good amenities are needed  to encourage citizens to explore  on foot and on bike.  There is a lot to be learned from Europeans that use public space longer than North Americans.

While a park “stay” in Europe is registered as twenty-five minutes, that same “stay” in a North American park is only ten minutes. Why? Is it the lack of amenity  or just that using public spaces as outdoor dens is not culturally embraced? We need to create public spaces to walk and bike to and to sit in, making those experiences as approachable and accessible as online shopping, but a lot more stimulating and fun.

Part of a return to mindfulness and sustainability is reinforcing a community’s connection at the most basic level~the sidewalk and street. We need to demand the best attention to detail at this level  to make the public realm and non-motorized use of city streets effortlessly accessible for everyone.

 

 

20 Aug 18:50

Casio adds a heart rate sensor to its new Wear OS smartwatch

by Dean Daley

The recently announced WSD-F21HR from Casio comes with a heart rate (HR) sensor along with a list of features carried over from the WSD-F20.

According to Casio, the HR sensor mounted underneath the watch measures heart rate “by shining an LED light to detect the flow of blood in your body.”

Compared to the F20, the F21HR trimmed up to 13 grams of weight and added support for the slightly newer Bluetooth 4.2 protocol. Unfortunately, battery life also decreased from two days to around 1.5 days in “Normal use (Color display auto OFF).”

Other than that, the spec sheets appear to have the same specifications in other areas, such as the dual-layer display, the same magnetic charging terminal and the identical MIL-STD-810G durability rating.

The new Casio smartwatch will hit the market during September 2019 for $500 USD ($666 CAD).

Source: Casio Via: Android Authority

The post Casio adds a heart rate sensor to its new Wear OS smartwatch appeared first on MobileSyrup.

20 Aug 18:46

Let's Play: No Man's Sky VR

Ben Plays VR, YouTube, Aug 20, 2019
Icon

As readers know, I've been playing No Man's Sky for several years now. I have hundreds of hours of playtime. :) Anyhow, this week was a banner week because of the new release, called 'Beyond', which included a large number of new game features and - best of all - a VR mode. Now I don't have the VR helmet (alas) but it still plays on my screen, so I'm OK. This video, though, introduces the VR mode from the perspective of someone new to the game. Now this game is deep, there's a lot to learn and remember, and it will take a long time to master. So the gameplay and instructions are crucial. It has taken a while for the producers to get to this point, but you'll see from this video a lot of innovation and nuance. Maybe one day I'll do an analysis of No Man's Sky from a learning perspective, but for now, it's going to be my favourite for a long time (and I can't wait to get a VR helmet).

Web: [Direct Link] [This Post]
20 Aug 18:46

A Moral Duty to Share Data? AI and the Data Free Rider Problem

John Danaher, Philosophical Disquisitions, Aug 20, 2019
Icon

This might seem like a counter-intuitive position at first, but it bears deeper thought. The idea is that, since we all benefit from the fruits of artificial intelligence (AI), we all have an obligation to contribute to it, and what AI needs is our data. It might me that we didn't ask for this benefit, but there are analogies in other benefits we didn't ask for. Herd immunity, for example: this is the idea that if enough people are vaccinated, everybody is protected from the disease, even those who cannot be vaccinated. So there is a moral obligation (it is argued) to get vaccinated. I think this paper could have spent more time considering the objections, but it's a well-crafted argument and gives pause for thought.

Web: [Direct Link] [This Post]
20 Aug 18:45

Leading US bosses drop shareholder-first principle

Simon Goodley, Rupert Neate, The Guardian, Aug 20, 2019

The five new principles at a glance:

  • Delivering value to our customers
  • Investing in our employees. This starts with compensating them fairly. We foster diversity and inclusion, dignity and respect
  • Dealing fairly and ethically with our suppliers
  • Protecting the environment by embracing sustainable practices
  • Generating long-term value for shareholders

More from NY Times, HBR, WSJ, Bloomberg, Quartz, Axios. As one commenter said, " Paying some taxes would be nice."  Via Metafilter.

Web: [Direct Link] [This Post]
20 Aug 18:43

I’m listening to a presentation that’s repeatin...

I’m listening to a presentation that’s repeating the phrases “no code”, “low code”, and “citizen developer” over and over.

Send help. Please.

20 Aug 18:42

Snips :: On device voice recognition

by Volker Weber

200e1769fdccd1dd4aab370097179258

Claim: Snips provides Private-By-Design, Decentralized Voice Assistant Technology and Solutions.

More >

[Thanks, Kai]