HN user

Silphendio

33 karma
Posts0
Comments34
View on HN
No posts found.

JSON 5 is pretty good. It just needs to make the top-level brace and all commas optional, and add proper support for multi-line strings (writing '/n/' at the end of every line doesn't count).

Allowing only valid JavaScript identifiers to be unescaped keys is also a bit quirky (You have to quote reserved keywords).

But they will never change any of that because it would break JavaScript compatibility.

I think the problems with big network were diminishing gradients, which is why we now use the ReLU activation function, and training stability, which were solved with residual connections.

Overfitting is the problem of having too little training data for your network size.

I find json5 much better than json, but it has still many of the same annoyances.

- instead of trailing commas, how about making them completely optional? It's not like they are needed in the first place.

- curly braces for top-level objects could be optional too.

- For a data exchange format, there should really be a standard size for numbers, like i32 for integers and f64 for floats.

- parsing an object with duplicate keys is still undefined behavior.

Popover API 2 years ago

How useful is such a feature in reality? On smaller devices, the web brower almost always covers the whole screen, and even on big monitors, it usually touches at least one corner.

You mean searching for keys?

  $..book[?@.price<10].title
Yeah, I don't think javascript has that function in the standard library. Writing one is not super complicated, but having to put that into every file (or importing it) is not ideal.
  find_key = (data, key) => {
    if(data instanceof Array){
     return data.map(x=>find_key(x, key)).flat()
    }
    if(data instanceof Object){
     let res = Object.keys(data).map(x=>find_key(data[x], key))
     if(data.hasOwnProperty(key)){
      res.push(data[key])
     }
     return res.flat()
    }
     return []
   }

  find_key(data, "book").filter(x=>x.price < 10).map(x=>x.title)

JSON Path:

  $.store.book[?@.price < 10].title
Python:
  [x['title'] for x in data['store']['book'] if x['price'] < 10]
Javascript:
  data.store.book.filter(x=>x.price < 10).map(x=>x.title)

It's worth noting that Stable Diffusion XL uses the OpenRAIL++-M License, which removed the update obligation.

Matplotlib isn't very friendly to casual users.

For even the simplest possible plot, I have to create a subplot and axis.

Sometimes I'd like to just plot a function. I don't want to initialize arrays for that.

It's easy to forget that I have to `import matplotlib.pyplot`

I don't need to plot things often, but whenever I use matplotlib, I always have to spend a few minutes to look up how to use it.

I really hate this article. They compared training ChatGPT to actual copy&paste sites without any supporting argument, complained about how much money OpenAI is making without paying them, and finished with blaming generative AI for the declining quality in Google search results.

It depends on the kind of game he wants to make.

If it's about 3D scenery or physics, I would recommend Godot. Just import some 3D models, place them into a scene, add lights and physics, and you need very little coding to have a simple 3D game. You can add complex logic and UI later on.

If the focus lies on UI, NPCs, combat, or inventory, I would recommend GameMaker instead. It's 2D, but it's made for that kind of stuff.