I need to dribble out JSON output a few times second, each looking like {stuff}. How should I do it:

[
{stuff},
{stuff},
...
]

or:

{stuff}
{stuff}
{stuff}
...
In other words, a single item that if redirected to a file, would parse as JSON, even though it's meant to be read live. Or as a series of independent JSON objects?
Thanks the twitters! My answer is #2. I changed the option in the code to say "--ndjson-status" to communicate what's going on. Here are the two references people pointed me to:
jsonlines.org
ndjson.org
The "correct" answer would be #1, but there's a whole lot of reasons streaming parsing of JSON is hard (#1), and that many tools are instrumented to deal with line-delimited JSON (#2).

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Robᵉʳᵗ Graham😷, provocateur

Robᵉʳᵗ Graham😷, provocateur Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @ErrataRob

1 Mar
I was wondering where this has been coming from, as discussions of hacks-du-jour seem to mention "cloud" as a solution.

For those readying at home: the idea is nonsense.
The solutions to your problems may involved "cloud" thingies, incidentally, but a cloud thingy is not the solution to your problems. Those pushing "cloud" thingies as the forefront of their solution to your problems, e.g. Brad Smith, are pushing, well, snake oil.
It's like that recent municipal water "hack". Nobody knows what happened, or even if it was a "hack". Yet everyone is promoting their solutions to the problem.

If you are promoting a solution and can't tell me how the hack happened, then your solution to the "hack" is snake oil.
Read 5 tweets
28 Feb
It's always "them" who don't understand, not "us". "We" have the clue, "they" don't.

In fact, it's this person who doesn't understand climate change. That's why deniers exist -- while climate change is real and important, those on the other side still misrepresent it.
It's like being correct that God exists -- and then claiming thus anybody who disputes "indulgences" is a heretic and must be excommunicated as a denier. No, Martin Luther believed in God, he just didn't believe in the excesses of the church.
No, climate change doesn't make everything worse. On average, 50% of changes are for the better, 50% are for the worse. The idea that climate change can only make things worse is so statistically improbable as to automatically be rejected by serious people
Read 7 tweets
28 Feb
One of the things I hate about open-source is the paranoia that this "pull request" containing a useful update to my code is actually a trojan vuln/backdoor. github.com/robertdavidgra…
This sounds like a really useful feature, but at the same time, is enough code I can't simply press the "accept" button to accept the changes.
I'm tweeting about this because there are legal concerns. Whenever I talk to law enforcement, they demand it's my responsibility to verify that contributors aren't just adding code to help illegal activities.
Read 6 tweets
16 Jan
If this sounds like a wackjob conspiracy theory, it's because this is a wackjob conspiracy theory. Signal's source code and algorithms are open. Just because some government departs have given it funding doesn't mean it's a secret plot by the CIA.
Signal uses well-known crypto algorithms. If they are insecure, well, then all cryptography is insecure and it doesn't matter which encrypted messaging app you use.
If there's a backdoor in the code, well, the code is open source and people would be able to find it.
Read 6 tweets
16 Jan
This is why I feel like Winston Smith in the opening of Nineteen Eighty Four, I remember a time when this issue meant something different.
Here's is the "censorship episode" of the show "WKRP in Cincinnati", where you see Andy (radio station program director) argue "free enterprise" against preacher "Dr. Bob Hallier" who is using boycotts to get them to remove music from the radio:
Or, if you prefer a transcript of that scene:
subslikescript.com/series/WKRP_in…
Read 7 tweets
16 Jan
I was an early 1980s Internet hacker. Let me explain why "Bugtraq" is probably the most important achievement in the world of cybersecurity.
Most of what you know of the 1980s hacking scene wasn't Internet, but "phone phreaking" and "BBSs". I don't know much about those things. I was an Internet hacker instead -- on the net since back before DNS was a thing (when 'hosts.txt' was distributed by hand).
By the late 1980s, computers from Sun Microsystems were a big deal. Yet, Sun (and other manufacturers) were immune to notifications of vulnerabilities. Issues had to be handle by tech support, and if you didn't have a support contract, you didn't matter.
Read 16 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!