12,069 questions
1
vote
1
answer
47
views
Turning off JFR events with startup args
Im trying to understand if it is possible to turn off certain JFR events for sanitizing reasons using startup args.
I know it is possible to scrub the file after downloading it, and that works just ...
-3
votes
0
answers
51
views
Why does my default list argument keep growing between function calls in Python? [duplicate]
I wrote the following function:
def add_item(item, items=[]):
items.append(item)
return items
print(add_item(1))
print(add_item(2))
print(add_item(3))
I expected the ...
-3
votes
1
answer
96
views
Does anyone have a nice concise way of parsing bash function arguments and options? [closed]
Here's my current preferred method that I normally put at the top of functions:
#!/usr/bin/env bash
unset opts args
for arg; do [[ ${arg:0:1} == "-" ]] && opts+=("$arg") || ...
2
votes
2
answers
133
views
Testing that a function receives a string
I would like to build a function such as:
test <- function( fct = "default" ) {
# here test that fct is a string
# ...
}
in which it is tested that fct is a string of length one. ...
2
votes
1
answer
174
views
How do i pass Program Arguments From Apache Flink 2.0.0 Web Gui to my Job properly?
I need to submit a new Apache Flink Job from the Web GUI instanced in a docker container in Session Mode and i need to pass some arguments to the main function of my job written in Java.
I'm trying to ...
5
votes
3
answers
387
views
How can you enable compiler warning on array argument decaying to pointer
I learned that in C++, array arguments decay to pointer arguments. As a result,
void PrintArray(int arr[4])
{
std::cout << arr[0] << std::endl;
std::cout << arr[1] << ...
2
votes
1
answer
181
views
Is there a way to store "$@" into a variable in pure POSIX shell?
When I do something like ARGS="$@", the shell just concatenates the arguments stored in "$@". Is there a way to store "$@" into a variable in pure POSIX shell to be able ...
5
votes
2
answers
115
views
How do you specify a variable name for a function call using a character variable in R?
I am working in R trying to create a wrapper function that calls a specified internal function (which is some existing function) and does some things with it. My wrapper function will include an ...
-3
votes
1
answer
114
views
#define COLUMNS as a function argument in C
It is more question than a problem.
I make my header file with a function declaration like this:
void fw_iteracja_wsk_rows_a(float (*tab)[COLUMNS], int ROWS);
How can I adjust/change the COLUMNS ...
0
votes
0
answers
52
views
Passing a dataframe column value as a function argument
I'm new to Python so this should be pretty basics but I can't seam to accomplish what I want.
Let's say I have the following data frame:
df = pd.DataFrame(index=[1,2,3])
df['Currency'] = ['USD','USD','...
2
votes
1
answer
117
views
Is it ok to send a value to the lvalue argument using std::move?
I have a function of the form void foo(std::string str);
I want to use it in two scenarios:
send a copy of the original value to it:
std::string myString = "any data that I want to keep in its ...
0
votes
0
answers
48
views
Hasura Documentation Pagination Example Seems Incorrect – Limit vs. Offset
I'm following the Hasura documentation on GraphQL Limit and Offset for pagination, and I noticed something that seems incorrect.
The docs state:
"If we have 50 todos, we could split them into 5 ...
0
votes
1
answer
80
views
Optional {locale} in routes messes up controller arguments (Laravel 11)
I have a project in laravel 11 and there are some issues with my config.
The site should support optional locale param to differentiate between default and custom language:
DE: https://example.com/...
7
votes
1
answer
415
views
C++ argument parsing is incorrect when the executable file path contains spaces
I am having problems with arguments in C++ console programs built under C++Builder 12 Community Edition.
If the executable is in a folder with spaces in its name, eg. "test dir", and I ...
1
vote
2
answers
85
views
Executing an R file with Rscript without specifying entire path with Powershell on Windows
I have an R script that takes arguments that I want to be able to execute without having to type the entire path to the script location. For examples sake, lets say this is the script:
# arguments ...