I wasn't aware until now, that jq is actually a full blown functional programming language. Originally it was inspired by Haskell and the very first version(s) of jq were actually implemented in Haskell. Only later jq got ported over to C. To have an idea how powerfull the jq language is, there is also a jq implementation purely written in jq: https://github.com/wader/jqjq#jq#json
@jamesog thanks for sharing this! I’m going to have to play with it. I have some complex #JSON cases that might really benefit. I also see promise in cases where today I might translate #XLSX to #CSV and then import into #SQLite. Why do all that if I can query the original directly? Awesome!
Adam is worried about what others said on NAS dooming his campaign, while he's said a million things himself on the podcast that will ruin his chances. He sees these problems in others that are exactly what he is guilty of. That old Dutch saying again. He doesn't need god, he needs therapy. But it's ok, even if he loses, he'll claim the election was stolen by aliens and the WEF. And most of his listeners will believe him. Let's just hope nobody gets shot. #ITM#TYFYC#TBPITU#NoAgenda
v1.0 then:
“Perl is kind of designed to make #awk and #sed semi-obsolete […] The language is intended to be practical (easy to use, efficient, complete) rather than beautiful (tiny, elegant, minimal).” https://github.com/Perl/perl5/releases/tag/perl-1.0
@sjfloat@Perl When you get tired of escaping #shell metacharacters in your #awk and #sed pipelines, when you get tired of inventing new ways to pass structured data between small tools as text streams, #Perl is there.
Of course, you can take that last point too far. See #PowerShell or even #jq, where half the “fun” is marshalling between bespoke data structures.
I have advanced the problem along a bit. My current problem is that in all my various directories of screenshot files, I have a metadata.json file I want to extract data from. I want to use the extracted data to build an appropriate "wp media import" command, to feed to WP-CLI.
Here's my dilemma: I don't know jq well enough yet. I've been trying to teach myself about how its filters work tonight, but I'm not quite comfortable enough with it or with bash to work out how to accomplish what I want to do.
Wow my perception of jq as like a grep for json has been changed it is so much more like an awk for json. very cool Thank you @FLOX_advocate and #seagl2023#jq#todayilearned
Ok folks, I decided to work openly on my Community Theatre talk at #SAPTechEd and start writing my notes in the shape of a long-form article. All critiques welcome. Share & enjoy! (And caution: WIP!)
Okay, wrestling with jq and I don't know enough about programming to google this effectively.
I have a bunch of different thingies, and some of them have the key 'heldBy: "Person"'. If I ask it to print "Held by (.heldBy)", the thingies that don't have the key just say "Held by null", and that looks gross. How do I tell jq to only print "Held by (.heldBy)" for each thingy if the key exists, and not print anything if it doesn't?
Proposition de Captcha : demander au visiteur d'écrire un programme en #jq pour un cahier des charges donné (genre, trouver tous les éléments d'un tableau qui contiennent un autre tableau qui contient une certaine chaine de caractères).
Ça élimine tous les robots et tous les humains. Seuls les mutants seront acceptés.
I've previously[1] talked about how stupid #WHOIS is, and while #RDAP is an improvement, it's still really just a bunch of information bits based on (regional) convention.
A human can usually quickly identify e.g., the owning legal entity from inspection of of the data, but good luck doing that programmatically. It's infuriating.
@jschauma Just for fun, here is a #jq script to extract the registrant (but, as you noticed, the biggest problem is in the lack of consistency of data):
This has been a long dream of mine, since I added JSON support in #fs2-data. And it has never been so close to become true: the PR adding support for #JSON queries (think #jq) is ready! It allows for declarative streaming extraction and transformation of JSON data, emitting data as soon as some piece of output has been built, discarding input that has been consumed, on the go. I must admit, that I am super proud of this one! https://github.com/gnieh/fs2-data/pull/426