1,060 questions
3
votes
1
answer
202
views
What does 0 mean in someList.toArray(new AnotherClass[0])?
In Java we have toArray() method which will return Object[]. If I want to return another data type I need to pass it to parameters like this
SomeClass.SomeList.toArray(new AnotherClass[0]);
What does ...
5
votes
5
answers
422
views
Why Zero has no decimal integer spelling in C?
I am reading modern C, and on page 66, I come across following section:
Remember that value 0 is important. It is so important that it has a lot of equivalent
spellings: 0, 0x0, and ’\0’ are all the ...
1
vote
1
answer
110
views
Custom pow function returns 0 for large exponent in C [closed]
As a beginner in C, I made my own pow function.
The type of arguments in the function and the return value are all long long int.
Here is the code:
typedef long long int lli;
lli p0wer(lli base, lli ...
0
votes
0
answers
79
views
Difference in handling zero after decimal between web and android
I noticed Flutter has different ways of handling zero after decimals between the web and Android.
for example:
Double Z = 0;
Double Y = 0;
Double X = 0;
Double W = 0;
Z = Y + X * (4 - W));
Print (Z);...
0
votes
2
answers
511
views
Replace Null in Big Query
“How to replace zero values with null in BigQuery for weather data analysis?”
Missing values were incorrectly entered as zeroes, and I need to change them to null values. The code I used was Update (...
0
votes
0
answers
63
views
Zero-inflated data in an RDA
I am trying to use an RDA model to find how strongly certain habitat variables are correlated with the abundance of bullfrog.
rda_b2 = rda(formula = d_final_scaled$BF_Conc_TF ~ mean_PVI_E + Refugia + ...
0
votes
3
answers
80
views
How to Group 0 with NULL in mysql select
I know there are many variants of this question, but none seem to address my issue.
I have a page reporting website order stats. One of the variables it considers is which 'website' a customer used.
...
1
vote
1
answer
114
views
R ggplot2: Is it possible to remove the zero label after using expand_limits(x = 0)?
The ggplot function expand_limits(x = 0) produces very pleasing spacing for many graphs (in a loop) but I'd rather not have the zero label. Does anyone know how to remove the zero label only ? The ...
1
vote
0
answers
21
views
Problem With SQL ZERO ROWS AFFECTED (Procedure) [duplicate]
Good morning, I have a problem With SQL Code. I have a table named DIPART (which contains information related to departments) with two attributes: NUM_DIPART, which is the department number (key), and ...
0
votes
0
answers
50
views
How Do I Avoid np.where Calculating Divisions By Zero? [duplicate]
Results = np.where(
thing_minus_1 == 1,
0,
(1 - thing) / (1 - thing_minus_1),
)
Running this code causes a warning:
RuntimeWarning: invalid value encountered in divide
This is because it ...
0
votes
0
answers
140
views
zero assignment to signed integer in C++
since zero is a number that is neither positive nor negative, so what will happen if we assign a variable of type signed int a value of zero in C++? Will this be a valid assignment?
In fact I have ...
0
votes
1
answer
125
views
Adding IFBLANK turn into 0 on an existing formula
I used this function =VALUE(RIGHT(D2,LEN(D2) - MAX(IF(ISNUMBER(MID(D2, ROW(INDIRECT("1:"&LEN(D2))), 1) *1)=FALSE,ROW(INDIRECT("1:"&LEN(D2))), 0)))) to remove only the right ...
0
votes
1
answer
444
views
Excel SUM Function = 0 after RIGHT function
I used this function
=RIGHT(D2,
LEN(D2) -
MAX(
IF(ISNUMBER(MID(D2, ROW(INDIRECT("1:"&LEN(D2))), 1) *1)=FALSE,
ROW(INDIRECT("1:"&LEN(D2))),
...
4
votes
2
answers
13k
views
Is there a way to initialize an array or slice of bytes to zeroes in Zig?
Apparently Zig used to provide this feature in an easy way, but it was removed in 6a5e61.
What is the recommended approach now for when such a behavior is needed? To manually iterate through the array/...
0
votes
1
answer
106
views
Trailing zeros in content: counters function of CSS
I've used the content CSS value with the counters function to create ordered lists that have nested numbering. My html is created using the DITA open toolkit, so there are auto-generated and ...
1
vote
1
answer
118
views
I want to count in R how many rows I have that have no 0 value at all
I have a data set with 5908 rows (now the variables) and 5 columns (observations). The variables take the value 0.00 in some column.
I want to sort out the rows that do not have any zero values at all....
0
votes
1
answer
303
views
How to delete variable leading zeros in Cobol program?
In the Cobol language: I use a numeric variable that is initially defined as the size. If the user typed a number smaller than the size I declared, there are unnecessary zeros at the beginning. How do ...
0
votes
1
answer
294
views
How do I create a mean variable excluding zeros using proc sql in SAS?
I have 5 variables:
Academicyear,
dept,
InstrGID
curenr
credit_hours
I need the mean of credit hours grouped by Academic year, dept, and InstrGID. The mean must exclude the zeros when "curenr&...
0
votes
2
answers
88
views
id is always returning 0 in Android Studio SQLite. Help me point out the problem
I'm creating a todo list app with Android Studio.
My MainActivity.java
package com.example.myapplication;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import ...
0
votes
1
answer
217
views
Category with zero value required in group by result
I'm using SQL SS with read-only permission. The data I'm using has 3 product types, but I need a result displaying a sum of transactions for 6 product types with zero values for the 3 not available:
...
0
votes
0
answers
291
views
Multichannel adc with dma values are not exact
I use multichannel(7 channels) adc1 in circular an scan mode with dma.i use ll functions and read adc values in dma_stream_IRQHandler function.the values are not exact and stable.adc sample clock is ...
0
votes
3
answers
257
views
How to assign a zero to genric Number in Kotlin?
I'm new to Kotlin, and I'm trying to write a simple generic method but it doesn't compile
inline fun <T:Number> List<T>.firstOrZero() : T {
if (isEmpty())
return 0 // this ...
0
votes
0
answers
97
views
What is the reason that C output assigns negative sign to zero? [duplicate]
While working on a program that I have written using C, I noticed an unusual thing. I have defined a constant a=0.0 of type double. Then, when I print a the return value is 0.0000 as usual, but when I ...
0
votes
1
answer
43
views
Purescript Complex zero element (Purescipt by example exercies)
I solve Purescript exercise from the book https://book.purescript.org/chapter6.html#multi-parameter-type-classes
I don't understand what "zero" statement is?
I have "Complex" type, ...
3
votes
4
answers
4k
views
How can I return blank cells as it is instead of printing as Zeros while using filter function
["referring to the data shown in the image while using the filter function and getting the return values, How can I return blank cells as it is instead of printing as Zeros while using filter ...
-4
votes
2
answers
130
views
I am having a hard time converting fluid dynamics equation into MATLAB code
I converted these two equations into MATLAB code before but I lost the file and now I am trying to write them again but there is a problem and I can't figure it out.
This is the main equation:
This ...
1
vote
1
answer
345
views
Python- fillna method adding .0
I want to fill empty cells in my csv file with zeros. I found that I can do this with fillna metod. It I do this:
fillna(“0”)
This will add 0 if cell is empty but if the cell has for example 1 it is ...
0
votes
1
answer
76
views
Why is dividing by double still 0, when all of the numbers are either decimal or double?
I am working on a test trading bot that connects to a centralized exchange. right now it is not actually trading but i wanted to simulate trading my making transactions fire when the price of an index ...
0
votes
2
answers
146
views
Octave Create Matrices with For Loop
i need your insight. I want to create 20 different zero matrices, like this:
metrics_1 = zeros(10, 19);
metrics_2 = zeros(10, 19);
metrics_3 = zeros(10, 19);
metrics_4 = zeros(10, 19);
metrics_5 = ...
-1
votes
2
answers
197
views
SQL Query Transpose not returning negative numbers
I have a table that I am transposing by using a database view (using SQL Server). This table has positive and negative values. All of the negative values are returned as zero. Any ideas on how I can ...
0
votes
1
answer
21
views
I want the Loop to stop if the value taucher.xPosition is equal or below 0
If i continue pressing the left arrow key, I want the value taucher.xPosition not to be below Zero. It should just stop right there. Now the Output when i keep pressing the right arrow key looks like ...
0
votes
0
answers
95
views
Adjust variance of zero value in R
I am not sure if I will manage to ask right but I have a continuous time series data sets, that have a DAILY zero value variance and it is necessary to actually find a way managing it.
Exaple:
In the ...
-1
votes
1
answer
166
views
how can i print zero at the first of output [duplicate]
#include <stdio.h>
int main(void) {
int Phone_number1,Phone_number2,Phone_number3 ;
printf("Enter phone number [(xxx) xxx-xxxx]: ");
scanf("(%d) %d-%d" , &...
-3
votes
1
answer
91
views
those zeros will be deleted. 0.00004300 => 0.000043 [duplicate]
This code works well. Now I want to add something to it. If there are zeros after the displayed number, those zeros will be deleted. For example: 0.00004300 => 0.000043
How do you think this part ...
0
votes
1
answer
57
views
Error in transforming blank spaces into 0 after pivoting_wider for performing DGEList function in R
the df I'm working on originally is a long format table like below:-
VALUE
Gene_Symbol
Sample_ID
12253
BRCA
P1
42356
CAMP
P2
Then for generating the DGEList, I decided to transform it into a wide ...
0
votes
2
answers
266
views
How can I add zeros or NAs to each species that does not have a corresponding date in R? [duplicate]
I have a database what looks like this (although it has more species and dates):
Date
Species
Count
2022/06/01
AMAV
50
2022/06/05
AMAV
20
2022/06/07
SESA
10
2022/06/07
AMAV
8
I want each date to ...
2
votes
2
answers
68
views
How is 0.0 typically represented in the absence of subnormals?
The inclusion of subnormal numbers in IEEE 754 was a controversial decision.
In floating-point formats without subnormals, but with "hidden" 1 bits, how is/was 0 typically represented?
Was ...
4
votes
1
answer
93
views
How do I distinguish negative zero with Aeson?
Haskell distinguishes negative zero:
ghci> (isNegativeZero (0 :: Float), isNegativeZero (-0 :: Float))
(False,True)
JSON also allows for distinguishing them, since both "0" and "-0&...
1
vote
1
answer
847
views
Whats the best way to keep a number equal or greater than zero [closed]
What I want to achieve is to make sure that my property is always 0 or greater. The type doesn't matter.
Lets say:
var x = 3;
var y = 5;
And after x -= y x is supposed to be 0.
Currently using this ...
0
votes
0
answers
228
views
Why is my first int value in C always 0 although I assign another value than 0?
I build a simple Calculator in C where I Put at first my first value number1, then the operation (+, -, *, /) and then the second value number2.
always when i put in the value of number1 via scanf i ...
0
votes
0
answers
87
views
Round a column in Python
I would like to round one specific column to 1 decimal place. Currently I am using the following code:
scatterLabelsEinkommen['Einkommen'].round(decimals=2)
I get the following error:
loop of ufunc ...
0
votes
1
answer
112
views
Issue with sympy dsolve and zero
In the following code, I want to have the friction constant 'c' be zero, however, if I put it equal to zero, the dsolve() function hangs up. It works fine if I put it equal to 1e-20 (effectively zero)
...
0
votes
1
answer
46
views
How to remove the last x zeros from a column dataframe in r?
My data frame looks like this:
dput(tree)
structure(list(date = c(2.0220409e+13, 2.022041e+13, 2.0220411e+13,
2.0220412e+13, 2.0220413e+13, 2.0220414e+13, 2.0220415e+13, 2.0220416e+13,
2.0220417e+13,...
0
votes
0
answers
32
views
why is my nested if in for loop not working?
I have a dataframe on bat activity with variables
"plot_no" "date" "rec_hour" "guild" "sunrise" "sunriseEnd" "...
0
votes
0
answers
31
views
How do i keep the tail zero in my dataframe and avoid variable lengths differ error from R
I have a dataset like below:-
Location
Reading
Above
0.0370
Above
0.0261
Below
0.0660
Above
0.0420
now when I load this in R, it appears prefectly in the console but when I run the below script-
model ...
0
votes
2
answers
399
views
Displaying a friendly error message for dividing by 0
number1_str = input(" First number: ")
number1 = int(number1_str)
number2_str = input("Second number: ")
number2 = int(number2_str)
operation = input("Operation [+, -, *, /]:...
2
votes
2
answers
43
views
Keeping values for first level of month in a data frame while set rest of the values to zero in R
I have the following data set;
df <- matrix(data = c("G1", "March", 98.97291,
"G1", "April", 95.99673,
"G2&...
0
votes
0
answers
46
views
How to change pi value to 0?
I have angles for theta but for the sake of deleting rounding errors, the values for pi must change to 0. In this case, the 3rd and 4th value should change to 0. Why does this not happen? Thanks!
...
0
votes
1
answer
435
views
check if an element has length zero in an array and do something with that element on javascript
I want to know if some elements in an array has length zero, and with those elements I want to change the color for example. all of this with javascript es5.
for example, I have a form with some ...
1
vote
1
answer
954
views
Why does the loss value of a Word2Vec model become zero after a few epochs?
I was using gensim to train a Word2Vec model with 'text8' as the corpus. But I just found that the loss became 0 after a few epochs and I didn't know what to do. Could you please help me and find what ...