skysight-inc/HackerNews huggingface dataset:
Most of the code by volume in this post's final product (and most of the ugliness you're probably seeing in it) comes from dealing separately with the arity of different operations (`compute_operation_with_one_operand`, `compute_operation_with_two_operands`, etc) -- which retains a whole lot of copy-paste-but-change-one-small-thing-in-the-middle boilerplate.

That can be taken further and generalized out.

It's been a while since I did much Python metaprogramming-navel-gazing, but if you can't do something to automatically detect the arity of the operations' lambdas/functions, you can at least explicitly annotate the operations data with their arity -- which is already implicitly being done (as code instead of data) in `compute`'s 3 if-statements + the 3 "compute_with_N_operands" functions.

From there, you'll only have 1 case once, instead of 3 cases with each one manifesting in 2 different places. And just about half of the code disappears.

----

edit: since adjkant already covered the "automatically detect the arity of the operations' lambdas/functions" approach to removing all the cases, (https://news.ycombinator.com/item?id=17329772), here is the gist of what I meant by "explicitly annotate the operations data with their arity":

import math, operator

class rpn_engine:
def __init__(self):
self.stack = []
self.catalog = {"+": (2, operator.add),
"-": (2, operator.sub),
"*": (2, operator.mul),
"/": (2, operator.truediv),
"^2": (1, lambda x: x * x),
"SQRT": (1, math.sqrt),
"C": (0, self.stack.pop),
"AC": (0, self.stack.clear)}

def compute(self, operation):
(arity, op) = self.catalog[operation]
operands = reversed([self.stack.pop() for _ in range(arity)])
return self.stack.push(op(*operands))
write your own version of function.bind()
So, say I break India into North India and South India as different countries, that doubles the visa the people there receive. What changed? How about Breaking India down into a hundred different countries? Did we increase the visas a hundred times?

EU is a unified political and economic entity, with individual states having well defined freedom. Just like a federation. India is like that, so is USA. So, does EU also qualify for a combined 7% cap as a united entity?

Discrimination and limits on the country of birth is such a stupid policy, unless you really think that a person born in Tuvalu should have 130,000 times higher chance of a green card than a person born in India.
A lot of those automations require capital, which only the business in question will be able to provide at a reasonable cost.
Imagine the efficiency gain of delivering packages in the middle of the night, when trucks can fly down the interstate with zero traffic.
Many of the board members of Theranos were retired military officials, which seems especially interesting in the context of how Theranos was originally planning on selling the technology that we now know to be non-working to the military. I recall that the sale was originally blocked by low-level military regulators. Holmes may not have scammed as many people as we thought - the window is open on the idea that some of her funding and support may have proceeded knowing that it was a ball of nothing, in the hope that it could be pushed forward anyway.

[0]https://www.bizjournals.com/sanjose/news/2018/03/14/theranos...
[1]https://www.washingtonpost.com/news/wonk/wp/2015/12/02/inter...
I don't even need a doorway, I can easily forget what I was up to between thinking "need keys" and walking over to where the keys live.

Kind of annoying TBH...
I read this section and it seems that e-mail communication is indeed excluded because of PECR:

> If you intend to process personal data for the purposes of direct marketing by electronic means (by email, text, automated calls etc) legitimate interests may not always be an appropriate basis for processing.

They even prepared a table listing marketing methods and "Emails/text messages to individuals – without ‘soft opt-in’" is marked as "not likely to be appropriate".

By the way, they definie "soft opt-in" like this:

> The term ‘soft opt-in’ is sometimes used to describe the rule about existing customers. The idea is that if an individual bought something from you recently, gave you their details, and did not opt out of marketing messages, they are probably happy to receive marketing from you about similar products or services even if they haven’t specifically consented. However, you must have given them a clear chance to opt out

So there are quite a few (very reasonable) conditions. If I bought something from you and didn't explicitly agreed to receive marketing e-mails, you are not allowed to fill my mailbox with spam.
I've got a patent on a fusion reactor... If my tech doesn't work I wish someone would let me know and save me the trouble of all the hard work to build it :)
And this is why Zcash excites me so much! It's everything Bitcoin is and much, much, more!
It shuts down at the end of this year, and restarts in 2021. During this period the first set of detector upgrades will be installed. Then, it shuts down again at the end of 2023 for the rest of the upgrades before restarting as HL-LHC in 2026. https://project-hl-lhc-industry.web.cern.ch/content/project-...

So it'll be shut down for about half of those 8 years.
Apple’s ARKit
Spent about a year loading and unloading at the Trabue UPS hub in Columbus back in the 90's. Everything you say is true. Unfucking the belt is something that is likely to be strictly a human endeavor for the next 20+ years.

There's no way automate it with the current hub architecture and today's technology. You'd literally have to have a stadium-sized package 'cache' where all package could be unloaded to, some machine vision doohickey to characterize every package, then have a solver identify the idealized load configuration, then picker bots go out and start streaming packages in order so that some high end robot could load the trailer with 90+ percent packing efficiency (which i believe we achieved as loaders getting paid $8/hr).

Then you'd still have to leave the last 8' of trailer space to handle the goats heads and exhaust pipes and all the other crazy shit that people just slap a label on and make someone else's problem. Maybe you could find a way to use air bladders or some kind of encapsulating foam to handle that, but mostly you'd just have to have a floater running from trailer to trailer to load that stuff.

(internet fist bump btw)
I literally did not understand the fundamentals when I started Python (e.g. Dictionaries, triples)
Simple idea, and yet useful for those that need a dashboard to manage the day to day expenses that people generally not find the time to do otherwise.
personally I always always hated operation segregation
You didn't give everyone an equal shot. For some reason, you think a billion Indians deserve the same opportunity as 10,000 Tuvalu residents.
ISO/IEC lists their publicly available standards at the address below.

[1]: http://standards.iso.org/ittf/PubliclyAvailableStandards/
In something like Safari, long press and 3D Touch already do distinct things (traditional right-click-esque menu vs. content peek-pop), which are both useful.

Elsewhere, those visual indicators mocked up in TFA seem pretty good. Probably offend Jony Ive's sensibilities though.
I’m not sure adding 20 more engineers guarantees these problems don’t happen.

There is very little substitute for real experience running a design for millions of flight hours, as the article points out.
Open source does well when companies build commercial products on top of it and then pay the developers.
AHK is good for hotkeys and keyboard/mouse overrides. And maybe some mini window automation.

If the logic grows and automation becomes complex, AutoIt is more suitable.
Would you care to stand-up that ludicrous statement?
Conversely, If the tech does work, I hope someone infringes me and saves me the trouble of all the hard work to build it ;)
America's Former CTO Remembers Historic Coders
To each their own I guess. I for one love studios.
This actually happened to Theranos itself. In the book (Bad Blood by Caryiyou), there is this old genius medical guy who is in a family fued with Elizabeth's family, he hears about Theranos early on in their development, thinks his way through the machine they are probably building, and decides to file a patent on sending remote diagnostic information to doctors. The entire point of his patent was so that Theranos would have to pay him - and he did it purely because he didn't like Elizabeth's family. He never built anything, never made a single swipe of a soldering iron.

She was able to defeat him by getting better lawyers. The book says she was paranoid, but also shows that this is kind of the environment she was in. This kind of abuse of the patent system is normalized within those vaunted halls of power and wealth. Big companies all have their portfolios of questionable patents and the lawyers sort it out in court. She wanted to build her portfolio just like anyone else in that situation. She was obsessed with Steve Jobs... people forget all the crazy patent lawsuits he was involved in, going back to the 80s.
Intro to Quaternion Rotations (with Unity 2017)
dozens of networks already use variable block size caps
And the noise and the poor staff who now has to work night shifts.
Having been using Mac os for a while at work, I can't say it is superior. More supported, but equally as broken as my expectations for any os.

Office suites just don't build for Linux. Mainly because the people buying are not there, I would wager. For personal, I still loathe most.

Games, it's true. But the same situation. Luckily, I don't do 3d shooters anymore. Steam mostly works. Otherwise, most of my game time is on the PS4.
In an idealised world the thousand white swans and 10 black swans will be mixed randomly, and you would be right. In the real world bird move in flocks, the presence of one group of birds frightens off different birds. You may live in the hemisphere with only white swans and never as long as you live see a black one, but just over the hill there is a big population, it just lives in a place you haven't looked. In natural systems observations are biased. You reasoning is based on ideal assumptions.
Makes me wonder if they are developing talent for the next generation or are we gonna have a similar issue as farmers in the US (avg age is like 65)? Albeit the job is more attractive .
Why has beauty failed us? Such mathematical beauty is produced by the conscious mind, and the mind is created (via the brain) from the action of the laws of physics. Perhaps it's because the self-referential circuit Math -> Physics -> Mind -> Math can't exist that Math can't fully explain Physics, and e.g. GR and QM will never be united via a "beautiful" mathematical theory.
Yes, there is a huge difference between the US and Europe. When I buy something from an American company, they immediately try to follow up. I don't blame them, it's business as usual, but it I hate these e-mails because they're a waste of my time. Sometimes they don't even provide an opt-out link. Or, worse, they ask me to change my e-mail preferences.
In Europe we haven't had this behavior for a long time. You always need to ask for consent separately in order to send marketing e-mails after the purchase. The advantage is that the people who opt in are usually excellent leads as they not only bought something for you but are also actively open to further purchases and confirmed that. So I wouldn't say the European system is worse for marketing, it's just different.
This sounds like an urban legend to me. Searching for it doesn't lead me to any credible sources? Especially if you can still get it on Amazon of all places.
> Also it's become exceedingly rare for UPS or Fedex to leave me a slip these days

So they just leave it in the hallway in front of the apartment door?
but at the same time it's significantly less reliable for humans - quite often some or all data from "registers" is lost during the context switch
goo.gl is shutting down, but is being replaced by some sort of Firebase URL shortener which also has an API, and uses goo.gl URLs.
> Open source software seems to do especially well mostly when the end-user of the software product is a programmer/software engineer/IT type.

Yes. The article and the parent regard industrial benefits.

Most of the propriety alternatives that you mention derive a great deal of their value from networked capabilities, made possible due to the proliferation of GNU+Linux on servers.

In this way, the availability of GNU+Linux without traditional copyright restrictions has been a huge boon to the commercial software industry, just as the availablity of printed knowledge without traditional copyright restrictions was a huge boon to various German industries.
Demystifying this.bind in React
Making legalese accessible: how to create friendlier ToS and privacy policies
Algorithms for everyone
At the risk of oversimplifying/getting the subtleties wrong, operators are syntactic sugar to call magic methods. You could still call the magic method itself:

>>> a = 1
>>> a.__add__(2)
3
>>> b = []
>>> b.__len__()
0

It's rare I have to use the "operator" module, and I find Python pretty well thought out w.r.t. consistency. All in all, seems fine to me.
Strings Are Evil
The wasted space costs more than the additional labor to deal with irregular size boxes
>"[Y]et we design open-plan offices around the central theme [...]"

Surely the theme is control and superiority. You go in the cube farm so that someone can control you and remain superior over you. I doubt people do it because they did time and motion studies and found it more conducive to your particular work?
LineageOS introduces privacy control center and android engineering corpus
As a musician, I noticed something interesting: musicians tend to be _extremely_ conservatives. Guitarists, for example: try telling them to use a solid state (transistor) amp, and wait for the instant explanation of why valves are absolutely better. Only very recently have "modelling" digital amps (axe-fx) begun taking place in professional productions, and those are quite simple (compared to ML) DSP processes.
Keep saying but let us know when a real world product can be achieved
Simple, easy to use, and useful. Nice work. It would be very interesting to see stats on how couples choose how their bills are divided.
"CodePush was the main reason why our team went with React Native instead of Flutter."

If so, why not Ionic?
Yep, to be honest I might even want to buy a genuine counterfeit item for some reason. If I see a listing for a counterfeit rolex then maybe that's fine (not legally, but it's not harming the consumer). The problem is when you buy a real rolex and get a fake one.
The truth is that in the alternative timeline where Theranos had a male founder they would never gotten their initial founding.

Holmes and Theranos rode the perfect wave built by the media being thirsty for a young, smart (blonde) female. It's so obvious when you look at it in hindsight.

Hilariously, even after the total collapse this topic is often taboo.

I can't help but feel for sorry for the young women out there creating actually useful innovations.
Sacramento May Ditch Protections for Low-Income Internet Users to Appease AT&T
I disabled everything from Pocket I possibly can when I downloaded and setup Firefox, in the `about:config`. That integration annoys me to no end. Who decided I needed pocket in my browser?
Every single Apple wire I've ever had up until the past couple years have all been trash. Whatever that white coating was only ever intended to look good in commercials. I never had a single wire ever fray on me besides theirs. It seems like they may have finally fixed the problem they've had for a decade since my latest replacement power brick seems to be going stronger than all the other wires, but I am probably just lucky so far
260K workers can provide the capital by investing a fraction of their salary.

A 4K a year on average per worker will provide 1 Billions $ a year to invest in technology to make UPS jobs obsolete.

There's no rule that one person or company should own all the machines that put people out of work, maybe it can be better for everyone if the machines are owned by a large number of private owners. Basically decentralised communism or if you want it to sound nicer, shared automation economy through crowdfunding.
Work on modernizing AutoHotkey's syntax has been ongoing for years, and the v2 alpha makes huge (backwards-incompatible) steps to make the syntax simpler and more consistent.

https://autohotkey.com/v2/v2-changes.htm
In the US pyrex is tempered soda-lime glass.

In Europe PYREX is borosilicate glass.

Tempered soda-lime is better if you drop the object. Borosilicate handles thermal stress better.

I don't think this has anything to do with "The Feds".

https://en.wikipedia.org/wiki/Pyrex
To me, the main controversy is that evolution seems to work too well. Almost as if some "intelligent designer" guided it.
I'm a big fan of first-class functions (or similar) and functional code, but lambdas are in the end just syntactic sugar. Why not just write:

"!": math.factorial,

The lambda wrapper isn't doing anything here.
Inspectors don't really concern themselves with verifying that an invention works. That would be insanely expensive. It's on the inventor to make something work so that they can profit. Although I do think inventors should have some burden of proof that they're effectively using their patent to provide a service to the market that justifies their monopoly protection.
Not always true; only if that vendor uses co-mingling.
Giving someone access to your email is unnecessarily trusting someone, even your spouse in my opinion. Email is used as your identity, there's no reason to give someone that power.
TLS certs issued after Oct 15 must meet Apples Certificate Transparency policy
Should Cryptocurrencies Be Taught in Schools?
I don't recognize those issues.

The two problems I saw were getting it dark enough to sleep (wasn't hard but was a bit of a chore, automated blinds would have helped) and noise from the refrigerator, but that's pretty much it.
What fraction of airplane engines are produced in companies that look like family farms?

If you look at aerospace, the craziest rocket company (RocketLab) looks like it has an average age much less than NASA, with SpaceX in the middle. Which is about what you would expect.
They're probably using JavaScript to submit that to the server. Although it's technically not necessary, it's completely believable that they would use JS for that.
What means no copyright law? Of course we have laws about it.
But they don't learn. They keep running head-first into these obvious blunders. Then they write a contrite sounding blog post, change nothing, and do it again a year later.

https://news.ycombinator.com/item?id=15421708

https://news.ycombinator.com/item?id=15931730

https://news.ycombinator.com/item?id=9876016

https://news.ycombinator.com/item?id=12441519
> As they spend more time watching, the company can collect more data on their viewing habits, allowing it to refine its bets about future programming.

This is a big advantage for Netflix. Live-TV cable companies don't have the same luxury of picking and choosing specific content, as they buy all-in to a single stream of ABC's content, NBC's content, etc. If there's an NBC show you like on Thursday at 8pm EST via Comcast, you know it will be available at 7pm CST in the Midwest via, say, Mediacom. There's not that much wiggle room. Analytics isn't all that useful unless you can deliver specific content, which is exactly how Netflix works.
People tend to get suspicious of nighttime activities in the suburbs and exurbs. I'm not sure that would go over too well. But deliveries to lockers would make sense.
Do you have any suggestions for someone that doesn't know much about the subject but would be interested in learning more about it?

Long-term I'd like to be able to dive into stuff like V8 and actually understand its internals.
Good luck being at someone else's mercy when the problems that are being held together by duct tape come to a head.
Pretty good, this one made me laugh https://i.imgur.com/kZr5kPL.png
How is LibreOffice being stuck in the 1990s a problem? MS Office was essentially feature-complete by Office 95, and LibreOffice does everything Office 95 does. It seems all the major changes since then (Clippy, Adaptive Menus, Ribbon Menus) have no value to experienced users.
She's relatively young and attractive and perhaps possesses hidden talents. Like maybe the ability to charm the pants off (so to speak) of men - especially older, rich, powerful men who were in a position to help move her ambitions along. Also men who may have been somewhat blinded to obvious warning signs of potential trouble.
What is Firefox?
Relatedly, we're screwing up the already nocturnal animals too. Street lights get mis-perceived as sunlight, keeping them in.

We actually started fixing this by switching to sodium bulbs, which was better for humans too, but now with the push to LED, we're undoing the fix that we did, again hurting both the wildlife and ourselves in the process.
Assuming you want to know how the tube works, as a passenger, independently of other systems, then yes.

But if you're building a grand unified model of how London works then not only do you want to be able to abstract certain facets, you also want to be able to combine the models those abstractions create with data points to build a more complex systemic model. You want to look at where the stations are in relation to others, how the different transport networks link, what happens when a tube-train stops - how does the effect ripple through the system and alter what time a particular Pret-a-manger have to restock the sandwiches.

At that point the abstraction in to a simplified system that only describes the tube is useless you need to combine the abstractions to model the entire system - and you may be able to get there, except your model missed out sunspot activity and a bus-driver turned the wrong way because their GPS was marginally out and the Pret-a-manger manager missed the start of the shift and now you have to eat Cheese instead of Mexican chicken.

In short you want your abstraction to be able to construct a model that is as close as necessary for the purpose to the "photorealistic, lifelike copy" of whatever it is you're seeking to predict. If you only wish to predict how many stops you'll need to stay on the tube for then a simple tube map suffices. If you want to predict airflow through the tube system and how it affects heat exchange then a more complex model will be needed, with different abstractions (preserving length of tunnels for example).

If you want to predict everything that it's possible to predict ...

[Disclaimer I've no idea what Pret's menu is.]
Why Hackers Aren’t Afraid of Us
> I'm surprised the industry hasn't collapsed as it did once in the eighties.

These days you have a massive inertial mass of 16 year old kids dragging their parents to Gamestop or to their credit cards and begging them to get them their latest CoD or whatever fix. Parents don't care and the kids don't as long as they can get their fix (and streaming to Twitch isn't broken).
> The "issue at hand" the parent discussed is immigration in general

No. djrogers above literally said that "This is one of the enormous penalties we as a nation have to pay because neither of our political parties actually wants to solve the illegal immigration issue." So unless you want to play games with finding an alternative antecedent for "this", you are going to have to retract that.

What the grandparent poster was doing, and you, is trying to inject a fundamentally unsound and offensive position into the debate by not saying it and instead creating a giant strawman around the issue to preemptively accuse the rest of us of intolerance.

So out with it: what's your common sense fix to this that we're refusing to discuss?