1,452 questions
-2
votes
2
answers
211
views
Optional const by-reference argument in C++
In a C++ program, I have an API function with the following signature:
Foo const & GetFoo() const;
The Foo class doesn’t allow copying or moving of instances. The API can’t easily be changed.
Now ...
1
vote
0
answers
39
views
Overloading Powerbuilder Native functions, optional parameters
We've been plagued for years by the GetFileOpenName and GetFileSaveName functions that open Windows dialog boxes. When the user closes them, the application's current directory has changed. Afterward, ...
1
vote
0
answers
18
views
How can I call different types of an agent in source block (or any other blocks in process modeling library?
I want to define an agent with two different types, A and B and then I want to separate each type and do some calculation of each type. for this aim, I defined an agent, called Product. Then I defined ...
0
votes
1
answer
138
views
typer.Option in python
I have a typer cli command like this:
@app.command(
no_args_is_help=True,
help="Test command help text"
)
def test(name:str = typer.Option(
None,
"--test",
...
4
votes
1
answer
69
views
Pass an optional argument to a custom function for use both directly and in an ellipsis construct
Sometimes I write functions that involve renaming/relabeling a lot of variables in different places, using a relabeller. The relabeller is used in multiple contexts, both directly in my code (e.g. for ...
1
vote
2
answers
103
views
Pass an optional argument to ggplot inside a custom function
I have a custom function that calls ggplot. I'd like to make one of the ggplot arguments optional - for example, changing the color of geom_point. I know two ways to do this, as shown below; one is to ...
0
votes
1
answer
50
views
Argument Not Optional is not working. How can I fix?
I am trying to iteratively generate project sheets row by row in an excel. Some columns have long descriptions so wrote an additional sub function to handle the long text strings. I believe an error ...
2
votes
1
answer
97
views
How to convert a class with all Optional fields to a class with no optional fields
I have a class with many many fields, all of which are Optional when deserialized from JSON.
Is there a way to convert this to a class with matching all non-Optional types.
My optional class
@...
0
votes
0
answers
30
views
Pass prop conditionally in react while handling routing
In React app, I render various components following app.tsx rendering. I would like to know if there is a possible way to pass such prop as an optional while managing routes. I get below error. This ...
0
votes
0
answers
19
views
Escape ':' in CLI command option that is expecting ':'
I am trying to run a CLI tool (Triton perf_analyzer) that takes an option --request-parameter that is formatted as <name:value:type>. The issue is that I need to pass in a string formatted JSON ...
0
votes
2
answers
95
views
Writing custom ggplot function with optional facet plot arguments
I am trying to create a customized function that uses ggplot facet_wrap, in which the user can optionally provide labels. I've wrapped the facet_grid argument in an if/else clause depending on whether ...
1
vote
1
answer
104
views
What does the first colon mean in the ":b:" with getopt command line?
Show bash and getopt version in my OS:
bash --version |grep [r]elease
GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)
getopt --version
getopt from util-linux 2.38.1
In the getopt's manual(...
0
votes
2
answers
69
views
Pass optional weight argument to model.frame
I'm trying to program a function that takes an optional weights argument and passes it to model.frame:
test <- function(ff, weights, data) {
mm <- model.frame(ff, data, weights=weights)
y &...
-2
votes
2
answers
117
views
VBA Macro - Argument not optional
I'm new to the whole VBA thing, currently practicing making macros for Excel worksheets. I wanted to make a button that, when pressed, updates query from the table to an archive table and then updates ...
1
vote
0
answers
74
views
Unexpected Behavior When Using Optional Arguments in Function
I'm experiencing an issue with sending AT commands through a serial port in my code. The problem is that when I send the following commands:
while (true) {
thread_sleep_for(5000);
...