Using clang-format, how to keep backslashes? - clang-format

I found that clang-format will automatically remove the backslash \ at the end of my code.
There is a flag, AlignEscapedNewlines, but it only works when backslashes are behind #define. How to keep them in all of the code? Thanks.

Related

Run FFMPEG command with commas and single quotes

I am using FFMPEG-Kit for iOS BUT this issue applies to all releases of FFMPEG-Kit... within my command I run [1:v]format=argb,geq=r='r(X,Y)':a='0.5*alpha(X,Y)'[withOpacitySet] but it does not work, if I run the command without that it runs fine...
Is it the commas? The quotation marks?
with not much information, I am assuming you are missing double quotes in your filter
try
"[1:v]format=argb,geq=r='r(X,Y)':a='0.5*alpha(X,Y)'[withOpacitySet]"
if that's not the case please share your input and/or other information.

How to resolve warning 'excess arguments to builtin `define' ignored' with m4

I'm using m4 define to create a macro.
I tried using include(file) to read the content of the file as below.
define(`TEST', include(file1))
TEST
file1:
test -abc -LDFLAGS "-Wl,-rpath,/home/user -lmsg"
When I run the code, it gives a warning and doesn't print anything beyond -Wl
m4:r1:1: Warning: excess arguments to builtin `define' ignored
test -abc -LDFLAGS "-Wl
I tried using single quotes, but it didn't work.
Can someone please help me resolve this?
If there are commas in the file, those will be interpreted as argument separators. The include replacement is inserted before determining the arguments to define.
Using single quotes is correct -- then the include will be processed in the output instead. For example:
define(`TEST', `include(file1)')
TEST
does work on my machine. (note that an even better solution is to add quotes around file1 as well).

Are backslashes supported in Groovy comments?

I experienced a weird Jenkins error while trying to run a groovy-scripted pipeline that contained backslashes inside comments.
Here is the offending code:
// The script below depends on:
// * The presence of a recent nuget.exe in c:\tools (v5.7)
// * The presence of the xxx plugin installed for user foo\username
I'm aware the backslash is used in many languages to start an escape sequence, but I had never before experienced backslashes being an issue inside comments.
I wonder if this backslash in comments behavior is due to Groovy itself or rather a bug in the way Jenkins interprets it...
Edit: I solved my issue by replacing the offending \ with \\ but then noticed I had forgotten to double the backslash in c:\tools, and still Jenkins did not complain. It seems Jenkins (or Groovy) tried to interpret the \u in foo\username as introducing an hex character code... but was okay with \t for it probably was interpreted as a tab!

Removing trailing spaces with clang-format

As the title says, I'm trying to get clang-format to remove the trailing white spaces of my files, but I fail to find the relevant option name.
Could anyone point me to the obvious?
clang-format does remove trailing whitespaces automatically.
You can test this by e.g. clang-format -style=Google file.cpp -i.
It is also useful to know most modern editors do have built-in options to do this and even more for you on save. Here are a few:
In Sublime text settings set trim_trailing_white_space_on_save to true.
In VScode set files.trimTrailingWhitespace to true.
In Vim you need a vimrc file as described here.
etc.

How can I get parens in a URL using the Doxia APT format?

I am using the APT format to create documentation on a maven project. I am trying to link to a JavaDoc method description, which URL contains a parentheses.
For example, the url
http://myjavadoc/methodname(java.lang.string)
Becomes
http://myjavadoc/methodnamejava.lang.string
Trying to use URL-encoding produces a similar result in that the percent symbol is stripped out.
http://myjavadoc/methodname28java.lang.string29
In both cases, escaping the character with a backslash has no effect.
Does anyone know how to get parens (or percents) to be interpreted through apt correctly?
You should mention your doxia version.
Anyway both methods worked for me with doxia 1.6
Link to {{{http://myjavadoc/methodname(java.lang.string)}http://myjavadoc/methodname(java.lang.string)}}.
Link to {{http://myjavadoc/methodname(java.lang.string)}}.

Resources