charlesdaniels

Joined 8 years ago

Karma
918
Submissions
171
Member since
Mar 17
http://cdaniels.net
View on Hacker News

Recent submissions

Comment · 7 months ago
If we're plugging jq alternatives, I'll plug my own: https://git.sr.ht/~charles/rq

I was working at lot with Rego (the DSL for Open Policy Agent) and realized it was actually a pretty nice syntax for jq type use cases.

Comment · 2 years ago
Wow, didn’t realize it had enough legs for people to be hearing about it except via me! Awesome to hear that.

Rego is “for” those authz cases like the ones you mentioned in the sense that it’s definitely designed with those in mind, and I do think it does a good job for those needs. OPA itself is definitely geared for use as a microservice or container sidecar, talking over the wire. That’s kinda hard to use in a shell script though.

Once I learned it I found myself using opa eval for searching and transforming data, eventually so much so that I made a shell script called “rq” that was basically opa eval -I -f pretty… the rest is history.

Comment · 2 years ago
What's better than 1 nifty tool for querying semistructured data?

2 nifty tools for querying semistructured data!

Comment · 2 years ago
I have been working on a project in a similar vein: rq[0]. Mine started out as an attempt to make a jq-like frontend for the Rego[1] language. However, I do find myself using it to simply convert from one format to another, and for pretty printing, quite often.

The interactive mode that qq has is really slick. I didn't torture test it, but it worked pretty smoothly with a quick test.

I see that the XML support is implemented using the same library as rq. This definitely has some problems, because the data model of XML does not map very cleanly onto JSON. In particular, I recall that I had problems using mxj to marshal arrays, and had to use this[2] ugly hack instead. qq seems to have done this a little more cleanly[3]. I may just have to lift this particular trick.

I definitely found CSV output to be challenging. Converting arbitrary JSON style data into something table shaped is pretty tricky. This[4] is my attempt. I have found it works well enough, though it isn't perfect.

I can also see that qq hasn't yet run into the byte order marker problem with CSV inputs yet. Might want to check out spkg/bom[5].

One final breadcrumb I'll drop - I drew a lot of inspiration for rq's input parsers from conftest[6]. That may be a good resource to find more formats and see specific usage examples of them.

Thanks for sharing! It's really interesting to see some of the convergent evolution between rq and qq.

0 - https://git.sr.ht/~charles/rq

1 - https://www.openpolicyagent.org/docs/latest/policy-language/

2 - https://git.sr.ht/~charles/rq/tree/c67df633c0438763956ff8646...

3 - https://github.com/JFryy/qq/blob/2f750f04def47bec9be100b7c89...

4 - https://git.sr.ht/~charles/rq/tree/c67df633c0438763956ff8646...

5 - github.com/spkg/bom

6 - https://github.com/open-policy-agent/conftest

Comment · 3 years ago
Comment · 4 years ago
There isn’t consensus on who the sea people were.

You might be interested in the book “1177 B.C.: The Year Civilization Collapsed” by Eric H. Cline, which covers what we know about the pre-collapse civilizations as well as the collapse itself. It’s very fascinating, though it seems a lot of the details are simply lost to time.

Comment · 4 years ago
I feel like requiring users to enter into a legal agreement with a private third party in order to perform legally required obligations for a government entity has some troubling edge cases.

What happens if a user has a dispute with ID.me, who decides to terminate their account for violating their ToS? Something tells me they will still be on the hook to pay their taxes (presumably via paper, for however long that's still supported).

Comment · 4 years ago
Comment · 5 years ago
Comment · 5 years ago
I don’t see why sixels couldn’t work. You’d probably want a tool to decode them, diff the images, and then output another sixel image. I’m admittedly not sure of such a tool existing off the shelf though.

I’m not aware of text editors supporting sixels, which could make preparing the tests a challenge. Certainly, you could imagine a text editor supporting them, but I’m not aware of one that does personally.

I will concede that for your specific use case, an off the shelf ASCII plotting library probably involves less custom tooling.

Comment · 5 years ago
Comment · 5 years ago
Personally, I have never used any of these features.

I'm not even really sure what "Expanded Dark Mode" is.

DOH is probably good for many people, but I prefer to run my own DNS server (and I VPN back into my LAN when not at home with WireGuard).

Comment · 5 years ago
The only BlackBerry I ever owned was the BlackBerry Classic, back when that was still contemporary. Best phone I ever had. The UX was very consistent between apps, everything targeting it natively tended to be quite speedy, and the keyboard was excellent.

I also miss the "BlackBerry Hub" feature, which would aggregate your emails, BlackBerry messenger messages, and SMS messages into a single UI. It even pulled in notifications from Android apps, though opening them switched to that app rather than letting you reply in-line.

I bought mine after they had already released Android compatibility for any APK you cared to load, but unfortunately I think that feature was too little, too late.

I've been on an iPhone SE since around 2016. If I had the option to go back to using the BB Classic hardware/OS as it was when I switched, but with third-party app support and security updates, I would do it without second thought.

Comment · 5 years ago
Comment · 5 years ago
> Unless several topics can be assigned to a person (which seems to be implied in the article), in which case that's 256 bits of entropy available to classify each person.

Good catch, forgot this was a bit-vector not a single key.

> Yeah, well theoretically you could. But that assumes that browsers are able to extract and balance some very arbitrary and very specific information from the browsing habits of all people on earth in a perfect decision tree.

Not really, people have found in the past that combinations of user agent, screen resolution, installed fonts, installed extensions, and things of that sort can come very close to uniquely identifying individual people.

> Though I think you are absolutely correct that in practice the number of bits to build up a classifier able to uniquely classify each person must be pretty low. Maybe a few hundreds.

Exactly. It might not narrow it down to one person, but perhaps a relatively small pool.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton