Live data from Hacker News

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

news.ycombinator.com

21–30 of 145 posts

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

#21
post #6
post #2

I sometimes find myself wanting a Unix timestamp, or to convert one into a human-readable date, and usually it's simpler to go to an online tool than use time(1). It might be nice to have a command line tool which can guess from the arguments what you want it to do. For example, if you run it with no arguments, it would output the current timestamp (to multiple levels of precision, listing the languages/platforms tha…

Get print the current time as as Unix timestamp. date +%s To convert a Unix timestamp to local time with GNU date, e.g. date -d @1651483224 With BSD date, e.g. date -r 1651483224

Yes, I can never remember that. It's faster to just go to some online tool than to look up how to convert timestamps with `date`. Especially since I often switch between Linux and "BSD" (macOS). Something like this would be nice:

    $ datez 1651483224
    human-readable-timestamp
    $ datez human-readable-timestamp
    1651483224

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

#22
A cross-platform command-line tool + C library with permissive license that makes compressed file-deduplicated snapshots of directories with accompanying indexed metadata. It should be foolproof, use a fast compression algorithm like snappy or LZO, and be optimized for fast multicore creation and extraction (but with optional CPU-limiting). Metadata could be stored in an sqlite database.

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

#23
I would love a small conversion tool to read in medical imaging dicom files and output a volumetric vdb dataset. I've nearly written this on several occasions. Most, but not all, dicom files encode a 2d or a 3d scalar field and vdb files are the graphical effects industry standard format for those, usually used for fog, fire, or similar effects. They can also usually be converted to polygon meshes through a variety of algorithms.

The reason why I want to do this is because 3d tools for artists -- blender, cinema 4d and the like -- have a large amount of easy-to-use and highly complex tools for subsetting volumes and making things look pretty.

Most medical imaging software is the opposite of this. You cannot change the data and the tooling is intentionally limited. Mostly this is a very good thing. Sometimes, however, and particularly for complex anatomy or pathology from a patient, you really just want to make a beautiful image for a paper with an anatomical structure manually removed, highlighted, or coloured differently -- something that would be very easy in e.g. Blender. The fact that Blender is python-scriptable is also frankly amazing and it's natively cross-platform too.

The reason I have written a tool like this is entirely because both file formats are very complex with lots of edge cases -- e.g. most ultrasound dicoms are little more then a screenshot with a lot of metadata, UI overlay and all. It's a lot of work and fundamentally isn't my job (I'm a medical physicist and should be making images with novel physics, not making images look pretty for presentation purposes).

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

#24
post #17

Earlier quoted context omitted.

I don't know about 'automatic', but in mpv[1] you have this: > Ctrl+Shift+Left and Ctrl+Shift+Right > Adjust subtitle delay so that the next or previous subtitle is displayed now. This is especially useful to sync subtitles to audio. This works in 9/10 cases. :) ---- [1] https://mpv.io/

I think this is what the OP refers to with "fiddle around for ages". I know the problem not with subs, but when audio is off related to the image. And of course the problem is rare enough that I am never "in training", and have to find a remarkable spot first (e.g. door slam shut or a suitable spot in dialogue), then think about going backwards or forwards, guess the amount, etc. etc. :)

If the whole subtitle file is out of sync (e.g. every line is late 2s), one shortcut is all it takes. In that 1/10 case, you do need to 'fiddle around for ages', but given that all other options (e.g. SubtitleEdit[1]) are way more complicated and time consuming, mpv is all I could suggest. For the problem with audio and image being out-of-sync, I have no idea :)

---

[1] https://www.nikse.dk/subtitleedit

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

#26
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…

Have you tried https://github.com/BurntSushi/xsv?

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

#27
post #6

Earlier quoted context omitted.

Get print the current time as as Unix timestamp. date +%s To convert a Unix timestamp to local time with GNU date, e.g. date -d @1651483224 With BSD date, e.g. date -r 1651483224

Yes, I can never remember that. It's faster to just go to some online tool than to look up how to convert timestamps with `date`. Especially since I often switch between Linux and "BSD" (macOS). Something like this would be nice: $ datez 1651483224 human-readable-timestamp $ datez human-readable-timestamp 1651483224

> Yes, I can never remember that.

Create aliases?

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

#28
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…

https://github.com/BurntSushi/xsv Can do at least some of these

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

#29

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…

And you need to do the manual thing so rarely, that you always forget that does the delay need to be positive or negative if the subtitles are fast. =)

And then VLC does this weird freeze thing to catch up that can't be aborted, so if you accidentally type an extra zero into delay, good luck waiting for that to stop haha. Usually faster to just restart the damn thing.
Post reply on HN