sigmoid.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
A social space for people researching, working with, or just interested in AI!

Server stats:

575
active users

#json

10 posts10 participants0 posts today

It's time for me to rennovate my digital mathematical library. This library is a git repo (initial commit 2017 april 1) consisting of a "stacks" folder where the actual books and papers are located, along with a series of folders on various topics and subtopics containing symlinks to the "stacks".

I had a "Research" folder which contained various git repos, like "Library", "Teaching", and "Research", confusingly. The inner "Research" has symlinks into "Library". I renamed the outer "Research" to "Math" after living like this for many years, knowing I'd break all the symlinks.

I'm done with using folders for organization in the math library. Instead, I'm manually entering every item in my library into a JSON file which I can peruse in Librewolf in order to find something. I'll be using tags for sorting by topic.

I try to be reasonable when saving stuff, so I only have about 1000 books and papers to sort through.

Continued thread

Consider this replacement to #python awful #json handling

It probably has problems. It definitely has missing features.

But in 20 minutes, it handles all the cases I currently care about that plain json.loads() absolutely falls flat on

#software

(screenshot is for convenience, but if it hides this from #AI all the better)

#python #json handling is incredibly awful

first, there's no built-in way to have it handle the extremely common datetime problem

but worse, it doesn't even really let you do it yourself.

you can use object_hook, but that is only called for a case like this

{"key": "2025-01-01"}

the commonly suggested solution handles the above, but not this

{"key": ["2025-01-01"]}

and worst of all none of these valid json cases results in a call to any hook I can find

"2025-01-01"
["2025-01-01"]

I don't want Yet Another Dependency. I want python's standard library to be useful.

Continued thread

So for #Tcl I wanted to write a #JSON formatter that takes the original data, and specifies how to format it for JSON, given a kind of type specification. Without the type specification there is no way to know if

{
name "Kristoffer"
nickname Setok
onMastodon true
}

is a string, an object, a list, and what each value is (true and "true" are the same in Tcl). Don't let the human formatting fool you! That data could be anything.

In my spare time I did a little #JSON formatter for #Tcl. What's interesting about Tcl is it's basically a completely untyped language, not just dynamically typed (as in JS). So even JSON is kind of too strict a format (for my own projects I used data formatted in a Tcl manner).

123, "123", {123} all mean exactly the same thing in Tcl. Each could be a number, a string, a command, an object reference ... depending on what you use the data for. Quoting is just to escape the data.

Continued thread

We can also ask the "rpgp" CLI tool to emit the same certificate status information in #JSON format:

$ rpgp status --json alice_v6.cert

Please be aware that the rpgp JSON output format is in a very early stage, and may be subject to change!

(At some point I will commit to not changing the JSON format on a whim, but that point is not right now.)

🧵 4/5

If you like #markup languages and related technologies, we have a Discord server where you'd be extremely welcome.

We discuss development of markup technologies, teaching and learning, theoretical stuff, and general tech. We'd love to see you, whether your interest is in #XML, #DigitalHumanities, #LaTeX, #JSON, #Markdown... We should use our collective experience to improve each of our technologies.

(I also just love chatting with other markup geeks!)

If you'd like a server invite, lmk.

#cli: extract structure from a blob of #json data

cat very-large-file.jsonl | jq -r 'paths(scalars) | map(tostring) | join(".")' | perl -ne 's/[.][0-9]+(?=[.]|$)/.[]/g; print' | python -c $'import sys\na=set()\nfor l in iter(sys.stdin.readline, ""):\n if l in a: continue\n sys.stdout.write(l)\n a.add(l)' > schema-like.txt

Capitalism is turning the world into a hijacked JSON document!?

In my latest post I explore how market captialism, like a computer network, is an open system whose users, resources, protocols, and infrastructure can be "hacked."

misaligned.markets/capitalism-

Misaligned Markets · Capitalism runs like a computer (and it's being hacked)Like computer networks, market capitalism rewards actors that exploit gaps created by system and user behavior.