Better HN
topnewbestaskshowjobs
Log inSign up

ComputerGuru

32,383 karma · joined Jan 3, 2008 (18y ago) · 8,295 submissions

mqudsi on most sites.
Submissions

comment 1y ago · link · parent

My problem with python is startup time, packaging complexity (either dependency hell or full blown venv with pipx/uv). I’ve been rewriting shell scripts to either Makefiles (crazy but it works and is rigorous and you get free parallelism) or rust “scripts” [0] depending on their nature (number of outputs, number of command executions, etc)

Also, using a better shell language can be a huge productivity (and maintenance and sanity) boon, making it much less “write once, read never”. Here’s a repo where I have a mix of fish-shell scripts with some converted to rust scripts [1].

[0]: https://neosmart.net/blog/self-compiling-rust-code/

[1]: https://github.com/mqudsi/ffutils

comment 1y ago · link · parent

To the contrary. They’re all run in parallel and the (standard) output goes directly from one to the next without being buffered by the shell. Unix overhead for process creation is very low compared to others, doing the same under, for example, Windows, would be more expensive.

But if you have to run n processes, much better to run them in a single pipeline like that.

(Source: I’m a shell developer. Fish-shell ftw!)

comment 1y ago · link · parent

Technically my solution didn’t either. Does the nightly solution cache the output?

comment 1y ago · link · parent

Hey, really nice work!

comment 1y ago · link · parent

Writing scripts in rust is as easy as copying and pasting this shebang: https://neosmart.net/blog/self-compiling-rust-code/

But that doesn’t make it embeddable, of course.

comment 1y ago · link · parent

DMA from device to host directly rather than from host USB controller to host memory.

comment 1y ago · link · parent

USB doesn’t provide any DMA (until USB 4) and requires more host cpu resources to meet the same bandwidth. It also has less consistent performance by virtue of the USB protocol itself.

comment 1y ago · link · parent

It’s fairly useless since raw footage isn’t typically distributed; it would be re-encoded first which would definitely destroy that watermark. So it would be a scandal that doesn’t necessarily accomplish much.

comment 1y ago · link · parent

Some foresaw this and add an OSD showing time/battery/etc to the HDMI output so you can’t get a clean feed.

comment 1y ago · link · parent

I can’t see why you think there’s a usecase for 25 minute videos but not 35 minute ones.

Speaking as an amateur photographer with multiple DSLRs: I’ve certainly needed longer than that for a number of gigs.

comment 1y ago · link · parent

Is the limitation the same regardless of quality, format, frame rate, etc? That would make me suspicious.

comment 1y ago · link · parent

Do you know of anything equivalent for Nikon?

comment 1y ago · link · parent

I’ve come across this before and think it’s brilliant. Are you aware of any comparable firmware for Nikon users (not that I really have any complaints about what Nikon has provided, but this is likely a case of not knowing what I’m missing out on)?

comment 1y ago · link · parent

It’s not exactly watermarking; each encoder works in a different way and it’s readily possible to determine (for one versed in such matters) which encoder was used to generate a video by inspecting the structure of the raw (eg h264) bitstream. This might not work reliably enough for simpler codecs like JPEG but for something as complicated as modern video codec where there are a million ways to generate a compatible payload it is as unique as a fingerprint.

comment 1y ago · link · parent

I believe this is why a number of products require you to manually activate a free personal license (by clicking a button and agreeing to TOS) in the settings instead of shipping with it. You are then separately licensing the tech from the software vendor and are personally liable for infringements.

comment 1y ago · link · parent

Eh. I get your point and truly appreciate structural safeguards as opposed to aspirational ones but this is really not as doable as you make it out to be, and doing it properly would be a full blown product in its own right. First, this only works if you have a very narrow interpretation of PII. Once you realize most of your non-int/uuid unique indexes (and all your join predicates) are probably PII in some way or the other, the scope of the problem greatly increases. How does your solution work when you need to group by PII, full text search by PII, filter by PII, etc?

comment 1y ago · link · parent

I’m not going to claim I’ve solved this and figured out “the way” to use LLMs for tests, but I’ve found that copy-and-pasting code + tests and then providing a short essay about my own reasoning of edge cases followed with something along the lines of “your job is to find out what edge cases my reasoning isn’t accounting for, cases that would expose latent properties of the implementation not exposed via its contract, cases tested for by other similar code, domain exceptions I’m not accounting for, cases that test unexplored code paths, cases that align exactly with chunking boundaries or that break chunking assumptions, or any other edge cases I’m neglecting to mention that would be useful both to catch mistakes in the current code and to handle foreseeable mistakes that could arise from refactoring in the future. Try to understand how the existing test cases are defined to catch possibly problematic inputs and extend accordingly. Take into account both the api contract and the underlying implementation and approach this matter from an adversarial perspective where the goal of the tests is to challenge the author’s assumptions and break their code” has been useful.

comment 1y ago · link · parent

The benefit of this approach is that you can directly test any function in the same scope without altering its visibility: it implicitly encourages you to test all functions (and design functions in a way they can be tested, as you are writing tests as you write code), not just those part of the public api contract.

Plus you can update tests, code, and comments in one go, with visibility into them at all times.

comment 1y ago · link · parent

Rust is missing an abstraction over non-contiguous chunks of contiguous allocations of data that would make handling ropes seamless and more natural even for smaller sizes.

C# has the concept of “Sequences” which is basically a generalization of a deque with associated classes and apis such as ReadOnlySequence and SequenceReader to encourage reduced allocations, reuse of existing buffers/slices even for composition, etc

Knowing the rust community, I wouldn’t be surprised if there’s already an RFC for something like this.

comment 1y ago · link · parent

Yes. And for string formatting in general such as sprintf to calculate buffer size. Also for proposes of calculating length for string padding and alignment.

comment 1y ago · link · parent

clang-tidy has an extension to do just that: https://clang.llvm.org/extra/clang-tidy/checks/altera/struct... -- I think there are other clang-tidy padding-related checks that apply here as well, iirc.

Also, not what you asked but certainly related, some lower-language levels (not just jit languages) can and do automatically re-arrange struct members (when not optionally fixed); e.g. by default rust will rearrange members as needed to optimize padding.

comment 1y ago · link · parent

SVGA support aside, it will never cease to astound me that you can load Windows 3.x on a modern standards-supporting PC and get basic VGA working out-of-the-box but you cannot do the same on modern Linux/BSD to get a basic software-accelerated VGA framebuffer supported by Xorg/Wayland if you don't have the right drivers installed (and the correct configuration files manually set up).

(the dead xfree86 project was probably the closest attempt to making this "just work" though it had a long way to go; this approach was not preserved in the Xorg fork)

comment 1y ago · link · parent

No, he’s not. Calling this telemetry is a stretch and that’s his style on everything he disagrees with (unfortunately).

comment 1y ago · link · parent

C# is headed this way. Typescript is there but only if you can ignore the fact that it is JavaScript masquerading as a more serious language for halloween.

comment 1y ago · link · parent

You can do that in your own custom completion.

comment 1y ago · link · parent

Interesting perspective. In our case, we accepted a patch to effectively use a lock around a 64-bit integer as the workaround for these platforms, however.

comment 1y ago · link · parent

In this case, it was specifically openwrt on mipsel.

comment 1y ago · link · parent

On the other hand, fish being a clean-room shell implementation not beholden to the baggage of legacy systems is immune to some crazy behaviors or vulnerabilities that other shells - including zsh - are prone to: https://yossarian.net/til/post/some-surprising-code-executio...

Compatibility has also come a long way in recent releases; you should give it a try.

1
181920
277