increment

Increment values using Zend_DB_Table Raw SQL

I have a website where a user can upload images for a real estate property. The table structure: image_id property_id userid filename thumbfilename display_order timestamp The scenario: When a user uploads multiple pictures, he / she SHOULD be able to set the primary photo from their uploaded images for the specified property. Th...

Why does int count jump from 1 to 4 on entering a loop? C++

My "counter" is jumping from 1 to 4 when I enter my loop. Any ideas? Code and output below: static bool harvestLog() { ifstream myFile("LOGS/ex090716.log"); if (myFile.fail()) {cout << "Error opening file";return 1;} else { cout << "File opened... \n"; string line; string field; int cs_uri_stemLocation = 0; int csRefer...

Python: Behaviour of increment and decrement operators

I am a newbie to Python. I notice that a pre-increment/decrement operator can be applied on a variable (like ++count). It compiles, but it does not actually change the value of the variable! What is the behavior of the pre-increment/decrement operators (++/--) in Python? Why does Python deviate from the behavior of these operators seen ...

post increment vs pre increment - Javascript Optimization

I was browsing Google Code when I chanced upon this project called JSpeed - optimization for Javascript. I noticed one of the optimization was to change i++ to ++i in for loop statements. Before Optimization for (i=0;i<1;i++) {} for (var i = 0, j = 0; i < 1000000; i++, j++) { if (i == 4) { var tmp = i / 2; } if (...

MySQL - second sequence in table (e.g. by category)

Hi all, I'm trying to find the most efficient way to do something and would appreciate your advice! I have a table with the following columns: id category category_sequence other_columns id is an auto-increment column and the primary key. The category is selected by the user on the UI. What I'd like to do is generate a category_seq...

C# Compiler Behavior Question?

Hey everyone, in the following code, what should the result of d be after the second expression? int d = 1; d += d++; One would assume d is 3 afterwards but the unary increment d++ doesn't seem to take effect and d retains a value of 2. Is there a name for this bug? Does it exist for other compilers that support unary increment...

std::map::iterator crashes program on increment

What could cause this? Here's the stack trace: #0 0x0645c0f5 in std::_Rb_tree_increment (__x=0x83ee5b0) at ../../../../libstdc++-v3/src/tree.cc:69 #1 0x0805409a in std::_Rb_tree_iterator<std::pair<std::string const, Widget*> >::operator++ ( this=0xbffff144) at /usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4...

Problem with MySql INSERT MAX()+1

I have a single table containing many users. In that table I have column called user_id (INT), which I want increment separately for each person. user_id MUST start at 1 I've prepared a simple example: Showing all names +--------------+-----------------------+ | user_id | name | +--------------+-------------------...

[jQuery] Next and Previous Slide Button Functionality i++, i--

Hi Ya'll, I had a great experience asking a question last time and thought I'd come back for more help. You guys are wonderful. Thank you in advance. I am working with a featured post slider that advances through 4 posts automatically. I would like to add next and previous buttons. I know that I need to attach some kind of .click()...

In NHibernate, is increment appropriate for identity key that's unique by group? What is appropriate?

I'm connecting to a legacy database that is our ERP system. I have a table that is using composite keys and one of those fields is incremented but it is unique within a subgroup of records. I have no ability to change this although I wish I could. For example, CustomerId_Field, SequenceID_Field 49, 1 49, 2 200, 1 200, 2 200, 3 200, 4 T...

incrementing a value after each refresh in javascript

Hi friends, Please help me to do this I want to refresh my web page in every fixed time period. i have done with a javascript timer. But actually i'm not refreshing the same page, it will go to next page after each refreah. I'm developing a web application in asp.net c# for example my url will look like this http://localhost:1096/...

proper usage of the pre-increment operator in combination with the pointer dereference operator

I just wrote the following line of code: if (++(data_ptr->count) > threshold) { /*...*/ } // example 1 My intent is to increment the count variable within the data structure that data_ptr points to before making the comparison to threshold, and this line of code works. If I had instead wanted to increment data_ptr before making the c...

Increment value of textinput with jquery like spinner

Hi folks Trying to create a simple spinner effect with Jquery, i.e. two buttons (up & down) with a text field. The upbutton increases the value while the down button decreses the value. increment steps + or - 1. Any suggestions as ui.spinner is most def. not working and I am new to jquery. musty be something like $(#up).click (funct...

jQuery spinner type thing

I'm trying to create a jQuery spinner type thing earlier today somebody gave me this code which increases the text field value up/down on button clicks. Fantastic. But what do you do to disable the .desc button if the value is 0 - zero. In PHP very easy if if <=0 then this etc... but I don't know jQuery.. Also any ideas how it can be u...

Sequential Key Generation

Right now, I'm working on a project which requires sequential text key generation. I need to seed the key generator with an integer corresponding to a certain key, which the constructor converts to a key. My key generator overloads the increment operators so that the string is incremented directly, rather than what I had previously been...

Accessing loop iteration in a sub-function?

I'm using the Google Maps API to plot several points on a map. However, in the click event function below, i is always set to 4, i.e. its value after iterating the loop: // note these are actual addresses in the real page var addresses = new Array( "addr 1", "addr 2", "addr 3", "addr 4" ); for (var i = 0; i < addresses.length; i++) { ...

using Notepad++ how can i make a macro type situation in which a number increments?

for example i have about 500 lines. in the beginning of each line i want to add a number. so in line 1 i would want "1)" and then line 2 i would want "2)" i know i can do a macro in n++, but it wouldn't be incremental. is there any possible way to do this? ...

Python: How can I increment a char?

I'm new to Python, coming from Java and C. How can I increment a char? In Java or C, chars and ints are practically interchangeable, and in certain loops, it's very useful to me to be able to do increment chars, and index arrays by chars. How can I do this in Python? It's bad enough not having a traditional for(;;) looper - is there an...

Postgres serial value incrementing by 2

I have some tables in my postgres database, and a few of them inherit from each other. For example: CREATE TABLE parent_table(parent_table_id SERIAL PRIMARY KEY, my_col1 VARCHAR(16) NOT NULL, my_timestamp TIMESTAMP WITH TIME ZONE NOT NULL); CREATE TABLE child_table() INHERITS (parent_table); CREATE TABLE step_child_tab...

How can I dynamically increase a number in PHP

I want to add number dynamically and aiming the outputs as follows. <li data-id="id-1".. > ...</li> <li data-id="id-2".. > ...</li> <li data-id="id-3".. > ...</li> <li data-id="id-4".. > ...</li> <li data-id="id-5".. > ...</li> <li data-id="id-6".. > ...</li> I tried this, but it does not work. Views for($i=1; $i<=$image_num; $i++){ ...