Readit News logoReadit News
Posted by u/shakezula 4 years ago
Ask HN: What small library or tool do you want that doesn’t exist?
The smaller the better! What small, sharp tool do you wish existed but doesn’t or does but isn’t up to the quality you’d expect?
eligro91 · 4 years ago
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 critical, and I should be careful with it, as well as invest more time in optimizing this code and document it better.

- I will understand what the customers do, which flows they use and which flows they avoid, so seeing code which I've developed recently but not used yet - will help me understanding that I'm wasting my time on writing unused features or we did not really understood the customers expectations.

- I will be able to cleanup dead code easily on the go.

It's like a theme park manager walking around in the park and watches which rides has long lines of people and which rides have no lines.. helps the manager understand where to put effort and which rides to remove / replace.

weinzierl · 4 years ago
The tooling for this exits and is 100% usable.

All you have to do is run a build with coverage enabled and then load the coverage data files into your IDE. At least Eclipse (with EclEmma) shows the results in a way that are pretty close to what you described. I'm sure other IDEs can do the same.

The only thing is that nobody does this on production, because of the performance impact and potentially increased risk.

eligro91 · 4 years ago
Yes. I know it's existing as coverage when you run unit-tests.

I'm well aware of the performance impact on production, I guess it's the major challenge here.

Since I'm mainly developing in python - here's a good article about that, he gave some directions to make it faster: https://www.drmaciver.com/2017/09/python-coverage-could-be-f...

dkarl · 4 years ago
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 code: blink tag, DOOM music plays

vidanay · 4 years ago
I really like the idea of a "code heatmap". I actually think this could be easily implemented in one scenario: Visual Studio Code Lens already has that information. Massaging it into a background color probably wouldn't be too difficult.

https://docs.microsoft.com/en-us/visualstudio/ide/find-code-...

sidpatil · 4 years ago
I believe TortoiseGit has this feature out-of-the-box: https://tortoisegit.org/docs/tortoisegit/tgit-dug-blame.html
ludovicianul · 4 years ago
We've built an internal tool which does exactly this. Among a bunch of other correlations
mikewarot · 4 years ago
It sounds like you want to combine git blame with performance data.
ozim · 4 years ago
What about code that is super important but rarely used like once a year - just when it fails you are in big trouble?
dimitar · 4 years ago
This can be approximated by generating a lot of metrics and monitoring executions
scrollaway · 4 years ago
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/episode.

theshrike79 · 4 years ago
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. =)
moffkalast · 4 years ago
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.
rayrag · 4 years ago
Try SubSync, open source movie subtitle synchronization app. Build in feature like this in VLC would be awesome.

https://subsync.online/

Discussion on HN (4 months ago): https://news.ycombinator.com/item?id=29794153

scrollaway · 4 years ago
Yes I was in that thread hehe :)

Given our capabilities, it's really a straightforward thing to do. YouTube does it automatically (you drop in your script with the video, it auto-syncs everything).

It could even be done for when the language doesn't match, given an auto-translation pass and some heuristics.

pgz · 4 years ago
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.

Ruthalas · 4 years ago
I can vouch for alass working quite well about 70% of the time.

It's very convenient when it does.

jotm · 4 years ago
But that's the "job" of releasers? I have had to manually sync subs to audio maybe a few times over the past two decades...
this_is_eline · 4 years ago
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/

riidom · 4 years ago
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. :)
sph · 4 years ago
I use Bazarr to automate downloading of subtitles for my movies and TV shows, and it integrates subsync. Works 99% of the time, if it doesn't I find the subs for that particular series are consistently offsync by 1.0s which is easy to fix with decent media players.
azalemeth · 4 years ago
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).

korijn · 4 years ago
Can you link a VDB spec?
azalemeth · 4 years ago
Sure! The details are on OpenVDB's website [1] and technical guide [2] and githup repo [3].

It's not as mature as the dicom standard (which is very...mature) and they do change it occasionally, but it is stable.

[1] https://www.openvdb.org/documentation/ [2] https://academysoftwarefoundation.github.io/openvdb/ [3] https://github.com/AcademySoftwareFoundation/openvdb

teleforce · 4 years ago
The top of the list is an open-source library toolbox for higher-order spectral analysis including time-frequency in a compiled programming language (C, C++, D, Rust, etc) for real-time applications.

This is an example of an old third party higher-order spectral analysis toolbox in Matlab but now Matlab has built-in toolbox due to its increasing popularity in signal processing of communication, biosignal, etc [1],[2].

The next generation communication systems (e.g. WiFi 7, 6G) will probably utilize this form of signal analysis for higher bandwidth and efficient communication [3]. The modern biosignal analysis (ECG, EEG, etc) is already moving toward time-frequency analysis and to have an open-source real-time time-frequency toolbox will be a game changer [4].

[1]Higher-Order Spectral Analysis Toolbox for use with Matlab:

https://labcit.ligo.caltech.edu/~rana/mat/HOSA/HOSA.PDF

[2]Time-Frequency Foundations of Communications:Concepts and Tools:

https://www.mins.ee.ethz.ch/pubs/files/SPMAG2013.pdf

[3]The OTFS Interview – Implications of a 6G Candidate Technology:

https://www.6gworld.com/exclusives/the-otfs-interview-implic...

[4]Analyzing Neural Time Series Data: Theory and Practice:

https://mitpress.mit.edu/books/analyzing-neural-time-series-...

dandare · 4 years ago
A library of person-to-person communication snippets for those of us on the spectrum like this tool https://news.ycombinator.com/item?id=31224996 but curated by well intentioned community.
OJFord · 4 years ago
I would suggest not using those ones by the way - most of them sound pretty passive aggressive to me (British) and no better (worse in some cases/contexts) than just being forthright.
akeck · 4 years ago
This is a great idea!
bazhova · 4 years ago
AWS has their own crontab syntax, slightly different from regular Cron. But there is no validation tool before you submit something. It just rejects it. I want something like crontab.guru but for cloudwatch syntax. It's such a small usecase but it'd be great.
cuu508 · 4 years ago
Is it this one? https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/S...

At a quick glance, the syntax looks similar to the one used by Quartz Scheduler, so you can almost use this: https://freeformatter.com/cron-expression-generator-quartz.h...

I say "almost" because Quartz Scheduler expressions have one additional field: seconds. And there are more than likely differences in how nontrivial expressions and corner cases are handled by different tools.

CGamesPlay · 4 years ago
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 other human languages (e.g. switch to 'es_ES' and parse "hace 2 semanas").

The implementation of this would be programming-language specific, but the grammar of this language isn't even standardized, as far as I know.

Lanzaa · 4 years ago
Something could be based on the "Rosie Pattern Language"[0]. There is already a parser for en_US/en_EU dates[1], which should be simple to extend to date ranges.

Another option would be using Tree-sitter[2]. It would be overall similar to using the Rosie Pattern Language, but Tree-sitter seems to have a more active community.

I wouldn't be surprised if one could write an automated Tree-sitter to Rosie Pattern Language translator.

[0]: https://gitlab.com/rosie-pattern-language/rosie/-/blob/maste...

[1]: https://gitlab.com/rosie-pattern-language/rosie/blob/master/...

[2]: https://tree-sitter.github.io/tree-sitter/

Deleted Comment

teknopaul · 4 years ago
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.

CGamesPlay · 4 years ago
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.
teknopaul · 4 years ago
And of course SQL is a relevant standard, even if you don't implement all of it.

BETWEEN Date1 AND Date2

is in the spec.

codecutter · 4 years ago
The issue I face is that the TV volume suddenly increases when they start playing advertisements on TV. It is probably done to attract user's attention, but it is very annoying esp. for old people.

I wished that there was some way (maybe an app on the phone) that will automatically control volume level at a set limit. The phones already have a way to measure decibals (sound meter app) and also a way to control audio receiver volume (remote control app). If we could combine these 2 in a single app, that will be great.

I can set the volume level in the app. It will monitor sound level say every 3 seconds. If it exceeds say 10%, then automatically reduce the volume. Someone, please build such an app. I will buy it or consider sponsorship/financial help. The loud commercials are driving me crazy. Thank you for listening to my request.

HWR_14 · 4 years ago
At least in the US it is illegal for TV (that is, real television, not streaming) to play ads louder than the regular programming (and has been in the last decade). So that app could also auto fill the FCC complaint form[1].

Meanwhile, some TVs and audio receivers have a "night mode" that limits the maximum decibels. It's designed to not wake other people in the household up, but it also serves your purpose.

[1] https://www.fcc.gov/consumers/guides/loud-commercials-tv

singularity2001 · 4 years ago
yes iOS "reduce loud sounds" settings should extend from headphones to all speakers!