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.

Adding one to the value of a variable, generally with the use of an increment operator.

3520 questions
1
vote
2 answers

Increment list items classes

I want to create a list with incremented ids and hrefs using jQuery. Is this possible?
1
vote
4 answers

Stopping increment in a for loop for a specific case in Java

Essentially, I'm trying to store user input in a multi dimensional array using for loops. If the user types in something which is not expected/wanted (e.g. less than 0), a warning message will be displayed and the loop should ideally 'wait' till it…
user432584920684
  • 379
  • 1
  • 8
  • 19
1
vote
2 answers

Generate series of incremented numbers from a mutually shared base

I have a table called SharedNumber, which has only one field - an integer number called LastNumber which can have one and only one entry. There are about 40 or 50 odd completely separate Access databases that use this LastNumber entry as a common…
Karl
  • 5,573
  • 8
  • 50
  • 73
1
vote
3 answers

mysql wrong column increment

what is wrong with this code? $core->query("UPDATE games SET hits = hits + 1 WHERE id=".intval($id).";"); hits incerements by 2 and sometimes by 3! I mean for example hits = 3; when I call this function, hits will be 5 and sometimes 6! (add 2 and 3…
m3hdi
  • 383
  • 1
  • 4
  • 15
1
vote
2 answers

MongoDB: increment the integer field (C#)

How to increment integer field in atomic manner? Can FindAndModify method helps? For example document contains field count and I wanna to increment it without retrieving full document and saving back.
Edward83
  • 6,664
  • 14
  • 74
  • 102
1
vote
4 answers

arrow clicks in jquery

I have 2 arrows one increments a counter by 1 and the left one decreases it the problem I am trying to solve is good logic to deal with negative number (it should go to the last item in the list) and at the other end when the counter is over the max…
LeBlaireau
  • 17,133
  • 33
  • 112
  • 192
1
vote
3 answers

PHP for each line in TXT, increase value of variable?

I have the following code with reads a TXT file, pulls out unneeded info from each line, then stores the edited lines in a new TXT file.
Sweepster
  • 1,829
  • 4
  • 27
  • 66
1
vote
1 answer

Java- how do I increment a variable whenever a file selected in JList?

What I'm having problems with is that I have a list of 10 files in a JList. On a JButton, I have "attached file(s) 0." What I'm trying to achieve is when a user clicks on a file in the JList, the variable fileCount (represents the '0') will…
user868935
0
votes
3 answers

How do I make a score label increase in cocos2d

so I have a label and I would like that when an image collide with another image it increase of 10 . score = score +10; but instead of this it increase of 40 I don't know why . so here is my code : -(id) init { if( (self=[super init] )) { …
greg rock
  • 239
  • 6
  • 14
0
votes
3 answers

Function not calling itself... enough

Each string in an array is a number, for example array1 = ["1296", "12", "27"]; For each string above, if possible to divide by 6 evenly without remainders, I want to do so at least once, then if the result is still longer than 2 characters, repeat.…
monkey blot
  • 985
  • 3
  • 10
  • 18
0
votes
1 answer

MySQL, PHP, Selecting ads for multiple spots in rotation and countng views

I am about to write an ad system and wanted to get some advice on a few things. Basically my website will have several ad spots a page. For each ad spot there will be six ads that run in rotation. I also need to track the number of views for these…
christian
  • 2,279
  • 4
  • 31
  • 42
0
votes
1 answer

Javascript rotating incrementing counter starting at 1

I have an array of image IDs. var images = ['238239', '389943', '989238', ... ]; max = images.length; Array index obviously starts at 0. The array size can vary. For example. If there are 5 images in the array, the indexes are 0, 1, 2, 3, 4. I'm…
DominiqueBal
  • 787
  • 1
  • 7
  • 18
0
votes
4 answers

UPON DUPLICATE KEY increment multiple columns?

Im running a database log and every day I log on a new row. My Mysql query therefore checks if the day (date (the unique key)) already exists, and if so, it tries to increment all the loggable values of the log-row by one. If the date record doesnt…
wallflux
  • 432
  • 3
  • 13
0
votes
1 answer

MySQL table ranking ranks the first row as 0 instead of 1

I'm having trouble with ranking the records in my table. It seems to be handling ties correctly, but for some reason the first row is being ranked as a zero, so the order I'm getting is coming out like 0, 2, 2, 4, 5. I've been playing about with…
MarkyMark
  • 7
  • 4
0
votes
3 answers

My own auto-increment

I have usual 'id' in my table, but I also need a 'code', which would be like id, but year specific. That means it will be somehow auto-increment, but will start with 1 for each new year. When I insert new row, I simply use SELECT MAX(code) WHERE…
Oriesok Vlassky
  • 797
  • 1
  • 13
  • 26