skysight-inc/HackerNews huggingface dataset:
The funny thing about unit tests is that it's actually possible to write unit tests that don't really help you at all and that this is the way how many unit tests are written (a pessimistic me would say "most"), but nobody thought that would be possible.

The initial people who came up with the idea thought about writing down the execution of a usecase, or a small part of that, as a test. Then they ran their code against it while developing it. That gave them insight into the the usecase as well as the API and the implementation. This insight could then be used to improve tests, API and implementation.

But most professionals aren't about making quality. They are about paying their rent. So when they started to learn unit tests, they just wrote their code as always, and then tried to write tests, no matter how weird or unreasonable, to increas the line coverage of their test suite. The proudest result for them is not to have a much more elegant implementation, but to find the weird test logic that moved them from 90% coverage to 91%.

I believe that's how you get a lot of clutter in your unit tests. However what is described in the document are sometimes example of people really trying, but that are just early in their development. Of course when you learn to do something by a new method you will first do crappy, inefficient stuff. The idea here is how much do you listen to feedback. If that team that broke their logic to get higher coverage learned that this was bad, then they probably adapted after some time, and then they did exactly what unit tests are there for.
This post is about how to learn, and touches on concepts that I felt were very well explained in the coursera course "Learning how to learn" (https://www.coursera.org/learn/learning-how-to-learn)
How come? I mean you sure can draw isometric views, is that such a huge leap?
lol, yes it is. Can't believe you're being downvoted on HN. Just shows how hyped it is. People can't handle disagreement.

This video looks good to me from the intro. I'm going to check it out. Thanks!
Single family homes with 3 bedrooms, 2 baths, 1,500 sq ft, 2000 sq ft yard, built after 1980, recently sold prices on zillow:

Palo Alto: Averages roughly $4,000,000.

http://www.zillow.com/homes/for_sale/Palo-Alto-CA/fsba,fsbo_...

Austin, Texas: Averages roughly $400,000 (10x less)

http://www.zillow.com/homes/for_sale/Austin-TX/fsba,fsbo_lt/...

Orlando, Florida: Averages roughly $400,000 (10x less)

http://www.zillow.com/homes/for_sale/Orlando-FL/fsba,fsbo_lt...

Chicago, Illinois: Averages roughly $800,000 (5x less)

http://www.zillow.com/homes/for_sale/Chicago-IL/fsba,fsbo_lt...

Philadelphia, Pennsylvania: Averages roughly $400,000 (10x less)

http://www.zillow.com/homes/for_sale/Philadelphia-PA/fsba,fs...

Seattle, Washington: Averages roughly $1,000,000 (4x less)

http://www.zillow.com/homes/for_sale/Seattle-WA/fsba,fsbo_lt...

Palo Alto is definitely _much_ more expensive.
> As a sysadmin, systemd is very very useful in my job

I agree; as a sysadmin, whatever init system the OS offers is very very useful in my job.

What I have not found is that systemd is more useful than the other major alternatives. Can you outline, let's say, three ways where you find systemd solves pain points you had with upstart or sysvinit?
If it's a one off isn't this exactly what nohup is designed for?
For std::vector, they should compile to the same thing, the iterator is just a pointer to a flat array. For std::map (ie. red-black tree) or something more complex, it might make a bigger difference. But even then, the iterator is quite light weight (just a pointer) so copying it is not a big deal.
https://en.wikipedia.org/wiki/Sudbury_Valley_School

(Previously linked and discussed here: https://news.ycombinator.com/item?id=8486440)
As far as I can tell, Telegram keeps spam at bay through:

1. Requiring a unique phone number for signup, and heavily restricting accounts which appear to have used a VOIP phone number for signup (including Google Voice numbers). Restricted accounts can't initiate conversations, so they can't really send spam.

2. Allowing users to report spammers that get past #1, and limiting the accounts of users that get reported.

For details, see: https://telegram.org/faq_spam
Trying to make kids memorize a bunch of stuff that's unimportant to them is incredibly inefficient and the information fades fast.

Having them do this at the expense of play (accelerated self-guided learning through social simulation, art and sports), at the expense of physical activity and in an insanely toxic social environment, is plain crazy.

Apprenticeship, where one learns what they need to learn when they need to apply it, and then uses the newly learned skills to achieve own goals beats that hand down. Look up Tobi from shopify and his posts about his learning to write software in Germany's apprenticeship programs.

Convincing kids that they are smart or stupid based on their teacher's opinion on the kids' obedience and ability to regurgitate uninteresting (to them) data is harmful at best. Convincing them that what they are experiencing in school is learning is even more harmful.

Schools are great at efficiently enacting a plan that has little to do with children's needs and little to do with learning.

Like a close friend who attended an elite private school with tiny classes and a lot of self-elected subjects, time allocation and projects said, "when I went to college I thought I was surrounded by idiots. Later I realized these were kids who didn't get a chance to learn good writing, or public speaking, or to plan, schedule and execute on their own nprojects, or to navigate bureaucracy."

I'd say same goes for other important life skills, like financial planning, media preparedness (understanding propaganda and advertising), job hunting, entrepreneurship, art, etc.
For completeness (though either way your point stands), is that /12 months of /10 ?
And now the burden of changing tests prevents any meaningful refactoring.
The title makes this a lot less interesting for our female readers, I'd guess. Please consider other people that don't share your humour when creating/sharing titles.
And because of the way the free market works despite the average family working twice as many hours as one in the fifties they're no better off, and in a lot of cases worse off, in terms of what they can actually afford. And kids never get to see their parents.

I don't know what the solution is long term but I have a feeling someday this experiment in free market capitalism is going to be considered in similar ways to the USSR's experiment in communism a few decades from now.
From the paper: "[UHECR air shower] can be detected via [...] radio and acoustic signatures"

Does this mean that the particles have so much energy you could HEAR the effects of them hitting the atmosphere?
I think of middle class in silicon valley starting at $250,000 honestly. $150,000 seems low based on the housing costs.
I'm sure giving your kids a good and useful education is one way to transfer wealth between generations. However, it sometimes fails.

Direct ways of transferring wealth between generations never fail. And there's a lot of those going on too.

Transferring values is hard. Transferring cash is easy.
How to create a personal brand from scratch
You should repeat yourself in your tests. See DAMP vs DRY [1]. Also that repetition is valuable feedback that you may have a design problem, that something about your object hierarchy is overly-complex, for example. If you hide it, you're just sweeping the problem under the rug.

[1] http://stackoverflow.com/a/11837973
A strikingly shallow and pointless article. TL:DR; We did some trivial, questionable, narrow tests, and turns out cognitive dissonance is what you thought it was and can be thought of as OK / survival instinct.
I don't think cognitive dissonance is a bad thing. I don't see why should add a coping mechanism to acheive inner peace. If you instead saw that sometimes you win a grape, sometimes you loose one, you would have taught yourself a lesson, which should be bettar than denying facts about the world and yourself, if you are a man of science.
Thanks, Obama

http://knowyourmeme.com/memes/thanks-obama
I was going to write pretty much the same thing. How comfortable would any of us be reaching our arms deep into a large piece of operating hydraulic machinery? It would take only a small bug to contort your arm into a position that your bones won't allow, and anything capable of lifting 1.5 tonnes can easily rip your arm off. I wouldn't want to test drive v1.0 of the aliens power loader. Or any other version that ends with ".0"
No one is talking about standards. I'm talking about food that might make your dog sick or malnourished.

But to each his own.
Obviously I don't disagree with that. Where are you going with this? People don't formulate their beliefs by picking randomly from a collection of all theoretically-possible beliefs. To expand on your example, if you are selecting from a bag of beliefs according to some criteria (based on some combination of morality, desire, etc) which are themselves in conflict (e.g. "I wish to be feared; I wish to be loved") then I think you are more likely to pick some beliefs which happen to contradict each other (again, if not logically, then for most inputs) than you would just by selecting randomly. Or, probably, if your criteria are more in tune with one another.
So, its find my friends. But for android, and not optimised to only collect your location on demand.

Does google not provide something like this for android accounts?
See also https://en.wikipedia.org/wiki/Doublethink
Ask HN: My Show HN post won't show. Could it be?
My friend had posted the project here without asking me and then deleted the post.

Could it be the reason why my submission doesn't appear? Am I doomed from submitting it to Show HN now?

This is what I submitted https://news.ycombinator.com/item?id=11800148. It was titled "Show HN: Goodbye Gun Stocks."
This is very patronizing, you're not better than some other developer because you fell in love with OCaml or similar strongly-typed languages.

I don't think this kind of criticism is healthy, you're trying to live on top of your ivory tower calling out everyone else who isn't like you as lazy and looking for job security, you really do think there's no other reason for people using languages that you aren't so fond of?

Honest question, because this kind of message is just unnecessary aggression.
Please don't move to fixtures, your tests are great as-is (thanks for sharing). See my comment above!
I found Dijkstra's letters appalling. Writing - utterly without shame - that his negative response to Backus' paper was disingenuous and served a "political" purpose is utterly despicable to me.

I don't know how you can defend that.
I once had a talk with Kent Beck way way back in the day (early 2000s) about how much unit tests there should be, etc... and I think its nicely captured by his reply here

http://stackoverflow.com/questions/153234/how-deep-are-your-...

A lot of people seem to miss many of Kent's subtly, but intentionally phrased advice. Unit Tests are a liability, so use them responsibly and as little as possible, but not at the expense of removing confidence in your software.

Also, delete tests that aren't doing you any favors.
The difference is that currently, there's no way to express "this (reference type) variable really cannot be null", which makes it painful. It's the equivalent of having "throws Exception" on every method, declared for you implicitly.
then you have never worked in anything but a small focussed team.

The majority of development is performed by people in corporate environments, 9->5. They simply know that they "have to" write unit tests.
No reasoning is performed, simply churn out the code to satisfy the boss and walk out at 5pm.
I'd also exclude:

+-- StopIteration
+-- StopAsyncIterat

which are used for mere communication rather than describing real error cases.

Also, you should exclude:

+-- SystemExit
+-- KeyboardInterrupt
+-- GeneratorExit

+-- ImportError
+-- MemoryError
+-- SyntaxError

| +-- IndentationError
| +-- TabError

because unit tests won't help you to catch these, either (because they are either thrown directly on program start, or depend of specific system circumstances rather than bugs in your code).

Finally, I would argue that most instances of this exception are caught by a type system:

| +-- KeyError

Why? Because most of the time the key is not user input, but a hard coded string, and accessing non-existing properties of an object/struct is caught by most type systems on compile time.
Wiley makes fake DOIs to trap web crawlers
My mental conception of this looks like a bell curve - most successful entities require a good amount of (hard, smart, strategic) work and a good amount of (pure, random, chaotic) luck. A very few succeed with a vast amount of hard work and only a small amount of luck, and equally few succeed with a tiny amount of hard work and vast amounts of luck.
"relying only on typing will cover about 10% of the error types". It's not about the percentage of error types. Its about the percentage of errors. A very high percentage of unit tests in a dynamic language are written to catch type errors. That work is a waste of time when a type system could check it for you. The reason for this is that type errors are involved in all code. A FileExistsError only applies if I am working with files. (Plus with types you get the added benefit of inline documentation and better tooling.)
This gets to the heart of why Apple probably did it and why it's significant.

It was a nasty hack for interoperability but it worked and is probably the only thing that would work. It also indicates how much Apple cares about squashing interoperability for iMessage. Whether you feel this is because it presents a security risk or a business risk is down to the cut of your tin foil hat.
Participating in Paid Research Made Easier with Xperii
Why do I get the feeling the phrase "technologically impossible" is going to come back to bite him in the ass.
This isn't a one-off; I want a simple solution that requires as little setup as possible. I also want infinite buffer space to store the stdout and stderr of processes, which neither screen nor tmux provide (both require you to preallocate buffer space).
There is a somewhat interesting philosophical question here. What does it mean for this result to be the 'placebo effect'?

That is, supposing it is in some sense caused by the psyche, and fasting reliably produces that effect...is there a sense in which fasting is not its cause?

Clearly for sugar pill vs drug we can measure the component which is 'placebo'. But here, since it is immeasurable...is it possible to call it a placebo effect? Or should we refer to effects derived psychologically from unique subjective experiences in another way.
Ah, I had always assumed Waldo was an acronym or initialism of some kind; checking wikipedia shows they are named after the Heinlein story you mention!
This suggestion feels dogmatic. Instead, the suggestion should be to use a better compiler.
To some extent verbose UT is the tax I'm paying for the joy of not using statically-typed language.

I'm happy to pay that, but by no means suggest it's the right trade-off for every scenario.
Yes! It is often distilled to this aphorism. But from my reading of it "sour grapes" is only one aspect. It is a more general concept that deals with how we resolve tensions between our beliefs and facts as we see them.
Weekly updates on Angular 2 development
It really depends on what kind of software you build.

There are certain kinds of software for which strongly-typed languages (in the sense of ML, not C/Java) are heavily underused. For those cases, parent's rant is quite	appropriate and mostly justified.

For example, we really, really want to have our browsers written in a language like Rust, rather than C or C++. Same with web servers, and public-facing web applications.
Data prices in Europe are ok but in the US its £5 a megabyte!
FWIW, formal verification requires a complete and exact spec - the TZ kernel is very complex and interacts with nearly all the peripherals on the SoC, it doesn't just manage QSEE applications. I think creating a spec for something like that would be really hard.
I develop and maintain an open source RSS reader. In my experience it's not so bad. I strip CSS and javascript from feeds, and most of them are displayed fine anyway. I don't think I've ever found a feed that needed javascript to load content, it seems even SPAs include plain entry content in their feeds, thankfully. I've never found a feed that became unreadable after stripping styling either.

I agree it's interesting to look at your content when loaded in an RSS reader. IMHO most feeds are actually more readable when loaded in a clean uncluttered RSS reader than in the original webpage. If the content is good, the reading experience should not be harmed by focusing just on its text and images and removing extra styling.

Shameless plug: the RSS reader I maintain is https://www.feedbunch.com , comments are welcome.
If you are presented with evidence that requires a Bayesian update, and you are smart enough to figure this out, yet you still do not perform the Bayesian update (or you calculate it incorrectly according to your whims as opposed to the evidence), then I would say you are cognitively dissonant in proportion to the change in probability mass you should have recalculated but did not.

Good enough?
Because the type systems of most languages that have checked exceptions cannot properly accommodate them when higher-order functions are utilized (i.e. "I throw everything that f throws except E, and also everything that g throws except T").
HackIDE – Open-Source Online Code Editor/Compiler/Interpreter
I think the section dealing with the Optional monad sort of glosses over their composability, which is one of the primary reasons we use monads. Multiple functions that all return an optional can be composed; for instance, if we had

Optional<WidgetFriend> GetWidgetFriend(Widget widget)

and WidgetFriend had an Optional<FriendName> property, we could simply write [1]

from widget in _widgetRepository.FindById(widgetId)
from friend in _widgetRepository.GetWidgetFriend(widget)
from name in friend.Name
select name;

and get an Optional<FriendName>, without having to repeat all the tedious pattern matching of Some or None for every call. If any of those calls returns a None, the entire evaluation short-circuits and we get a None result at the end.

Of course, we can still write

Optional<Widget> widget = null;

which is the problem with not fixing this issue on a language level.

[1] You'd have to implement Select and SelectMany, instead of Map and Bind, to get query syntax like this.
How is this simpler? Seems a lot more complex to me.

In his story he sat down at his computer for a while and did what he needed. A couple of trips to town later it was done.

In your story he needs to get a bunch of messy stuff, using tools and processes he has no knowledge of, of which even stage one I don't know where to start.

I don't understand how you think that is simpler!
How do unit tests protect you from a corrupted database?

You are making a very weak case.
Don't forget to tell them to go catch and cook mudcrabs bare handed:

https://www.youtube.com/watch?v=44aNi4UgYAo
Longevity Cookbook
That's tens of millions of devices and probably growing - that's a decent chunk IMO
Is WALL-E named after him? I know that's an acronym for "Waste Allocation Load Lifter Earth-class", but I bet it's no coincidence.
5 tips to screw up your whole customer acquisition process
You also need to factor in the available cures.
A simple gastric band operation means you can't then die of overeating.
But a liver replacement can still be abused by an alcoholic.
Good idea. Too little too late. I suffer horribly with my small family and two good jobs. One job basically pays for the taxes. And housing is so expensive I cant get over the hump to get a mortgage to see any tax benefits. Its really crushing to not be a landed gentry here. We rent is a good school district and have a kind landlord but we cannot build housing equity besides having good jobs.
Lead generation can be challenging but converting trial users into paying clients is even more challenging! According to MarketingSherpa, 7% conversion rate is avarage in SaaS businesses. But what are the key influencers of that specific number? What are the key parts of a good customer acquisition process? Here are the 4 parts where you can screw up your whole customer acquisition process.
Does anyone expect that by sitting around doing nothing they'll get lucky and become successful? Do one's choices mean nothing?

Talk about a non sequitur. Grandparent said, essentially, that luck is necessary for success. You seem to be arguing against a strawman who you imagine claims that luck is sufficient for success.

You have accomplished much, Walter, and you deserve to feel proud. You also should feel lucky, however.
I find it hard to believe anyone was/is using OS X instead of Windows just for Bash.

Every Mac since the switch to Intel processors has built in support for dual-booting Windows. If you want to play games that don't run on OS X, boot into Windows and play your game.

I am struggling to understand the concept of compromising your working environment so much, just for the ability to play games without a reboot.

I would imagine the productivity losses in a single hour of working would be more time than is required for two full reboots - into Windows and back to OS X.
> I'd also exclude:
>
> +-- StopIteration
> +-- StopAsyncIterat
>
> which are used for mere communication rather than describing real error cases.

Absolutly not. If you implement very low level logic, you can use those. I have to catch them several times in my life.

> Also, you should exclude:
>
> +-- SystemExit
> +-- KeyboardInterrupt
> +-- GeneratorExit
>

Certainly not. You should DEFINITLY unit test for those. I do it all the time:

def test_ready_keyboard_interrupt(aioloop, app):
beacon = Mock()
real_stop = app._finish

def beacon_stop():
beacon()
real_stop()

app._finish = beacon_stop

@app.on('running')
def stahp():
beacon()
raise KeyboardInterrupt()

@app.on('stop')
def stop():
beacon()

app.ready()

assert beacon.call_count == 3

You must check if you app behavre well when killed.

> +-- ImportError

That a type system can't check for, but a good linter can. I never have import errors because I got proper tooling.

> +-- MemoryError

That you should test for of course. Last week I worked on a split/merge algo on big files. I had to test that.

> +-- SyntaxError
>
> | +-- IndentationError
> | +-- TabError

Well, doh :) Type system or unit tests won't catch that. Tooling, tooling, tooling.

> Finally, I would argue that most instances of this exception are caught by a type system:
>
> | +-- KeyError

No, no no !

KeyError should be super mega tested:

- keys can be any mutable in Python, not string;
- keys are very often generated on the fly, not constants;
- dict are mutable, you can add or remove keys.
So those of us that do not have a unique phone number shouldn't be allowed to communicate?
I remember 15 years ago people were saying the same thing! (not to bother with this micro-optimisation because the compiler will do it anyway).

I often still sometimes write "++it" out of habit, but usually will just go with whichever variant I feel conveys my intent better and leave the optimisation of this to the compiler.

EDIT:

Its also not always true that "++it" is faster than "it++", as this quote from Agner Fog's C++ optimisation guide notes:

For example, x = array[i++] is more efficient than
x = array[++i] because in the latter case, the
calculation of the address of the array element has
to wait for the new value of i which will delay the
availability of x for approximately two clock cycles.
Obviously, the initial value of i must be adjusted
if you change pre-increment to post-increment.