Questions tagged [increment]
DO NOT USE THIS TAG ALONE. Use with a language tag like [javascript] or [python]. Adding one to the value of a variable, generally with the use of an increment operator.
increment
3,582 questions
-2
votes
1
answer
177
views
Basic order of operations question with ++ [duplicate]
This should be a simple order of operations question, but I am wondering what exactly is happening step-by-step?
My code is
int x = 1;
Console.WriteLine(x++ + x++);
...
1
vote
2
answers
89
views
Incremental Value based on fixed total in a cell
I am looking to simplify my current setup, if possible with a single array formula to produce the following result.
I want to have a column with
Incremental value by 1
Base starting is 1,000
Total ...
1
vote
0
answers
19
views
What is an elegant way to select a database cell and then increment it? [duplicate]
I have a stored reference number, let's call the variable "my_index," in a table of variables.
id
var_name
var_value
1
black
#000005
2
domain
example.com
3
my_index
3
I need to collect that ...
0
votes
2
answers
180
views
for loop with increment tcl
I have a total of 750 count. And each set is 5. Instead of doing many for loop, for {set i 0} {i < 5}, for {set i 5} {i < 10}, for {set i 10} {i < 15}..... Every 5 count, will insert "...
-9
votes
2
answers
122
views
Why does i += ++i result in 1 in Java? [duplicate]
I was learning Java. I am facing a problem with the following expression:
int i = 0;
i += ++i;
System.out.println(i);
It says the output is 1.
If we rewrite it ...
0
votes
2
answers
91
views
Print incrementing integer as part of a string
I am trying to get a list of scores from user input. I want each prompt to include the current game number, which will increment from 1 to the total number of games. For example, if the user wants to ...
1
vote
4
answers
116
views
Incrementing adjacent mines in minesweeper using Python
I'm currently struggling to get the cells adjacent to mines(#) to increment based on how many mines are next to them.
My current code is returning 0 instead of incrementing - please can anyone help?
...
0
votes
1
answer
64
views
Incrementally rename all text files without 'duplicate' errors
Given the files 0.txt, 1.txt, 2.txt etc., I want to identify the existing number, and rename ...
2
votes
4
answers
119
views
VBA Increment string within For Loop
I'm trying to break up a textbox string (serial number) and start with the initial textbox value then increment it by 1 within a For Loop. I cannot figure out how to start with the first string in the ...
4
votes
1
answer
6k
views
Incrementing to the last decimal in python
I want to write function in python when given float or string for example 0.003214 to return me 0.003215, but if I give it 0.00321 to return 0.003211, it will apply on other floats also like 0.0000324 ...
0
votes
1
answer
46
views
CURL request with string variable and letter increment in url
Here's what I'm trying to achieve:
I'd like to return a list of valid urls, based on the following structure:
example.com/a
example.com/b
example.com/c
and so ...
1
vote
1
answer
2k
views
Increment Azure Pipelines version number with commits
I have an Azure DevOps pipeline that references two repos:
The code repo, which contains my application code
The config repo, which contains my environment variable config files.
The idea is that I ...
0
votes
2
answers
190
views
Javascript code to count selections in both matrix and singular questions (Qualtrics)
I have made the following code Javascript code to count the number of times 0, 5, or 10 are selected in questions throughout my survey on Qualtrics. I place this code in each question:
...
1
vote
2
answers
71
views
Why are these results different between two types code of Java? [duplicate]
First of all, my mother language is not English.
Now I study Increment(++) ande Decrement(--) operators of Java.
I tried an issue. But the result of mu code differents from my expectation.
Issue
...
1
vote
0
answers
23
views
Kotlin - how can I create a list of numbers between a range and stepped by a certain value [duplicate]
In Kotlin, I'm trying to create a val with a list of numbers within a specific range, incremented by 1.5. How can I do this? I've tried the below, but I'm getting an error with "step".
<...
0
votes
3
answers
194
views
Decrement value MongoDB, prevent negative number
I'm using MongoDB and I have a document where I want to increment a count field. However, I need to ensure that this count does not go below zero. For example, if inc is -2 and the current count is 1, ...
0
votes
1
answer
35
views
Incrementing Key in Simple React To Do App
I have an incrementing key in my React To Do App so I can filter out certain tasks with an id identifier. For some reason, I have to declare and define my id outside of the main function. Why can't I ...
0
votes
2
answers
344
views
Autoincremental values for multiple columns in snowflake
is there a way to create sequence without any gaps in snowflake. I cannot use row number as I am running the updates/inserts multiple times which will end up creating same row numbers 1 to n on every ...
3
votes
3
answers
313
views
PHP 8 how to concisely increment dynamically generated variables
PHP 8 raised the Notice to a Warning that an unset variable/array key is worked on.
PHP 7.4:
...
0
votes
1
answer
46
views
Why is my angular datetimepicker adding increment/decrement text over arrows on input?
I can't figure out why my datetimepicker in my angular project is suddenly adding these weird lines of text over my arrows on the time input. They appear to be related to increment/decrement hours/...
0
votes
2
answers
107
views
C increment ++ unexpected result
I have a problem with using increment ++ while trying to increase the value of an int variable. I'm passing the address of the variable called records to the function open() than opens a file in ...
0
votes
1
answer
36
views
Adding (increment) values to a record in Laravel or creating a new row
I want to say that if there is a row in the "ListingPoints" model where "ListingPoints" is equal to 1 and "review_cat_id" is equal to 1, then the value of "...
1
vote
1
answer
32
views
Why is the cart increment not working properly?
I need to increase or decrease the quantity of items on the cart, but when I click the increment button for a particular item, it increases the quantity of all the items in the cart.
Here's my code - ...
1
vote
1
answer
104
views
Variable in Python going up by more than 1 at a time
I am currently making a project for my school for fun, and I came across a problem. The project is a paddle and ball game, and every time the ball hits the paddle the score SHOULD go up by one, but ...
-1
votes
1
answer
52
views
Increment number on each node with excluding one
I'm trying to automatically name node number in tomcat server.xml on several nodes.
I have for that the playbook below:
...
0
votes
1
answer
118
views
Ansible Increment Number on each node
I'am trying to define the jvmroute in server.xml of tomcat by naming it node0x.
To do that i find i playbook with increment_number with anisble_facts
...
-1
votes
1
answer
60
views
If statement not working all the time in java
I am making a text game movement system and a found a difficult issue. When i enter the cardinal directions, east returns the value expected but locks me in place, west returns my programmed error ...
0
votes
1
answer
626
views
Increment (and Decrement) values in a [Google Sheet] column
The image (attached) is a simple "AppScript" adapted from a popular YouTube ...that allows "Values" (in a column) to be increased by 1 - by clicking an "Arrow" (button) - ...
0
votes
0
answers
56
views
Variable is not incrementing with the function I have written
I am fairly new to Javascript and am trying to create a quiz. I am having issues getting the finalScore variable to increment when an answer is correct. I have been trying to figure this out for the ...
2
votes
2
answers
131
views
1
vote
1
answer
237
views
Increment/decrement button React.js/Redux
I know similar questions have been asked, but I couldn't find one which I could adapt to my code (possibly cause I am still new to Redux).
So, I am editing the cart functionality which was already ...
1
vote
1
answer
61
views
python binning frequency values iteratively
I am just starting with python. I have produced a list of ten random numbers from 1 to 100 and entered them into a list. Now I want to bin their frequencies in a second list also with ten elements ...
-3
votes
1
answer
91
views
Incrementing using prefix and postfix
Can someone explain why the alert still shows 5 under postfix? I understand prefix identifies the last iteration to be falsy, but with postfix, it will still return i as 5.
...
1
vote
1
answer
78
views
MATLAB Loop with non-integer Increments and Starting at Index Zero
I have the following loop:
t_train = 25;
t_wash = 5;
for t = 1:t_train
if t > t_wash
X(:,t-t_wash) = L(:,t-t_wash);
end
end
I would like to ...
1
vote
1
answer
984
views
PowerBI DAX: How to create a calculated column, which increments in value when a certain condition is met
I am trying to create a calculated column [NewCol] in DAX. Everytime The previous value of [Col1] is different than that of the current row, I would want the value of NewCol to increase by 1. How can ...
-2
votes
1
answer
89
views
my function increment does not print 6 when called 3 times using a global variable [duplicate]
I have a header called "counter.h":
...
0
votes
1
answer
58
views
For..of loops confusion
So I've been writing 'for' loops only with the (let i = 0; i < arr.length; i++) set up until now. This is visually something you can break down and understand so its been logical for me. Now I'm ...
0
votes
1
answer
123
views
Why does this C word histogram program print an overflow of 0?
I am studying from the K&R C Programming Edition and one of the exercises (1-13) is to print a word length histogram which I mostly succeeded in doing. However, there is one issue.
...
0
votes
1
answer
202
views
PowerBI Increments on slicer not working (GENERATESERIES)
I have created a Parameter with GENERATESERIES in order to filter amounts of two fact tables by using increments:
...
0
votes
1
answer
38
views
sequelize how to increment a value from many to many relation
I want to increment or decrement quantity value if it exists in orderproduct join table
...
0
votes
2
answers
255
views
OpenMP with ++ increment in 2d array
I have two large 1-dimensional input arrays (input_array1 and input_array2) with billions of elements with values, ranging from ...
1
vote
1
answer
131
views
How to increment ++ from an existing value
I am working on an app to track winter bird feeder counts. I am using ++ to increment and -- to decrement.
When I try to increment an existing value, the increment re-starts at zero. For instance, if ...
2
votes
1
answer
84
views
why is my counter acting strangely and how should I edit my code to fix it?
I'm trying to implement my own version of the snake game using turtle(), and its working almost perfectly as I want it to. However, my problems are with the ...
-1
votes
2
answers
152
views
java and Arithmetic Operators and Increment [duplicate]
It is one of the simple operations and I do not understand why and I just save it, but this bothers me, so I want to understand why?
...
0
votes
1
answer
65
views
-1
votes
1
answer
62
views
Lambda Calculus - Evaluating Custom Rewrite Rules to Increment
I am working with this set of rewrite rules for lambda calculus:
While evaluating "INC 0", I performed these steps:
Subsequently, I evaluated "INC 1" as such:
Are these ...
0
votes
1
answer
190
views
Is there a way to patch/increment a Bigtable column value non-integer?
Using Node.js and the libary: "@google-cloud/bigtable"
I've a scenario where I need to append/increment/patch a text value in a Bigtable row, since we receive multiples requests at the same ...
0
votes
0
answers
25
views
Make a button that increments numbers on every click [duplicate]
Here is my html and JavaScript code:
...
-2
votes
1
answer
52
views
Why does ++ increment after returning the value in this JavaScript code? [duplicate]
Here's the problem (with a working solution):
Create a function cycleIterator that accepts an array, and returns a function. The returned function will accept zero arguments. When first invoked, the ...
0
votes
4
answers
165
views
Is this two-increments expression well-defined in C?
I want to iterate over integers up to some power of 2 t by skipping all integers having a specific bit set. Let m be some power ...