HNHacker News
TopNewBestAskShowJobs

bijection

1,252 karma · joined September 19, 2014

submissionscomments
bijection··on Show HN: PgTyped – Typesafe SQL in TypeScript and Postgres
If you were willing to give up a bit of magic, you could probably build this as a thin layer over PgTyped.

The API could be something like this:

Query.sql

  SELECT * FROM user LEFT JOIN post ON user.id = post.id
Application.ts

  const results = await Query()
  const nested = nest(results, {
    parentFields: ['userId', 'name'],
    childFields: ['postId', 'title'],
    childName: 'posts'
  )
If you wanted, you wouldn't really have to specify child fields, since they'd just whatever wasn't a parent field. It'd take a bit more work to get it to do multiple levels of nesting, but after a point it doesn't make sense to write queries that return so much duplicate data anyway.
bijection··on In protest of the web{*} bulldozer, a response to websocket port scanning
> Unlike the rest of the technologies, [Websockets] seems to have somewhat of a purpose — even if it’s been made redundant by things like HTTP/2 streams. ... Give it a few months, and there will be some NodeJS fad where everyone wants to re-implement HTTP with WebSockets, and load every asset for their website through JavaScript to save a tenth of a microsecond in some edge case involving tech buzzword bingo. ... Once this happens, disabling WebSockets breaks the internet.

To be fair to Websockets, they've been around for almost a decade, pre-dating http/2 by a few years, and the duplex communication they offer is a fundamental building block for all kinds of stuff, from games to trading websites to chat systems.

Although the Battery API is a different story, the author's point about Websockets seems to be based on somehow having overlooked them for quite a while.

bijection··on Kleroterion
It's interesting that the people being chosen with a kleroterion and black and white dice were called 'dikastes', since the mechanic was literally 'die casting' (as in die rolling, not the manufacturing process).
bijection··on Ask HN: What are the “best” codebases that you've encountered?
The Codemirror codebase [0] is simply written and richly commented, and using Codemirror itself in a project is a pleasure.

Tellingly, Marijn Haverbeke, Codemirror's creator, is also the author of the excellent 'Eloquent Javascript' [1].

[0] https://github.com/codemirror/codemirror

[1] http://eloquentjavascript.net/

bijection··on Iodide: An experimental Mozilla tool for data exploration on the web
I'm pretty sure you can await any javascript Promise!

For example, running `await Promise.resolve(3)` in Chrome's js console prints `3`.

bijection··on Show HN: X-spreadsheet – A JavaScript canvas spreadsheet for web
Although canvas does do grayscale anti-aliasing, this particular app is blurry because the canvas is being rendered at a lower resolution than your screen. To make it crisp, the author would have to set the canvas' javascript canvas.width property to be twice the canvas' css canvas.style.width property.
bijection··on Prevent users registering with passwords from data breaches
Any known password is no longer a particularly strong one.
bijection··on Tries as the evolution of nothing
I think the author means the data structure 'trie', not the action 'try': https://en.wikipedia.org/wiki/Trie
bijection··on A Wikipedia editor's long-running campaign
Why is FiveFilters taking such interest in this particular anonymous Wikipedia editor? This doesn't look like simply an honest piece of investigative journalism, given how far FiveFilters seems to be going to promote this story (https://twitter.com/fivefilters/).

Why doesn't the article disclose the relationship between FiveFilters and Media Lens? The FiveFilters blog (http://blog.fivefilters.org/) mentions Media Lens three times (they've built tools for viewing Media Lens articles) and explicitly thanks Media Lens for making their content go viral.

There's a lot that doesn't quite add up.

bijection··on The Future of JQuery UI and JQuery Mobile
To make that work for all elements of that class, you could rewrite it as

  document.querySelectorAll('.myclass')
    .forEach(el => el.style.display = 'block')
The jQuery is still shorter, but the vanilla js is definitely manageable.
bijection··on Show HN: Cyborg Writer - In-Browser Text Editor with Neural Autocomplete
Thanks for the tip! What OS and chrome version are you using?
bijection··on Show HN: Cyborg Writer - In-Browser Text Editor with Neural Autocomplete
What is it generating for you? (and what OS/browser are you using?)
bijection··on Franchise – An Open-Source SQL Notebook
Thanks! We're looking into it.
bijection··on Franchise – An Open-Source SQL Notebook
Here's the test it currently runs: https://github.com/HVF/franchise/blob/b9b1b8414bbc930f7e1a68...

Basically, it looks for geo-ish column names.

bijection··on Franchise – An Open-Source SQL Notebook
We're hoping to work with the community to add support for new databases. If you open an issue at https://github.com/hvf/franchise/issues we can track Teradata progress there.
bijection··on Franchise – An Open-Source SQL Notebook
We're hoping to add support, ideally with the help of the open source community! You can follow along at https://github.com/HVF/franchise/issues/5
bijection··on Franchise – An Open-Source SQL Notebook
Take a look at https://github.com/HVF/franchise/blob/master/src/cell/visual...

Basically, each visualization is a react widget with some static properties that define its icon / when to show it / etc.

bijection··on Franchise – An Open-Source SQL Notebook
What browser are you using? It's working for me on chrome and safari.
bijection··on Franchise – An Open-Source SQL Notebook
Co-creator here! We wanted

  * A simple, flexible SQL client
  * A notebook interface that lets you drag stuff around and view things side-by-side
  * Query CSVs, JSON, and XLSX documents fully in-browser with Emscripten + SQLite
  * Postgres, MySQL and BigQuery through a local connection bridge. Your data never touches a third party server.
I’ll be here with @antimatter15 for the rest of the morning answering questions!
bijection··on Can we know what animals are thinking?
Is unpleasant existence always better than nonexistence?

Put another way, would you make the same argument if the creatures in question were people?

bijection··on Show HN: TensorFire
At the moment WebDNN only runs models on the GPU in Safari Technology Preview, falling back to CPU on all other platforms / browsers: https://mil-tokyo.github.io/webdnn/#compatibility
bijection··on Show HN: TensorFire
Yes, you are correct! Training benefits much more from available memory through batching and, since in many cases you only need to train once, it usually makes sense to train on beefy GPUs.

TensorFire is useful in situations where you want to perform inference, but you don't want to ship user-supplied data to your servers, either because you would run out of bandwidth, you would run out of compute power, or your users want to keep their data private.

bijection··on Show HN: TensorFire
TensorFire is up to an order of magnitude faster than keras-js because it doesn't have to shuffle data back and forth between the gpu and cpu. Also TensorFire can run on browsers and devices that don't support OES_TEXTURE_FLOAT.

We will probably release it under an MIT license.

bijection··on Show HN: TensorFire
We're still finishing up a few things (documentation etc) and planning on releasing more stuff tomorrow.

You can also sign up for the mailing list if you'd like us to email you when the repo goes live!

bijection··on “Users will only be able to view patents via HTTP. HTTPS will no longer work”
I think that's the maintenance period, after which https won't be available.

Immediately after the maintenance, users will only be able to access Public PAIR through URLs beginning with HTTP, such as http://portal.uspto.gov/pair/PublicPair. Past URLs using HTTPS to access Public Pair, such as https://portal.uspto.gov/pair/PublicPair, will no longer work.

bijection··on [dead]
I think the author is looking for the `.bind` method of the .click function [1], which explicitly specifies which object to use as `this`. Using that their code would be

  document.getElementById("eta-reduced").onclick = listener.click.bind(listener);
Which is a little clunky, but shorten than before. Alternatively, an arrow function would also get the job done:

  document.getElementById("eta-reduced").onclick = e => listener.click();
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
bijection··on Ask HN: Do you have a side project you want to sell?
I have a cute natural language data analysis tool. It turns sentences into pivot tables.

http://omrelli.ug/tables/

It really wants to be wrapped up into some sort of product, but I'm not quite sure what :)

bijection··on The broken promise of Web Components
Also, for whatever it's worth, the js could be written more concisely as

  ['Hello', 'world'].forEach( text => MyComponent
      .appendChild(document.createElement('p'))
      .appendChild(document.createElement('span'))
      .textContent = text
  )
bijection··on Show HN: Distributed Scraper
What output are you looking for? IIRC, Kimono was about creating REST apis — are those sufficiently non technical?
bijection··on As obesity keeps rising, more Americans are just giving up
It may be that that lower income means lower quality food means higher BMI, in which case a BMI tax would exacerbate the problem. Food for thought.
← PreviousPage 2 of 4Next →