Questions tagged [default-value]
A default, in computer science, refers to a setting or value automatically assigned to a software application, computer program or device, outside of user intervention.
1,925
questions
0
votes
1
answer
20
views
React Bootstrap Form.Control default value not taken
I am trying to make a modal that you open upon a click of a button for a specific student and try to add a grade for that student. But I face a problem - whenever I try to put a poor mark (which is ...
0
votes
1
answer
45
views
JPA updates a column/attribute that is not modified
We have a class User, which has a field isMigrated which is 0 by default. Now in the service layer, we are trying to update the user's status (another attribute). So these are the steps
We fetch the ...
0
votes
0
answers
12
views
Python bug on recursive function and default argument [duplicate]
here is a weird bug I found while coding a recursive k_argmax function.
Basically when calling the function with 2 parameters it seems the default value for res is not taken into account and some kind ...
1
vote
2
answers
39
views
How to use a formula to generate a date as a default value in an input msgbox?
I am trying to make my input message box a bit more sophisticated by using a formula to generate a default date in an input message box in excel.
Currently, it just gives a default value of "dd-...
0
votes
1
answer
33
views
set default kubernetes cluster
This is kind of a silly one but, given a number of clusters...
How would a user specify one cluster to be set as the default?
CURRENT NAME
* minikube
stage
prod
...
0
votes
0
answers
19
views
Does DB not null + default value constraint: `default 0 not null` mean I can set to there null and it converted to 0?
Does DB not null + default value constraint: default 0 not null mean I can set to there null and it converted to 0?
Or will it be there exception like constraint violation? ( And the constraint just ...
0
votes
2
answers
57
views
How to manipulate default argument value?
Consider the code below. It involves application of a very interesting python concept of using default argument during recursion[reversing a list]
A = [1,2,3,4]
def recur(A,Q=[]):
if len(A)==1:
...
0
votes
1
answer
22
views
how to update input defaultvalue using useRef (after the initial render?)
const Component = ()=>{
const [list, setList] = useState(getLocalStorage());
const [isEditing, setIsEditing] = useState(false);
const [itemToEdit, setItemToEdit] = useState();
const refContainer = ...
0
votes
1
answer
45
views
Pass a reference to a cell as the default value for an optional parameter while creating a custom function
I am trying to write a custom function where one of the parameters is an optional parameter that I want to default to the value I have stored in the cell B2 is nothing is entered by the user. Is this ...
0
votes
2
answers
29
views
HttParty: set default header for all requests
In some HTTP Clients theres one way to do something like:
HttpClient.default_headers = { "my-header": "a-value" }
And then every request done with that client will include those ...
-3
votes
3
answers
44
views
How to pass only 2nd parameter's value while function has three parameters in js?
function range(start=0,end,step=1) {
}
console.log(range(10));
Here I want 10 as the "end" value. Default values of "start" and "step" are 0 and 1.
1
vote
1
answer
27
views
PowerShell: Iterate through all arrays and push a default value if empty
There are multiple arrays, and their contents might or might not be empty. If any of these arrays are empty, I would like to add a default value to them.
I have tried wrapping all the arrays into a ...
0
votes
0
answers
32
views
Why parameters with default value must be on the right side of any parameter without a default value?
Now, I know this question has been asked before, but I was not convinced with the answers given. So I have to ask it again. But this time, I should first explain here what was the answer and why I was ...
2
votes
1
answer
61
views
Default value for associated type enums in Swift
I want to write code for an enum of stationary that takes default values when nothing is mentioned. Is it possible to do so in Swift?
Here's an example of what I'm trying to do
public enum Stationary: ...
0
votes
0
answers
26
views
React-select deletes every selected option by mistake
I created a drop-down select with react-select. I import some defaultValues with this.returnLayers (an array with value/label couples) and I add the possible options from the state this.state....
0
votes
1
answer
44
views
Are an Entity Framework object's properties with HasDefaultValue() automatically set to said default values at creation?
I guess that's a silly question, but I can't seem to find a straight answer.
I'm working with an EF Core entity, BanalTable. It has a property, RegularString, that I've set a default value in the ...
2
votes
1
answer
33
views
Can you specify a default value for a function or sub parameter of type Func or Action?
Consider the following code (don't mind the design, it's just an example):
Private _value As Boolean
Public Sub SetValue(Optional getValue As Func(Of Boolean) = ... )
_value = getValue()
End Sub
...
1
vote
1
answer
52
views
Optional parameters in HttpPost MVC marked as required?
In my C# code, I have a method in my Microsoft.AspNetCore.Mvc.ApiController that gets values. However, if I call the GetThingsAsync method without having the Origin header set in the POST call, I get ...
1
vote
3
answers
64
views
How to perform multilevel lookup with possible missing values at the each level? [closed]
I'm creating several variables based on query string parameters, and I have two options:
Single-line if/else statement
foo = event['queryStringParameters']['foo'] if event['queryStringParameters'] ...
1
vote
0
answers
25
views
Swift Protocol Extension unexpected behavior [duplicate]
I am having trouble understanding why t and tt are treated differently. Obviously it has to due with what is specified directly in protocol A, but what is the logic here for this difference?
protocol ...
0
votes
1
answer
160
views
Default arguments to C macros
Suppose I have function bshow() with signature
void bshow(int arg0, int arg1, int arg2);
but for arbitrary reasons I want to implement it as a macro.
Furthermore, I want the function have default ...
0
votes
2
answers
27
views
How to set a default return value if a row doesn't exist
Say I have two tables:
Users - UserID, UserName
Actions - UserID
The database doesn't have referential integrity, and so If a user has been deleted, the Actions table can still contain the User ID.
...
0
votes
0
answers
77
views
Default Value for ion-input type = "date" from Back End
I am trying to set the default value of ion-input type = "date" in the lines given below as this.metadataDrawing.issueDate which is a value coming from back end inside init() function in ts ...
0
votes
2
answers
49
views
how to provide default value while destructing interfaces inside interfaces in typescript?
what i'm trying to accomplish here is to be able to use the function in a way that if:
you provided arguments it works with the provided arguments, yet
if arguments were not provided it would use the ...
3
votes
2
answers
80
views
How to specify a default argument for a template parameter pack?
I have the following method
template <std::size_t N, std::size_t... Indices>
void doSomething()
{
...
};
It seems not possible to supply default values for Indices, e.g.
template <std::...
0
votes
0
answers
10
views
Error in const input parameter with default value [duplicate]
I have a class in Foo.H and Foo.C files
The below arrangement works fine!
Foo.H
class Foo{
public:
//constructor
// few other functions
bool foo_method(int a, string b, const common::MsgType ...
0
votes
1
answer
45
views
I want to set a default value of my input field but it doesn't provide right one without reloading and shows previous default value in that field
I am trying to show minOrderQuantity for the selected product but it gives me previously selected minOrderQuantity data in the default value of input field.
const { data: product, isLoading, refetch } ...
0
votes
0
answers
33
views
how to get default value from react hooks form? I tried it. but it shows undefined
const { register, handleSubmit, reset } = useForm();
const onSubmit = data => {
console.log(data)
};
<input type="email" placeholder="...
0
votes
1
answer
48
views
HTML default value fo radio button input type based on python variable
so im making a Flask app where a user uploads a spreadsheet and then can play with the parameters of that spreadsheet on a html page. One parameter is a value which can only be 1, 2 or 3. The user is ...
0
votes
1
answer
106
views
How to change default value of date filter in metabase?
I am trying to write dynamic sql query in metabase-
I added date filter like that (using snowflake for query):
select * from my_table where date > {{date_filter}}
after that I needed to set ...
-2
votes
3
answers
69
views
Is there a way to find values that contain only 0's and a symbol of any length?
I want to find strings of any length that contain only 0's and a symbol such as a / a . or a -
Examples include 0__0 and 000/00/00000 and .00000
0
votes
2
answers
65
views
Java constructor with default values
thx for reading.
I need to create constructor, which in one case has default values example below.
this code is wrong of course, Is it possible to do that it means in case "dog" constructor ...
0
votes
3
answers
55
views
How to find values that contains only 0's and any other digit for example 000000001 or 0000010001 or 010101 or 0002 or 02020 or 0090 etc.?
I want to find 'default type values' in SQL that is entered when something like an ID number of company registration number is entered. Some of the values I see is a combination of 0's and another ...
1
vote
1
answer
42
views
variable not initialized in different case
//(old)Hello so I'm writing a program that ask for an option from the user and run the methods created for each one
there are 2 input files "input1.txt" and "input2.txt" that is ...
1
vote
2
answers
38
views
Is there a way to find default values that is a combination of the same number like 000/000/0 or 11111 or 99999?
I want to find values in the SQL database that is a combination of the same number such as 0000 or 000/000/0 or 11111 or 99999 etc.
Is there a way to find these values without hardcoding?
What I am ...
0
votes
1
answer
258
views
Set enum field to default value in case no value is passed
I have a gender enum like this:
public enum GenderEnum {
INVALID,
MALE,
FEMALE;
public static GenderEnum from(String text) {
if (text == null) {
return INVALID;
...
3
votes
1
answer
210
views
GitLab-CI: Why do stageless pipelines show all jobs under stage "test"? Can this be changed?
I've moved my pipeline to a "stageless" one, simply by using needs rules and removing all stage declarations.
This all works fine, but I've noticed that all my jobs now appear under a single ...
0
votes
1
answer
44
views
How to know if a function parameter value is the default in python
I have a function with some parameters that have default values, how can i know when one of those parameters values was changed without having to evaluate each of them individually?
This is the ...
0
votes
1
answer
313
views
Kotlin default parameter and named argument for map
I am writing a method and I use default parameter and named argument because sometime, some parameters are not required and it's easier for me to have default value. But I am getting trouble making it ...
0
votes
0
answers
224
views
Change value dynamically with click.option callback function
So I want to Change default list in program by reading option from command line.
Using this answer by @Stephen Rauch and add simple option to click with simple callback function set_list() it seems to ...
0
votes
0
answers
87
views
Flask-wtf SelectMultipleField: how to configure default choices
In my app I use a among others a SelectMultipleField ("stektypes") for creating “stekken”, using the following form:
class createStekForm(FlaskForm):
name = StringField("...
0
votes
1
answer
166
views
Flutter: create const color from hex string
I am using Firebase remote config to store my color values. This gives me the flexibilty to update colors without the need to update my app. Now I have written myself a helper function which returns ...
0
votes
1
answer
225
views
Setting a default data validation value in Google Apps Script
I am working on a materials order spreadsheet in Google sheets that has four main columns and a pertinent cell. Column D contains a list for a default order amount, column E contains a list of amounts ...
0
votes
0
answers
61
views
How to avoid `specialization after instantiation` when using the return of a function template specialization as default parameter?
Is there a way to avoid the following code:
class MyClass {
public:
struct MyData {
/* ... */
}
template < typename T = MyClass >
static MyData myFunc();
explicit ...
0
votes
2
answers
132
views
Gradle - Get the default value (convention) of a Property
I want to achieve a very basic thing (in any normal language): I would like to get the default value (convention) of a Property. Gradle docs in chapter Lazy configuration, describes how to apply the ...
0
votes
1
answer
154
views
How to tell a method to use the default value of its optional parameter?
Consider the following method
private void PrintThis(string xxx, string text = "MARY")
{
Trace(text); // MARY
}
and assuming I use it as such:
PrintThis(xxx:&...
0
votes
1
answer
73
views
How to ignore zero values with MapStruct
I am trying to update a postgres record based on what the http request is sending, which is unpredictable (can be any combination of attributes). Now, what i want to do is to get MapStruct to ignore &...
1
vote
1
answer
33
views
Member Function with no Signature or Name - Java
So I'm looking at a Java project for my university and the code we are working with has this syntax that I have never seen before:
public abstract class Machinery {
protected String name="...
0
votes
3
answers
45
views
Using interface correct in java
Having this interface
public interface BookService {
List<Book> search(int childLimitPages, int numberOfBooks, List<Book> sourceOneResultSet, List<Book> sourceTwoResultSet);
}
...
0
votes
2
answers
252
views
react typescript set default value multiselect
I am using this module
import { MultiSelect } from "react-multi-select-component"
and creating form by this
const [selected_to2, setSelected_to2] = useState([]);
<MultiSelect
options={...