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.
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.
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...
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
https://docs.microsoft.com/en-us/visualstudio/ide/find-code-...
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.
Discussion on HN (4 months ago): https://news.ycombinator.com/item?id=29794153
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.
Video players wouldn't want that in their codebase, maybe if it was available as a C library.
It's very convenient when it does.
> 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. :)
----
---
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).
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
I work in the medical software field by the way. I know all about the pains of dicom...
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-...
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.
- 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.
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/...
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.
BETWEEN Date1 AND Date2
is in the spec.
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.
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
I know dead keys, I know compose, but they all seem wayyy too unnatural to me, I got used to Accenti's system, ie. just type e' and it becomes è, but context-aware so perche' becomes perché instead of perchè, and pressing ' further cycles between all the other options (èéê..), it even supports user-configurable macros (eg. I have made so I can write "\deg" to become °) It's just very hard for me to consider anything else since this is the most natural I've ever typed, and it's Windows-only.
Another perk of a tool instead of a keyboard system thing I can white/blacklist apps.
---
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 combination of cut, sed, tr and/or awk, it's a common task when working with columnar data and could be made more intuitive and less error prone. transforming columnar data mostly boils down to clean up and basic sanity checks. good karma on this one.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 that typically use each one).
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 $ datez 1651483224
human-readable-timestamp
$ datez human-readable-timestamp
1651483224Create aliases?
I just gave it a try now, as a shell script:
#!/bin/sh
# https://news.ycombinator.com/item?id=31233092
case "$1" in
-*|"")
echo "Usage: datez <unix-timestamp>"
;;
*)
if date -r "$1" 2>/dev/null; then date -r "$1"; else date -d "@$1"; fi
esac
Edit: tried to add the reverse, from human-readable-timestamp to Unix timestamp, and got a problem when the locale does not use the English language: the human-readable form is not understood by date as input!So the round-tripping version of the script has to set the locale to C:
#!/bin/sh
# https://news.ycombinator.com/item?id=31233092
# Needed for round-tripping:
export LANG=C
case "${1}" in
-*|"")
echo "Usage: datez <unix-timestamp|human-readable-timestamp>"
;;
*)
case "${1}" in
(*[!0-9]*)
date -d "${1}" +"%s"
;;
(*)
if date -r "${1}" 2>/dev/null; then
date -r "${1}"
else
date -d "@${1}"
fi
esac
esac
Edit 2: it does round-trip by using a locale-independent format like "%Y-%m-%d %H:%M:%S %Z", which is anyhow the format I prefer: #!/bin/sh
# https://news.ycombinator.com/item?id=31233092
# Needed for round-tripping if you use a locale-dependant format:
#export LANG=C
FORMAT="%Y-%m-%d %H:%M:%S %Z"
case "${1}" in
-*|"")
echo "Usage: datez <unix-timestamp|human-readable-timestamp>"
;;
*)
case "${1}" in
(*[!0-9]*)
date -d "${1}" +"%s"
;;
(*)
if date -r "${1}" 2>/dev/null; then
date -r "${1}" +"'${FORMAT}'"
else
date -d "@${1}" +"'${FORMAT}'"
fi
esac
esac- Main inputs are an input directory or a list of files, the location of a file repository (1 file), the location of a metadata DB, and some indexed and searchable metadata like original path, modification date, semantic version number, arbitrary title, and other strings.
- If an input file has been changed or is not yet stored, it is archived in the file repository compressed with very fast compression like snappy or LZO with corresponding metadata and version in the metadata DB. Otherwise only the metadata information is stored. Support for deltas / storing incremental changes in the file repository would also be nice but is not required.
- The metadata is stored in the metadata DB so later a file can be retrieved based on version information, it's original modification data, it's original path, and/or metadata regexp searches.
- Snapshots of an input directory or list of files can be extracted based on version information and any other metadata. Extraction needs to be very fast.
- The library needs to work on common file systems and at least on Linux, Windows, and MacOS.
- Archiving should be ACID-compliant. Either a file is stored with all of its metadata so that it is retrievable, or nothing is stored and an error is returned. Likewise for whole input directories and for extraction.
I only use the search file/folder name feature, I don't even need any content indexing that this tool has. It just needs to scale to Terabytes size (like millions of files/folders) and optionally do de-duplication.
If you know such tool on Linux, it would really help me to be less dependent on Windows. Or maybe someone you can build such a tool on Linux. I tried to create my own tool in Java but it took too much DRAM to index the many files I have. This Win tool indexes all my files and folders in a file of 1-200MB and searches all in 10-30 seconds. No server/database in involved, just a standalone tool.
I share the tool just for reference. The tool didn't had any update for years, I hope the programmer is still alive and healthy. https://www.whereisit-soft.com/
Python is putting its fingers in its ears singing "LALALALA USE A VENV" instead of fixing the damn ecosystem. Node and npm proved that a solution exists and it's doable.
https://peps.python.org/pep-0582/
Unfortunately the PEP is from 2018 and is still being discussed. The last post in the comment thread is from February.
https://discuss.python.org/t/pep-582-python-local-packages-d...
That's unfortunate; until I went looking for citations I thought it was further along and actually scheduled for the next Python release.
Looks like there is a pip-alternative that implements the PEP, but I haven't played around with it yet.
(though the usual way it breaks is your python interpreter gets updated and the venv becomes useless)
Closest I've come is VLC with a split video interface in full screen, but it isn't perfect.
We used to ise etherpad and pther tools and drive for bigger emails, bit they are both not ideal.
Use cases include keeping common (CI, Make etc) configurations up to date across multiple Git repos.
Even better if it doesn't require configuration and can identify files it manages using a magic comment eg # Source: http://github.com/my/repo/file.txt
I would like to have a simple app that would let me define a time, a beep sound and a pattern. So I could have a one beep timer [1] and an interval timer [2]. I use those for exercise, but I'm not entirely satisfied. Bonus points if the beep sound could be configurable to notification sounds, sfxr UI [3] (maybe it could be be another simple application) and speech synthesizer.
Something that would crawl GitHub and look for Android play store links in READMEs, then it would offer a search over repository name, description and the README. I would use this first to search for Android apps. I know about F-Droid, but I'm lazy and there are things in the play store that are not in F-Droid. Also it would be easier for me to find apps to recommend to my family/friends, who will not install F-Droid.
[1] https://play.google.com/store/apps/details?id=com.thrvg.beep... - like this, but without this introductory screen and single button to reset and restart the timer
[2] https://greggman.github.io/interval-timer/ - I use this, but I would just want to set a single parameter: time between beeps and let it play in a loop until I stop
[3] https://sfxr.me/
"today 17:00 Pacific in UTC" should be accepted.
There are other time zones too: I've seen "PDT", "Mountain", and so on. The `date` tool doesn't always understand what those are. That's a bummer because neither do I, and that's why I need this tool.
/ You already mentioned it.
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.
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 you'd just like to not see these clickbaity links at all, which is fair too haha.
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
- show a table of content with a key press - jump to next section with a key press (like what woman does in emacs) - on a given flag, generate examples using that flag gathered from like GitHub
Just set up a bash alias to simplify querying it.
[1] https://github.com/cheat/cheat
[2] https://tldr.sh/
- In Visual Studio I want a tool that shows me show many "hops (calls)" a C# method is away from another method.
People usually recommend https://file.pizza but it just doesn't work for me.
Now that I think about this it would be beautiful if there was something like stunnel but for NAT hole punching and what not. You would do:
$ send-file FILE
qk11c14pmq7maeod
$
You would send the unique id (that could be also something that gives a QR code to scan or something like random words) over a separate channel. Then you would "receive-file qk11c14pmq7maeod" on the other end. It would be a simple binary that would be easy to embed and call through some pretty UI. Probably generation and scanning of those possible QR codes would have to be a part of the package. The problem would be who would finance servers needed for NAT traversal?I just use good old SMB/network sharing - it's not much harder than setting up some program on two devices. Works between Windows/Linux/Android, fast and good enough.
In Free Pascal, the AnsiString type is a reference counted string, which can contain up to 2 billion characters, and you never have to allocate/deallocate them. These strings can contain any binary data, including nul, with the length of the string being counted as well. If you modify the string, it first checks the reference count, if it's 1, nothing needs to be done, if more than 1, it copies it first.
There is an equivalent WideString type as well as traditional pChar, etc.
C could really use a modern string type.
Currently everyone around (I included) scraps memes from reddit, and then displays them on their website, app or chatbot.
I would love to have some API do the heavy lifting by:
- indexing memes from reddit and other social media sites. Where I can search with text or an image.
- recommending memes directly to my users, based on their like(s) or dislike(s).
(bonus) a text to meme creator. A user inputs text on the front end, I send it to the API, it returns a nice full meme.
I just want to hand a function a string of the XML, and a string of the XQuery, and get back a string of the answer.
$ listen hello.wav stop.wav next.wav
next.wavI know about Webmin as well as lots of other weird (outdated) gui's. I also am aware about the Xigmanas and nas4free projects. They serve lots of purposes at once and i'd like one just for samba.
I'd move to a command line tool, e.g. a sqlcmd variant or shell voodoo, if it could do that.
They have a log already: https://intellij-support.jetbrains.com/hc/en-us/community/po...
SELECT DATE, SUM(DAILY_REVENUE) FROM TABLE_X WHERE DATE <> PUBLIC_HOLIDAY(USA,GB,MX,DE) GROUP BY DATE;
Or if the piano supports midi, maybe record using some kind of DAW (e.g. FL Studio), that way you won't be fooled by someone making noise into the mic to keep the timer going.
A second one could be to hash all the things and hide images/videos/... already viewed.
Both these have fundamental downsides. The comments are often the most interesting thing, and if you plan on interacting with them in any capacity, the specific subreddit is important, so hiding that randomly might be undesirable.
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.
(There may be issues with automatically not doing this when piped.)
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.
- Firefox will render stuff wrong
- Safari will render stuff wrong and something will break
There are some dark corners where there are still differences but these are not in the "I just want to build a website"-level of complexity IME, and are more in the "I am building a large XXX,XXX lines-of-code enterprise SPA used for hours at a time for thousands of users as their primary job across varied OS and browser combinations" level of complexity. E.g. I recently had to debug how different browsers handle cookie eviction for more than 100 cookies under the same top-level domain. This is not the sort of issue you you face with a "I just want to build a website" problem.
Not just dark corners IMO.
> [2,1,3].sort((a,b) => a < b)
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 < b.id` or something, but it's not a significant detail.)You can even reduce the reproduction to `[1,2].sort((a,b) => 1)`. Have fun..!