HNHacker News
TopNewBestAskShowJobs

the_imp

153 karma · joined March 17, 2009

-
submissionscomments
the_imp··on Learning not to trust the All-In podcast
2024 - 1964 = 60
the_imp··on Porffor: A from-scratch experimental ahead-of-time JS engine
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
the_imp··on Explaining the Postgres iceberg
I am left wondering how far down one must go to find row level security.
the_imp··on Lessons From Linguistics: i18n Best Practices for Front-End Developers
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.

the_imp··on Show HN: Can you beat my dad at Scrabble?
"You found the Nth highest word score"
the_imp··on “Harbinger households” consistently buy products that get discontinued (2019)
Young's AAA, UK early 00s. They never brought it back. Ye olde sigh.
the_imp··on Sam Bankman-Fried Described Yield Farming and Left Matt Levine Stunned
When farming tulips, at least you could get pretty flowers from them.
the_imp··on YAML: It's Time to Move On
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
    `
    )
the_imp··on Hospitals lift curtain on prices, revealing giant swings in pricing by procedure
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?

the_imp··on ISO-8601 date format reference not publicly available
I've seen 25:00 and even 26:00 being used as times, in Japan.
the_imp··on Chromium cleans up its act and daily DNS root server queries drop by 60B
I wrote a fully spec-compliant YAML library.
the_imp··on Git is too hard
> 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.

the_imp··on Scientists rename human genes to stop MS Excel from misreading them as dates
This was fixed in YAML 1.2, which was released in 2009. Don't blame the spec, blame the applications that use ancient libraries.
the_imp··on How to pay your rent with your open source project
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.

the_imp··on Catalina is checking notarization of unsigned executables
The Objective-C format strings in the URL would imply that the hash is sent as a path parameter.
the_imp··on Lime shuts in 12 markets, lays off around 100
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.

the_imp··on JSON as configuration files: please don’t (2016)
> 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/

the_imp··on JSON as configuration files: please don’t (2016)
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.
the_imp··on JSON as configuration files: please don’t (2016)
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.
the_imp··on On Cash
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.

the_imp··on A browser extension to make Medium more readable
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...

the_imp··on YAML: probably not so great after all (2017)
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

the_imp··on Migrating to React’s New Context API
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

the_imp··on Cluster and app management services in Docker Cloud are shutting down on May 21
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.
the_imp··on The Electric-Car Boom Is Real
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.
the_imp··on Images of New MacBook Pro with Magic Toolbar Leaked in MacOS Sierra 10.12.1
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.
the_imp··on Outlier Detection at Netflix
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?
the_imp··on Policing, Mass Imprisonment, and the Failure of American Lawyers
> 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?

the_imp··on Show HN: Get pinged when standards hit 90% browser support
In addition to email, could you provide an RSS feed as well?
the_imp··on JavaScript's world domination
It sounds like you're describing ES6 arrow notation: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
Page 1 of 2Next →