2,039 questions
2
votes
2
answers
122
views
How to use the [DefaultValue] attribute to ignore boolean = true properties in JSON serialization
This is a follow up question to the Ignore boolean property = true in JSON serialization.
I have a record with multiple bool properties, some of them having default value true and some false:
private ...
1
vote
1
answer
70
views
Adding a column with default value incorrectly fills a different column
After executing the following script:
alter table test_table
add (test1 varchar2(1 char),
test2 varchar2(1 char) default 'T' not null);
I got interesting results... both columns are filled with ...
1
vote
2
answers
39
views
Is there way to add one more argument to the function(which has var args) with default value without breaking existing calls?
I have a function
fun foo(
id: String,
vararg values: Int,
){
...
}
and there are calls like these
fun bar1(){
foo("id_1")
foo("id_2", 1)
foo("id_3&...
0
votes
1
answer
342
views
typescript for react-hook-form without default values
We have react-hook-form + zod + react-query.
How do I type values with TypeScript to let it catch a bug if I do not provide optional default values?
https://codesandbox.io/p/sandbox/react-form-form-...
0
votes
1
answer
286
views
How to set a default value for a specific cell in a matrix dropdown question in Survey JS?
`I'm working on a survey using SurveyJS, and I need help configuring a matrix dropdown question. My goal is to set a default value for a specific cell in this matrix.
Problem Description
In my survey, ...
0
votes
0
answers
426
views
Postgresql pgvector: How to set a default value to a vector when its size is large?
Say I have a very large vector, I want to set all its indices to some default value. How can I achieve this? I seached online but couldn't find an answer. Note that this is not a postgresql array, ...
1
vote
1
answer
318
views
How can I turn a literal into an expression in SQLAlchemy for MYSQL?
I'm using sqlalchemy to create a table in mysql. I would like to have a JSON column, with a default value, but mysql doesn't allow literals to be the default value, only expressions.
If I create the ...
4
votes
1
answer
54
views
What is by default significance level of Modified Mann Kendal test in R?
I am using Modified Mann Kendal test in R.
I want to know its by default value for significance level. Can we set the significance level manually? For example: 5%, 10% etc. if possible, then how can ...
0
votes
1
answer
64
views
Default value of input 2 is from input 1. Why does the state of input 2 not get its default value from input 1?
I have 2 <input type="text"> elements. What users type in input 1 will be the default value of input 2. The value of input 2 will be used for other tasks. The tasks should run right ...
0
votes
0
answers
26
views
Exploring the Use of Mutable Default Arguments for Caching in Python [duplicate]
Today, while tackling this question on Project Euler, I stumbled upon an intriguing use-case for employing mutable objects as default arguments in Python functions. Typically, this practice is ...
0
votes
2
answers
548
views
Get the default value of a property of an abstract class
Is there a way in C# to access the default value of a non-static, non-const property that is defined in an abstract class?
For example, given:
public abstract class SomeClass
{
public int ...
0
votes
0
answers
672
views
Default type discriminator for some subtypes in JsonDerivedType
For the following types' structure
public class Person { public string Name { get; set; } }
public class Adult : Person { public string Occupation { get; set; } }
... // many more subtypes
I need to ...
2
votes
2
answers
94
views
Multiple similar inputs to an R function - problems with providing them using lists
I have the following problem: I want to write a function that is supposed to get multiple similar sets of inputs, lets say:
FUN <- function(part1.x, part1.y, part1.z, part2.x, part2.y, part2.z){}
...
1
vote
1
answer
2k
views
ORA-02262: ORA-904 occurs while type-checking column default value expression while modify by sequence defaults
Why I got error? Column datatype is integer like a sequence value...
SQL> create sequence SEQ_TEST_ID;
Sequence created.
SQL> desc test
Name ...
-3
votes
1
answer
440
views
How to declare a default value for a struct with kelseyhightower/envconfig?
At the beginning, everything is going well.
I have a configuration to read from drivers with the help of the package github.com/kelseyhightower/envconfig
type NXConfig struct {
Enable bool `...
1
vote
1
answer
773
views
Symfony 6 set default value for unmapped ChoiceType field in form
I have this scenario:
A value is read from a cookie and passed as an $option to a FormType:
$indexOrder = $request->cookies->get('clientfile-order') ?? 'date-last';
$advancedSearchform = $this-&...
0
votes
2
answers
325
views
Add column to table with a default value from function
I am pretty new to this, so please be nice ;)
I have created a function in PL/SQL where I feed the function a UserNo and it gives me an email-address.
What I would like to be able to do, is to add a ...
0
votes
1
answer
82
views
How can I specify an argument object when the default is NULL in R?
I am trying to write a function that sets the default for some arguments to NULL. However, when I then want to specify those arguments to not be NULL when calling the function, I receive the error ...
1
vote
0
answers
202
views
Can we set default values for inputs on demand in your workflow file set for Github Issue
Below is my github actions ISSUE_TEMPLATE that seeks input from user.
name: GH Action details
description: GH Issue form
title: "GH Action details"
assignees:
- my-devops
labels:
- ...
2
votes
3
answers
134
views
Python itertools.zip_longest with mutable fillvalue
In a code that evaluates a web response, I would like to zip elements from several lists. However, the elements of the iterators are dict's.
Therefore, I would like to fill up the missing values also ...
0
votes
1
answer
1k
views
How to make a button clicked by default in React
I'm working at a ToDo app and I managed to make a menu section with two buttons switching between the app section. The problem is that when it's first opened the 'About me' button should be clicked by ...
1
vote
2
answers
82
views
jq: Defaulting multiple possibly-nonexistent key, in nested path?
I'd like to default values in place on jq, and return root document.
What I have (note that some property is missing from the inner object) is following, but length is not fixed:
[{"foo":{}},...
1
vote
1
answer
100
views
Importing function with arguments with "variable" default values in Python
I want to use a function with a default argument (as in argument with default value) in two separate scripts in which that default argument is set differently. Of course, the function may also be ...
1
vote
1
answer
339
views
Lua script with input either piped from a command or passed as an argument with a default value
I would like to call a Lua script, say "test.lua", with an input argument through any of the following options:
Piping in the output of an earlier command, say as:
echo "value" | ...
0
votes
0
answers
84
views
Flutter dropdownbutton is not display current value selection
I have a menu where you filter geographical locations using two dropdown menus. Then the user proceeds to the main screen.
On the main screen, if the user wants to change the geographical location ...