skysight-inc/HackerNews huggingface dataset:
Of course this can be improved and simplified.
Handling 12123123 err checks is a problem of avoiding short circuit failures. That's fine, but you have multiple return values, so there's no reason not to leverage that properly...or even consistently. The whole file is littered with waiting assignment until a comparison, except in some cases or where if and elseif statements use the return values inline but not other places. It's just random.

//checkVolumeSatisfyClaim checks if the volume requested by the claim satisfies the requirements of the claim
func checkVolumeSatisfyClaim(volume *v1.PersistentVolume, claim *v1.PersistentVolumeClaim) error {

// check if PV's DeletionTimeStamp is set, if so, return error.
if utilfeature.DefaultFeatureGate.Enabled(features.StorageObjectInUseProtection) {
if volume.ObjectMeta.DeletionTimestamp != nil {
return fmt.Errorf("the volume is marked for deletion")
}
}

volumeSize := volume.Spec.Capacity[v1.ResourceStorage].Value()
requestedSize := claim.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)].Value()

if volumeSize < requestedSize {
return fmt.Errorf("requested PV is too small")
}elseif v1helper.GetPersistentVolumeClass(volume) != v1helper.GetPersistentVolumeClaimClass(claim) {
return fmt.Errorf("storageClassName does not match")
}

// function here, obviously
err = volumeAccessModeChecks(volume, claim)

return err
}
// Here's the function
func volumeAccessModeChecks(volume *v1.PersistentVolume, claim *v1.PersistentVolumeClaim) error {
// even the naming sucks. DISTINCT case error name
isMismatch, volumeModeErr := checkVolumeModeMismatches(&claim.Spec, &volume.Spec)

if err != nil {
return fmt.Errorf("error checking volumeMode: %v", volumeModeErr)
}elseif isMismatch {
return fmt.Errorf("incompatible volumeMode")
}elseif !checkAccessModes(claim, volume) {
return fmt.Errorf("incompatible accessMode")
}
return nil
}

This whole function is already a separated function from the middle of the file, no reason to stop there. No need for separate files when the function calls are going to be distinct and inline beneath their usage.
> Have you worked in a corporate environment?

I have, and been a consumer of them, and have quit them easily.

> I haven't seen any convincing evidence [...]

I guess I could link a page of companies dissolving due to financial mismanagement vs governments or something. The point is not that only one sector suffers mismanagement, it's how that mismanagement is realized/handled/reacted-to, and of course it doesn't apply to every situation. I just get tired of hearing assumptions like a public service is improperly implemented due to funding, especially in this case where I know many of the municipalities are well endowed and should have the redundancy of their systems questioned. Why not ask for convincing evidence for those statements instead?
Good point. Says 2016 in the site's breadcrumb line.
It feels a bit more natural once you've bent your mind enough to understand what the shell is doing.

The trick is that `test` and even `[` (which is essentially another name for `test`) are ordinary commands, that exist as stand-alone binaries as well as identical-behaving built-ins. They masquerade as syntax, but they're really not. You can even call them from other, non-shell languages:

>>> from subprocess import run
>>> run(('/usr/bin/[', '-n', '', ']'))
CompletedProcess(args=('/usr/bin/[', '-n', '', ']'), returncode=1)
>>> run(('/usr/bin/test', '3', '=', '3'))
CompletedProcess(args=('/usr/bin/test', '3', '=', '3'), returncode=0)

That means that they're not allowed to do anything to variables, because the variables are inside the shell. `test` doesn't see `"$git_branch"`, it only sees the content of the variable.

Per the normal rules, `"$git_branch"` is an empty string iff $git_branch is empty or unset. Leaving the quotes off can do unexpected things, though a lot less so in fish. Using single quotes means you get a literal string, without any substitution.

You're just looking for an empty string anyway, so you might as well use the equality operator instead of digging through the 18 (!) unary flags prescribed by POSIX. So I'd write either `[ "$git_branch" = "" ]` or `test "$git_branch" = ""`. Some implementations support `==` as another way to write `=`, but `=` is standard.

This modularity makes the shell simpler, but it's not exactly sane. I think that providing `[` was a mistake, because it doesn't look like a command, but maybe having `test` as a command is better than having special expression syntax just for these cases.
In areas where cities are dense enough for public transportaiton to make sense, adding a new line does indeed lead to induced demand. For cities that are spread out and unwalkable (read: almost all US cities), public transit isn't efficient enough to move enough people from point A to B, due to A and B being very far away -- never mind the fact that once you get to B, you can't even walk to many destinations due to the city being designed in such a sprawly, pedestrian hostile way.

For public transportation to work, we first need to make our cities denser. The best way of doing this is by outlawing use-based zoning and moving to form-based zoning. That means getting rid of the concept of a "single family zone" and a "commercial zone", etc. and just specifying stuff about the materials and shapes of buildings. It also means outlawing parking minimums. Many cities around the world (and even a few in the US, re: Philadelphia, NYC) have this kind of zoning which allows for much denser development.
Interesting how many things he got right... and while part of his education prediction is right, I feel that much is not better and in fact lost in more recent generations, including my own.

My great grandmother was a school teacher... when I was younger, I remember looking at a 5th grade textbook from when she taught, compared to what I had nearer that time... It was harder than what I saw through H.S. even. It was an english language textbook. There was similar for Math as well.

I think a large part is lost from current american schools where homework is rarely assigned, and the coursework has been watered down rather than asking students to rise up, or heaven forbid more general separation of classes based on ability.
and building trains makes people ride trains. The fundamental rule is path of least resistance, literally and figuratively. It also matters who has the powerful interest.

Seen this?
Taken for a Ride - The U.S. History of the Assault on Public Transport in the Last Century

https://youtu.be/p-I8GDklsN4
Except for the fact that building more roads != more commerce. In fact, roads often DECIMATE the communities they are built through. Ask the rural United States how building a bunch of highways through their towns to the local Walmart has gone for them. Roads for cars are much less efficient for commerce than community oriented walkable streets.[0]

Also, maintaining roads is expensive. Once you build a new road it is politically unpopular to get rid of it. Who really benefits from the new road being built? The businesses that can afford to build a long the new highway and have a massive amount of parking around it. IE: Taco Bell, WalMart, etc. The people road construction businesses the government shovels money to. [1]

We have a CRUMBLING infrastructure in the US, and people are constantly complaining about potholes in major metropolitan areas. And the solution is build more roads? We cannot even maintain the ones we have!

[0] https://www.strongtowns.org/journal/2018/1/16/why-walkable-s...
[1] https://www.strongtowns.org/the-growth-ponzi-scheme
Are you factoring in network effects?

I have lived in Phoenix and Tucson, where the light rail is a joke: they are so short and there's only one line, so you probably don't live close enough for them to be useful and they probably don't take you where you want to go. If there was more light rail, more people would use it, but since so few people use it, there is little incentive to grow the light rail.

Contrast Hudson County, NJ, which has a light rail system that's used heavily, the trains are often full during rush hour. You can use it to get pretty much everywhere (except Union City and uptown Jersey City, which both require a long trudge up the Palisades).
Our government is busted. In many cases, it fails to function at all. Thousands of regulations, which are effectively laws, switch back and forth every time the president changes. Both parties blame the other and some independents blame both parties. We have become, as a society, incapable of forming and abiding to compromises. Our healthcare is a shit show, but it's not nearly as much of a shit show as our government, so we're scared of putting one in charge of the other.
I need to get out of here.
No, you don’t have to purchase a hamburger to earn a living, but you probably have to travel.
Vital ecosystems in tidal flats lost to development and rising sea levels
Elastic demand requires free-flowing masses. I'm quite sure New Yorkers or Londoners would be able to fill as many new subway trains during the rush hour as you could humanly add to the rail network, at least on the sections that are most commonly shared between lines to different destinations.

On the other hand, if the on-ramp of a highway would only let cars through for one minute every 10 minutes (which would be considered a good service interval for any suburban public transit), the demand for roadspace would likely be a bit less elastic. Ditto, if the highway would only go to a set of destinations with no connections.

Motorists can embark on a trip any time, join the highway any time, and take any exit, and continue from there to local destinations. This free schedule suits way more people than fixed departures to fixed destinations using public transit.

Only in a densely built city you can achieve the same: people sharing segments of public transit before diverging to a number of different destinations.
People will also adjust their housing and working decisions based on road availability, although the lag here is a little long.
That "one special edge-case" is easily the most common case by far. Your dismissive attitude towards this is antithetical to the design of user friendly software.

Even when the noob manages to learn that ? is a deprecated but still present wildcard in fish, they'll still be left with the unfortunate reality of being forced to manually quote their urls each and every time, until either fish fixes this or until they switch to zsh (where complaints about url escaping inconsistency don't seem to come up very often at all despite your reasoning.)

Here is an idea to improve the UX that zsh currently offers: use bracketed paste mode and prompt the user whenever they paste something that looks like a URL, asking if they'd like it to be escaped/quoted. y[enter] or n[enter] after the paste is much nicer than remembering to press ' before you paste and then pressing it again after you paste.
Or because the syntax is directly inspired by Ruby.
> a front end using one of the major frameworks (Vue for me), but without even the need to managing it all with node and NPM

This sounds like such an arbitrarily painful limitation I couldn't resist asking: why? As far as I heard, package managers have been regarded by every language as a blessing. Ruby has its Bundler; Python has its pip; PHP has its Composer (and I heard PHP programmers joke that they feel like grown-ups now, when they have modern tools). Why would you deliberately exclude Node, NPM, and the whole ecosystem that it brings to the table?
Or more likely, CenturyLink is now tacking a mandatory $10 "911 robustness and replication" fee to your bill.

Someone's gotta pay for those duplicated systems.
It is a compelling argument for calculating ranges, where the subscript is the offset into the range, which is useful when your data structure has properties like being backed by continuous memory and being passed around as a pointer to the first element. But when treating subscripting as “give me the nth element” it doesn’t really make sense.
Medicare works pretty well. Just expand it.
It also does not apply to .NET Native, Delphi, Ada, Eiffel for example.

On Haskell's case it depends on which compiler backend you are actually using.

So yes, it is a matter of effort spent in the code compilation, specially if the language does support modules.
Outside of defense, which is probably where 99% of it is still done, malware analysis is the biggest area. Some consulting firms will hire some people. Sounds neat and mysterious, but if you want a high paying career, learning C# or Java and grinding leetcode problems is going to be a far better use of your time. (Yes, yes, I'm sure we all "know a guy" that makes millions selling exploits)

Defense burns through reverse engineers as it gets the same type of people that want to make games for a living. Relatively easy to replace them after they leave.
In an arc welder, arcing is the intended mode of operation and any protective devices are set accordingly.

In the protection schemes used on the bulk electrical system, we have very sensitive relaying that can pick up on faults of even milli-amps (remember at high voltage even a small amount of current can dissipate a lot of energy) to detect, for instance, high impedance ground faults or turn-to-turn faults inside a transformer.
It is, yeah. Roads are bad and toxic to the businesses and areas around them. Nobody wants to hang out next to a 4 lane blacktop with cards screaming down it at 60 miles an hour.

It spreads out businesses and makes our cities utilities spending less efficient. The roads need to be maintained, and it is very expensive to maintain them.

https://www.strongtowns.org/journal/2018/1/16/why-walkable-s...

https://www.strongtowns.org/the-growth-ponzi-scheme
I've seen this same thought expressed quite a bit through my ~20 year career. I think the earliest expression of this that I've found was a quote from the 1980s. So, people have been saying this for a long time.

In the early 2000s, I thought they were probably right, because a half-drunk baboon could put together a working application using VB6 (and later, if he sobered up, he could do the same with .NET WinForms). RAD was a real thing, and I thought it signaled the end of the high-salary programmer.

I was wrong.

Looking at modern tech stacks, none have productivity tools that are contextually equivalent to VB6 and .NET's WinForms. So, I think we're still wrong about this prognosis.
The biggest problem with Keynes is a psychological one.

It makes sense to spend more during tough times, but it's a career suicide for a politician to suggest tightening the purse strings when the times are good.

In essence, modern Keynesian politics oscillate between "The times are bad, we have to spend more", and "The times are good, what do you mean we can't afford to spend more".
> When workers can’t afford to live within biking distance of work, then it’s not a viable solution.

This is a catch 22 because the way our cities are designed in America makes them unaffordable. American zoning in most cities prohibits the kind of dense mixed use development that makes low cost housing near work possible. We need to reform the zoning code in most cities and improve bike safety, walkability and public transportation to make headway.
You mean by spending less on tax breaks? Or on mandatory prison sentences for minor offenses? Or on overpriced police and military equipment?

Or do you mean cut funding to services like education, medical care, maintenance to create the appearance of “savings” in the short term, but costing vastly more in the long term?
I have the best insurance money can buy: a plane ticket to %anycountry (business class if needed)

Cost of emergency endoscopic shoulder surgery in a private for-profit hospital in France, when totally uninsured, and paying by credit card: 1900 Eur - including anesthesiologist fee, surgeon fee, facility fee, radiology, drugs, private room etc. So around $2200 total, done the same day, after being arranged by phone. It was in France just because I couldn't do that in Thailand (great hospitals and food, like France, but also great beaches during recovery)

Add plane ticket + out of pocket costs, divide by 12: about $200/month, 0 deductible - and $0 for the years I don't need anything.

Alternative options for the risk averse: purchase local insurance in %anycountry, all inclusive. Cost of health insurance in Europe for non residents: around $70 per month.
Just pay, and get treated in that country if you need it. Of course, you still need the plane ticket to fly there.

Still getting treated abroad is way way way cheaper than the alternatives.

Am I risking it? No. I'm making an educated decision.
In Germany, we have "Verkehrsberuhigte Zonen"[0] (Wikipedia says the english term is "living street"), where the speed limit is very low, and drivers are expected to look out for playing children. It works relatively well, at least in residential areas. Usually such streets are built in such a way you cannot go very fast any way.

[0] https://de.wikipedia.org/wiki/Verkehrsberuhigter_Bereich / https://en.wikipedia.org/wiki/Living_street
There are a few misfeatures in `test`, though.

For instance, one way to use it is

test somestring

to test if "somestring" is empty. POSIX mandates that test with exactly one argument succeeds iff that argument is a non-empty string, to allow that. Fish's test is POSIX-conformant.

Now, that means that

test -n

is true! Which is also triggered for

test -n $var

if $var has 0 elements.

This is a problem and should be improved.
What do you mean by socialized medicine?

If you mean government required and subsidized, like the systems of France and Germany, which have great healthcare systems, that sounds wonderful.

If you mean single-payer healthcare, like Canada and the UK, screw that disaster.
I agree that the government is busted. But from what I understand, one of the two ruling parties is at least somewhat pro-socialized medicine. I do not understand what needs to be compromised about socialized medicine. I struggle with the idea that fear of the government is greater than the desire for universal medical coverage.
TLDR there is a service/good that is useful (point-to-point personal transport) and in high-demand.

This whole notion of "induced demand" seems like a suspicious artificial label used to position roads as a negative. The reality is that roads provide something people want - the ability to get around quickly, on one's own terms, without dealing with waiting times or trip planning, and without some of the unsavory experiences that can sour public transit (e.g. https://www.sfgate.com/crime/article/BART-takeover-robbery-5...).

Building roads doesn't "induce" demand. Rather, it _fulfills_ it. There is a limit to that demand - it's not like supplying infinitely more of something would infinitely scale the associated behavior. There are only so many humans and only so many trips they are willing to make in a day. And an area that is 100% roads obviously would not have any destinations worth traveling to (leaving aside edge cases like race tracks).

So as far as I can tell, this is just regular supply-demand: people want something, and supplying it satisfies that need. Why is this noteworthy except that it lends dubious credence to a narrative Vox likes to push?
Also interesting is that they settled on what would now be called a canard design with the pitch control surface on the front rather than the tail. This is actually a superior arrangement in most cases as both the wing and the stabliator are both generating positive lift. Most conventional aircraft have the center of gravity in front of the main wing, such that the system is dynamically stable (try throwing a dart backward and you'll see what I mean). To control pitch, they then have control surface in the rear pushing down to keep the nose up. In a canard, the CG is still forward of the wing (and the center of lift) but the control surface helps lift the nose up instead of pushing the tail down improving efficiency. This also has an important safety feature in that you can add a couple degrees to the canard's angle such that it will stall before the main wing. In effect, this means the pilot cannot fully stall the aircraft and put it into a spin, it'll simply mush about, descending in and out of canard stall until the control input is relaxed.

Edit: an excellent example of a modern canard would be the Rutan LongEZ and it's accompanying, rather ridiculous, performance numbers: https://en.wikipedia.org/wiki/Rutan_Long-EZ
That's a good idea, but what if you cannot travel because of your health?
It might also be worth starting to let go of the notion that you need 2000+ sq ft and a 1/4 acre yard as a minimum. Roads are effectively a subsidy to that life style (everyone shouldn't be forced to pay for the life style of a few).
If the United States and the Soviet Union flail away at each other at any time between now and 2019, there is absolutely no use to discussing what life will be like in that year. Too few of us, or of our children and grand· children, will be alive then for there to be any point in describing the precise condition of global misery at that time.

A lot of the people I work with are too young to wrap their brains around the idea that the vast majority of people were really scared of nuclear war. They've grown up with a mindset that, in spite of 9/11, war happens somewhere else to someone else.

This is largely because of the success of the military's "fight them over there so we don't have to fight them over here" strategy. But at the same time, it's reduced the notion of war to a video game, and empathy has gone by the wayside.

By 2019, we will be back on the moon in force

Oops.
URL pasting is indeed annoying. That said, second-guessing the user's input is dangerous territory, which is why no shells do what you describe by default.

The way we plan to address this in fish is to make ? an ordinary character instead of a wildcard. Then URLs will have nothing to escape.

You can opt into this change today by setting the 'qmark-noglob' feature flag:

set -U fish_features qmark-noglob

now ? no longer globs.
Ask HN: What is the current best-practice for authentication for Apollo/GraphQL?
Wow, being used to Belgian healthcare... This article really makes America look primitive.

We pay a lot of taxes, but at least I don't have to worry about money, if i would get severely sick.

Eg.

- A checkup at the doctor ( blood) costs 2€, results within 24 hours.

- Additional costs are required upfront by law. If I'm not mistaken, you can't even get an estimate on the US.
I think the name of this medium undermines the discussion.

"Games" instead of the interactive experiences they are

Pretty much any heavy topic has a gamer saying "I think we SHOULD we able to have [this controversial thing] in games!" and it sounds horrible.

From the gamer's perspective it is as benign and intense as reading a book, or watching a movie, but calling it a game, VIDEOgame even - something in the minds of the population as a play thing for children, and coupling it with adult controversial peril - just won't get the message across.

Of course we aren't for censorship in mediums, which means anything goes.

I think the way this topic is framed - primarily due to the name of the medium - has slowed this discussion down.
We used a vendor to put up two MPLS drops to every office. different providers, different routes from the building, etc. Turns out, further up the chain, an ISP was buying transit from another ISP, and they all went on the same shared fiber that a nice backhoe operator found for us, about 800 miles away.
People will do drugs regardless, the threat of jail has, historically, not worked.

What Portugal showed was that punishing them is actually counterproductive.