Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Activity for Trevor‭

Type On... Excerpt Status Date
Comment Post #296356 That would work with the example I posted. But that is a minimal working example which I could easily solve that by hand. For even a slightly more complicated example example like this: $$ \sqrt{b x_1^2 + b x_2^2 + b x_3^3} + 3 = a $$ I would expect to get $a = 3 + \sqrt{b}$ and your suggeste...
(more)
2 months ago
Edit Post #296349 Initial revision 2 months ago
Question How to apply a unit constraint in SymPy
The solution to this is probably easy, but I haven't been able to find it. Using SymPy, I am trying to solve this equation: $$ {x1}^2 + {x2}^2 + {x3}^2 + 3 = a $$ with this constraint: $$ {x1}^2 + {x2}^2 + {x3}^2 = 1 $$ It is obvious that $a=4$. So, I wrote this code: ```python impor...
(more)
2 months ago
Edit Post #295305 Initial revision 8 months ago
Question how to disable Python pdb's `Quitting pdb will kill the process. Quit anyway [y/n]?` prompt
I'm running Python 3.14 in Linux. I have script with a `breakpoint()` in it, so when I run `$ python myscript.py`, it will take me into the `(Pdb)` prompt. Then, if I want to exit, I type `q` or do CTRL+D. It then shows this prompt: ``` Quitting pdb will kill the process. Quit anyway [y/n]? ``...
(more)
8 months ago
Comment Post #295296 Thanks, `setbufvar()` and `setwinvar()` are great, I knew there had to be some kind of vimscript functions equivalent to the `:set` command. However when I run `setbufvar(0,"&number",1)` Vim doesn't update and display the line numbers until I do some action in like move the cursor up a line. I al...
(more)
8 months ago
Edit Post #295294 Initial revision 8 months ago
Question how to run Vim's `:set` command using `vim --remote-expr`
In Vim command-line mode, I can run `:set invnumber` to toggle line numbers on/off. Is there a way to run this command using the `$ vim --remote-expr {expr}` shell command? I know I can do this using `$ vim --remote-send ':set invnumber'`. But I want to know if I can do this using `vim --remote-e...
(more)
8 months ago
Edit Post #294139 Initial revision over 1 year ago
Answer A: how to update RPROMPT each time a key is pressed in zsh
The cause of this problem is that `RPROMPT` has not yet been set when the `self-insert()` function is called. So the solution is to define `RPROMPT` as an empty string (`RPROMPT=""`) somewhere in your `.zshrc` file, in a place where it will get defined before ZLE is started. This solution cam...
(more)
over 1 year ago
Edit Post #294065 Post edited:
over 1 year ago
Edit Post #294065 Initial revision over 1 year ago
Question how to update RPROMPT each time a key is pressed in zsh
In zsh, I want to create a function that updates `RPROMPT` when I have typed `cd ..` into the terminal. As a starting point, I know I can, for example, add the `+` character to my `RBUFFER` when I have typed `cd ..` by adding the following to my `.zshrc`: ```zsh function self-insert() { zle ...
(more)
over 1 year ago
Edit Post #293865 Post edited:
grammar
over 1 year ago
Edit Post #293865 Initial revision over 1 year ago
Answer A: how to apply ANSI escape codes when a backslash precedes the escape code
I figured out a solution myself. You can use two `echo` commands to print the two strings separately, where the `-n` option is used for the first string to prevent the insertion of a trailing newline at the end: ```shell $ var='test\' $ echo -n $var; echo '\e[41mNOTE\e[0m' ```
(more)
over 1 year ago
Edit Post #293864 Initial revision over 1 year ago
Question how to apply ANSI escape codes when a backslash precedes the escape code
I am using ANSI escape codes in a shell script to colorize some parts of a string. For example, here I add the text `NOTE` with a red background color at the end of `$var`: ```shell $ var='test' $ echo $var'\e41mNOTE\e[0m' ``` ![good output This works as intended. However, if `$var` has...
(more)
over 1 year ago
Edit Post #293744 Post edited:
over 1 year ago
Edit Post #293744 Post edited:
over 1 year ago
Edit Post #293744 Post edited:
over 1 year ago
Edit Post #293744 Initial revision over 1 year ago
Answer A: zsh - autocomplete with braces in the middle of a directory
I figured out a solution myself. I'm not a zsh expert so this may be improved, but it works. 1) make a custom completion file for the diff command The completion file that zsh uses for the `diff` command is called `diff`. On my computer, this file is located at `/usr/share/zsh/functions/C...
(more)
over 1 year ago
Edit Post #293473 Initial revision over 1 year ago
Question zsh - autocomplete with braces in the middle of a directory
Suppose I have the following directory structure: ```txt folder/ aaa/ f.txt bbb/ f.txt ``` I want to compare the file `f.txt` as it is common to both directories. So in zsh I type this: ```console % diff folder/{aaa,bbb}/ ``` Pleasingly, zsh autocompletes both the `aaa` an...
(more)
over 1 year ago
Edit Post #293085 Initial revision almost 2 years ago
Question how to save the line number of a double-clicked line in tmux
In tmux I have the following command in my `.tmux.conf`, which will save a double-clicked line to the file `/tmp/tmuxline.txt`: ```tmux bind-key -n DoubleClick1Pane select-pane \; copy-mode -M \; send-keys -X select-line \; send-keys -X copy-pipe-and-cancel "cat > /tmp/tmuxline.txt" ``` Is th...
(more)
almost 2 years ago
Edit Post #293072 Initial revision almost 2 years ago
Question how do I get markdown to render # as a shell prompt and not a comment?
Note: This is a general question about Markdown formatting for any Markdown renderer (e.g., Gitlab, Github, Codidact). So this is not just a question about Codidact's renderer. When displaying shell commands in Markdown, I often want to use the hash sign (`#`) to indicate that I am running the...
(more)
almost 2 years ago
Edit Post #292973 Post edited:
almost 2 years ago
Edit Post #292973 Initial revision almost 2 years ago
Question empty line in table cell in reStructuredText (rst)
I would like to have an empty line in the cell of a table in reStructuredText. Consider the following example: ``` .. list-table:: :header-rows: 1 - aaa - bbb - ccc - ddd eee ``` Which produces this table: original rst table But I would like there to be a...
(more)
almost 2 years ago
Comment Post #291820 Yeah this community might not be a perfect fit for this question, but it was the closest I could find out of all the Codidact & TopAnswers communities (I'm trying to avoid StackExchange). Since ffmpeg is multi-platform, I figured Linux wasn't the right community.
(more)
about 2 years ago
Edit Post #291820 Post edited:
about 2 years ago
Edit Post #291820 Initial revision about 2 years ago
Question ffmpeg - concatenating identical audio-only files results in "non-montonic DTS" warning
I am trying to join some video files and have an issue. I have boiled down the problem to the following minimal working example. I create a 2-second mp4 with a silent audio stream: ``` $ ffmpeg -f lavfi -i anullsrc -c:a aac -t 2 a.mp4 ``` I then create a file containing the file names to be...
(more)
about 2 years ago
Comment Post #287851 Thank you for the suggestion
(more)
over 3 years ago
Edit Post #287851 Post edited:
over 3 years ago
Edit Post #287851 Initial revision over 3 years ago
Question How to define an object with different subclasses in an if-statement?
Note: I asked this question on TopAnswers a couple weeks ago, but didn't get any response, so I figured I'd ask it here. I am currently learning C++. I have a parent class (Vehicle) and two subclasses (Car and Boat). I am wondering how to create an object that will either be Car or Boat, d...
(more)
over 3 years ago
Edit Post #286959 Post edited:
about 4 years ago
Edit Post #286959 Initial revision about 4 years ago
Answer A: ffmpeg: apply a filter from a start time to the end of the video
I think I found a solution myself. Instead of using the `between()` function, you can use the `gte()` (greater than or equal to) function. So the command above would be: ``` ffmpeg -i video.mp4 -vf "yadif:enable='gte(t,30)'" output.mp4 ``` I discovered this command by looking through the FFmp...
(more)
about 4 years ago
Edit Post #286958 Initial revision about 4 years ago
Question ffmpeg: apply a filter from a start time to the end of the video
I'm using ffmpeg to apply a filter in between two time points. I am using the `between()` operator to specify the times. For example, to apply the yadif filter between 30 and 90 seconds I run: ``` ffmpeg -i video.mp4 -vf "yadif:enable='between(t,30,90)'" output.mp4 ``` However, I want to sp...
(more)
about 4 years ago
Edit Post #286570 Post edited:
made first sentence a little more specific
over 4 years ago
Edit Post #286570 Initial revision over 4 years ago
Question Vim: how to search for all instances of a string, except for those that are between two specific strings
Using Vim, I am trying to search for all instances of a specific string, except for those that fall somewhere in between two other specific strings. For example, I want to determine all instances of `bird`, except for those that fall somewhere between `abc` and `xyz`. So in the text below, a s...
(more)
over 4 years ago