Philosophy - What's the use? - <AUTHOR> http://opinionator.blogs.nytimes.com/2012/01/25/philosophy-whats-the-use/?hp

<comment><AUTHOR> Since it's a meta-discipline (i.e. thinking about thinking) philosophy has been pooh-poohed and vilified since ancient times; or philosophers have been elevated to god-like stature. The danger in the current times, I think, is that they are fast disappearing from the public consciousness, eliciting neither of these strong responses that they did in the past.

This is too bad since, like it or not, we need them more than ever (or as much as always, depending on your view about the progress or lack thereof of the world):

"... if I say I would never kill an innocent person, does that mean that I wouldn't order the bombing of an enemy position if it might kill some civilians? Does a commitment to democratic elections require one to accept a fair election that puts an anti-democratic party into power? Answering such questions requires careful conceptual distinctions, for example, between direct and indirect results of actions, or between a morality of intrinsically wrong actions and a morality of consequences."

Those are not abstractions but common questions that we are facing _today_ (e.g. using UAVs in Afghanistan or the rise of Islam in Egyptian elections). Add to these the important questions that are perennial election debates in the US: gay marriage (check how your argument fares against e.g, polygamy), abortion rights, limits to right of speech (e.g. the very recent ruling in personal data encryption), stem cell research, affirmative action, and so forth.

<comment><USER2> I would say "as much as ever," but I agree with your basic premise (as a guy with a philosophy degree).

I'm not sure philosophers are disappearing from the public consciousness-- rather, they are being replaced with pseudo-philosophers. I reckon Richard Rorty was the last philosopher/public intellectual.

<comment><AUTHOR> I couldn't agree with your pseudo-philosopher observation. The public does have a need for consultation on these important questions and more and more that's being filled by such people.

</comment></comment></comment><comment><USER3> Philosophy is interested with the very edge of knowledge and learning why and how we can know about it. Perhaps you forget not so long ago the philosophers Frege, along with and Russell and Whitehead. These guys were trying to create a logic that mapped to language better that their traditional logic. This guy named Wittgenstein came up with this idea called 'truth-tables'. This work eventually lead some guy named Turing to invent the effing computer. It was philosophy, now it's a science.

Philosophy is the creation of sciences. Whether it's computer science of the recent past, or psychology and political science before that, or even physics if you go back to Galileo's and Decartes' 'natural philosophy'. It's easy to disparage philosophy in retrospect, because you don't consider the science you love as being its biproduct.

<comment><USER4> _It's easy to disparage philosophy in retrospect, because you don't consider the science you love as being its biproduct._

But this is exactly the problem with philosophy - all the useful stuff[1] leaves the field and takes on another label, because all the crap that's been around forever (you know, all that meandering metaphysical wishy washy nonsense about the nature of existence that everyone immediately thinks when they hear the word "philosophy") is pretty much garbage and nobody wants to be associated with it if they've got something that you can actually use.

Philosophical motivations are fine, and every field needs a "Philosophy Of" to guide it; quite often those philosophical thoughts are exactly what inspired the original visionaries to do the real work of studying that field, and that's great, we need people thinking about stuff like that.

But the pure study of philosophy has too many dark corners where stupidity can hide out and self-reinforce for me to approve of its current incarnation: while a small part of it is legitimate work in formal logic, a good part of the rest is lightly camouflaged religious apologetics, and the remainder is just inane arguments over definitions which ultimately do little more than remind us that human language is imprecise and does not lend itself to formal analysis. In my experience, way too many of the people that are "into philosophy" focus exclusively on the latter two pieces of it, embracing rigor only to the extent that it allows for squishy beliefs that can never be proven wrong.

[1] ...with the notable exception of some parts of mathematical logic, which for some inexplicable reason seemed to stick around in the philosophy departments rather than moving on over to math like they probably should have.

</comment></comment><comment><USER5> Even if many people do not need to know more philosophy, they certainly need more _practice_ in philosophy. Philosophy teaches people to think logically, to form rational arguments, to carefully define their terms. Thinking clearly is an important life skill.

</comment><comment><USER6> I majored in Philosophy. It requires reading a bunch of obtuse and boring stuff, as well as a couple of logic classes. It turns out if you do the homework, it makes the LSAT a piece of cake. So there's one practical use case.

<comment><USER7> Agreed, as evidenced by my SO who took philosophy and got almost a perfect score on the LSAT. I didn't go in that direction, but I think majoring in Philosophy is a great path if you're sure you're going to get a post-graduate degree (or already have a certifiable skill).

</comment></comment><comment><USER8> Philosophers are a lot like programmers. The car you drive, the clothes you wear, the food you eat - all of them are touched in some way by a computer program - even if you personally are unaware of how these computer programs design things and route people & things. Philosophy is like this - the most ardent Bible (or Quran) thumping fundamentalist makes a bevy of philosophical arguments, even if they do a poor job of it while they are unaware of it.

As with programming, the more esoteric and technical aspects of philosophy can be difficult for the layman to grasp. No policy maker would dream of de- funding computer science education because it's obtuse to the general public. Yet somehow technical difficulty is a knock against funding philosophy education in the USA....

</comment><comment><USER9> I think the most succinct response to this question I've found comes from the Starcraft II casting archon, "Tastosis" during one of those filler periods where nothing is happening in the game:

 _Tasteless:_ I'm a philosophy major, man.

 _Artosis:_ Hmmmm? That's good.

 _Tasteless:_ You major in that, people are like: "What are you going to do with a philosophy major?" _::outraged mumble::_ I'm like: "I dunno, properly navigate the world with my mind? Geez!"

</comment><comment><USER10> I have several friends involved with philosophy, as students or lecturers. If you listen to them talk, there is some interesting stuff there, like formal logic, but the lion's share is just arguing about semantics and nuances of translation from the original German. I think of philosophy like chess: it's an intellectual challenge, with a lot of history, but at the end of the day it's just a game. It's not _for_ anything.

<comment><USER11> _If you listen to them talk, there is some interesting stuff there, like formal logic, but the lion's share is just arguing about semantics and nuances of translation from the original German._

I think that describes what it is to work with a programming language compiler. And everyone knows that it is of utmost importance to get the semantics and small nuances just right. Compiler that can detect more of these ambiguities is often held as the better one.

Caring for these kind of ambiguities in our lives in general might not make one a better person. But it is _for_ something.

</comment></comment><comment><USER12> At the risk of coming off as a fanboy, I'll say that pg's essay on philosophy is my favorite of his writings:

<http://paulgraham.com/philosophy.html>

It matches my experience of getting a B.A. from a SLAC quite closely, and I regularly share it with non-techies.

<comment><AUTHOR> The essay is quintessential pg: some things that are not his specialty he gets wrong but clear and full of great insight. It should be required reading.

When pg talks about his naive decision in high school to major in philosophy he says: "I thought studying philosophy would be a shortcut straight to wisdom." I believe this is the central fallacy that people have about the discipline that turns them off quickly once they realize that it's not a royal path to wisdom but a broad and technical discussion on what qualities such a path would have.

</comment></comment><comment><USER13>
        > Rejecting foundationalism means accepting that we
        > have every right to hold basic beliefs that are not
        > legitimated by philosophical reflection.

No, that's an utter non-sequiter. It certainly does not follow on from a rejection of foundationalism that you can hold arbitrary basic beliefs.

For example, you may instead set a standard of evidence whereby you expect the set of your ideas to have an internal consistency, and where you consider the weight of new evidence against your existing map. Your tree could be influenced by philosophical reflection.

Of you might consider your belief to consist of parallel hypotheticals. I may be a brain in a vat, but I'm also open to being a geek tapping on a computer in a newtonianish universe.

</comment><comment><USER14> I respect philosophy, but am more persuaded by Richard Feynman's perspective, when asked what he considered a philosophical question.

<http://www.youtube.com/watch?v=X8aWBcPVPMo>

This NY Times story gets that philosophy isn't that necessary, but then got so bogged down in philosophical writing it was a chore to get through and I don't consider it worth my time to have read it.

Socrates said "The unexamined life is not worth living." I've examined my life a bunch and have benefited from the examination, but the people I know who seem to enjoy their lives the most haven't examined theirs at all.

I tend to examine mine less now and I think I'm living better. But maybe that's from figuring things out earlier.

<comment><USER15> "The unlived life is not worth examining."

</comment></comment><comment><USER16> Philosophy is for the people who are pre-determined to be interested in philosophy. People who are not pre-determined to be interested in philosophy will never be able to see value in the act of studying philosophy.

</comment><comment><USER17> There are 2 types of philosophy - the abstract stuff that deals with semantics and logic. And the more practical type that deals with emotional mastery (such as Zen, the non-religious aspects of Buddhism, and Stoicism).

This type of philosophy is supposed to relieve suffering. I hate to phrase it as a negative, but for most people, we turn to philosophy when our lives are in dire straits, not when we're doing well. In a sense, I guess it's more like spirituality.

</comment><comment><USER18> I was reading Benjamin Franklin's autobiography and he wrote about philosophy in a broader sense. The context I remember is that he was hoping that a philosopher would take on the challenge of figuring out how best to shape and rig a sailboat, because at the time it was all more of an art than a science.

Point being, up until the 19th century some or most people who would consider themselves philosophers tended to be more pragmatic/practical in their pursuits.

<comment><USER19> Science used to be called <http://en.wikipedia.org/wiki/Natural_philosophy>. Many of those people would not call themselves philosophers today, because the meaning has shifted.

</comment></comment><comment><USER20> Why Philosophy? free iOS app:

<http://itunes.apple.com/us/app/why-philosophy/id354900479>

And short pro-thinking/philosophy website presenting an argument/reasons:

<http://curi.us/think/>

</comment><comment><USER21> There are many philosophies, but only one can be right. Seems to me every self respecting adult should settle on what philosophy they think is right, and then live by it, and not waste time going back and fourth about abstract technicalities in other philosophies.

</comment><comment><USER22> Philosophy is rational thinking. Just like any rational thinking in any domain or discipline. Philosophy 'just' concentrates on the most basic concepts, the irreducible concepts.

</comment><comment><USER23> New York Times - What's the use?</comment>


Can We Trust Uber? - <AUTHOR> https://medium.com/@petersimsie/can-we-trust-uber-c0e793deda36 <comment><USER2> We can answer this question by simply looking at what Uber is without the smokescreen of "tech" and "disruption".

Uber is simply a very old and familiar way to circumvent labor, safety and consumer protection laws. It just happens to have two new elements enabled by tech: an app and dynamic pricing.

There is nothing "cool" or innovative about Uber. Many of the laws and regulations Uber runs afoul of aren't outdated, they exist _very specifically because of operations like Uber_ , which existed in the days before smartphones and the internet.

And Uber brings absolutely nothing new to the table that changes the rationale behind those regulations. What the fuck is innovative about facilitating unlicensed taxi drivers in private cars? Hell, in Dutch we even have a word, "snorders", for such people, a word that has been barely used in decades until Uber popped up and revived it.

Uber is basically the kind of "business" that you would expect from an organized crime outfit, and their _other_ dubious practices should come as no surprise.

<comment><USER3> First off, let me say that I want someone to please counter my argument. I have been unable to see a valid counterargument so far.

I've thought about this quite a bit, anytime I see someone use the phrase 'disrupt an established company,' I assume they're talking about barely skirting the law through the use of hazy, gray areas. And an app.

The only 'innovation' in (most of) these companies is the same 'innovation' that this site screams about when it's on the part of patent trolls; I will do X, but now I will do X with a smart phone or computer. That's not innovative, it's lazy.

It would be super easy for giant companies to meet the same prices if they were able to ignore laws. That's not competition, it's cheating.

<comment><USER4> The reason so much disruption comes from "barely skirting the law" is because government sets up the law/regulation to entrench these old business models. So much of what the US government does today is in service of big business, not necessarily adhering to whatever moral standard you have in mind for the rule of law.

Uber has to use the gray areas precisely because regulation was set up to prevent disruption of the cab industry. This regulation inhibits growth and promotes stagnation, evidenced by the fact that NYC cabs did not accept credit cards until 2007 and by how obviously under-served the SF cab market was.

Uber, by skirting the laws that were not serving the consumer but rather entrenching an industry has been able to do more in five years than the entire taxi industry has in 50.

<comment><USER3> I think you have the chicken and egg backwards. Issues with quality and service are what formed regulation in the first place. Regulation exists to fix a problem; look at the history of transportation, and the current state of 3rd world country transportation.

Cabs were dangerous and took advantage of people before regulation, much as 3rd world country cabs do today.

Your argument is not persuasive and is very short-sighted in terms of history.

And to take it one more step: Lead-uber, by skirting the laws that were not serving the consumer but rather entrenching an industry has been able to do more in five years than the entire lead mining industry has in 50.

Does that make you feel comfortable about 'disruption'? What makes mass transportation any different?

</comment></comment></comment></comment><comment><USER5> I wish the title of this post on Hacker News could be the context-providing "Uber allegedly revealed well-known rider's location without consent for promotional purposes".

<comment><USER6> The article is not just about the one thing you mentioned. The first example in the article of why we should question whether to trust Uber is the corporate attacks that Uber allegedly waged against Lyft.

<comment><USER7> The real story is that Uber leaked confidential information without consent. The discussion about Lyft is tangential.

<comment><USER8> Is it? It shows a pattern of sleaze that raises the question on if Uber can be trusted.

<comment><USER9> It seems like every time I see Uber in the news they're being assholes in one way or another to their customers, drivers, competitors, and governments of all types.

The ends don't justify the means.

</comment></comment></comment></comment></comment><comment><USER10> My fairly worthless opinions as an NYC Startup Programmer:

1) 'Disruption' is just a code-word for skimming margins in legal grey areas

2) The founder of Uber's twitter avatar used to be the cover of "Atlas Shrugged" (update: it's now a picture of Thomas Jefferson.)

3) Only tourists and transplants believe using an app is in any way better than simply hailing a cab (with exception for storms, bad times, and bad locations)

No idea why this company ever deserved my trust in the first place.

<comment><USER11> > 3) Only tourists and transplants believe using an app is in any way better > than simply hailing a cab (with exception for storms, bad times, and bad > locations)

You don't get taxis very often. From my experience in Chicago. They're everywhere you want them to be. There are huge dead zones for taxis. (Webster/Clybourn, Grand/New Orleans, Western/Armitage anytime before 6pm, Humboldt park, 5am in Old Town [4am bars have a 5am cut off in Chicago on Saturdays]). They tend to be either: a. on the phone the whole freaking time speaking Hindi or b. blasting music.

They also tend to pull shit like: "Oh my CC machine is broken, please give me cash" (which is against the ordinance), they'll try to use their square payment reader instead (which is also a big no-no), etc.

Uber cuts that out. With Uber, despite my bad experiences, they're consistently better.

<comment><USER12> _You don 't get taxis very often. From my experience in Chicago._

I'm pretty sure the OP was only referring to NYC.

And even then, only Manhattan. Uber and the like have made it a lot easier to book private cars, though it's difficult to know what the green "Boro" taxis would look like if the apps hadn't launched.

</comment></comment></comment><comment><USER13> The question is even bigger: should we trust startups that claim "no evil" when they are small, and quickly forget it when they grow? Here is another example: [http://blog.garrytan.com/infanticide-how-anti-competitive- la...](http://blog.garrytan.com/infanticide-how-anti-competitive-lawsuits-by)

<comment><USER14> Short answer: No.

If faced with a choice between money and doing the right thing, corporations are legally obligated (c.f. Dodge v. Ford) to pick money every single time.

<comment><USER15> Only a publicly traded company would be subject to Dodge v. Ford.

Even then, making money and doing the right thing are rarely a strict dichotomy.

Trying to sue start ups out of existence is not the only way to ensure the profitability of an incumbent company. Lawsuits always have the risk of losing and flushing all of those legal costs down the toilet, or potentially inviting countersuits. A company like Fab for instance could've just as easily decided to buy the new competitor or get more aggressive on price or marketing to snuff them out.

<comment><USER14>
       Only a publicly traded company would be subject to Dodge v. Ford.

...or startups that have publicly traded corporations as investors (which is approximately all of them).

Don't delude yourself into thinking you can trust a corporation. Corporations are sociopathic by design, barely kept in check by threats of lawsuits and bad PR.

<comment><USER16> > ...or startups that have publicly traded corporations as investors (which is > approximately all of them).

What definition of startups are you using here?

<comment><USER14> Okay, "all of them" might be an exaggeration, but it's certainly true of Uber in particular.

<comment><USER16> Startups with billion dollar valuations are rare and the exception, not the rule.

</comment></comment></comment></comment></comment></comment></comment><comment><USER17> Of course you can't. That's crystal-clear by now. They've been called out more times than I can count in the last 6 months.

"Does it matter?" That's the question that puzzles me, because seems that Uber got the pockets and backers to continue it's aggressive progression towards cabs annihilation.

</comment><comment><USER18> Uber cars aren't gypsy or livery cabs because the difference is that gypsy and livery cabs often try to shake down the passenger for more money than what was previously quoted or agreed on.

I had the exact experience that monksy outlined and it happened with Yellow Cab (largest taxi provider in So Cal afaik) and I discovered the next day that my card was used to ring up almost $1000 in gas and purchases almost 80 miles from my house in a city I've never been to in my entire life. This obviously doesn't mean that all taxi drivers are unscrupulous like this but you can't help but appreciate that Uber and Lyft provide something not so trivial as a way to pay without having to factor in an unethical driver.

Can we trust Uber? Not entirely. Shouldn't the question be, can we trust Uber (and by proxy , Lyft) more than the alternatives?

<comment><USER19> > Can we trust Uber? Not entirely. Shouldn't the question be, can we trust > Uber (and by proxy , Lyft) more than the alternatives?

But at that point you still must answer the question: Do you trust Lyft or other alternatives more than Uber? Given the evidence we have, I don't trust Uber to tell me the sky is blue; I'm damn sure not doing business with them.

</comment></comment><comment><USER20> When I moved to the Bay Area, I was amazed at how bad cabbies were. They were expensive, took a long time to show up, often flaked out on even showing up and often refused to take me where I wanted to go.

Über was a breath of fresh air. I rationalized their competitive gaffs with Lyft as "they're just competing" and their syncretic religion of Ayn Rand books and Clayton Christensen as objectionable but tolerable. But I don't use them anymore. I started to use Uber constantly, refer friends and some OSS I've written even powers Uber's node.js components today.

But their support of Urban Shield is the straw that broke the camel's back. And I do not want to line the pockets of anyone accelerating the militarization of the police in the US. Like the author, I can't see myself trusting them to do what's right.

</comment><comment><USER21> You can probably trust Uber just about as much as you can trust the TLC. The only real difference is that Uber has a bit more real--time data they can mine. Even if you only pay for your cabs in cash, your privacy can be compromised by pick up/drop off point meta data ([http://research.neustar.biz/2014/09/15/riding-with-the- stars...](http://research.neustar.biz/2014/09/15/riding-with-the-stars- passenger-privacy-in-the-nyc-taxicab-dataset/)).

Then what about all the other plethora of apps and OS features that do background location tracking. Can we trust them?

I think this problem really goes beyond Uber and touches on something fundamental about how we can maintain privacy when everyday technology asks for so much more personal information to operate.....

Maybe we need more robust data privacy laws. Maybe we need better technology that allows for identity obfuscation or anonymity. Maybe we need to mature as a society so transparency is less likely to lead to harassment, violence or discrimination. Maybe it is a combination of all of the above.

I just don't think you should leave it up to Uber.

<comment><USER22> Except that the the yellow cab leaks are unintentional and based on ignorance, and these are (allegedly) based on intentional disregard for privacy. So I don't agree that the two are the same at all.

</comment></comment><comment><USER23> These are shocking and worrisome allegations, but I do want to hear Uber's response. Perhaps they asked certain well-known users if they wanted their locations to be revealed and there was a miscommunication? It seems unlikely, I admit, but there tend to be two sides to every story.

If the allegations are true and there was no miscommunication, Uber violated its privacy policy and should be held accountable. Note I'm not calling for FTC action, but (again, if this is true) Uber's management owes me and other users an explanation, an apology, and a plan for privacy controls to ensure this doesn't happen again. Firing the person responsible would not be inappropriate. You can read the privacy policy yourself here: [https://www.uber.com/legal/usa/privacy#3](https://www.uber.com/legal/usa/privacy#3)

It's also a little depressing. I've taken pains to try to get privacy "right" when working on [http://recent.io/](http://recent.io/), including being extremely sensitive about location privacy, and examples like this (again, if true) will make folks less likely to trust apps in general. It's a shame because phone owners will assume that if you can't trust the billion-dollar lawyered-up companies to get privacy right, you surely can't trust the smaller ones. So it becomes safer not to install the apps in the first place. :(

</comment><comment><USER24> THIS IS ANECDOTAL EVIDENCE, and MAY BE COINCEDENTAL: I was having serious problems using Uber because both forms of payment I was using were failing processing. They were both credit cards I had used earlier in the night, and were both certainly valid. I became frustrated, and as Uber has no customer support I had to sort out contingency. I downloaded lyft and then Uber started to work. It processed both cards and let me request a a car (if it does not process it saves the info but does not let you request). So instantly, without me doing anything, I was immeadiately able to use Uber after I downloaded lyft, without doing anything extra. So I now exclusively use Lyft. It has been cheaper for all comparable distances I can track.

</comment><comment><USER25> I suspect this is a bogus article designed to stir up the name Uber and draw some attention to them.

Stealth marketing, or "murketing" as Rob Walker calls it in his book Buying In.

Seriously. The more I think about it, the more I'm convinced this article is a sneaky Uber marketing ploy. Don't trust it. I call fake.

</comment><comment><USER26> in uber we trust.??

</comment><comment><USER27> However, for the _vast_ majority of users, who cares? The service is useful at a usually-fair price. If it works, use it.

<comment><USER6> _The service is useful at a usually-fair price. If it works, use it._

Hopefully we can agree that Uber doing things like corporate attacks against Lyft might say something about their character that should give you pause on dealing with them. For example, someone willing to unfairly attack a competitor might also think nothing of disclosing a customer's location in real time without permission for promotional purposes. Oh, they reportedly did that too. With a pattern of poor judgment, it only makes sense to question whether you should use them even if it generally just works.

<comment><USER19> For me at least, it's not even the questionable morality of pulling dirty tricks on your biggest competitor. It's the fact that Uber feels they have to do these dirty deeds to get ahead in the game. If you feel you can't compete on a level playing field and you have to do such things to keep up, it tells me that you don't have a clue how to really do business in the first place.

If I can't trust Uber to build a better product instead of sabotaging their competitor, I'll go with their competitor by default.

<comment><USER28> Why do you think they're doing it because they 'have to' instead of doing it because they 'can'.

<comment><USER19> It could be either, or both. Regardless, it's dirty and makes me feel that they'd probably treat their customers with the same disdain.</comment></comment></comment></comment></comment>


We're reorganizing how Twitter is going to work together for the next decade - <AUTHOR> https://twitter.com/jack/status/1012381283396157440 <comment><USER2> Somebody needs to lock @jack in a room and make him watch this video on "repeat" for 400 hours.

[https://youtu.be/Vhh_GeBPOhs](https://youtu.be/Vhh_GeBPOhs)</comment>


Ask HN: What are some services that lets you sell digital goods online easily? - <AUTHOR>

I am looking for some services that lets one sell digital goods(templates/ebooks) online easily & quickly without the need to setup a website. It should have option to send earnings through paypal or any other payment method through which I can get money in an Indian bank. <comment><USER2> Bitbuffet, Cerizmo, dbox, DPD, Pulley, Fetchapp, Plimus, ejunkie, payloadz, Sellfy to name a few.

There must be hundreds.

</comment><comment><USER3> Gumroad? (though I'm not sure about Indian bank...)

</comment><comment><USER4> Clickbank possibly

</comment><comment><USER5> Instamojo</comment>


The Great Statistical Schism - <AUTHOR> http://quillette.com/2015/11/13/the-great-statistical-schism/ <comment><USER2> What's amusing is that Bayesian reasoning is what human beings do all the time. Most of the -isms that people can do (racism, sexism, ageism, etc) have to do with taking the prior (what already I know about other similar people) and applying that knowledge to the new person. It's "too hard to understand" and yet all kinds of people are doing it every day.

<comment><USER3> Frequentist: Here's a couple formulas that kind of make sense. Plug in your data and go.

Bayesian: Here's Bayes' theorem, a single formula that makes perfect sense! See, it's simpler, right? What, you want to use it? Something something beta distribution something something Markov chain Monte Carlo something something - okay, got it?

Good luck teaching that to undergrads. In the real world, intro stats classes are taken mostly by people with little math background, no programming background, little interest in statistics, and little innate talent for any of those things. With the frequentist approach, at least they have a fucking chance.

<comment><USER4> I agree that frequentist methods are more amenable to teaching students to apply rote formulas that they do not understand.

I do not agree that this is a feature. Quite the contrary.

<comment><USER3> Whether it's a feature or not is subjective. And I think I mostly agree with you - it's probably bad that we're encouraging the application of bad statistics.

But the alternative isn't just replacing bad with good, it'd be more like telling ~98% of the science majors in the country, "hey, you're too dumb to do real statistics, so please just stop trying". I can't see that realistically happening.

</comment></comment></comment></comment><comment><USER5> [http://jakevdp.github.io/blog/2014/03/11/frequentism-and- bay...](http://jakevdp.github.io/blog/2014/03/11/frequentism-and-bayesianism- a-practical-intro/)

I recommend this series of posts on frequentism and bayesianism. Of particular interest is part 3, which has a very good explanation of why frequetism shouldn't be used in science.

        Let me say it directly: you should be suspicious of the use of frequentist
        confidence intervals and p-values in science. In a scientific setting,
        confidence intervals, and closely-related p-values, provide the correct
        answer to the wrong question.

<comment><USER6> Also read chapter 37 "Bayesian Inference and Sampling Theory" of [http://www.inference.phy.cam.ac.uk/itila/book.html](http://www.inference.phy.cam.ac.uk/itila/book.html)

</comment></comment><comment><USER7> I think the author is treating the frequentists somewhat unfairly. A good design involves both NHST and equivalence tests + discussion about power/effect size (imo).

Random grab from my methods collection in my literature tool: "A Comparison Of Equivalence Testing In Combination With Hypothesis Testing And Effect Sizes": [http://digitalcommons.wayne.edu/jmasm/vol2/iss2/6/](http://digitalcommons.wayne.edu/jmasm/vol2/iss2/6/)

I think the biggest problem is that many fields just churn out people who can click buttons in SPSS but couldn't really tell you what a p-value actually represents. "Unfortunately" it's fairly easy to do the testing with tools. From students, I often get the feeling that tests are conducted for the sake of conduction a test (talking about BA theses etc.).

I'm not sure how wide spread Bayesian thinking is in other fields. Coming from CS it is somewhat natural since it's pretty pervasive in AI/ML. I think our econ students didn't get exposed to it at all (iirc). Would love some feedback from other fields :)

</comment><comment><USER8> There's a good book on the subject, "The theory that would not die", which covers the history and sheds some light on the people (Fisher, Laplace, Bayes, Pearson) behind the names.

Reviewed: [http://www.ams.org/notices/201205/rtx120500657p.pdf](http://www.ams.org/notices/201205/rtx120500657p.pdf)

</comment><comment><USER9> I really never understood the divide. They are all just tools in our toolbox. It feels like arguing screwdrivers versus hammers. They may not do the same thing, but both can be useful!

<comment><USER10> The author specifically argues against this view as something that obscures the superiority, in most cases, of the Bayesian approach:

 _One downside of this ecumenicalism is a reluctance to ask fundamental questions: having a strong opinion on this matter has gone out of fashion. Who's to say one statistical philosophy is better than another? Aren't all statistical philosophies equally valid paths to good data analysis? Frequentism is "true for me". As in religion, so in statistics. If you criticise a colleague for using p-values when posterior probabilities are clearly more appropriate, it will lead to accusations of being a 'zealot' [2] who should stop 'crusading'_

and then later:

 _If Einstein's theory were easier (as well as being more accurate), teaching Newton's would be silly. Yet that's the way most statistics curricula are structured. The only reason statisticians think frequentist ideas are easier is that they are used to them_

<comment><USER9> I guess I hate the idea of a "statistical philosophy." It's math for god's sake. Given these axioms, these other things are true.

The point about teaching relativistic versus newtonian mechanics is totally different because they're incompatible. One is more correct than the other, which is not the case here. In the stats case, both tools give correct answers to different questions.

Maybe I just get frustrated feeling like people want a data analysis silver bullet to teach.

<comment><USER11> I'd say the analogy is more valid than you think. Classical (frequentist) methods are valid as long as the results correspond to the relativistic (Bayesian) ones.

<comment><USER12> As far as I know, Bayes came first and Fisher later, so some may say the analogy is the other way round.

<comment><USER6> That's true, but Bayesian methods were handicapped by a lack of computational resources for quite a long time. Modern Bayesian methods, although fundamentally the same, are in practice quite different today compared to a century ago. Frequentist statistics gained popularity because it was more tractable to apply to complex problems until computational technology caught up.

Edit: one can argue that frequentist methods are generally approximations to Bayesian methods, much like Newton vs Einstein

</comment></comment></comment></comment></comment></comment><comment><USER13> I think these kinds of articles generally overstate the "schism." I wrote about this here: [http://blog.keithw.org/2013/02/q-what-is-difference- between-...](http://blog.keithw.org/2013/02/q-what-is-difference-between- bayesian.html) and here: [http://qr.ae/70H3k7](http://qr.ae/70H3k7)

Three points:

(1) I couldn't follow the author's Bayesian analysis or what "standard assumptions" were used. Does anybody know what is meant?

Here's a plausible Bayesian analysis using what are arguably standard assumptions: "assume, a priori, that the success rate of the new drug was drawn uniformly between 0 and 1. Given the outcome of 83/100 i.i.d. successes, the probability that the new drug has a success rate worse than the old drug is Integrate[PDF[BetaDistribution[84,18],x],{x,0,0.7}]. In other words, p(worse|outcome,uniform prior) = 0.0018."

Here's a plausible classical analysis: "Before doing the experiment, let's specify how to calculate the p-value at the end. For whatever outcome we get, we'll calculate the one-sided probability that the old drug produces an outcome that good or better. Now perform the experiment: our outcome is 83/100\. Per the method that we pre-specified, the probability that the old drug would have produced an outcome that good or better is Sum[Binomial[100,i] (0.7)^i (1-0.7)^(100-i), {i, 83, 100}]. In other words, p<0.0022."

Here's a plausible takeaway: "What do you know, the p-value from the classical analysis and the posterior probability from the Bayesian analysis are almost the same. There isn't much difference in this case, and contrary to a point emphasized in the article, the posterior probability was actually slightly smaller. The claim that p-values overstate the certainty of findings compared with Bayesian methods is not supported and probably not true -- often the accusation is the reverse, that p-values are too conservative!"

(2) The Bayesian analysis and the classical one are trying to achieve different things. Speaking very generally, classical methods are about designing an _experiment_ that has a cap on the rate of false positives, even in the worst-case input (and then running that experiment). Depending on who you are, this may or may not be what you really want to do. Bayesian methods are (again very generally) about calculating the conditional probability of some event, given a particular observation and well-stated prior assumptions. Again, this may or may not be what you really want to do.

The difference is sort of like the difference between saying that the running time of QuickSort is O(n^2) on adversarial input, compared with saying that the running time is O(n lg n) in expectation, assuming the input order is uniformly distributed. Both of these statements can be useful.

You don't have to pick a side and declare yourself a worstcaster or an expecterian, any more than you have to call yourself a Bayesian or a Frequentist. These are families of mathematically-sound techniques, not religions.

(3) Ultimately, statistics doesn't _really_ matter until somebody starts making a decision based on the results. And once you start putting a cost on bad decisions and designing a decision rule to maximize utility (the domain of decision theory), methods based on p-values and posterior probabilities end up reaching THE SAME DECISIONS. This makes sense since there can really only be one utility-maximizing decision theory.

This was understood in the early 1940s when they had to decide how to balance the cost of mistakenly shooting down an Allied aircraft versus the cost of mistakenly letting a Nazi aircraft off the hook. It was understood in the late 1940s when Shannon and others worked out the mathematical theory of communication. These fields do not have squabbles about a Bayesian vs. frequentist schism.

</comment><comment><USER14> >"For example, consider the 'null' hypothesis that the new drug has exactly the same effectiveness as the old drug."

I'd encourage people to ask: Why should I consider that null hypothesis when it sounds like a strawman? Wasn't the use of strawman arguments debunked over 1000 years ago?

<comment><USER15> A strawman argument is a distorted version of someone else's position, formulated to be easy to knock down for the purpose of appearing to win debates. A null hypothesis is just a starting point for reasoning.

<comment> loup-vaillant Interesting: how do you _chose_ that starting point in the first place?

Sounds like the null hypothesis is just as arbitrary than any Bayesian "prior" (prior probability distribution, I mean).

<comment><USER16> The null hypothesis is the hypothesis that your control and experimental groups behave roughly the same* . This is the baseline assumption when group membership is randomly assigned. It is not at all arbitrary.

* see my below comment for elaboration on what "same" means

<comment> loup-vaillant Okay, but, it's like _expecting_ the two groups to be the same, which is a bit ridiculous. I'd rather just measure how much evidence the experiment provides either way.

<comment><USER14> Exactly, we do not care they are different (usually). We care in what way and how much they are different. Then we care about what possible explanations there may be for that difference.

I would say an exception is studies of ESP, etc where the existence of any effect would be surprising. However, in practice, everyone just assumes paranormal researchers messed up the experiment somehow. Small effects are not taken seriously even if they are "significant" because there are many explanations for such differences.

<comment> loup-vaillant > _I would say an exception is studies of ESP_

Actually, E.T. Jaynes touched that topic a bit, and argued that it's not really an exception: probability theory applies to this phenomenons (or lack thereof) as usual. If I recall correctly, he reached the same conclusion as you just did: if a study looks like it demonstrated an instance of ESP, it probably went wrong.</comment></comment></comment></comment></comment></comment></comment>


A chart showing a fascinating historical perspective of the current housing crisis.  - <AUTHOR> http://3.bp.blogspot.com/_wFWqWIH-WFU/SPnTDZ-G-pI/AAAAAAAAGLw/EmInfXSfe00/s1600-h/housing_projection.jpg

<comment><USER2> Buh, there is an extra tick mark between 2000 and 2010.

</comment><comment><USER3> The natural trend for housing prices should be down, as technology makes equivalent houses cheaper to buy, and better transportation infrastructure (in theory) increases the supply of viable housing.

<comment><USER4> Not disagreeing with you on the general idea but there are other factors pushing up. Mostly to do with rising population. 'Existing' houses stand in places that will over time become more central, more developed & therefore more scarce.

<comment><USER5> These are both good points. I was wondering why the supposed trend was so flat. The answer is that there are so many other random factors pushing in both directions that there probably is no real trend.

It would probably be more reliable to predict the bottom by looking at the ratio of house prices to income. _That_ shouldn't change too fast.

<comment><USER4> An interesting bit is that you'd need to use different samples to infer about the 'cost of housing' then what you would need to infer about the 'value of property.'

Most places, the cheaper houses are new developments on the city's fringe. Since a lot of people live there, you need to take them into account when looking at 'housing costs.' But you don't take into account new developments when looking at real estate as an asset. You're not buying 'housing' your buying 'houses.'

Existing properties can increase while cheap new houses keep averages down.</comment></comment></comment></comment>


Does ad-blocking mean that in the future what we read will be the ad? - <AUTHOR> https://dhariri.com/posts/570a9ec3d1befa66e6b8e1d0 <comment><USER2> > I think I'll still read the New York Times, but as entertainment; not as > news.

I read all news as entertainment; the global pratfall.

EDIT: like this: "How a federal spy case turned into a child pornography prosecution" [https://www.washingtonpost.com/world/national- security/how-n...](https://www.washingtonpost.com/world/national-security/how- national-security-powers-are-underpinning-some-ordinary-criminal- cases/2016/04/05/1a7685f4-fa36-11e5-80e4-c381214de1a3_story.html)

> During his initial appearance in a federal courthouse in Santa Ana, Calif., > the prosecutors indicated a willingness to reduce or drop the child > pornography charges if he would tell them about the C-17, said Sara Naheedy, > Gartenlaub's attorney at the time.

</comment><comment><USER3> That is a distinct possibility (but not that different to the current situation). On the other hand you could be reading something that someone wanted published without any thought of anything in return.</comment>


I've been writing ring buffers wrong all these years - <AUTHOR> https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/ <comment><USER2> _This is of course not a new invention. The earliest instance I could find with a bit of searching was from 2004, with Andrew Morton mentioning in it a code review so casually that it seems to have been a well established trick. But the vast majority of implementations I looked at do not do this._

I was doing this in 1992 so it's at least 12 years older than the 2004 implementation. I suspect it was being done long before that. Back then the read and write indexes were being updated by separate processors (even more fun, processors with different endianness) with no locking. The only assumption being made was that updates to the read/write pointers were atomic (in this case 'atomic' meant that the two bytes that made up a word, counters were 16 bits, were written in atomically). Comically, on one piece of hardware this was _not_ the case and I spent many hours inside the old Apollo works outside Boston with an ICE and a bunch of logic analyzers figuring out what the hell was happening on some weird EISA bus add on to some HP workstation.

It's unclear to me why the focus on a 2^n sized buffer just so you can use & for the mask.

Edit: having had this discussion I've realized that Juho's implementation is different from the 1992 implementation I was using because he doesn't ever reset the read/write indexes. Oops.

<comment><USER3> > It's unclear to me why the focus on a 2^n sized buffer just so you can use & > for the mask.

The cost of a mask can probably be entirely buried in the instruction pipeline, so that it's hardly any more expensive than whatever it costs just to move from one register to another.

Modulo requires division. Division requires a hardware algorithm that iterates, consuming multiple cycles (pipeline stall).

<comment><USER4> You do not need modulo or division to implement non-power-of-2 ring buffers. Because you will only increment by one. So instead of "x = x % BufferSize" you can do "if (x >= BufferSize) x -= BufferSize;" or similar.

That's for "normal" ring buffers. I suspect that the design described in the article can be implemented for non power-of-two without division but I'll need to think about the details.

<comment><USER5> Then you have to deal with branch mispredictions which may hurt performance pretty bad if the RB is heavily trafficked (which often is the use case for an RB).

<comment><USER6> Actually it might not really be mispredicted. Slightly older Intel CPUs had a dedicated loop predictor that would exactly predict quite complicated taken/non-taken sequences. If the RB is of fixed size the edge case would be always perfectly predicted.

More recent CPUs, IIRC, do away with the dedicated loop predictor as they have a much more sophisticated general predictor, which, although won't guarantee perfect prediction on this case, it might still get close enough.

</comment></comment></comment></comment></comment><comment><USER7> > Join me next week for the exciting sequel to this post, "I've been tying my > shoelaces wrong all these years".

Probably. Use the Ian Knot: [http://www.fieggen.com/shoelace/ianknot.htm](http://www.fieggen.com/shoelace/ianknot.htm)

Seriously, spend 20 mins practising this, and you'll never go back to the clumsy old way again.

<comment><USER8> The Ian Knot is quick, but as someone who never ties their shoes and just slips them on and off, I much prefer Ian's Secure Knot: [http://www.fieggen.com/shoelace/secureknot.htm](http://www.fieggen.com/shoelace/secureknot.htm)

I usually tie this knot twice over the lifetime of a pair of shoes. Once when I get them, and once more when they're worn in and need to be tightened.

<comment><USER9> I don't get it - both of these knots seem to be identical to the standard shoelace knot, just illustrated differently.

<comment><USER10> From the site:

"The finished "Ian Knot" is identical to either the Standard Shoelace Knot or the Two Loop Shoelace Knot. Because it was tied much more quickly and symmetrically, the laces suffer less wear and tear and thus last longer."

<comment><USER9> Do people's laces wear out? That's not a problem I've ever experienced.

<comment><USER11> I've had a shoelaces break maybe 3-4 times on shoes I wore regularly for more than 2-3 years. It's annoying out of all proportion to the expense involved.

(The plastic bits at the end can also get frayed and fall off, which happens more quickly, but I'm not sure knot style has much to do with that.)

<comment><USER12> I think it's so annoying because of the timing. I've never had one break when untying the knot or when just walking around. It's always while tying it which means I was just about to leave and now life has thrown a monkey wrench into my plans. Depending on how close I am cutting things, this may be an event that makes me late. Grrrrrr. Stupid shoelace!

<comment><USER13> Yes, this! And this happens particularly often, when you use standard cotton laces which make knots harder to accidentally undo. The synthetic ones last much longer, but are slippery and easy to untie.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER14> I love the way this discussion has divided neatly into thirds: history of ringbuffers; digression on shoelaces; fragmentary, widely ignored, replies about everything else (this one included, I'm sure).

I like this kind of article and enjoyed this particular one, but the long discussion above about the "right" way to do it goes some way to justifying why so many people are happy to do it the "wrong" way.

I've implemented and used ring buffers the "wrong" way many times (with the modulus operator as well!) and the limitations of this method have never been a problem or bottleneck for me, while its simplicity means that it's easier to write and understand than almost any other data structure.

In most practical applications, it's memory barriers that you really have to worry about.

</comment><comment><USER15> This is another interesting ring buffer implementation that uses mmap. [https://github.com/willemt/cbuffer](https://github.com/willemt/cbuffer)

<comment><USER16> Here's another implementation that works on Windows too: [https://github.com/andrewrk/libsoundio/blob/master/src/ring_...](https://github.com/andrewrk/libsoundio/blob/master/src/ring_buffer.c)

<comment><USER17> This seems to use modulus. The whole point of the mmap trick is to get the kernel/MMU to do the work for you, IIRC.

EDIT: Oops, I see they use mirrored memory here as well.

</comment></comment></comment><comment><USER18> The Linux kernel seems to leave one element free, which surprised me, but it does have this interesting note about it:

[https://www.kernel.org/doc/Documentation/circular- buffers.tx...](https://www.kernel.org/doc/Documentation/circular-buffers.txt)

      Note that wake_up() does not guarantee any sort of barrier unless something
      is actually awakened.  We therefore cannot rely on it for ordering.  However,
      there is always one element of the array left empty.  Therefore, the
      producer must produce two elements before it could possibly corrupt the
      element currently being read by the consumer.  Therefore, the unlock-lock
      pair between consecutive invocations of the consumer provides the necessary
      ordering between the read of the index indicating that the consumer has
      vacated a given element and the write by the producer to that same element.

</comment><comment><USER19> I have always considered these "double ring" buffers. Along the same lines as how you figure out which race car is in the race is in lead by their position _and_ lap count. You run your indexes in the range 0 .. (2 * SIZE) and then empty is

        EMPTY -> (read == write)
        FULL -> (read == (write + SIZE) % (2 * SIZE))

Basically you're full if you're at the same relative index and your on different laps, you are empty if you at the same relative index on the same lap. If you do this with power of 2 size then the 'lap' is just the bit 2 << SIZE.

<comment><USER20> No, I think the author is using the full range of a 32 bit int. So read could be any 32 bit integer, even if the size of the ring is 1.

(The trick is that SIZE has to be a power of two, or else when you increment from 2^32-1 to 0, your pointers will jump to a different position in the array.)

</comment></comment><comment><USER21> _Why do people use the version that 's inferior and more complicated?_

Because it's easier to understand at first glance, has no performance penalty, and for most busy programmers that often wins.

<comment><USER22> The first version always leaves a "clean" state, that is both indices points to actual array locations. A mentally "clean" state makes understanding easier. For the third version one has to keep in mind the wrap around behavior of computer specific integers throughout the comprehension process, so it is a bit more difficult (to understand).

<comment><USER23> The third version also allows for the write index to be a counter of total store operations, at least until overflow, which could be useful.

</comment></comment></comment><comment><USER24> A very related post by ryg: [https://fgiesen.wordpress.com/2010/12/14/ring- buffers-and-qu...](https://fgiesen.wordpress.com/2010/12/14/ring-buffers-and- queues/)

<comment><USER25> Another one by ryg: [https://fgiesen.wordpress.com/2012/07/21/the-magic-ring- buff...](https://fgiesen.wordpress.com/2012/07/21/the-magic-ring-buffer/)

</comment></comment><comment><USER26> Usually when I'm writing a ring buffer, it's for tasks where the loss of an item is acceptable (even desirable - a destructive ring buffer for debugging messages is a fantastic tool). As such, I simply push the read indicator when I get to the r=1, w=1 case.

Using the mask method is slick (I'd cache that mask with the array to reduce runtime calculations), but it's definitely going to add cognitive overhead and get messy if you want to make it lockless with CAS semantics.

<comment><USER27> In general, this makes sense; certainly data you're putting into a ring buffer is data you're willing to lose.

Doesn't it break the order invariant of the buffer, though? I can't see a way to do this without the risk of getting reads of newer data prior to older data. That's probably fine in many cases, but something like non-timestamped- debugging strikes me as a case where I'd want to know that the data arrived in the order I'm seeing.

<comment><USER26> > Doesn't it break the order invariant of the buffer, though

No, if you increment the read pointer prior to the write pointer, the read pointer will still point at the oldest _valid_ value in the buffer.

So, in pseudo code:

        if (w+1 >= r) {
           r = w + 2
        }
        w++
        b[w-1] = value

For a debugging ring buffer (i.e. looking at it in a core file), you have the last value of the write pointer, so you can simply read from write pointer + 1 back around to the write pointer and have your messages in order. This makes the assumption that there is no readers of the debug buffer, so you're only having to deal with the one pointer.

</comment></comment></comment><comment><USER28> From what I understand, this is the way you'd do it with hardware registers (maintain the read and write indices each with one extra MSB to detect the difference between full/empty).

We've been using similar code in PortAudio since the late 90s[0]. I'm pretty sure Phil Burk got the idea from his hardware work.

[0] [https://app.assembla.com/spaces/portaudio/git/source/master/...](https://app.assembla.com/spaces/portaudio/git/source/master/src/common/pa_ringbuffer.c)

</comment><comment><USER29> > This is of course not a new invention

No, this is a well known construct in digital design. Basically, for a 2^N deep queue you only need two N+1 bit variables:

[http://www.sunburst- design.com/papers/CummingsSNUG2002SJ_FIF...](http://www.sunburst- design.com/papers/CummingsSNUG2002SJ_FIFO1.pdf)

</comment><comment><USER30> PicoLisp: last function here as circular buffer task [https://bitbucket.org/mihailp/tankfeeder/src/3258edaded514ef...](https://bitbucket.org/mihailp/tankfeeder/src/3258edaded514ef010a1526d5a298eeaebed215d/exercism- io/a-f.l?at=default&fileviewer=file-view-default)

build in dynamic fifo function [http://software- lab.de/doc/refF.html#fifo](http://software-lab.de/doc/refF.html#fifo)

</comment><comment><USER3> > _don 't squash the indices into the correct range when they are incremented, > but when they are used to index into the array._

Great! Just don't use it if the indices are N bits wide and the array has 2 __N elements. :)

Not unheard of. E.g. tiny embedded system. 8 bit variables, 256 element buffer.

</comment><comment><USER31> I had to pause for a second to convince myself that the version relying on integer wrap-around is actually correct.

I guess that's the reason most people don't do it: they'd rather waste O(1) space than waste mental effort on trying to save it.

</comment><comment><USER22> He keeps stating the case of one-element ring buffer. Is that a real concern ever?

<comment><USER32> It seemed like a sarcastic comment to me. Why would that ever be used?

<comment><USER33> It's indeed a ridiculous data structure, but I did actually need it.

It's a dynamically sized ring buffer with an optimization analogous to that of C++ strings; if the required capacity is small enough, the buffer is stored inline in the object rather than in a separate heap-allocated object. So something in the spirit of (but not exactly like):

      struct rb {
          union {
              Value* array;
              // Set N such that this array uses the same amount of space as the pointer.
              Value inline_array[N];
           };
          uint16_t read;
          uint16_t write;
          uint16_t capacity;
      }

You'd dynamically switch between the two internal representations, and choose whether to read from array or inline_array based on whether capacity is larger than N. In this setup it'd be pretty common for N to be 1. Having to add a special case to every single method would kind of suck, generic code that could handle any size seemed like a nice property to have.

</comment></comment></comment><comment><USER34> I find the headline very interesting. It's very inviting because of the way it expresses a sort of epiphany about doing it wrong on a mundane programming task. One is tempted to read it in order to see if there is some great insight to this problem. just maybe it's applicable outside this one problem. It begs the question: if he's been doing it wrong on a fairly mundane thing, maybe I am too. I need to see what this is about.

<comment><USER35> I believe it's very common to find little variations on algorithms or coding style like this that could produce a nice gain in efficiency or elegance. They aren't really the same problem as whole-system engineering, though, since most of your bottlenecks come from the algorithm that is completely unsuitable, not the one that is a little bit suboptimal.

</comment></comment><comment><USER36> Hmm..., interesting.

I've always been doing it the "wrong" way, mostly on embedded systems. My classic application is a ring buffer for the received characters over a serial port. What's nice is that this sort of data structure doesn't need a mutex or such to protect access. Only the ISR changes the head, and only the main routine changes the tail.

</comment><comment><USER37> Just in case, StackOverflow has some variations for JavaScript, although not that much optimized ;)

[http://stackoverflow.com/questions/1583123/circular- buffer-i...](http://stackoverflow.com/questions/1583123/circular-buffer-in- javascript)

</comment><comment><USER26> My C is rusty, but won't this act... oddly... on integer overflow?

        size()     { return write - read; }

0 - UINT_MAX -1 = ?

[EDIT] Changed constant to reflect use of unsigned integers, which I forgot to specify initially.

<comment><USER38> Actually, this method counts on it.

What I find interesting are the trade-offs: machine vs explicit integer wrap- around and buffers with maximum ~size(int)/2 vs ~size(int).

<comment><USER26> Got it. Modular arithmetic was the term I was looking for to resolve this.

        (0 - (2^32 - 1)) % 2^32 = 1

</comment></comment></comment><comment><USER39> Dumb question: why use power of two sized rings? If I know the reader won't be more than 100 behind the writer, isn't it better to waste one element of a 101 sized rings instead of 28 of a 128 sized ring?

</comment><comment><USER40> i love that he has 20 different shoelace knots! life was too simple before now.

</comment><comment><USER41> His favored solution introduces subtlety and complexity. Remember that 20-year old binary search bug in the JDK a few years ago? That is the sort of bug that could be lurking in this solution.

I understand not wanting to waste one slot. A third variable (first, last, count) isn't too bad. But if you really hate that third variable, why not just use first and count variables? You can then compute last from first and count, and the two boundary cases show up as count = 0 and count = capacity.

<comment><USER42> > Why not just use first and count variables?

I think he addressed that in the post:

 _The most common use for ring buffers is for it to be the intermediary between a concurrent reader and writer (be it two threads, to processes sharing memory, or a software process communicating with hardware). And for that, the index + size representation is kind of miserable. Both the reader and the writer will be writing to the length field, which is bad for caching. The read index and the length will also need to always be read and updated atomically, which would be awkward._

</comment></comment><comment><USER43> If you use modulus instead of bitmasking, it doesn't have to be power-of-2 size, does it?

<comment><USER44> No, the size of the array doesn't need to be a power-of-2 if you use modulus to derive indices. But you need to deal with the overflow somehow. For instance:

0xffffffff % 7 = 3, but (0xffffffff + 1) % 7 = 0.

<comment><USER45> Also as mentioned elsewhere in the comments, modulo is expensive, even more for non-powers of 2

<comment><USER46> Modulus by a power of two is cheap. Modulus by a constant is a multiplication by reciprocal and a shift. And if your argument is in [0..2N], mod N is just a conditional subtraction that doesn't even require a branch.

<comment><USER47> cheap is relative right? I mean a multiplication can be spread over shift and add/sub instructions whereas a mask is just one instruction I think right?

</comment></comment></comment></comment></comment><comment><USER48> > I've must have written a dozen ring buffers over the years

Why would someone do this instead of re-using previous (or third-party) implementations? Of course unless it's all in different languages, but I don't think that's the case here.

</comment><comment><USER49> > So there I was, implementing a one element ring buffer. Which, I'm sure > you'll agree, is a perfectly reasonable data structure.

I didn't even know what a ring buffer was

where do I dispose of my programmer membership card?

edit : lol, what a hostile reaction...

<comment><USER49> I honestly can't tell whether the downvotes are from elitist neckbeards or offended plebs

pls explain I'd love to hear

<comment><USER50> Probably just because it doesn't add to the discussion. Though, from a certain standpoint it shows one of the problems with our education system pretty clearly. This is truly a fundamental technique. I don't know how one gets out of school without knowing it. It doesn't say anything about you, but it says a lot about what we are teaching people. Embarrassingly, for a long time I thought I had invented this technique ;-)

<comment><USER49> I didn't attend college or graduate school (yeah ik ik I'm a pos), so that may well go a ways towards explaining my dumbassery

<comment><USER50> Don't worry. Programming and computer science is one of those things that anyone can learn on their own. If you don't mind some advice, though, try not to be embarrassed by things that you don't know. I can imagine that it is difficult, especially if you don't feel confident about your previous education. Even if most other people already know it, it just means that you have the pleasure of discovering it (as a certain XKCD comic pointed out).

One thing I've said to many people starting out (especially those without an academic background in the area) is that there is a lot to learn. Sometimes at the beginning, you improve so quickly that it is easy to think, "I must be getting close to knowing it all". After several decades in the industry, though, I'm still learning brand new (to me!) , important things every single day. In many ways, the best programmers are the ones who can see how much they _don 't_ know, not how much they do know.

<comment><USER49> I want you to know I genuinely appreciate you taking the time to write that. It's both helpful and uplifting. I've been going through a rough patch professionally and in life, and your comment lifted my spirits and brought me to tears (as absurd as I'm sure that must sound).

From one stranger on the internet to another : thank you.</comment></comment></comment></comment></comment></comment>


Ask HN: Is Tik Tok Breaching Apple's Privacy Guidelines? - <AUTHOR> I found out that Tik Tok is uniquely identifying devices and may be breaching Apple's policies.
1) Install the app
2) Don't allow notifications or anything else
2) Search 25 terms
3) Tik Tok asks you to log in
-*
1) Uninstall the app
2) Reset Advertising ID
3) Switch IP address with VPN
4) Change timezone, language, region
5) Remove SIM card
6) Restart device
7) Reinstall Tik Tok
8) Tik Tok still knows that it's you and asks you to log in.
I am sure they are not using the 2 bits from the DeviceCheck API, which Apple allows, but a more privacy invading option.
Anyone here has an idea what it is they are abusing? <comment><USER2> Maybe via NSUbiquitousKeyValueStore[1]?

Its purpose is synchronizing app state data across devices via iCloud.

[1] [https://developer.apple.com/documentation/foundation/nsubiqu...](https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore)

<comment><AUTHOR> I have iCloud deactivated.

</comment></comment><comment><USER3> I know a popular app used to do this by saving an item to the keychain, which persisted between installations. I'm not sure if that's still possible but I would look into it.

<comment><AUTHOR> I assume that must be what they're doing as well.

However the Keychain should only be used for logins, not to store UUIDs. I never logged in to Tik Tok</comment></comment>


The Toshiba Tablet - <AUTHOR> http://thetoshibatablet.com/

<comment><USER3> If you visit from an iOS device, you get redirected to this page: <http://thetoshibatablet.com/mobile/apple.html>

Wouldn't it make more sense to advertise the device and list its features to a potential convert (I am visiting the site to check it out after all), than show me a "haha you can't see flash page". As soon as I saw the page I just hit back and moved onto something else, as most probably will. A red page without even an image of the device so I might later recognize it as the tablet that does flash isn't helping them much.

<comment><USER4> Sounds like they don't think they have much chance of getting switchers from iOS.

<comment><USER5> You say this based on what, exactly? It sounds to _me_ like they just need to finish working on their web site, and one can't really take more from it than that without inserting one's own personal biases.

<comment><USER6> The page I saw insulted me. It didn't say "Hang on while we finish up here." I reserve the right to draw conclusions based on their tone, not just on their decision to skip building a cheap and simple web site.

<comment><USER7> I suspect you are fulfilling exactly what they want out of the page - <USER2> iOS users foaming at the mouth, expressing their anger and propelling their new site into the headlines with accompanying controversy lasting several days. This will lead to yet more discussion about Flash and the iPad not supporting it which will trickle down to even non-tech users who will slowly absorb the controversy as a simple equation of "the iPad can't do something the Toshiba tablet can".

I think it's a brilliant move.

<comment><USER8> It hasn't even launched yet. I'm sure the publicity will die down before they ship a single unit.

<comment><USER9> Toshiba is a major company, and this is a major product launch. I don't think unveiling a single video on their web site is their full advertising plan.

<comment><USER8> I was referring to the "controversy buzz". Unless they keep reiterating it, I don't see it helping enough to be a huge sales strategy.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER10> That's an ad full of win. It's very different from the off putting DROID eats your lunch and is smarter than you stuff from Verizon, doesn't look at all inspired or a derivative from Apple marketing and lists features that are interesting instead of attacking Apple.

<comment><USER11> I found the music very jarring and unsettling. I didn't care for the little spinning wheels/arrows everywhere, I have a really fast connection, I wonder if they could have loaded their flash faster somehow?

I wanted to look for the resolution and it told me 720p, which I then had to go look up what that meant (I mean, I know it's a tv display format, but if someone had said WXGA I'd have needed a translation to pixels for that too).

It didn't make me want to recommend one to someone else or buy one for myself. I don't recall a price. There are a lot of ways this could be improved.

But hey, I thought the Seinfeld/Bill Gates ads were interesting, so what the heck do I know, eh?

</comment></comment><comment><USER12> I just tried to read this on my iPhone and it redirected me here: <http://thetoshibatablet.com/mobile/apple.html>

Such a shame :)

<comment><USER6> Oh, THAT is going to get me to tell all of my friends not to make the mistake of buying an iPad. And I ask: Is brochureware for a product shipping Real Soon Now really an "Interesting site on the Internet?"

I don't think they're eating their own dogfood, I think they're drinking their own kool-aid.

</comment></comment><comment><USER13> Is it just me, or did anyone else not see anything that makes it stand out from the rest of the android tablets coming out.

</comment><comment><USER14> I had a Toshiba tablet (a Tecra M4). It now hangs on my wall as a Star-Trek- styled dashboard: <http://d.pr/8Dyk>

<comment><USER15> Nifty! Are you using an App for that, or is it custom?

<comment><USER14> It's a webpage running full-screen on Chrome in Ubuntu. You can actually see it here: <http://marcuscavanaugh.com/dashboard/>

I tried using Geckoboard, but it wasn't customizable enough for what I was trying to accomplish.

</comment></comment></comment><comment><USER16> I am on my iPad and now that I clicked on that link and could not browse back because of the redirect I dislike toshiba even more. An on the ugly page is a ugly message.

Trying to get Apple users to like Toshiba products : fail

<comment><USER17> Incredibly stupid. "Hey, I've got an idea! When any one of a group of over ten million wealthy, technologically-inclined consumers visits our site, _let's insult them!_ "

<comment><USER18> I'm what many might call an Android fanboy, but I have a hard time understanding these sorts of decisions made by companies. What iOS device owner is going to see that message and think "OMG I WANT A TOSH-TAB"?

<comment><USER7> To me it looks like an attempt at viral marketing. Their market? Android fans. How do you get Android fans to look at your page? By putting up a controversial page making fun of apple users.

I suspect that the kind of person who owns and iPad AND is offended by this is probably a market they are willing to write off in trade for huge publicity in Android circles - they might just be right.

<comment><USER18> I guess I'm having a hard time taking this thing that seriously compared to the Xoom. I mean, if Toshiba told me they were releasing full source at launch and include flashing utilities, I'd be ecstatic and would buy in a second. Like I said, I like Android and tinkering. I recognize that I'm a minority and I suspect Toshiba wants to move these puppies.

-1? Really? The hardware looks inferior to the Motorola Xoom. The Toshiba has that awkward chrome and has hardware buttons when Honeycomb is eliminating them or making them redundant. I guess others are just uh super into Toshiba?

<comment><USER9> I downvoted you because you jumped right in at the beginning of the thread and made a bunch of posts about the Xoom, all of which sounded more like excuses to mention it than like informative posts. Acting like a marketing bot is as bad as being a marketing bot in my book. If people are interested, they'll respond or upvote. If they ignore you, they're not interested. There's no need to repeat yourself all over the place. (However, if this stupid pagination thing keeps going, I will start to be more sympathetic to thread-spamming.)

<comment><USER18> So two constitutes a bunch now? Especially when one is in reply to the notion that "techies" are going to buy it when it has an inferior build, inferior specs and a bulkier size, and the other was a general comment at the top level of comments?

"all over the place is an exaggeration". Clearly I'm not a marketing bot, that's equally absurd.

<comment><USER9> I count three, with no information about the Xoom (before you got downvoted) except that it would "slaughter" the Toshiba and its UI was "better." I think the downvoting was consistent with HN standards. When a particular web site is under discussion and a guy posts a plug for a similar site, he doesn't get downvoted. Three in the same thread without an informative comparison, he gets downvoted.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER19> I notice that, once you get through the video, it shows a bunch of bars that you can hover over to see previews. I wonder how their tablet is going to handle that, since the concept of hovering doesn't exist without a mouse.

That bit of snark aside, this looks like a really impressive device. The cameras are a great addition, and if they put together some demos of video chatting, it could help them explain how they're better than an iPad in a way that really resonates with people, more than Flash and ports.

<comment><USER20> Touch works on the rollover menus, it only fires on finger/mouseup.

</comment></comment><comment><USER21> Really sharp looking flash advertisement.

</comment><comment><USER22> How much will it cost?

</comment><comment><USER18> Unless they have a really competitive price point, it seems like they're going to be slaughtered by the Xoom.</comment>


Strace in 60 lines of Go - <AUTHOR> https://medium.com/@lizrice/strace-in-60-lines-of-go-b4b76e3ecd64 <comment><USER2> I'm not a Go programmer, but I'm impressed by how simple and straight forward this is!</comment>


With Subscription Snacks, Entrepreneurs Think Inside the Box - <AUTHOR> http://www.nytimes.com/2015/09/26/business/with-subscription-snacks-entrepreneurs-think-inside-the-box.html?smid=tw-nytimes&smtyp=cur <comment><USER2> Please do not editorialize the titles of stories you submit to Hacker News. (Submitted title was "Can 14 companies in the US exist selling Japanese candy in subscription boxes?").

[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

</comment><comment><USER3> No.</comment>


Runq – Runc-based runtime to run regular Docker images in KVM/Qemu - <AUTHOR> https://github.com/gotoz/runq/ <comment><USER2> I would assume Clear Containers[1] are more lightweight solution, and they also leverage KVM/Qemu for isolation purposes.

[1] [https://github.com/clearcontainers/runtime](https://github.com/clearcontainers/runtime)

<comment><USER3> Or Kata containers or Hyper.sh. There's so much going on, it's hard to keep up or even tell the difference. Kata is an initiative by the OpenStack foundationa and somehow a mix of Clear and Hyper as far as I can tell.

[https://katacontainers.io/](https://katacontainers.io/)

<comment><USER4> Kata is the merge of ClearContainer and Hyper's runV.

Disclosure: I work at Hyper.sh

</comment></comment></comment><comment><USER5> I'm not very familiarized with this problem space. Could someone explain what why this is useful, and why you'd want to use it? What are the problems that it solves? I looked through the README, but I'm a bit lost.

<comment><USER6> You can use Dockerfile (easy to start, large ecosystem) to build and launch a VM (presumably more secure).

</comment></comment><comment><USER7> Ok, I'll say it. I think we need efficient arbitrary depth nesting of containers.

Sure, it is incredibly bloaty.

But so is the way, say, npm works.

Bloaty apps often provide a ton of programmer convenience.

And history tells us that programmer convenience usually wins.

Docker style development already usually means bundling tons of redundant dependencies everywhere.

Let's just take that further, and hold your nose.

<comment><USER8> Isn't that entirely possible with regular containers, but it's mostly Docker's client/server model getting in the way?

I agree with you we need this, though. I'm frequently running CI in Docker, and this makes launching a new container from CI a pain.

</comment></comment><comment><USER7> See also: user-mode Linux. I think it's a good idea but it's not really maintained and never really worked well as far as I know.

Google is also working on a shim that intercepts system calls in userspace to simulate having more priveledges.

But user mode Linux is a real full kernel!

<comment><USER9> There is also HyperD: [https://github.com/hyperhq/hyperd](https://github.com/hyperhq/hyperd)

<comment><USER4> Hyperd has been merged into Kata (katacontainers.io).

</comment></comment></comment><comment><USER10> Very nice, but bummer for me is:

      Limtations (not supported):
        - docker exec
        - docker swarm

Specially 'exec' part.</comment>


Floating point math: Why doesn't GCC optimize a*a*a*a*a*a to (a*a*a)*(a*a*a)? - <AUTHOR> https://stackoverflow.com/questions/6430448/why-doesnt-gcc-optimize-aaaaaa-to-aaaaaa <comment><USER2> Because the two product expressions compute different results for some values of a. Floating point values are not real numbers. Many apparently obvious equivalences are not. Welcome to the wonderful world of floating point computations.

<comment><AUTHOR> That much I'd expect most developers to be reasonably familiar with but the SO link I submitted goes into a lot more detail about what the compiler does with floating point operations which is why I thought it was worth a share.</comment></comment>


Google Earth Enterprise Open Source - happy-go-lucky http://www.opengee.org/ <comment><AUTHOR> This is huge. A while back this product was offered in the enterprise market for ~$100k per instance.

We have been using CesiumJS ([https://cesiumjs.org/](https://cesiumjs.org/)), which is fantastic, partly because Google stopped developing Google Earth. But it would be great to see new features added to a very mature product.

</comment><comment><USER2> From: [https://github.com/google/earthenterprise/wiki/Google- Earth-...](https://github.com/google/earthenterprise/wiki/Google-Earth- Enterprise-Client-\(EC\))

"The Google Earth Enterprise Client (EC) is required to connect to Earth Server and view 3D globes. This client is not open-sourced; but will continue to be maintained by the Google Earth Team."

That's a shame.

<comment><USER3> So what did they open source, exactly?

<comment><USER4> The server.

<comment><USER5> Fusion Server - imports and 'fuses' imagery, vector and terrain source data in to a single flyable 3D globe or 2D map.

GEE Server - Apache or Tornado-based server which hosts the private globes built by Fusion.

GEE Portable - A disconnected globe that allows you to access your data in a local-server configuration

</comment></comment></comment></comment><comment><USER6> Here's the link to the documentation (PDF) for more infos: [https://github.com/google/earthenterprise/raw/master/earth_e...](https://github.com/google/earthenterprise/raw/master/earth_enterprise/docs/landing_page/manual/gee_docs.pdf)

<comment><USER7> This doc is an improvement over most technical projects (it has an Audience section, hurrah) & is certainly better than the waste of time visiting the submitted link was, but… this PDF should be front-and-centre in the GitHub repo and available as HTML in the wiki.

</comment></comment><comment><USER8> >a geospatial application which provides the ability to build and host custom 3D globes and 2D maps

Always great when the main page is full of advertising speak, but has no clear description of what the software actually does. You'll find that on GitHub or the developer page. WHY?

<comment><USER9> You know how Google Maps lets you zoom around a flat 2D map, and how Google Earth lets you zoom around satellite imagery in 3D?

Google Earth Enterprise is the software that lets you build your maps, from your own satellite imagery or vector data, and serve them in 2D or 3D.

(Disclaimer: I work at Google, and used to work on GEE.)

</comment></comment><comment><USER10> Is this BYO terrain data? It looks like Google Earth Engine with no dataset?

<comment><USER11> Yes. The github readme [1] has more info:

 _Earth Enterprise is the open source release of Google Earth Enterprise, a geospatial application which provides the ability to build and host custom 3D globes and 2D maps. Earth Enterprise does not provide a private version of Google imagery that 's currently available in Google Maps or Earth._

 _The application suite consists of three core components:_

 _Fusion - imports and 'fuses' imagery, vector and terrain source data in to a single flyable 3D globe or 2D map._

 _Server - Apache or Tornado-based server which hosts the private globes built by Fusion._

 _Client - the Google Earth Enterprise Client (EC) and Google Maps Javascript API V3 used to view 3D globes and 2D maps, respectively._

Similar text appears on their 'Getting Started' page [2].

[1] [https://github.com/google/earthenterprise](https://github.com/google/earthenterprise) [2] [http://www.opengee.org/development/getting- started.html](http://www.opengee.org/development/getting-started.html)

</comment></comment><comment><USER12> At first glance, I don't understand the use cases for this, or what implications its being open sourced could have. Maybe someone could help explain its uses?

Looking at the website, there's four use cases linked, but only one of the options is available as text, and it still left me a bit unclear.

<comment><USER13> GEE lets you take a lots of imagery and vector data and process it together so that it can be displayed on Google Earth or anything that can render simple imagery tiles like the Google Maps API. It can run locally / on prem which is a big benefit if connectivity is a challenge for your business or end-users. Previously, this was something Google sold but was deprecated a few years ago. Now that it's open source people can keep using it :-)

Disclaimer: I work for Google, but not on GEE.

<comment><USER14> So as an example, if I had a lot of aerial photography of an area taken with a drone, would this be something I should research to stich together all of the raw / separate photographs into a map?

<comment><USER15> No, but once you had stitched together your photos and made a (georeferenced) map you could use this to combine those photos with terrain data and vector data you have from other sources and present the combined data in a google earth like viewer.

One advantage is that you can now host that viewer and the data on your own server (with any access restrictions you may wish to add) and even make the whole thing available for offline viewing.

</comment></comment></comment></comment><comment><USER16> Here is the github link in case you're searching for it: [https://github.com/google/earthenterprise](https://github.com/google/earthenterprise)

</comment><comment><USER2> Can anyone from Open Street Maps comment on how this release impacts their various projects? Does it fill in any missing functionality? I've lost track of the range of OSM projects but I know there's been a lot of work on improving the 3D dataset. Are there any sources for global satellite imagery under a reasonable licence?

</comment><comment><USER9> Previous HN discussion for the earlier announcement: [https://news.ycombinator.com/item?id=13528456](https://news.ycombinator.com/item?id=13528456)

<comment><USER17> I am the only one that finds the recent HN feature change that makes it impossible to upvote older stories annoying?

(I prefer to have all my upvoted stories in one list)

<comment><USER18> Instead of upvoting the story, you can favorite it. This will also upvote it if it can still be upvoted.

You can also favorite a comment - you can't do it directly from the comment thread, but click on the comment's date/time link and you can favorite it from there.

You can find all your favorited stories and comments from your user page.

The one caveat is that unlike upvotes, favorites are public. There doesn't seem to be a way to create private favorites other than keeping your own list outside the site.

<comment><USER17> I know that. That option is made very clear each time I click on upvote on an old story via an full screen info message. But as mentioned above, I want just one private list of upvoted stories. The changed interface is annoying and less useful. Why not let someone upvote an older story? (maybe without increasing the vote-count)

<comment><USER18> I'm sorry, I don't know why those changes were made, I'm just a random user trying to be helpful and provide a possible alternative. And I'm embarrassed to say I forgot about that full screen message you mentioned.

You're right, the old system did have some advantages!

</comment></comment></comment></comment></comment><comment><USER19> Should have called it GEEOS

</comment><comment> happy-go-lucky The GitHub repo is at [https://github.com/google/earthenterprise/](https://github.com/google/earthenterprise/)</comment>