Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
lovasoa
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
68 ms
·
331.
▲
Show HN: I created rEg, a new puzzle game
(github.com)
2 points
by
lovasoa
7y ago
|
0 comments
332.
▲
Python Security Challenge
(gist.github.com)
1 points
by
lovasoa
7y ago
|
0 comments
333.
▲
by
lovasoa
7y ago
Here are a few points I think should be taught in high school : - What a file and a file system are - How text, image, video, sound and other kind of data is encoded and stored on computers - What a database is, and how is real-world inform
334.
▲
by
lovasoa
7y ago
No it is not. It is a browser feature that allows rewinding to a previous state of a webpage. There is much more to that than recording and replaying HTTP requests.
335.
▲
by
lovasoa
7y ago
They might, indirectly. If web developers use chrome as their main browser, they test their sites on chrome more, and in the end websites just work better in chrome. And this is what can make a difference in their market share.
336.
▲
by
lovasoa
7y ago
Run it online at: https://repl.it/repls/WeeSlightExams
337.
▲
by
lovasoa
7y ago
This is the kind of things that are a real pleasure to model in Haskell. Here is a nice solution: solve funcs = filter (matches funcs) (possibilities funcs) matches funcs truths = truths == zipWith (($).($truths).flip) funcs [0..]
338.
▲
by
lovasoa
7y ago
I see what you are doing here! Pushing it one step further, one could even do this: https://repl.it/repls/CourteousCreepyAdaware
339.
▲
by
lovasoa
7y ago
> wouldn't any(q[:3]) (the 4th sentence) return true even if 2 or 3 of the above were correct? Yes it would ! > If I understand correctly, it should be true if exactly one of the above is correct, not at least one. In logic, &quo
340.
▲
by
lovasoa
7y ago
Here is a single python statement that solves the problem: print([ q for q in itertools.product((True, False), repeat=6) if q == ( all(q[1:]), # 1. All of the below. not any(q[2:]), # 2. None
341.
▲
by
lovasoa
7y ago
"Bad JSON Parsers" Bad: 0.0006 - Good: 0.9992 "Bad XML Parsers" Bad: 0.9998 - Good: 0.0003
342.
▲
by
lovasoa
7y ago
I added RapidJSON to the tests. It segfaults at 87,289 nested arrays.
343.
▲
by
lovasoa
7y ago
You never "artificially cap it to protect against stack overflow": Most libraries that cap it artificially cap it to a fixed value, that may or may not protect against stack overflow depending on how large the stack already is whe
344.
▲
by
lovasoa
7y ago
My takeaway would be "using the C stack to parse JSON is probably not a good idea", not "accepting an unlimited depth structure by default is probably not a good idea". This limit is entirely artificial, and due only to
345.
▲
by
lovasoa
7y ago
> I can't even conceive of a use case for 100 A serialized trie ?
346.
▲
by
lovasoa
7y ago
Someone just contributed a pull request with results for Jackson in java
347.
▲
by
lovasoa
7y ago
The memory used by parsers that do not limit the maximum depth is still bounded by the size of the input. An application that does not limit the maximum size of its input in bytes is vulnerable, one that does is not. This is completely in
348.
▲
by
lovasoa
7y ago
Would you be interested in making a PR adding the .NET project to travis and the results to the README ?
349.
▲
by
lovasoa
7y ago
fixed
350.
▲
by
lovasoa
7y ago
Well, most JSON parsers (haskell being a notable exception) use an amount of memory that is proportional to the size of the input, independently of whether they can parse deeply nested structures or not. Saying that a parser that does not l
351.
▲
by
lovasoa
7y ago
Most JSON parsers use an amount of memory that is proportional to the size of the input, independently of whether they can parse deeply nested structures or not. A parser that limits the maximum depth of the input can still be made to consu
352.
▲
by
lovasoa
7y ago
Maybe I shouldn't have called this repository "bad json parsers". I just added the following to the README: > The name of this repository is intentionally provocative. It's goal is to document limitations of existing
353.
▲
by
lovasoa
7y ago
Even if serde does indeed use macros, they run at compile time. The limit on macro recursion depth has an impact on what programs do compile, but it has no impact on the runtime behavior of these programs.
354.
▲
by
lovasoa
7y ago
Indeed, I'd love to get pull requests. It's mentioned in the "Remarks" at the end.
355.
▲
by
lovasoa
7y ago
Independently of the backslashes, this is not valid JSON: keys have to be quoted, and JSON uses double quotes, not single quotes...
356.
▲
by
lovasoa
7y ago
I agree the project could use some better documentation. You can run the test with any program by running ./test_parser.sh my_program [arguments] Where my_program is a command that reads json on it's standard input, and r
357.
▲
by
lovasoa
7y ago
Well, in your example, there is a physical limit on how much space is available. In the case of deeply nested json, we are talking about structures that perfectly fit into memory, and could be decoded in a fraction of a second if only a dif
358.
▲
by
lovasoa
7y ago
Exactly. Another example is python's standard library json parser that is documented to throw a JSONDecodeError on invalid input. But if the invalid json contains deeply nested structures, it raises a RecursionError, and this is not do
359.
▲
Bad JSON Parsers
(github.com)
211 points
by
lovasoa
7y ago
|
191 comments
360.
▲
by
lovasoa
7y ago
I liked your trick to iterate on chunks to force the compiler to vectorize the code ! Now that the code is properly vectorized, you can add the `mul_add` function, and this time you'll see a significant speedup. I tried it on my machi
More ›