skysight-inc/HackerNews huggingface dataset:
> If you are a professional developer, you can consider these examples as a great resource for interview questions and quizzes for newcomers in your company

No, do not consider these examples as a "great" resource for interview questions. They are nothing more than tricks and hacks abusing the bad aspects of the language and anyone who includes them in an interview has failed in screening JavaScript developers, at least in my book.

A JS developer should understand that JavaScript has some flawed, unfixable core concepts and educate themselves on how to avoid them, not use them in actual production code or memorize every coercion scenario.

Some simple rules:

1. Always use referential equality checks (triple equal `===`). In idiomatic JS you can also use double equality only when explicitly checking against undefined or null (foo == null). It's the only use of abstract equality that I find acceptable.

2. Learn how the `this` execution context works. Kyle Simpson explains it very well in YDKJS (https://github.com/getify/You-Dont-Know-JS/blob/master/this%...). There are four simple rules that matter and are straightforward to grasp.

3. Familiarize yourself with how type coercion works in JS but avoid it. The spec is quite easy to follow in this matter and follows very specific, documented rules. e.g.:

https://www.ecma-international.org/ecma-262/8.0/index.html#s...
https://www.ecma-international.org/ecma-262/8.0/index.html#s...

Use strictly as reference.

4. Stop using plain ES5, the language currently is ES2017. ES2015 and beyond provide modern constructs that make most of ES5's weirdness obsolete. For example, never use `var` anymore, `const` and `let` are superior initializers.

By following the above rules a JS developer should be fine in 99% of cases, in my experience. Yes, JavaScript will possibly implode on you on the rest 1%, but I'd be hard pressed to find a (similarly popular) language that doesn't. If one finds that to be unacceptable, enabling types via TypeScript or Flow should make their life even easier.
""The CFAA makes it a crime to "access a computer without authorization or exceed authorized access." Courts have been struggling to figure out what this means ever since Congress passed it more than 30 years ago.""

The law by itself is ok, but I suspect lawmakers were referring to accessing a single personal workstation, probably not taking into account a cluster of servers containing public accessible data.
>Electronic banking comes with many types of federal guarantees to protect against fraud. The government can step in to investigate and prosecute the fraud as well. But there is no such guarantee for the voting to select the government itself!

That's only because the government hasn't bothered to invest in electronic voting security, regulations, and rigor to the extend that they invested in fraud protection and financial regulations. I'm willing to be that if the government cared more about modernizing, securing, and distributing our voting systems, we'd see improvement on the level of electronic banking and finance.

Not that I expect this to happen anytime soon. For various reasons, voting rights and opportunities in the US are steadily declining and don't seem to be taken seriously. You can fill in the blanks yourself there.
I find many are willing to invest sparingly in a facade to retain 'usefulness' for whatever net they gain, while concurrently mocking & deriding my shortcomings... I am socially awkward. This type if disingenuousness feels wrong to me, and as a result, I fail miserably in the 'networking' aspect of life.
I don't get why. Counting ballots is so easy. Fraud can easily be prevented (open process that everyone can attend, group of people who have to agree on the result, re-counting by officials of results that are outliers and of some random samples, etc). Plus it's cheap. I find it hard to belief that these systems can be cheaper than a few people working for $10/hr. Counting a few thousand votes can easily be done in 2-3 hours by 3 people (by my own experience).
So, just make the machines nationwide present "sensible" but false results?
> If you have permission to view the page, then you have permission to scrape the page.

This is false. Web pages expect scrapers to respect robots.txt and users to respect the terms and conditions. From what I understand, the CFAA law was not meant for these violations, and the fight is whether or not this law can be used to win the trial. However, other laws can be put into place to address these situations.
Approximately 100,000 American children suffer physical abuse at the hands of a parent each year:

http://www.nationalchildrensalliance.org/media-room/media-ki...

If the proportion of abuse victims which are subject to physical parental abuse is approximately the same, then about 13,000 of those victims are under one year old.

If you're going for an argument that really bad parents are too rare to take into account, it seems to me that argument works both ways: the number of good parents who would be victimized by prosecuting hot car deaths would be really small. At an average of ~40 such deaths per year, at most 80 good parents would be improperly prosecuted per year.

This page gives examples of criminal negligence which to me seem to be pretty similar to leaving a child in a car like this:

http://examples.yourdictionary.com/examples-of-negligence.ht...

In particular, I don't see a fundamental difference between a nurse forgetting to feed a patient and a parent forgetting to take their child out of the car.

The fact that there are only ~40 such deaths per year in the US suggests to me that this is not, in fact, something that would apply to essentially every parent.
From now on I'm going to include at least one of these in each interview I'll be conducting - for extra points of course.

Anyway a lot of these examples can be explained if you know how type coercion works in JS and are aware what the `valueOf` method exists for.

Here's a nice write-up about this mechanism: http://2ality.com/2011/12/fake-operator-overloading.html
Vote count could also be optimised with machines. Each party can bring it's own OCR machine to count the votes. If there is a disagreement, fallback on humans.

The issue is with having a single machine that we have to trust end-to-end.
> what have we achieved other than adding another few layers of middlemen and cost?

and uncertainty. In principle the idea of hitting a button and having the non-networked machine spit out a paper trail that can be electronically counted sounds like a good compromise. But this leaves 1 or potentially 2 sources of uncertainty that are not necessary: (1) that what the machine prints actually corresponds to what you wanted and (2) that the counting machine actually counts what it says on the paper.

(1) is not such a risk if you can verify it visually before submitting. There do exist I believe some ideas in cryptography to allow you carry a record of your vote that allows you to verify it without revealing the choice, these could have interesting application here, but I don't know the pros and cons.

(2) is even a risk in the non-machine case, although it can be mitigated by having multiple independent parties do the count. But it can't easily be done by machine and have the same level of certainty.
The specs would agree with you, but my real life side-by-side experience only demonstrates that the XPS is better for gaming. For everything else, my old rMBP is as fast or faster.

And my Mac runs for weeks, sometimes > 2 months, without a reboot. I've had to reboot the XPS on average twice a week (due to crashes, or updates, or really weird performance drops).
This laptop looks like mixed bag of opinions. I'm looking something to switch from rMPB 2013 (need more RAM, storage). That laptop i still on my list but on last position.
I had rMBP2016 for 3 months and I could't write on that keyboard. After 1-2 hr's I felt pain in my fingers because constant contact of my nails with that keyboard. And I don't have some bear nails :) Sold it and now my short list is
1. Lenovo X1 carbon WQHD - best keyboard I ever written.
2. XPS 13 (coil whine, spongy keyboard)
3. XPS 15 - problems described in many places ..
Still can't make decision :/
And if you do give a county, do you mean the historic unchanging counties or the modern government administrative areas with the same names?
Measuring Data Science Business Value
What should the ISO C++ Standards Committee be doing?
>That's a bit different in other countries where counting paper ballots can take days.

Seems to me the solution is to figure out what makes german voting and vote counting so efficient and replicate that, rather than switching to voting computers.
A perfect example of corporate hypocrisy. Both Facebook and LinkedIn did illegal things when they were younger but now that they are more established, they don't want anyone to do the same thing to them.
I know these are great resources, but I don't think redux should be taught with react. Most of the React projects I've seen using Redux didn't need it - all they needed was for their developers to have a deeper understanding of how React handles state.

Learn React first. When you have complex data management problems, consider learning Redux, but master Reacts own state management first.
"satellite imagery for oil tankers" - Interesting.

If hedge funds floating drones above oil tankers, I'd guess they'd be accussed of corporate espionage / spying / invasion of privacy?

Ok, so oil tankers are big and "in the clear". What if $TANKERCORP floats big parachute balloons above its tankers to imply "looking past these is unauthorized viewing"?

Then if a HedgeFund gets a clever angle on a satellite photo.. is that the equivalent of breaking a lock, or violating CFAA?
We have some code here, not written by me!, which queries by Canadian Postal Code, of which, their are several hundred thousand.

Apparently, dropping the last character and requerying is the equivalent of a proximity search!

This in itself is laughable. But the company sent the code back to the creators to have the ability to query by city added.

Guess what. Apparently if you drop the last letter of a city, it's the equivalent of doing a proximity search!

I must be totally turned around on this.
Are you on Chrome Canary? I'm on the stable branch and I'm not having any issues.
I completely agree about the function keys. That's the only reason I haven't upgraded my 2015 Macbook pro.
Update:

In Germany, the Tekpower TP3005D-3 is called Komerci QJ3005EIII and can be bought on Amazon. Its the same device, only ~150€.
In my experience with this new XPS 15 9560, the touch screen is only marginally useful. It doesn't seem to play well with screen pens, so it's just a thing to smudge your finger grease on if you want to show off.
I agree.

Evidence out there seems to suggest that trainers are bad by overcushioning the feet or placing the body in a bad position, but...

For example, I'm sure our neolithic ancestors ran long distances because they had to. There's nothing implicit in this about whether it's good for us, and we don't know how many of them got eaten or died because they had bum knees!
Purescript's Argonaut lib has major performance issues that are incurred for the "powerful type system."

When you only have thousands of items in an array, you end up with performance discrepancies between older browsers like IE 11 and Chrome that are unacceptable outside of a toy application.
I didn't know it was part of IEEE 754, thanks.
So JS is not alone in this.
What if the user is provided with permission to view medical records - your medical records for example? Would it be ok to scrape and sell those? What about children's school profiles and records?
You can't send money to multiple people using paypal without being approved by PayPal and with KYC and other regulatory laws there's a lot of friction using paypal send api with bitcoin on the other hand, no permission is needed that is way I think bitcoin has an easier api, I'm not referring to the actual C++ bitcoin api but there are javascript api clients to Bitcoin that are dev friendly. Bitcoin transaction fees are high? (Around $1 per transaction at the moment) versus 2.9% of the total with paypal. It is even cheaper with Ethereum which fall under the bitcoin umbrella.
Gives you a paper result that you can verify, and leave there for manual recounts as needed. Checksums and verified hardware. This is not insurmountable.

You vote, confirm the receipt says the right thing, and stuff it in a box. Verified hardware is a solved problem. Given that it'd have no idea of the candidates, there's no way to program it ahead of time to favor a candidate without being caught.

We already have election officials watching each other. This needn't be more complicated than a late 70s calculator. It can even be so simple it doesn't know the candidates names or party affiliations.

Well, in theory... In reality, it will be a black box, connected to any open wireless, and made by the company who donated the most. But, in theory, it'd not be too hard to make a fairly dumb device that provides verification. It only has to count and print.
In my country, it was the winning presidential candidate complaining about fraud.
Can you blame a startup oriented news aggregator for being drawn to bubbles?
Apple says it is removing VPN services from China App Store
BBC is paid for by the British government, that is, politicians or oversight orgs that report to politicians. For-profit news agencies are simply delivery mechanisms for advertisements run by mostly large conglomerate corps. News happens to be their niche to get eyeballs on the advertisements that pays the bills -- porn tubes and cnn have more in common than we'd like to accept. Additionally to the extent they need licenses for the public airwaves or access to governmental officials, they are influenced by those.

Decades-old reputation matters nothing compared to the current leadership being beholden to those who hold the pursestrings.

The best that can be hoped for is the powers influencing the news somehow balance each other out enough for a modicum of truth to leak through.
The New Ring Spotlight Cams: Smart Security Anywhere You Need It
Finally.. I'll give it another chance.
It does not take long to aggregate votes using paper ballots. I was counting paper ballots in a national election, and we were done before 11 PM the same day.
intext:"index of /.git" reveals a ton of those.
A little bit "out there" but I've been impressed with 'Dry Erase: Infinite VR Whiteboard'[0]. You get far more space to play with in a virtual environment than you can get on a screen. This would be killer if it supported multiple users over the internet, which is possibly being considered by the dev.[1]

[0] http://store.steampowered.com/app/585040/Dry_Erase_Infinite_...

[1] https://steamcommunity.com/app/585040/discussions/0/14584554...
HN is not special. Every public exposure precedes a bubble, that's how it works, influx of new buyers raises the price.
Is the webcam back at the top of the screen, or is it still at the bottom-left "I can see right up your nose" position.

edit Yep, on page 2:

> The smaller bezels really do reduce the bulk of the notebook, with the one downside in Dell’s case of a poorly positioned webcam at the bottom of the display. Dell wants to keep the top and side bezels the same size for aesthetics, and heavy webcam users will not appreciate this, with a less than flattering up-the-nose result.
I'd always been suspicious of linking up with my current employer/coworkers, now I guess it was a valid concern.
The paper trail would be used for post-election verification. A nonpartisan body randomly selects several districts in the state every election and audits the paper record versus the electronic record. If there is a discrepancy, then an investigation is started and all of the records are verified.

This gets you the speed and ADA compliance of the machines, but the reliability of paper.

This commission also helps to insure that there was no funny business at the aggregation center.
All countries have a Postal Code / ZIP Code or equivalent. Ireland only very recently added them and called them Eircodes (because of course we did). It used to be slightly annoying having to find some combination of characters that the online form would accept as they often varied site to site. Interestingly enough, several of these companies had their European head-quarters in Ireland. Also having to talk to the bank manager because the cashier in a UK bank wouldn't let me open an account without giving a valid postcode for my Irish address.

EDIT: typos
> All machines are hackable all systems are hackable.

Then why use machines at all? As mentioned in this thread multiple times, Germany can count all votes within a few hours without any voting machines.
If you want to get good at JavaScript, do learn about closures and lexical scope. Example assignment: Make a function that loads a list of images and then show the average width of the images. Then make three versions of the function, one that loads the images in serial, one that loads the images in parallel and one that loads max three images at a time.
We are past bubble stage with Bitcoin IMO. It has failed to become much other than a bullshit investment vehicle. People only worried about how high it can go, instead of actually using it daily.
Preventing idiocy. I wish such a thing were possible. I am sure that you have heard: If you make something foolproof, they will make a better fool.
Anyone interested in electronic voting, I would suggest reading the article: Internet Voting: A Requiem for the Dream in the last issue of Phrack. It was eye opening for me.
http://phrack.org/issues/69/11.html#article

Conclusion:

1. Internet voting is not compatible with democracy
2. No amount of technology can change this
3. Whom you voted for ought to be secret
4. Who voted should not be secret -- it should be known as widely
as possible
5. And who counts the votes, and how, certainly ought not be secret
This is not true stories come out all of the time. The big news lately isn't related to price but the split.
Click-bait header lines always suck, but especially on HN.
As far as I can tell the TLDR here is: domains can have previous owners, who might have made users cache malicious pages forever.

I agree it's a concerning thing, but I must be missing something because I don't see why this is a medium-specific issue - doesn't it impact almost every website?
At my voting location they use paper ballots and only supply pens.
That said the deriving mechanisms have been mostly exposed to the end used now in at least a few different ways.

Even more importantly, deriving doesn't change the semantics of the language. You could in principle do exactly the same things without deriving as you can with.
Yap, let's introduce the "invisible hand of the free market" into the voting system. As we have all experienced, that always leads to the safest and most ethical outcome.
Everyone loves to watch a train-wreck.
This is just when there's tech news on Bitcoin. If you want to get ready for bubbles just keep an eye on google trends "how to buy bitcoin". Worked for me, admittedly only once though.
Google’s smart keyboard app Gboard adds doodling, YouTube and Google Maps
Floating point can be a bit mind bending. Still, something not being equal to itself almost pushes the barrier into philosophy.
Well, in addition to (just) hacking all the machines, you'd have to tamper with a sufficient number of exit polls to limit recounts (and the waves of subsequent recounts that would follow widespread evidence of tampering).
As if a society, if things get bad- would not behave rationally? Almost, as if there was a war-mode, where we vote for erratical leaders, close the ranks, shut down all free communications, and would invade some neighbourhood until things are good again.

Of course to accept the ugliness of reality and the finite ressource of reason- that would be a real blow to all those utopian daydreams. So never gonna happen.
That's a good explanation, thanks.
I suggest the lattitude E7470 or E7480 (if you don't see a laptop as a fashion statement). Light, practical, enough ports (the E7470 has a full Ethernet port) and a boring keyboard (which is what I expect from a keyboard).
There is a distinction between a person reading one page and a scraper reading all pages.

First, the scraper consumes a lot more bandwidth (which some websites might have real trouble with). Second, the aggregated scraped data is a lot more valuable than what any single person receives from reading a few pages.

Websites could (and sometimes do) limit the number of views and the frequency of accesses from the same IP, which allows users to read the page and discourages scrapers without "taking it down".
Except for "Precision of 0.1 + 0.2" which all programmers should know is a floating point fraction arithmetic limitation, not a JavaScript issue.
Doesn't it bother you to be led around by the nose like that?

Apple refuses to open up their dev space, like the worst kind of community citizen, and your response is to support that behaviour?
> If the numbers reported by the machine are nonsensical

The problem is that this is not a sufficient criteria for detection. Presumably a hacked machine would spit out "sensical" counts that are biased to one side, not 99% for one party or something like that. How would you detect that by just looking at a simple sum?

I can't really see how to verify the count without having everyone check that the machine printed what they thought, and having multiple people perform independent counts that must match.

You could have people count later and check that the machine got it right, but then consider the problems that would cause if the media was reporting bad numbers before the official count is finished.
This is interesting as it's Shannon's own writing. There was a recent Medium post listed here on HN about Shannon: "Claude Shannon: How a Genius Thinks, Works, and Lives (medium.com)"

> https://news.ycombinator.com/item?id=14819377
The only way I can think to relate them is (a) FP tends to highlight the importance of value-semantics over all others, (b) non-termination is an effect, (c) FP also, subsequent to a, tends to emphasize control of side effects, (d) in a terminating lambda calculus all evaluation strategies are confluent/equal under the value-semantics, thus (e) laziness is particularly _available_ in a FP language.
Are you implying the only possible solution for that is a women? That itself is very sexist.
Derry vs Londonderry being one. Its interesting how different publications have different style guide rules to handle it as best as possible. I can't remember which it was, but one had that it would always be called Londonderry first, the Derry for the rest of the article/piece.
> They shouldn't have to serve that content to people who aren't actually their users.

So put it behind a password. It's not reasonable to expect to get only the benefits of publicly-searchable data without any of the drawbacks.
React Native Template Design http://www.9lessons.info/2017/03/getting-started-with-react-...
It's not spitefully calling out programmers for being ignorant. It's an invitation for reflection and getting some perspective.
I don't see a problem with that. Market transparency is a good thing, as it allows the market to be efficient.