News for hackers. Stuff that matters.
Re:FFmpeg by Example by levocardia on Tuesday January 14, 2025 @04:58PM (#42704483)
For the longest time I had ffmpeg in the same bucket as regex: "God I really need to learn this but I'm going to hate it so much." Then ChatGPT came along and solved both problems!
Re:FFmpeg by Example by earnestinger on Tuesday January 14, 2025 @06:44PM (#42705520)
Not sure about ffmpeg, but you should definitely try memorising regexp. Casual Search&replace that becomes possible is worth it.
Re:FFmpeg by Example by sergiotapia on Tuesday January 14, 2025 @07:04PM (#42705683)
in 15 years it never sticks and by the time i need it again i've forgotten it! :D
Re:FFmpeg by Example by kevin_thibedeau on Tuesday January 14, 2025 @07:41PM (#42705960)
Don't learn the Perl influenced extensions. You just need POSIX EREs (and BREs for some older utilities) which are simple enough to keep in the head.
Re:FFmpeg by Example by ziml77 on Tuesday January 14, 2025 @09:04PM (#42706488)
And with the POSIX EREs, everything except the syntax for character classes will carry over to other common Regex dialects.
Re:FFmpeg by Example by Over2Chars on Tuesday January 14, 2025 @10:43PM (#42707070)
I'll just leave this here

"The Insanity Of Linux's Regular Expressions " https://www.youtube.com/watch?v=ys7yUyyQA-Y

Re:FFmpeg by Example by earnestinger on Wednesday January 15, 2025 @04:55AM (#42709177)
Many loosely compatible (so, not compatible if we are strict..) implementations are a problem, but awareness and testing helps.

All in all, my life would be miserable if I would not have regexp available in grep/sed/editor/ide/java/python, their usefulness trump any such inconveniences.

Re:FFmpeg by Example by teaearlgraycold on Tuesday January 14, 2025 @06:33PM (#42705434)
Gotta be honest, years of configuring automod on Reddit have honed me into a regex God.
Re:FFmpeg by Example by hackingonempty on Tuesday January 14, 2025 @05:15PM (#42704675)
CSS has entered the ChatGPT.
Re:FFmpeg by Example by kccqzy on Tuesday January 14, 2025 @06:58PM (#42705632)
My rule for using LLMs is that anything that's one off is okay. Anything that's more permanent and committed to a repo needs a human review. I strongly suggest you have an understanding of the basics (at least the box model) so that you are competent at reviewing CSS code before using LLM for that.
Re:FFmpeg by Example by permo-w on Tuesday January 14, 2025 @06:25PM (#42705340)
I've been looking for a good guide on prompting LLMs for CSS.

does anyone know of any?

Re:FFmpeg by Example by johnisgood on Wednesday January 15, 2025 @09:48AM (#42711374)
I have no set of rules when prompting LLMs for CSS, it does seem to work more or less for me though.

What are your current issues or what limitations have you ran into?

Re:FFmpeg by Example by permo-w on Thursday January 16, 2025 @12:01AM (#42721452)
mainly with trying to impart a particular art style.
Re:FFmpeg by Example by zxvkhkxvdvbdxz on Tuesday January 14, 2025 @08:24PM (#42706228)
Interesting. Being able to use regexps for text processing through my career has probably saved me a few thousand hours of programming one-off solutions so far. It is one of those skills that really pays off to learn proper.

And speaking of ffmpeg, or tooling in general, I tend to make notes. After a while you end up with a pretty decent curated reference.

Re:FFmpeg by Example by codetrotter on Tuesday January 14, 2025 @09:32PM (#42706654)
I use regexes a lot. The main thing that always trips me up is dealing with escaping, because different tools I use – vim, sed, rg, and so on – sometimes have different meanings for when to escape or not.

In one tool you’ll use + to match one or more times, and \+ to mean literal plus sign.

In another tool you’ll use \+ to match one or more time, and + to mean literal plus sign.

In one tool you’ll use ( and ) to create a match group, and \( and \) to mean literal open and close parentheses.

In another tool you’ll use \( and \) to create a match group, and ( and ) to mean literal open and close parentheses.

This is basically the only problem I have when writing regexes, for the kinds of regexes I write.

Also, one thing that’s not a problem per se but something that leads me to write my regexes with more characters than strictly necessary is that I rarely use shorthand for groups of characters. For example the tool might have a shorthand for digit but I always write [0-9] when I need to match a digit. Also probably because the shorthand might or might not be different for different tools.

Regexes are also known to be “write once read never”, in that writing a regex is relatively easy, but revisiting a semi-complicated regex you or someone else wrote in the past takes a little bit of extra effort to figure out what it’s matching and what edits one should make to it. In this case, tools like https://regex101.com/ or https://www.debuggex.com/ help a lot.

Re:FFmpeg by Example by nuancebydefault on Wednesday January 15, 2025 @04:02AM (#42708879)
The problem with escaping (like with using quotes) is often that you need to know through how many parsers the string goes. The shell or editor, the language you are programming in and the regexp engine each time can strip off an escape character or a set of outer quotes. That and of course different dialects of regexp makes things complicated.
Re:FFmpeg by Example by account42 on Thursday January 16, 2025 @03:58AM (#42723046)
This is like saying that words have different meaning if you talk to someone in english or french. Most tools have a switch to inform them that you're going to talk in english (perl-compatible regular expressions).
Re:FFmpeg by Example by mystified5016 on Tuesday January 14, 2025 @10:15PM (#42706924)
No one doubts the power or utility of regexes or ffmpeg, but they are both complicated beasts that really take a lot of skill.

They're both tools where if they're part of your daily workflow you'll get immense value out of learning them thoroughly. If instead you need a regex once or twice a week, the benefit is not greater than the cost of learning to do it myself. I have a hundred other equally complicated things to learn and remember, half the job of the computer is to know things I can't put in my brain. If it can do the regex for me, I suddenly get 70% of the value at no cost.

Regex is not a tool I need often enough to justify the hours and brain space. But it is still an indespensible tool. So when I need a regex, I either ask a human wizard I know, or now I ask my computer directly.

Re:FFmpeg by Example by imp0cat on Wednesday January 15, 2025 @02:06AM (#42708185)
It's self-reinforcing though. If you invest the time to learn, then you may find yourself (i a beafutiful house :)) using it a lot more than two times a week.
Re:FFmpeg by Example by nuancebydefault on Wednesday January 15, 2025 @04:09AM (#42708920)
I think this way of thinking is an uphill battle.

My kid uses wifi, google classroom tools, youtube, games,... I can tell him if only you knew command.com, ipconfig, doom.wad formats, lateg,... you could be so much more proficient. I already know this will never happen, just like I never learned x86 assembly.

The same goes for tools like LLMs, once you are used to them, your knowledge shifts.

Re:FFmpeg by Example by skydhash on Wednesday January 15, 2025 @09:55AM (#42711462)
I learned a bit of assembly and it was a god send to understand linkers and how FFI works. Also make it easier to have a good model on using a debugger. Not that useful on a tactical level, but really great when faced with some errors in your compiled programs.
Re:FFmpeg by Example by shlomo_z on Tuesday January 14, 2025 @09:59PM (#42706815)
... Then ChatGPT came along and I had 3 problems! https://regex.info/blog/2006-09-15/247
Re:FFmpeg by Example by jmb99 on Wednesday January 15, 2025 @03:35AM (#42708706)
For me, it wasn’t so much learning ffmpeg, as it was understanding containers/codecs/encoders/streams/etc. Learning all of the intricacies there made ffmpeg make a lot more sense.
Re:FFmpeg by Example by skydhash on Wednesday January 15, 2025 @10:00AM (#42711542)
Almost no one cares to understand the domain of the tool anymore, they only want result and expect a simplified interface that already does the unique thing they want to do, but can’t accept that a power tool can only be used with training.