skysight-inc/HackerNews huggingface dataset:
Ambiguous

- is used to exclude results

* is a wildcard

There's other search options i.e. for date ranges, "inurl:", "filetype:", and looking for exact string matches using quotes. But sometimes they don't work as well. Try:

"define:-2*2"

"2 * -2 * +2"
When I enter this in the Chrome search bar, it returns the correct answer immediately in the dropdown menu.

When I hit Enter to submit the search, there's a delay while it loads the calculator over my slow connection, then shows the calculator with the correct answer in the display.

No problem.
but searching -200 * 21 gives an instant result.
I don't understan what you mean that you have to "go all the way to the end".

with

if my_data := my_function():
do_stuff(my_data)

the left-hand side of the assignment is completely irrelevant to the if statement. Here you have to go "all the way to the end" just to see what that clause of the if-statement is.

With the as-syntax, the if-statement and the clause are placed together.

However, I do find the if-as sentence kinda weird, when trying to understand it using normal english.
This is not a trade-war issue. This is a long planned review of the Privacy Shield regulation. Even if all trade conflicts ended, this would continue because it is not about trade but fundamental rights.
Telegram protocol is open and the official clients are open source, unfortunately a lot of my contacts still use only WhatsApp, even if Telegram is superior in a lot of ways.
There are lots of large construction projects that overrun their budget, not just for nuclear power plants.

Just check out Berlin's new airport:

Fifteen years planning phase, construction start 2006 with initial estimates of five years construction time. Initial cost estimate ~700 million Euros. Cost estimate at the start of construction 2400 million Euros. Cost estimate five years into the construction 4200 million. Cost estimate nine years into the construction nearly 6000 million Euros... now we're 12 years into construction and still don't have a reliable estimate when it's going to open.

And it's not like we haven't been building new airports for decades like with nuclear power plants.
Where do you see it returning special values? While loops have always stopped on a falsy value.
If you want to learn JavaScript start by writing JavaScript.

This should really be like the first point of every javascript tutorial ever. Honestly.
Since this was posted it came out that Apple's ditching the Intel 5G stuff and as a result Intel killed off the product and the team that was working on it. I suspect nokia was betting on that product because it was 10nm, just because it was a good fit for their product plans.
These seem to be relatively thin wrappers around existing APIs.

A more typical way to read from a file-like object is argumentless .read() to get all content, or iterating over it to get it line by line, but if you're passing an argument to .read you're doing something fairly low-level anyway.

EAFP is already violated in a few cases where it makes more sense. This doesn't add new violations, it adds a cleaner way to work with them.
Something must have changed in the last 2yrs or so since I was last active on the site. The search experience used to be notoriously bad and even non-existent ( If I remember correctly for a while the search box was just a link to a filtered google search). I've also come to look at voting as a negative feature. Nowadays I mostly use twitter for what I used to use reddit for - to keep up with current news. Twitter has its faults but one of its better features imo is being able to read tweets of every different kind of point of view with equal weight, without the filter of upvotes/downvotes by the majority mob.

*edit - I should say, without the filter of downvotes, since twitter has likes which is the equivalent of upvotes.
Can you link to Aristophanes' speech?
What if you need to use the value of 'foo' more than once?
As someone who is not very good with grammars of programming languages, what is wrong with having

if a = b():
foo(a)

I know it doesn't work, but why couldn't it?
Everything is easier with methane and even compressed natural gas has better storage density than liquid hydrogen (liquefied natural gas destroys hydrogen in energy per unit volume).
I think it was meant to mirror the Go syntax? Or maybe they both came to the same decision. Personally I think it looks "wrong" for Python (which has for better or worse always opted for word-based syntax), but I disagree that it's awful.
I will never eat bugs or things made from bugs. Billionaires in silicon valley want to entice you to eat bugs and promote it as environmentally friendly and sustainable while they keep real food supplies for themselves. I will eat them before I eat bugs.
Evolution doesn't optimize for anything but the result are such that, to quote:

> The prevalent genes in a sexual population must be those that, as a mean condition, through a large number of genotypes in a large number of situations, have had the most favourable phenotypic effects for their own replication.
Why should the EU parliament care about that?

Plenty of EU business interests use AWS and Gmail.
Too easy to typo when you mean

if a == b():
foo(a)
The issue is the readBlah() methods. What should they do when they can't read anything? They can return either 0 or an empty result (non-special falsy value), return -1 (special truthy value), return None (special falsy value), or raise an exception. In this case it seems they chose the first option, but this is at odds with something like next(iterator), which similar but raises an exception. It's not clear to me which is the proper pattern anymore, now that they're encouraging assignment.
Welcome to Python, where proponents will proudly claim that the language is easy to read and intuitive.

I was reading the discussion above, where they argue whether a statement like

if (foo := check_foo()):
do_foo()

is readable. The entire time I’m thinking Willis. Tango. Foxtrot! This is the kind of stuff us C / AWK programmers do all of the time precisely because it’s concise, elegant and intuitive (not to mention well understood), and these guys are struggling since it turned into a huge discussion. Made me wonder if we’re in a programming kindergarten here or what?
Foucault is spot on in saying in this day of age we are obsessed with sex and its labels. Sadly I don't see much liberation in the HBQT movement. All those labels are just shackles on a heavy chain of controlling discourse.
This is addressed in the PEP: https://www.python.org/dev/peps/pep-0572/#why-not-just-turn-.... Their argument seems to be that 'if a = b()' is too similar to 'if a == b():' and thus doing that would cause more mistakes, whereas at the moment (?) they are caught by the parser.
Someone needs to run the numbers for a modular chain of wire-carrying drones: if you get rid of the batteries, what length of cable could a drone carry? How much power would that cable be able to transmit, how much of that power would be consumed by the cable-carrying drones? Just how light could we make the power electronics to feed the drones from the (obviously, for weight reasons) high voltage power lines they would be lifting?

If this is possible at all, it could be an important base technology for a very wide range of new application fields.
>debug initial wifi issues myself.

But doesn't that make you better at troubleshooting and fixing problems in Linux -- a useful skill to have?
US and many other countries. It's a sad brag that shows just how low the expectations have come down to.
I agree. This makes me think about the elegant "attached as" syntax [1] of Eiffel:

if attached rawdata.count("\n", i, j) as nlines then
....

[1] https://www.eiffel.org/doc/eiffel/Void-safety%3A%20Backgroun...
no, managers are not stupid, it's just that their incentives are aligned this way

to get you a raise, (s)he needs to do a lot of convincing to their boss, HR, etc - a lot of trouble, really, so they are not naturally inclined. But having offer in hand helps with the process and creates urgency, so they will do it

otoh, to fill a vacancy is most probably a streamlined process which keeps everyone busy and happy (even if its worse for the company as a whole)
Since version 1.13 Docker has a built-in init based on https://github.com/krallin/tini
It is just my feeling that Vue.js is almost like Ember.js, the only differences that Ember.js is more matured?
To be fair, being used to full frameworks such as angular, you think that you have to do it in some kind of vue-way or react-way. I even made the mistake of using a vue-specific HTTP library when I started. Only later I learned that Vue and react give you the freedom to do whatever you want.
Redux is only a little more work/complexity than the "singleton state class" approach but brings a lot more benefits: timetraveling debugger, serialization of the state (i.e. to localStorage to allow multi-tab operation or resume after tab was closed) and separation of pure HTML/Visual Components versus Container components.

Oftentimes beginner would create just a single React component that references the state - which immediately couples the visual parts of your Application to your data, making it harder to introduce automated testing later on. When using the smart/dumb pattern together with react-redux it is very straightforward to come out with a good architecture, that does not mix ui and business logic/data handling.
> the left-hand side of the assignment is completely irrelevant to the if statement

I guess is subjective? To me, that's the first thing I want to know about an assignment -- what is being assigned to? Especially if you try to keep your programs reasonably functional, then it's in fact the thing that matters, since the right-hand side would be side-effect-free.

Another way I see it is that an assignment expression is like solving a problem: first you'd ask "what did they solve for?", then you ask "how did they solve for it?" -- not the other way around.
Hah, nice one.

Where i live (The Netherlands, Europe) you are allowed by law to cancel subscriptions in the same way you signed up. That seems fair... so if you sign up via internet then you can cancel via internet. No more cancel-bullying.
FWIW I agree with this, I missed it the first time around and found it very useful this time.
Played around with this for a minute, interesting find. It seems to trigger a parsing ambiguity, but only for specific forms of that query.

Notably, this doesn't happen for other multiplies I randomly plugged in involving a positive and a negative. 2 * -2 has the same slow behavior as well, but if you remove the whitespace from the query, or rewrite the -2 as -(2) or (-2), it runs fast again.

Removing the white space from the query with the -2 as the first value doesn't speed it up, only adding the parens does.

I think the big clue to what's actually going on is on parses that run in the normal amount of time, Google also returns actual search results. I'm guessing the slowness is coming from the search service timing out, but the calculator service still returns, so you still get a result at all.

Good stuff, thanks for sharing.
18 Million people watched the last England game on BBC One, 3 million watched live on iplayer.

That's the most number of viewers for anything since the 2012 olympics. 1 in 3 people in the UK was glued to their screen watching, and that was the first round. Tomorrows quarter final I'm sure will be even higher.

This world cup is major news for the UK - even for those like me that don't watch football. My understanding is that the BBC coverage is better than ITVs too.

(BTW, the BBC's facilities in Moscow are dwarfed by Fox Sports, and the U.S. isn't even in the competition!)

This is the bbc news page I see. World Cup is below the fold: http://imgur.com/c2mkpAkl.png
Yes. This mistake is very common in C. So much so that it's considered good practice to put the constant first when doing equality comparisons:

if (10 == x)

This way accidentally missing a "=" triggers a compiler error instead of quietly doing the wrong thing.
Can you provide steps to upgrade it via terminal as well as to fresh install the LTS 18.04 version of Ubuntu?
That's partly because the experience mostly is that they don't taste very satisfying. If I ever tasted vegetarian food that satisfied me the same way bacon or beef does, I'd happily eat more of it. Not ever gotten anywhere close, though.

So I don't think it's so much cultural beliefs as it is experience, coupled with exactly the idea that it is "fake", and coupled with a stereotype of smug vegetarian eating food that people don't expect to taste very nice for ideological reasons. It's associated with choosing away nice tasting food, basically.

Reducing the meat content and adding more of various substitutes would probably work a lot better to change habits than trying to get people to pick vegetarian food, and open the door for cutting more later.
There’s a subset of scratch that felt very logo like. My kids (5 and 7 at the time) readily picked it up.

Their hardest struggle was dragging the blocks around with the touchpad. It would have been less frustrating to have a keyboard-based interface I think. (Now that I type this, I realize maybe I should have tried a two button mouse for them.)
Of all the news outlets available, why is Jack Ma's Hong Kong newspaper linked?
jq is a great tool but I wanted something that was more seamless than piping data to jq with a jq script quoted as a parameter. I wanted something where the shell itself could fragment and understand structured data (and not just JSON but YAML, TOML, HCL, CSV, XML, etc - though XML is proving more a great deal more troublesome than I'd hoped).

I'm not suggesting the work I'm doing is any better that jq though - there's a lot of areas where jq will run circles around my shell. I see it more as different design goals but with a fairly large area of overlap.
I think that's a legacy from MacOS Classic, where there was a way of keeping a handle to a file that was independent of the file's name (so you'd still point at the same file even if it was renamed).
The biggest thing this gives, IMO, is the ability to filter on a computed value in a comprehension, and then use that computed value as the result. It's something that's needed quite often if you use comprehensions heavily, and there's no good workaround for it currently (you can use a nested "for" over a 1-element tuple to create a named binding, but it's much uglier, has more overhead, and readability is basically non-existent).
SiliconANGLE – Extracting signal from noise
The parentheses are actually not required: https://mail.python.org/pipermail/python-dev/2018-July/15433...

Why not "as" syntax: https://mail.python.org/pipermail/python-dev/2018-July/15433...

(I'm just pointing to the given explanations for the interested. I'm not necessarily agreeing with them.)
I think BeOS went Palm -> PalmSource -> Access (the embedded web browser people).
Show HN: Medium-like series, but embeddable anywhere
I think this is the issue Relay tries to solve. It basically just allows components to declare which part of the data tree they are concerned about without having to have knowledge about the data that other components need.
I was having trouble earlier, but have tracked it down:

https://thedailywtf.com/articles/Sketchy-Skecherscom

The featured comment at the bottom is from the original devs.

One of the early comments is that it only worked properly on Firefox, which is wrong. IE6+ had excellent, extremely fast XSLT support.

The company I worked for at the time actually had an enterprise app that didn't work properly on FF as it relied on some IE only functionality, some sort of VBScript controls you could embed in IE that I forget the name. They dropped support for them in IE8 or 9. The app was otherwise excellent, basically a sort of dropbox + basecamp for the construction industry before dropbox + basecamp were even made, users loved it. The founding developer was the best developer I have ever known (his quirk was that he'd often forget to rename his functions after prototyping something so a lot of his methods were called Something or Thing or Something2 and we'd have to rename them later to make it clear what they did).

We had a SQL helper that would allow you to write XPath in the SELECT names something like this (I have totally forgotten xpath by now, but hopefully you get the jist):

SELECT c.CompanyId [@companyId], c.Name [@companyName],
o.OrderId [/orders/order/@orderId], o.Name [/orders/order/@name], o.Quantity [/orders/order/quantity]
FROM Orders o
JOIN Company c ON o.CompanyId = c.CompanyId
ORDER BY c.CompanyId

And it would spit out appropriately nested and structured XML like:

<companies>
<company companyId="1" name="thing">
<orders>
<order orderId="142" orderName="Sally's Order">
<quantity>1</quantity>
</order>
<order orderId="156" orderName="Sally's Other Order">
<quantity>1</quantity>
</order>
</orders>
</company>
<company companyId="2" name="different company">
..etc
</company>
</companies>

It was actually pretty nifty, you only got exactly the data you needed for the page, but meant often our business logic was in SQL statements. It did make me realise how infrequently you actually re-use specific data queries and a lot of people over-egg how much data re-use there is or logic sharing that is actually required in a real-world app.

Because you had the XSLT on the page, you could make it dynamic, just post back for the new XML on a drop-down change, button-click, etc.

Another story from there is that they made their own version of jquery just before jquery rose to prominence. It was a nightmare to debug, that fully got me onboard the jquery train.
It makes the intent of the loop less clear, since now the condition is tucked away somewhere in the middle of the body, even though it's really a precondition.
Speaking with a crew member from a NASA simulation of a long space mission
Probably the the style some programming books are written in, e.g. https://www.packtpub.com/virtualization-and-cloud/ceph-cookb... "100 effective recipes"
Why not take a look at the examples in the PEP?
Any reason the landlord wouldn't just build a $13/month policy premium in to the rent and purchase the insurance themselves?
Unlike, say, Facebook, I hate the ads that Reddit presents to me. They're often poorly targeted, or flat-out obnoxious.
I'm trying to figure out why this is a good HN story. Should we care what Terry Gilliam says about anything? Does this comment represent the views of some significant group that he belongs to?

I honestly wish the media wouldn't even publish these kinds of comments, because it's clearly just an attempt to stir outrage. With tens of thousands of major and minor celebrities, at least one of them is going to say something stupid and/or offensive every day. What do we get by covering all of that?
Yes, something like letting your crops get rained on just before harvest can ruin them and make them rot in storage. Although purposefully planting crops with slightly different yield times could alleviate the problem. Currently though crop harvests are a huge rush to get all of it collected as soon as possible because it all tends to ripen around the same time, if a few plants ripened or finished it usually causes surrounding plants of the same species to ripen too.
Totally agree. I'm using bash only for scripts that are at most (say) 10 lines long. More complicated than that, and I'm off to a real programming language.
Kind of a tangent (secant?), and this is a rather broad discussion topic, but is anybody else also worried that the EU is going to lose some of its teeth with Brexit and such coming up? I'm wondering how all these regulations will play out in the next few years if members decide the EU isn't serving their interests. Will serious enforcement take place, or not? Because if not, it seems likely to me that companies might try to "wait it out" and avoid full compliance with regulation for a while, to see what happens.
Privacy shield is just one way to satisfy GDPR requirements for a US business. EU model clauses can be used as well, so it doesn't mean you cannot use US companies any more. The question is if they offer a good enough level of protection if the US government can demand access to data anyway.
So because someone else has it bad, we have to have it bad as well?
Swiss stock exchange is building a regulated platform for tokenized securities
Even though everybody in the company is also a developer we have a set of markdown documents for common tasks. E.g. "Customer want to upgrade from monthly to yearly payment" or "Quarterly cost review". Mostly checklists and links to documentation. The idea is that a new person to the team will be able to perform tasks. Also helps us to agree on processes.
This immediately came to mind. The Morphology and Evolution is near complete. https://hackernoon.com/on-the-infestation-of-small-souled-bu...
We do the people at the same bank get free transfers, it's out of bank ones is ~5$ per transfer. The bank recommended using viewpost which charges at 50 cents/transfer but from their site they say they should not be used for payroll, and require the other side is registered on their network so it isn't just a routing+accounting numbers push ACH transfer.
Technically correct is the best kind of correct ;)
Nice thread, I'm trying to build a poor man's app store for the web at appshare.co , but true , you can't beat mobile apps for performance and native integration with your phone
"-2 * 2" shows the calculator with the correct result.

As others mentions maybe the minus is seen as exclusion parameter. So I tried "-test test" which shows empty results. However searching "-2 2" (without the wildcard, shows an empty map tile with "Map for -2 2", funny.
I can't fathom why it's so popular for Java programs to ship a slew of poorly-tested shell scripts that read environment variables and config files, and transform these into -D arguments to the java command. Why on earth don't they just o that with Java!?
I have but this doesn't answer my question:

Am I wrong to say that a bunch of code that works is changed for no other reason than to exercise the new syntax?
This is also the kind of stuff that you C programmers write bugs with all the time, by mistaking = with ==; to the point where most C compilers these days would just flag something like if(a=1) as a warning with default settings.

Really, all this mess is the legacy of poor choice of = and == as operators back in C (or rather, B). Pascal really had it right with the assignment being very distinct from comparison, such that it's pretty much impossible to confuse the two. The sole reason for that design decision in C, so far as I know, was that assignments occur slightly more often than comparisons, and so they wanted it to be a single character. But I seriously doubt that it was worth all the bugs.
I've heard good things about them, for me right now the payroll takes ~30 minutes or so a month with end of quarter payroll taking a little longer to create the 941 forms.
This is an assignment operator, so why shouldn't it use an established syntax for an assignment operator?
I used https://websiteforstudents.com/upgrade-ubuntu-16-04-lts-to-u... for several servers. Took just 30min minutes.
Indeed, Galileo approached at this problem with the very same thought experiment you're describing (even cited as an example of what a thought experiment is, right in the Overview section).
Is it me or are Americans are more protein-minded than Europeans? Americans talking about health and food will often bring up protein in the first sentence, whereas a European (at least here in the Netherlands) more often will talk about fats, antioxidants, fibers. Protein is almost an afterthought. This is pure anecdotal evidence of course.