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' ``` 