Live data from Hacker News

Ask HN: What small library or tool do you want that doesn’t exist?

news.ycombinator.com

131–140 of 145 posts

Re: Ask HN: What small library or tool do you want that doesn’t exist?

#131

Some way of automatically applying 'less' to shell commands when the output exceeds a limit (like 40 lines) but is otherwise invisible. (There may be issues with automatically not doing this when piped.)

less -F will cause less to terminate if there's only one screenful of text. I usually forget to add it, so just knowing about -F isn't enough for me.

As for always applying it... I don't think bash has hooks to transform interactive command lines. Do other shells?

Another thing: exporting less(1) search history as grep commands, though a recent post made me realize I should use fzf and related tools instead.

Re: Ask HN: What small library or tool do you want that doesn’t exist?

#133
post #76

Earlier quoted context omitted.

I unknowingly relied on undefined behaviour in JavaScript Array.sort; worked fine/as expected in Firefox but then got bug reports that turned out to be Chrome/Safari. Not just dark corners IMO.

Interesting - what were the details? I've never heard of this and rely on this feature all the time so please do share the reproduction so we can all benefit?

    > [2,1,3].sort((a,b) => a 
Sorts in Firefox (gecko), but not in V8. (resp. `a > b`.)

FF:

    Array(3) [ 3, 2, 1 ]
Node:

    [ 2, 1, 3 ]
(Obviously that's a silly example because you'd just `.sort()`, I think I was doing `a.id You can even reduce the reproduction to `[1,2].sort((a,b) => 1)`. Have fun..!

Re: Ask HN: What small library or tool do you want that doesn’t exist?

#134
post #9

I wish VLC, plex, video players in general had the ability to automatically sync subs to audio. ( automatically , not manually) We have the technology; everything we need to do this exists. It's just not done automatically, and when using slightly off-sync subs, you have to fiddle with sub timing for ages until you find the right sync. Even more so when the subtitles have different off-sync issues for the whole movie…

I've used https://github.com/kaegi/alass and sometimes it works, sometimes it doesn't. It's not an easy problem to address automatically... Video players wouldn't want that in their codebase, maybe if it was available as a C library.

I can vouch for alass working quite well about 70% of the time.

It's very convenient when it does.

Re: Ask HN: What small library or tool do you want that doesn’t exist?

#135
post #14

NAME swizel - takes csv input, selects columns and arbitrarily selects output order OPTIONS change the field delimiter (default comma) handle trimming whitespace per field (or an arbitrary set of chars, e.g. quotes) ignore or transform a prefixed one-line header or comment (default #) [bonus points] handle numeric fields (e.g. precision or float/int conversion) OBLIGATORY while all of this can already be done with a…

Reading this, I'd like a neural net trained on man pages as input, with C code as output :D

Re: Ask HN: What small library or tool do you want that doesn’t exist?

#136

Almost every data exploration tool requires a date range to work, and yet there's no standard language for expressing these. I want a parser that: - Undertands simple ranges (e.g. "2022-04-01 to 2022-05-01"). - Understands relative ranges (e.g. "4 weeks ago to 2 weeks from now"). - Understands ranges to be expressed by omitting components (e.g. "2022" means "2022-01-01 to 2022-12-31"). - Has equivalent parsers for ot…

I believe that iso dates officially support missing off any component so points 1 and 3 should be supported by any date parser. Time parsing from all natural language is going to be hard/impossible because there is so much jargon/ambiguity. How long is a jiffy? Is a moment a point in time or a short while in the future? Mañana has two meanings in Spanish.

I'm looking for a rigid, localized, natural-language specification for time ranges, though. Not supporting some words or combinations of them is fine, as long as it's natural enough that a nontechnical user doesn't need to use a manual to figure out how to search dates. I'm sure this isn't a trivial problem, hence why there are no obvious solutions, but I'm not ready to believe that it's impossible.

Re: Ask HN: What small library or tool do you want that doesn’t exist?

#137
post #75

I wish I had a tool which measures the trend of every line code in my codebase in production, and shows me on IDE on the background of each line of code which code is mostly used (dark green background or such) and which code is barely used (in light green), and in gray unused code in production (based on the trend of last few months. The benefits : - I will understand during development which code is mission critica…

I would want something slightly different. I care a lot about how recently code has been changed. I usually don't care how much code is run in production, unless it isn't run at all, and then I care a lot. So: Code that was changed within the last week: red Code that was changed within the last month: yellow Code that hasn't been changed in over a month: normal Code that hasn't been touched in over a year: green Dead…

I believe TortoiseGit has this feature out-of-the-box: https://tortoisegit.org/docs/tortoisegit/tgit-dug-blame.html

Re: Ask HN: What small library or tool do you want that doesn’t exist?

#138
post #123
post #80

A simple reddit client that de-dupes posts (across subs and over multiple sessions)

I have written something [once] that de-dupes on just the URLs, you could take this way further with images and content analysis. This is also manly an app to stop me from scrolling across the same stories on HN and lobste.rs again and again multiple times a day. So it lacks reddit specific features. [once] https://github.com/batram/once

Interesting, thank you!

Re: Ask HN: What small library or tool do you want that doesn’t exist?

#139
Disk usage history.

Like the du command, except it shows the size of directories over time. Doesn't have to be precise, daily historical snapshots of directory sizes isfine.

When your disk is almost full, you want to know which directory grew the most recently, not which directory takes up the most space

Re: Ask HN: What small library or tool do you want that doesn’t exist?

#140

I wish there was a click-bait headline filter. Too many news headlines are either hypothetical question with no real information content, telling me to re-evaluate everything that I know, something sensationally misleading designed to make some alarm bell go off in my head etc. I worry how some of these might still manage to creep into my head.

Good idea! May be worth a look at using this[1] API for something like this - it's what the autotl;dr reddit bot[2] uses. I'm generally impressed by how much it is able to condense articles while delivering a pretty accurate summary - see examples at the bot user /u/autotldr[3]. Might not work well enough if you try squeeze whole articles down to 1 sentence (for a title), though. Edit: I guess you might have meant yo…

Yeah - I meant not seeing the clickbaity titles. Even major news outlets like BBC and NYTimes are becoming like this which is frustrating.
Post reply on HN