skysight-inc/HackerNews huggingface dataset:
"It's impossible to chain multivalue functions together to write anything succinctly"

Lua's standard error return idiom is: nil/false, error-string, error-code. The Lua standard library also includes a function, assert, which will throw an error if the first argument is nil/false. The value thrown is the second return value, which in the idiomatic case is the error string. If the first argument is not nil/false, then assert returns the entire list of values.

Thus _you_ can choose the best approach based on _your_ needs. The following are _both_ examples of idiomatic Lua.

Example 1:

local v, errdesc, errcode = foo()
if not v then
if errcode == 1 then
...
elseif errcode == 2 then
...
else
error(errdesc)
end
end

Example 2:

local v = assert(foo())

Example 2 (easy composition):

local v = assert(foo(assert(bar())))

You're not limited to that. Neither assert nor error are specialized built-ins. You could throw a structured object with, optionally, a __tostring metamethod for string coercion; or you could write your own routine that manipulated the values differently. But in idiomatic Lua it's not common for thrown errors to be caught and differentiated, and code usually expects the thrown value to be a string or coercible to a string. If it's thrown it's usually because there's nothing particular that can be done, and so usually it's caught at the boundary of some logical transaction. But Lua allows you put that boundary anywhere, and you're not limited to that idiom. In some cases you want more structured exceptions, and you can have them. But as a module author the expectation is that you preserve the application's freedom of choice, so modules usually return the idiomatic tuple whether or not it's recoverable.

There are some errors that Lua will always throw, like memory allocation failures. These can be caught like any error, and the Lua VM is never put in an inconsistent state. But they're an example of the kind of non-specific error where you normally only catch them, if at all, at some logical transactional boundary--an image transformation in a photo editor, or a client request for a web server. Lua is, notably, one of the few scripting languages where allocation failure is recoverable. And rather trivially recoverable, in fact.

EDIT: error() is a specialized built-in: it's how you "throw" in Lua. But it will throw any value, not just a string.
Reading the comments was brutal. It really makes me think twice about ever releasing software to the public. Sheesh...
So an obvious maybe long term solution here is to eliminate the need for a grid. The transition to battery solar powered homes would reduce the need for the upstream power supply and larger and transmission lines...
Actually my bank/ebanking offered this feature. It also works opposite, so as example if you have less than 1000$ it will automatically move money from a certain account to this account.
Python is high level language while Go is low, system level language (I think it’s fair to say it’s C 2.0). 95% of asciinema codebase is high level code...

I get this sentiment. There's an attitude among golang developers that things which are "trivial" to implement don't belong in the go standard library (even if they would see high usage). That, and Go's animosity toward generic code and syntax sugar make me feel like I'm fiddling with nuts and bolts sometimes.

For example, Go stubbornly excludes a math.Round() function from it's math package because "the bar for being useful needs to be pretty high" (this comment was followed by several buggy implementations of the method[1]). Go excludes integer math functions, and the lack of generics means I have to cast to float64 or write my own implementation everywhere.

Go’s lack of versioned packages and central repository makes packaging cumbersome.

One of the big headscratchers of the golang ecosystem. It's resulted in a million different package managers and ridiculous tools that rewrite all of your imports for you.

My favorite method of managing requirements now is glide[2] which pins all of your dependencies (to a git commit or tag) in a glide.lock file. Glide fetches dependencies into the vendor directory, but you never need to commit your vendored dependencies. Instead, commit the glide.lock file and glide can fetch everything for you.

----

1. https://github.com/golang/go/issues/4594#issuecomment-660733...

2. https://github.com/Masterminds/glide
> How is a middle class family supposed to pay $400/night to rent a room in NY?

If you can afford to take your family to any of the major attractions people want to go to NY for, the additional cost of a NY hotel may be noticeable, but its not going to radically change the affordability of the trip.
These, in turn, ultimately owe their name to the Library of Alexandria:

https://en.wikipedia.org/wiki/Alexa_Internet#Operations_and_...
> Those computers probably won't get into situation like this in the first place, being able to stop or react preventive.

It will always be the case that circumstances can change faster than something with the momentum of a fast moving car could adapt. Somewhere between "you're boned" and "your car saves the day" lies room for a scenario such as this, with potential room for a large amount of thinking.

> Anyway, it will be so rare an occasion with no guaranteed outcome (it's all about probabilities), so it's not really matters as much as it's discussed.

I agree that it will be rare, and that the concern is overblown. That said, "it's all about probabilities" is no reason something can't be vitally important.

> With same kinda of attention you could ask if making and selling ladders is ethical, because people fall from them and hurt themselves.

I think there is a substantive difference between the two. We're not asking whether selling a car that has a chance of injuring the user is ethical - we're fine with that. We're not even asking whether selling a car that has a chance of hurting others is ethical (already meaningfully different than the ladder case). We're asking about the ethical ramifications of making particular tradeoffs in "chance to hurt the user" versus "chance to hurt others". It's an interesting question, so it gets a lot of attention. I don't think most of those involved see it as a reason to prevent self-driving cars - long before the dilemma is really relevant, self-driving cars are already safer than human driven.
"people just staring at me, everywhere"

That happened to me (a white guy) in China. Not in Beijing or Shanghai, but in the "smaller" interior city of Zhengzhou (Zhengzhou has a population of 2.5 million). It was very unnerving at first but having my Chinese wife with me helped alleviate the anxiety.
90% of software developers work outside Silicon Valley
What exactly was dismissive and/or self-righteous about the comment? A question like "Why is hip-hop associated with black people, but not rock?" is 1) absurdly broad, and 2) beyond the obvious parts, so full of nuance that doing it justice in a single HN comment is impossible.

I would also like to add that it's discouraging that someone who is evidently a white American is so ignorant about these things. Not having at least a cursory understanding of "why do black people like hip hop more than rock?" and "why are neighborhoods still racially segregated?" means you probably aren't capable of engaging in any healthy discussion about race in the US.
Whaaaat!? I'd have never thought the combination. But Greeks and Israeli's, huh? So, do you just sprinkle some on one? Put a thin layer over the watermelon piece? How to properly combine them?
Seems like MS is making several big pushes with the electron engine. I actually kind of like the idea.
Location: Portland, OR
Remote: Yes
Willing to relocate: no
Technologies: Ruby, JavaScript, Rails, React, Angular, Node, HTML/CSS.
Resume/CV: http://vcolavin.com/Colavin_Resume.pdf
Email: vcolavin@gmail.com
Literally anything is possible in a contract. Recall that for instance, the Canadian government blocked a RIM sale to China. It's not unreasonable for MV to have a clause in the contract that the winner of the land development bid must agree to transfer restrictions XYZ.
One of the goals of OEIS is to discover when the same integer sequence arises in different mathematical contexts, and to confirm whether it's really the same sequence, which then gives the opportunity to prove why it's the same.

That might be a bit of a narrower domain, but it seems to work out pretty well!

https://oeis.org/
I don’t think low-discrepancy sequences have quite the same kind of structure as these “hyperuniform” distributions. There don’t seem to be any papers which explicitly compare them though, https://scholar.google.com/scholar?q=hyperuniformity+halton
Before 2007, you mean?

Because that's when SICP was deprecated for MIT 6.001. Happily, it's still available: http://web.mit.edu/alexmv/6.037/
Go is far lower level than Python, which makes the term "low level" fine. Its like calling some color swatch "black" then arguing "that's not black _enough_ to be black". Any definition we give for an absolute term like that will be fundamentally arbitrary, but we know right from wrong when we see it.

A language does not have to replace C to be "low level". You sound like the type of person who, thirty years ago, would argue that C isn't low-level because it isn't assembly.
I would love it if there were a keyword to check if an error return value received was non-nil, and then return it and default values for other return types if so.

So:

if x, err := foo(); err != nil {
return 0, nil, err
}

becomes:

x := check foo()

with "check" being the keyword here.
@sctb: Which part of the guidelines do you feel he violated? If it's "Please avoid introducing classic flamewar topics unless you have something genuinely new to say about them", one could argue that offering a link to a rigorous statistical analysis on this topic that come out last week will be new information to many readers.

(responding to Snargorf here since direct reply isn't possible to dead comments)

It was a fine article up until it repeated this Great Lie: "The amount of senseless shootings and beatings by the police towards other people of color is alarming."

It's not necessarily a lie to say that the number of shootings of one group is alarming just because other groups are being shot in statistically equal numbers. For example, I might truthfully say that "the degree of extreme poverty in major US cities is alarming", even if there is also extreme poverty in rural areas, and even if the situation is worse in cities outside the US.

In the context of the article, despite a high level of crime in Jamaica, he seems genuinely worried about the safety of his siblings were they to visit him in the US. Should the new statistical study alleviate his fears? Perhaps, but I'm sure you're familiar with the joke about the statistician who drowned in the river that had an average depth of just 2 feet.

Statistics can be "true" without being universally applicable. Considering that the Bahamas (another majority-black Caribbean country) just released an official travel warning for travelers to the US, perhaps some of his fear is justified: http://mofa.gov.bs/ministry-of-foreign-affairs-and-immigrati...
You're simultaneously wed to copyright because it's here, and arguing against a "right" to repair because it is not. So you're just repeating rationalizations for the current status quo.

For the third time now - copyright and patents presume to create a type of creative product wherein it is not the manufacture of the product that is really being sold to the consumer, but the design of it. A person buys a cell phone not for the plastic and doped silicon it is made of, but ostensibly for the abstract structure of the way that they are arranged.

Since the person is buying an instance of a design, it stands to reason that they should have the ability to service the physical manifestation and otherwise directly interact with that design.

It's not surprising that companies want to have their cake and eat it too - implementing only the half of an abstraction that takes away a consumer's rights while ignoring the second half and leaving them subject to law-of-the-jungle. They successfully wrote law like this for scratched cds, binary software, and DRM. But that hardly implies that their land grab is in the public's interest, appeals to "trickle-down" benefits notwithstanding.
I disagree. These are incredibly complicated issues and no single HN comment could possibly do an incredibly broad and vague question like "why are some neighborhoods black neighborhoods?" or "why does hip-hop exist?" justice -- especially given that this community is not primarily made of qualified experts in the area. Telling the commenter they should really be looking for expert opinions on these topics is hardly dismissive and self-righteous.
The Habitat of Hardware Bugs
There are about 30,000 traffic fatalities per year in the US. If ethical problems come up 0.0001% of the time, then that's one ethically questionable fatality every 33 years. I think the industry can withstand this. Especially when self-driving cars drop the annual fatality rate from 30,000 to 3,000, or whatever it ends up being.
> Batteries included: argparse, pty, locale, configparser, json, uuid, http. All of these excellent modules are used by asciinema and are part of Python’s standard library. Python stdlib’s quality and stability guarantees are order of magnitude higher than of unversioned Go libs from Github (I believe discrete releases ensure higher quality and more stability).

Worth noting that Go has `flag`, `json`, and `http` in its standard library, and they're all much higher easier to use than the Python equivalents. In Python, you unmarshal your JSON into a dict or list and then write a function to convert it into the right object while making sure the structure is correct. With Go, the library does the right thing out of the box.
My experience is with insurance, funds management and telco billing systems.

Although every project is different, as a general rule I prefer to use stored procedures to make changes to the data. The SPs are written to ensure data integrity. Of course, there are some very basic business rules evident at this level but the primary concern is the correctness of data as updated/inserted. I would characterise these as the "data integrity rules".

Each SP encompasses a document, a test suite and the implementation. It goes through the DEV-TEST-UAT-PROD QA - promotion stepwise deployment. I see that as a reasonable substitute for continuous integration.

The OO layer implements business rules. (The SPs are transactional/procedural). I consider the BRs as a lower level business logic. Then the application provides the high level business logic, e.g. validation, workflow, etc.

In reference to your question, I generally end up with three layers, DB, BR (API), BL (app). Technically the DB also has an API, but that is only visible to the BR layer.
See also doFuture[1], an adaptor for the foreach[2] package.

[1] https://cran.r-project.org/web/packages/doFuture/vignettes/d...

[2] https://cran.r-project.org/web/packages/foreach/index.html
That's what I was referring to, yes.
Yes, higher operational costs in the Bay Area - market-rate property taxes, for example, would encourage Google and other large incumbents to grow or relocate employees to more favorable locales, all things being equal. Of course, there could be a specific machine learning expert that the company receiving Bay Area-tied subsidies must have, or a startup they would like to acquire, whose employees refuse to work outside the Mountain View office. By paying market rate rents, these companies would look more closely outside the area and existing office space made available to new players - these new market entrants are paying market-rate anyways. "Triple net" only affects long term leases (usually 20-30 years, often longer) and as the real estate consultants cited by the NYT, usually corporate space is not passed onto the lessee (e.g. they would pay more for the lower tax base). Startups and new mom-and-pop shops suffer (maybe the VC can became a long-vested landlord?).

Good point about local planning departments and equilibrium achieved that way. Decreasing tax revenue with fixed costs (sewage, schools, highway, park maintenance) should encourage planning committees to greenlight more new development or better, zoning rights, to increase tax revenue. But this assumes that the new construction would cover their outgoing expenses (families require schools, and everyone needs transit and police services). Thus, you see only a few luxury condos being added like in the San Antonio shopping area in Mountain View.
The title should have been a dead giveaway to the weight of the article. Does every Basic Income article make it to the top of HN now?
It's scary to think about the damage an actually competent force can inflict in this day and age.
It may be 12% overall, but it's obvious to anyone that downtown Seattle looks nothing like downtown Atlanta. My high school (small town in Georgia) was ~30% black. Which of course was fine with me. I had lots of black classmates from first grade on.

When I got to college in Chicago, though, I was surprised that for most of my fellow students' high schools, black people numbered in the single digits.
> Go forces you to handle the error (or explicitly ignore it).

No, it doesn't. For example: https://play.golang.org/p/jGMmsaorez
Good idea, but someone beat you to it:

http://www.nber.org/digest/sep03/w9873.html
I thought Jamaicans ate cheese on Easter. *

* (saw it mentioned on reddit many many moons ago)
It's not like there's a shortage of available female names. I don't understand their motivations.
I have social anxiety, and I have to admit that one of the triggers my anxiety is teenage and young adult black men.

I feel for this guy and I realize that I'm part of the cause of his problem, but I don't know what I can do about it.
Also, no team below you can ever use -Wdeprecated, and no compiler team can ever test your project with a new compiler, because all of it will break your build.
I thin the real problem is that we've set up only one grid. If we had competing distribution providers, the failure of one network wouldn't matter so much.
Also very relevant:

http://www.theatlantic.com/science/archive/2016/07/music-to-...
Unlike drugs, the products in question here are in themselves evidence of crimes (the acts you mention). Is it really a knee-jerk reaction that selling or "hoarding" such evidence would itself be prosecutable?
I don't think you are being very fair to the poster.

> That is different than assuming you must be an athlete because of the color of your skin (racism).

They could be thinking he plays a sport because of his race, or it could be the fact that he is 6'2" and weighs 240 pounds. Likely it is a combination, and I don't think there is anything wrong with that. We make assumptions based on race because a lot of things correlate to race. I have been 6 feet tall since middle school and was always asked if I played basketball because, well, a lot of tall black kids play basketball. When trying to have a conversation with a person I don't think their is anything wrong with trying to find a topic based on that person's appearance (i.e. clothing, height, weight) why should race be excluded?

> That reason isn't because the color of your skin.

Again, I think it is unfair to just say his feeling that people avoid sitting next to him is not only true, but it is because all those people are distrustful of him because of his skin color. Everyone feels like people avoid at times, an ugly person may thing it is because they are too ugly, a person who just ran a marathon may think it is because they stink. I don't think you should take his feelings as fact.

> how about feeling sad that people are actually victims of racism.

It is unfair to imply he doesn't already feel sad about those who actually experience racism, just because he is sad about something else. You can be sad about multiple things. And I (a black dude) think it is perfectly reasonable to be sad about racial divides that feel as if they are growing year by year.

> A persons skin color is part of their identity, and we should recognize that, but not use that as a way to group, categorize, or otherwise use as the basis for how we behave towards that individual.

I kind of agree here, but I find your statement somewhat hypocritical. You say a person's skin color is part of their identity but you also say we shouldn't group or categorize people based on skin color. You were also unhappy earlier about assumptions being made based on race. It sounds like you can't assume any cultural or societal standards for anyone based on race then it is just skin color, and then I don't understand why you would have a problem with everyone being colorblind, if you don't think race correlates to anything. Or do you think people should just completely ignore these correlations despite their existence, no matter how benign (like being more likely to ask if you play a sport you look like you could play based on physical appearance)?
> In general, exceptions do not work well within async programming.

Exceptions do work well with synchronous programming, which is Go's model.
Great question! A large portion of our infrastructure still runs on Ubuntu Precise, and so the default "supported" options for the kernel on those machines are 3.2 or 3.13. Once you're on newer releases you get 4.x support, at the very least in backports, and at that point I would definitely agree the upgrade is worthwhile.
Multi-WAN and Xfinity and Samba – Part 1 – From Zero to Xfinity
Yeah that's why I say I think it's just a misunderstood thing coming from that tract; meaning over time casual associations of certain food groups now considered "staples" of soul food became less and less understood and discussed along with other aspects of that era of time to the point where foods that were never there to begin with got tossed in, no one checked it and everyone else ran with it.

Take Huey P. Newton for example, I've had plenty of frank, honest and open discussions with individuals who want to tell me everything they know about Huey P. Newton and his "radical-ness" and his "anger" and his "passion" as a Black Panther because of whatever oral tradition they've had passed down to them informing their viewpoint of the man-but it never goes very far beyond surface-level descriptions, and rarer still his philosophies or doctoral essays. Substitute Newton with James Baldwin, Clarence Thomas, MLK, heck even Dr. Cornel West.

I think the same unfortunate blurring of the culinary traditions of Black Americana has happened re: Fried Chicken and Watermelon-thin, surface-level oral traditions passed down time and time again until we got where we are now "Fried chicken, watermelon and purple koolaid" are for good or ill tied into every conversation of "black foods".