Better HN
topnewbestaskshowjobs
Log inSign up

the_imp

153 karma · joined Mar 17, 2009 (17y ago) · 49 submissions

-
Submissions

comment 2y ago · link · parent

2024 - 1964 = 60

comment 2y ago · link · parent

With Extractors [1] (currently at Stage 1), you could define something like this to work:

    const Integer = {
      [Symbol.customMatcher]: (value) => [Number.parseInt(value)]
    }

    const Integer(counter) = 42.56;
    // counter === 42
[1] https://github.com/tc39/proposal-extractors

comment 3y ago · link · parent

I am left wondering how far down one must go to find row level security.

comment 3y ago · link · parent

Implementing something like an "id" locale is a great idea. Just don't call it that; it's the locale code for Indonesian.

Using a word that's longer than three characters like "identity" will help ensure that it won't conflict with a real locale.

comment 3y ago · link · parent

"You found the Nth highest word score"

comment 4y ago · link · parent

Young's AAA, UK early 00s. They never brought it back. Ye olde sigh.

comment 4y ago · link · parent

When farming tulips, at least you could get pretty flowers from them.

comment 5y ago · link · parent

In JavaScript, use https://www.npmjs.com/package/yaml for this:

    import assert from 'assert'
    import { parseDocument } from 'yaml'
    
    const flowDoc = parseDocument(`[1,2,3]`)
    flowDoc.add(4)
    assert(flowDoc.toString(), '[ 1, 2, 3, 4 ]\n')
    
    const blockDoc = parseDocument(`\
    - 1
    - 2
    - 3`)
    blockDoc.add(4)
    assert(
      blockDoc.toString(),
      `\
    - 1
    - 2
    - 3
    - 4
    `
    )

comment 5y ago · link · parent

I don't understand why US healthcare providers are allowed to charge different customers a different price for the same service or good.

As this is clearly being systematically abused to extract the most wealth from patients and insurance companies, is anyone seeking to require healthcare providers to not provide such variable pricing?

comment 5y ago · link · parent

I've seen 25:00 and even 26:00 being used as times, in Japan.

comment 5y ago · link · parent

I wrote a fully spec-compliant YAML library.

comment 6y ago · link · parent

> Why can't there be an equivalent of stash that keeps track of which parts were added and which weren't?

But git stash does keep track of what it added?

> If switching branches wouldn't conflict with my current change, why do I have to stash/checkout/unstash instead of just doing it?

If your current changes apply to files which haven't changed between said branches, you don't need to stash your changes when switching between them.

> Why can't I pull without fetching?

The command for that is `git merge`.

> Why will none of the 5 or so push configurations just do "push the current branch to the branch of the same name on the remote"?

The command for that is `git push origin HEAD`.

> Why is there no way to stop git from setting master as the upstream every time I do git checkout -b myfeature origin/master?

The option for that is `--no-track`.

> Why do I have to detach from a branch before deleting it?

Because the `git branch` command never changes the working tree, which in this case uses the branch name to identify its location. If the branch were to be deleted without first detaching (or switching to a different branch), stuff would break.

comment 6y ago · link · parent

This was fixed in YAML 1.2, which was released in 2009. Don't blame the spec, blame the applications that use ancient libraries.

comment 6y ago · link · parent

To clarify/correct this a bit, Webpack is not funded by the OpenJS Foundation. Yes, it is an OpenJS project, but the foundation does not provide financial support for open-source development. It does provide legal, marketing, and other support, as well as being able to assist with infrastructure costs, but it's still up to each project to separately run (or not) their own fundraisers and other funding activities.

Also, it would be incorrect to say that the foundations "picks software" such as AMP; instead, projects apply to join. The decision to accept AMP was made entirely without consideration for Google's status as a sponsor of the foundation. And finally, while it may count as splitting hairs, Google retains ownership and control of the AMP cache; it's the core technologies that have been transferred to the foundation, not the instance run by Google that relies on those technologies.

comment 6y ago · link · parent

The Objective-C format strings in the URL would imply that the hash is sent as a path parameter.

comment 6y ago · link · parent

The whole model of needing to own your own transportation devices is flawed.

9/10 times, I'm moving from one location with many other people in it to another location with many other people. I would prefer not needing to own any medium in order to move between them, but instead be able to use a public service to do so. Bus, tram, metro, citybike, scooter. I'd really rather not own stuff with really high capital costs, like cars.

At this point, the only reason to own anything more expensive than a bike is bad city planning and infrastructure.

comment 7y ago · link · parent

> But in the world we live in, YAML parsers don't have security features like this.

I'm the author of the "yaml" npm package, and would be interested to hear more precisely what security features you'd wish for a YAML parser to have. In other words, if there's one I've missed, I'd like to fix that.

https://eemeli.org/yaml/

comment 7y ago · link · parent

Do note that in addition to block collections, YAML also supports the flow collections of JSON, which are not whitespace sensitive. In fact, YAML 1.2 is a superset of JSON, and you can parse JSON with # comments as entirely valid YAML.

comment 7y ago · link · parent

To be clear, both of those issues are just with YAML 1.1. The core schema of YAML 1.2 dropped parsing "no" as true, or (as you mentioned) colon-separated numbers as sexagesimal integers. But yeah, unfortunately a number of libraries that only support 1.1 are still being used.

comment 8y ago · link · parent

The current Finnish solution for this problem is to use one of the two mobile payment services that allow person-to-person payments using a phone number as the identifier:

https://siirto.fi/

https://www.mobilepay.fi/

Admittedly these aren't anonymous as the recipient will get your name and phone number, but the convenience is arguably even greater than what's possible with cash.

comment 8y ago · link · parent

I've put together a Chrome extension that does the same thing, but it requires no permissions and works on all other similar sites as well: Kill-Sticky adds a keyboard shortcut (Alt+K or Cmd+K) that removes all sticky content, and re-enables scrolling.

https://chrome.google.com/webstore/detail/kill-sticky/lekjlg...

comment 8y ago · link · parent

Over the past few months, I've built up a somewhat masochistic relationship with YAML, as I've been writing my own JS library for it [1]. Yes, the spec is more complicated than it ought to be and yes, writing yet another implementation might just mean more overall variance within the spec, but it's still the only config language with decent usage that supports human-readable multi-line strings and comments. And it would've been really nice if someone else had supported editing comments, so I wouldn't have needed to do that myself.

Still, I'm optimistic, especially now that Prettier is getting YAML support. [2]

[1] https://eemeli.org/yaml/

[2] https://github.com/prettier/prettier/pull/4563

comment 8y ago · link · parent

I wrote a small library [1] for localization messages using the new Context API; I'm pretty sure that any other base for it would have made its implementation significantly more complicated.

[1] https://www.npmjs.com/package/react-message-context

comment 8y ago · link · parent

The timing of this (shutdown on 21 May) made me wonder if it's related to the GDPR coming into effect starting on 25 May.

comment 9y ago · link · parent

Not quite. The 25 km/h limit is just for the bike's classification as a "bicycle"; electric bikes that go faster than that just need to get registered and are effectively treated as mopeds under traffic laws.

comment 10y ago · link · parent

Have you considered whether you also need a laptop with a physical caps lock key to do your work? If you do not, then perhaps you do not need to invest in a brand new old laptop right now, but could instead remap your caps lock key to work as escape.

comment 11y ago · link · parent

The data looks like it could lend itself to an approach where you model the error rate based on the prior data (at simplest, get a mean and variance out of it) and then use a Chi-square critical range check to see if the last n (degrees of freedom in the check) measurements are likely to have come out of the modelled distribution. Is that something you've considered?

comment 11y ago · link · parent

> In other countries, if you're convicted of a crime you may have a body part cut off. You may be executed. Or you may simply "disappear". In any of these cases, you're not considered a prisoner.

But are those really the countries you would like the USA to be compared with?

comment 11y ago · link · parent

In addition to email, could you provide an RSS feed as well?

comment 11y ago · link · parent

It sounds like you're describing ES6 arrow notation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
12