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
0
votes
1 answer

How to increment a child model value in Rails?

Hello stackoverflowers!!!! I have 2 models: models/user.rb class User has_many :colleagues before_save :give_points private def give_points if self.name == "Jordie" colleague1 = Colleague.find_by_name("Ann") colleague2 =…
blawzoo
  • 2,465
  • 4
  • 19
  • 24
0
votes
1 answer

SQL Server Management Studio Express crashes when I try to run an ALTER TABLE query to add a PK with auto increment

I have an existing table where I use existing column (type INT) as PK and manually increment its value with each row inserted. I wanted to change it to IDENTITY with auto increment. I found a thread here…
Khaled
  • 9
  • 1
  • 4
0
votes
4 answers

How can we determine the Increment and decrements in PHP

Please provide me the proper solution of this script with explanation: $a = 5; $c = $a-- + $a-- + --$a - --$a; echo $c; What will be the value of $c = 10; Why?
PPS
  • 542
  • 1
  • 8
  • 25
0
votes
1 answer

Jquery: trying to use height of div to calculate distance of increment animate event

Solved (see below) $(function () { var textHi = $('#text').height(); var moveIt = textHi / 5; var margH = parseInt(("#text").css("marginTop")); margH = Math.abs(margH); $("#down").mousehold(function(){ if (margH === textHi) { return…
0
votes
1 answer

Invoice number auto increment

Invoice Number = Now.Year & Now.Month & ????? how can i add 5 digits that auto increment when the form loads? Expected OUTPUT 20120100001 20120100002 Now.Month Problems# when the month is one digit invoice will be 10 digits while when it is two…
0
votes
2 answers

How To Increment jQuery Element ID

I have instances of jPlayer (jquery audio player): jPlayer1, jPlayer2, jPlayer3, jPlayer4, each initialized and preloaded with audio files. Calling function below will traverse an existing array and adding the methods that plays the preloaded…
10davvid
  • 33
  • 4
0
votes
2 answers

rails 3 increment a related model attribute before/after_save

I have a basic app that allows user1 to create a redeemable code. user1 shares this code with his friends and user2,3,4 redeem the code. At each redemption I need to to increment user1's points attribute. the first time a user redeems the code, it…
TJ Sherrill
  • 2,465
  • 7
  • 50
  • 88
0
votes
2 answers

Actionscript 3.0 getter setter increment

private var _variable:int; public function set variable(val:int):void{ _variable = val; } public function get variable():int{ return _variable } Now if I have to increment the variable... which one is more optimized way of doing…
user418836
  • 847
  • 3
  • 8
  • 19
0
votes
1 answer

Can't make variable incremention with jquery load() images

i have a problem while incrementing a variable and adding new data to array in the jquery load function. I think that incremention and array manipulation is done when all images are loaded. But I need to use imgCount variable futher in the code. So…
mXaln
  • 105
  • 11
0
votes
2 answers

I can't figure out where to put my incrementing variable

Ok, here's my problem. When I check check box cbPause (cbPause = true) then my count start 1 not 0. The counter is named tickCount and if I put tickCount inside of if (cbPause.Checked == true). If I put it ad the end of my Interval method it also…
NewHelpNeeder
  • 693
  • 1
  • 10
  • 19
0
votes
1 answer

Jquery class/name increment

I need to increase my input name if this already exists. When it exists it has to put an index number after the name. Something like: selectboxvalue1, selectboxvalue2 etc. I had something in mind like this, but I can't figure out a simple…
Nick
  • 425
  • 3
  • 9
0
votes
4 answers

Trying to set a variable as 0 and increase it with every onclick function execution

I am new to javascript, but here it is. I am working on this page, and I want it to increase the variable for each question asked. I am confused as to why it is not working properly, I have tried different things for…
user1106352
0
votes
3 answers

javascript, increase number day by day

I need to write a code with javascript which increase the given number and sum it with a random range numbers and finally displays it. This has to be saved, because the next day, this should increment current result, using the same "sum with random…
Mehdi
  • 13
  • 1
  • 11
0
votes
1 answer

Increment variable then get info from database from the row of the variable value

Hi i would like to know if it possible to, on the click of a button increment a variable then get the data from the row of the vale of the variable eg. a = 0, when the button is clicked, a = 1 --> now get data from database record of row a? please…
fosho
  • 1,666
  • 6
  • 20
  • 28
0
votes
1 answer

Updating a property in an array after querying with $ne

A document in my collection rooms has the following structure: { "_id": { "$oid": "4edaaa4a8d285b9311eb63ab" }, "users": [ { "userId": { "$oid": "4edaaa4a8d285b9311eb63a9" }, "unreadMessages": 0 }, …
pimvdb
  • 151,816
  • 78
  • 307
  • 352
1 2 3
99
100