Questions tagged [decrement]

Subtracting one from the value of a variable, generally with the use of an decrement operator.

Subtracting one from the value of a variable, generally with the use of an decrement operator(--).

425 questions
1
vote
1 answer

Javascript decrementing value returns NaN

Good day, I'm working on a small JS loop that executes an action each X second-s randomly selected in a range, here is my current script: var test = { lastFrame: 0, timeBeforeSomething: 0.0, update: function() { let now =…
Lucas F
  • 15
  • 6
1
vote
0 answers

Increment and decrement version numbers

I want to increment and decrement 1.2.3 in this problem when we increase with a button after the right side value increased to 1.2.9 it should be1.3.0 and when second decimal point reaches to 1.9.9 it should change to 2.0.0 . The same condition…
aravindh
  • 11
  • 2
1
vote
2 answers

Update an integer variable inside the except block

def inputList(): list=[] length=int(input("Enter the length of the list : ")) print("Enter the elements -->") for i in range(length): print(i) try: …
bot-coder101
  • 132
  • 1
  • 7
1
vote
4 answers

How to makelike button with once click +1 value, second click -1 value etc

I am new here I have this code https://codepen.io/Void0000/pen/oNzGmGr and I need to make (with jQuery) some…
Void0000
  • 13
  • 4
1
vote
3 answers

While loop decrements in JavaScript until it reaches 0 and prints "Blastoff"

Exercise: Declare a variable named countdown and assign it the value of 10. In a while loop, decrement the value of countdown once for every iteration and print it. Once countdown hits 0, print 'Blastoff' to the console. What I've done so far: var…
1
vote
3 answers

Dereferencing through pointer and incrementing gives a different value and decrements it instead C++

I was trying to do some experiments with pointers in C++, I did understand the concepts of precedence a bit but the following program is mingling with my mind and am unable to comprehend it CODE: #include using namespace std; int main()…
Ali M
  • 47
  • 3
1
vote
2 answers

Increment/Decrement Confusion

What is happening when we decrement the code here: temp[--countArray[getDigit(position, input[tempIndex], radix)]] If temp is 1 in this case: are we decrementing first so that we are assigning to 0? How immediate is this decrement? It always…
Matt
  • 75
  • 8
1
vote
1 answer

Mongodb Update: I want to $inc {field: -1} but the result is {field: -2} (ie. decrementing 1 is resulting in decrementing 2)

I'm trying to update multiple documents with a loop, and decrement the "weeks" field in each Phase by one (1). Seems simple enough, and here is the code: //Go through masterPhaseArray and decrement a week for each phase for(let i=0;…
Izzi
  • 2,184
  • 1
  • 16
  • 26
1
vote
1 answer

autoincrement & decrement integer field are available in sqlite database?

I am fetching my data with id which is Integer primary key or integer. But after deleting any row... After that if we make select query to show all. But it will give force close because one id is missing. I want that id can itself take auto…
Siten
  • 4,515
  • 9
  • 39
  • 64
1
vote
0 answers

How can I update current value of my Prometheus metrics, by Python3

I need to add metrics and then change current values of those metrics. This my script on Python3 for add 3 metrics add.py from prometheus_client.exposition import basic_auth_handler r = 10 def my_auth_handler(url, method, timeout, headers, data): …
Garcia
  • 41
  • 2
  • 9
1
vote
1 answer

How to get decrement forloop.counter in django template?

I'm new to django and python, and not able to find how to get decrement forloop.counter. (no matching result in google & stack overflow.) I tried "forloop.counter-". Please help me. -in_a_django_template.html START {% for value in list %} …
TRANSOFCOM
  • 13
  • 4
1
vote
2 answers

Python: i want to make a variable that stores decrementing my 'limit' variable but it's not decrementing

(Python beginner Problem)::: I want to make a variable that store my limit variable but I just want to decrement it while looping. it's like that i want to make life left for the user. import random limit = 5 i = 1 while i <=…
1
vote
3 answers

shared preference not able to get data

I am trying to make promo code for my app when the user gives correct value in the EditText I will set a boolean value false and a number will be stored in shared preferences. But don't know why the value is not getting decremented and even if it…
Neelay Srivastava
  • 1,041
  • 3
  • 15
  • 46
1
vote
1 answer

Photoshop Script Processing Images Out of Order

I am running javascript via Photoshop's scripts tool/option in order to batch process a folder of images. The script adds a second image layer from a single image in folder 02 to a number of images in folder 01. That works fine, however, I am trying…
forestkelley
  • 341
  • 3
  • 14
1
vote
3 answers

The output of following program given to me and its just not clicking.The answer is 6 3 which is clearly not understood by me

class ab { public static void main(String a[]) { int x = 0, y = 0; for (int z = 0; z < 5; z++) { if (++x > 2 && ++y > 2) { x++; } } …
vicky
  • 31
  • 3