HNHacker News
TopNewBestAskShowJobs

charlesdaniels

918 karma · joined March 17, 2018

http://cdaniels.net
submissionscomments
charlesdaniels··on A Faster Alternative to Jq
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.

charlesdaniels··on Show HN: Qq: like jq, but can transcode between many formats
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.

charlesdaniels··on Show HN: Qq: like jq, but can transcode between many formats
What's better than 1 nifty tool for querying semistructured data?

2 nifty tools for querying semistructured data!

charlesdaniels··on Show HN: Qq: like jq, but can transcode between many formats
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

charlesdaniels··on Clipboard: Cut, copy, and paste anything, anywhere, all from the terminal
I wrote a wrapper around these some years ago which I’ve been using since. It’s been working pretty well for me.

https://git.sr.ht/~charles/dotfiles/tree/171c95a20394552e02a...

charlesdaniels··on This is How Civilisations Collapse
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.

charlesdaniels··on IRS Will Soon Require Selfies for Online Access
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).

charlesdaniels··on Ask HN: What are these low quality “code snippet” sites?
I wonder if we'll see a comeback of hand-curated directories of content? I feel like the "awesome list" trend is maybe the start of something there.

I would be willing to pay an annual fee to have access to well-curated search results with all the clickbait, blogspam, etc. filtered out.

Until then, I recommend uBlacklist[0], which allows you to hide sites by domain in the search results page for common search engines.

0 - https://github.com/iorate/uBlacklist

charlesdaniels··on Using ASCII waveforms to test real-time audio code
> That's a protocol that's a good forty years old

34 years old, actually. I guess we can go ahead and deprecate the x86 instruction set, tcp/ip, ASCII, C, tar, and many other tools and standards that are old.

> and even that is not supported.

xterm supports vt430 emulation. I use this semi regularly. I believe mintty also supports sixels, plus a handful of others. The libsixel website has a full list.

> And I can see why, why on earth would you want to be adding support for that in 2021?

You might want to read your own post ( https://news.ycombinator.com/item?id=28856005 ).

What’s your great idea as opposed to sixels?

charlesdaniels··on Using ASCII waveforms to test real-time audio code
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.

charlesdaniels··on Using ASCII waveforms to test real-time audio code
I would point out that sixels[0] exist. There is a nice library, libsixel[1] for working with it, which includes bindings into many languages. If the author of sixel-tmux[2][3] is to be believed[4], the relative lack of adoption is a result of unwillingness on the part of maintainers of some popular open source terminal libraries to implement sixel support.

I can't comment on that directly, but I will say, it's pretty damn cool to see GnuPlot generating output right into one's terminal. lsix[5] is also pretty handy as well.

But yeah, I agree, I'm not a fan of all the work that has gone into "terminal graphics" that are based on unicode. It's a dead-end, as was clear to DEC even back in '87 (and that's setting aside that the VT220[6] had it's own drawing capabilities, though they were more limited). Maybe sixel isn't the best possible way of handling this, but it does have the benefit of 34 years of backwards-compatibility, and with the right software, you can already use it _now_.

0 - https://en.wikipedia.org/wiki/Sixel

1 - https://saitoha.github.io/libsixel/

2 - https://github.com/csdvrx/sixel-tmux

3 - https://news.ycombinator.com/item?id=28756701

4 - https://github.com/csdvrx/sixel-tmux/blob/main/RANTS.md

5 - https://github.com/hackerb9/lsix

6 - https://en.wikipedia.org/wiki/VT220

charlesdaniels··on Firefox Browser: best for a free web
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).

charlesdaniels··on Ask HN: Do you still miss your RIM BlackBerry?
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.

charlesdaniels··on Fun with regular expressions: part I
Regular expressions, deterministic finite automata, and nondeterministic finite automata are all equivalent[0][1].

All three of these representations are capable of describing any regular language (set of symbol sequences, or more intuitively a set of strings), and the fact that a language can be described by an NFA, DFA, or RE implies that it is regular.

I am not hugely familiar with Pearl's "extended regular expression" system, however I was under the understanding that the set of languages it can recognize is a superset of the set of all regular languages. Based on [2], it would appear that Perl regexes can recognize all regular languages, and parts of the set of all Turing-recognizable languages.

0 - Introduction to the Theory of Computation 3/e, Michael Sipser, Thm 1.39, pp. 55.

1 - Introduction to the Theory of Computation 3/e, Michael Sipser, Thm 1.54, pp. 67.

2- https://www.perlmonks.org/?node_id=809842

charlesdaniels··on Google considers switching FLoC to a topic-based approach
> 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.

charlesdaniels··on Google considers switching FLoC to a topic-based approach
At the end of the day, even if you assume good faith on Google's part (which I think is quite a leap), causing the user to present more entropy to the site will make them easier to fingerprint.

256 topics would be ceil(log2(256)) = 8 bits of entropy

30,000 topics would be ceil(log2(30000) = 15 bits of entropy

As a reminder, there are ~ 10 billion people on earth, so if you have 34 bits of entropy or so, you can uniquely identify each person.

So really, the way to think of this as "Google considers making FLoC 20% less effective at fingerprinting users", and that's not even considering other sources of entropy, like user agent or screen size.

charlesdaniels··on Google now shows why it ranked a specific search result
I have found uBlacklist[0] works very well for this purpose.

0 - https://addons.mozilla.org/en-US/firefox/addon/ublacklist/

charlesdaniels··on Replit used legal threats to kill my open-source project
Try It Online[0] seems to offer a very similar service - if you don't care about the collaboration aspect of it. It claims to be self-hostable[1].

glot.io[2] is another, which seems to fit more in the realm of "pastebin with runnable snippets".

As I understand it, a big sell of repl.it is that they have some kind of collaborative editing support, which none of the alternatives I was able to find in a few minutes of digging have. Google Colab has this, but only support Python (AFAIK) and is not open source.

0 - https://tio.run/#

1 - https://github.com/TryItOnline/tiosetup

2 - https://glot.io/

charlesdaniels··on Firefox Release 89.0
Can't say I'm a fan of this. The new redesign looks dreadful; the weird floating tab button thing looks like a UI toolkit bug or maybe someone trying to fake tabs using buttons, rather than an intentional design choice. As other commenters have noted, there is also now no visual distinction between open tabs (tab separator is gone) - how is the user meant to tell that the non-open tabs are even intractable UI elements, let alone distinct from each other?

The menus and omnibar look the same to me though, for better or worse.

It seems like FF is getting worse with every release. Who thinks the changes (read: regressions) over the past few versions are a good idea? Who is the target audience of FF?

charlesdaniels··on Florida will fine social media companies that bar candidates
Discussion thread for the NY Times article: https://news.ycombinator.com/item?id=27268418
charlesdaniels··on Magic Wormhole: Get things from one computer to another, safely
Agreed. Especially on iOS, there isn’t really a convenient way to do this. I’d love something that uses an ssh key pair to accept files from the “share” dialog and have them end up in ~/Desktop. I tried hacking something with Shortcuts, but couldn’t get it working.
charlesdaniels··on Show HN: Litmaps – Visual Research Discovery Tool
This is a really cool idea! I have wished for something like this for a long time. Glad to see someone built it.

Sadly however, it seems that the .bib file I get from Zotero isn't supported, since it claims to have found 0 articles in it, despite the fact that I have verified those articles show up when searching for them directly.

Edit: TIL that you can also get a .bib file from the "export items" button, as well as from "create bibliography from items". I had been using the latter. It seems that Litmaps only works with .bib files created using "export items".

charlesdaniels··on Mozilla plans to remove the Compact Density option from Firefox's Customize menu
> Citation definitely needed. This is worded without precision, you could claim "work as well" to mean nearly anything. Do you have specifics, with data? Performance? Functionality? Features? DRM? What is it? I haven't encountered any broken web sites with desktop Firefox. But, I also don't look at all the internet, so I'm curious - what's broken?

Mostly JS-heavy sites by big companies. But yes, I admit that I don't have hard data to back this claim up.

> What alternatives are there? Chrome is a no-go, Brave is off doing it's URL redirect and bitcoin weirdness (that I don't need in a browser) Edge is just Chrome. There's some de-googled Chrome options and I guess some weird special-build Firefox options, but really, out of all the options I see, FF is best for me.

Un-googled chromium is one. I suppose that I trust Mozilla marginally more with my user data than Google.

But yes, I agree, the browser landscape is pretty lousy right now.

> I'm not changing because they moved one tiny feature used by a very vocal minority, and it's a mistake to assume that FF has no value or no "sell".

I perceive this to be the continuation of a trend.

I think FF still has value for now, but it seems like that value is pretty quickly dropping - as a piece of software, if not from a philosophical perspective (supporting the open web and all that).

charlesdaniels··on Mozilla plans to remove the Compact Density option from Firefox's Customize menu
I have noticed this trend across many different applications/toolkits. In Linux land, GTK is an especially bad offender.

Desktops tend to have high-precision pointing devices. It is wasteful of space to make big, touch-friendly buttons. Many web apps and GTK programs that follow this trend are barely usable on my laptop (1366x768 display).

A good UI toolkit should support adjusting the size of the UI elements according to what platform is being used. In an ideal world, I could just set some kind of scale factor and have all my applications respect it. Then the people with touchscreens can be happy, as can the people with mice.

I guess from the perspective of commercial software, it's cheaper to write one UI and have it cater to the lowest-common-denominator. What I don't understand is why these design trends have become popular in the open source space.

charlesdaniels··on Mozilla plans to remove the Compact Density option from Firefox's Customize menu
I feel like it would be even worse on a smaller display where screen real-estate is at a premium. I am fortunate to be able to afford (relatively, compared to most of the world) high end computer equipment where wasting pixels is not as problematic as it might be for someone with less resources.
charlesdaniels··on Mozilla plans to remove the Compact Density option from Firefox's Customize menu
I use this feature. On a large monitor, Firefox wastes quite a lot of space with the default layout. To be honest, I wish there was an option to make it more compact than the "compact" layout. There used to be an XUL extension to do this, before XUL was killed off.

Seems like every time I see coverage about Firefox, it's Mozilla removing or crippling some feature I care about.

Why bother using FF at this point? Most sites don't work as well, and Mozilla seems actively hostile to my use case. If I'm going to use a browser that is hostile to me, I may as well get better website compatibility out of the bargain.

Not surprised their market share keeps shrinking. At this point, what's the sell?

Edit 1: worth noting, there is a lower-down comment thread[0] with relevant links - Mozilla does not care if you like this feature.

0 - https://news.ycombinator.com/item?id=26464973

charlesdaniels··on Reddit: Online Presence Indicators
Personally, I have found that even old.reddit.com is pretty much unusable these days, to say nothing of the horrible new mobile site, which for some reason is also the desktop site.

I have found Teddit[0] is much more usable, and much less privacy-invading. Of course Teddit does not allow posting or commenting though, so depending on your use case it might not be suitable.

0 - https://teddit.net/about

charlesdaniels··on Lyra audio codec enables high-quality voice calls at 3 kbps bitrate
This reminds me of a technology in Vernor Vinge's "zone of thought" series. I think they called it "evocations", where at the beginning of a call, a model is transmitted that allows the other end to re-construct what the sender would look/sound like from severely abridged data. It sure sounds plausible - the semantically meaningful parts of a conversation (video or audio) would appear to have significantly less entropy that all of the details captured by a mic/webcam. The fact that things like JPEG and MP3 exist are proof enough, and those (to my knowledge) aren't even feature-based.

Maybe N years from now, your {Skype,FaceTime,Zoom,Jitsi} call starts by transmitting a pre-trained auto-encoder that can reproduce your speech and visual appears with a "good enough" margin of error from a few kbps worth of data.

charlesdaniels··on Jacquard by Google
Obligatory comment about how this will be cancelled in 6 months[0]

> What if technology helped us focus on what matters most?

> Keeping our lives free from distractions.

> To help us be more present, more engaged, and more connected with the people surrounding us.

Somehow, I am dubious that the way to solve these problems with not only more technology, but also with technology made by the largest advertising firm on the planet. I am deeply skeptical that a company whose primary business is distracting people and keeping them engaged with advertisements is also going to solve these problems for us... problems they created... with a new product you have to buy.

Ok, sure, that aside, let's look at it...

> Our ambition is simple: to make life easier. By staying connected to your digital world, your things can do so much more. Skip a song by swiping your sleeve. Take a picture by tapping on a shoulder strap. Get reminded about the phone you left behind with a blink of light or a haptic buzz on your cuff.

Yes, I definitely want touching my clothes have second-order effects. And I'm sure mapping all these different "gestures" to actions will be smooth and straightforward. And having a haptic buzzer in my cuff is definitely what I need to keep my life free from distractions.

Having a look through the three sample products - a backpack, a shoe insert, and a jacket... this looks pretty pointless. I guess maybe the shoe thing could be handy for people that want a fitness tracker. But I'm not really sure what this is buying in the backpack or jacket. You get one or two gestures which you have to set up, remember, and not trigger accidentally. You get some kind of haptic notification, which I guess might be useful if you don't keep your phone in your pocket.

Who is the target audience for this? Who would pay money for this?

[0] - https://killedbygoogle.com/

charlesdaniels··on Ask HN: Why are e-ink note-taking devices so expensive compared to iPads?
I was under the impression that ReMarkable in particular was pretty good about this. I believe they just run a custom Linux variant and you can even ssh into them.

I was really considering getting one, but I think the bigger issue for me is the LiPo battery. You can’t take the thing apart without a heat gun because it’s held together with adhesive, so in a few years when the battery doesn’t hold a charge, you have an expensive paperweight. I would pay a premium for a thicker device that used normal screws so that consumables such as the battery can be replaced easily.

(Many devices these days are similar, so it’s not only ReMarkable doing this.)

Page 1 of 6Next →