counter

SQL: Add counters in select

Hi, I have a table which contains names: Name ---- John Smith John Smith Sam Wood George Wright John Smith Sam Wood I want to create a select statement which shows this: Name 'John Smith 1' 'John Smith 2' 'Sam Wood 1' 'George Wright 1' 'John Smith 3' 'Sam Wood 2' In other words, I want to add separate counters to each name. ...

Python - making counters, making loops?

Hi, I am having some trouble with a piece of code below: Input: li is a nested list as below: li = [['>0123456789 mouse gene 1\n', 'ATGTTGGGTT/CTTAGTTG\n', 'ATGGGGTTCCT/A\n'], ['>9876543210 mouse gene 2\n', 'ATTTGGTTTCCT\n', 'ATTCAATTTTAAGGGGGGGG\n']] Using the function below, my desired output is simply the 2nd to the 9th digits ...

How to create file download counter ?

Which is the most simple way to create code ( with PHP and SQL ) which will count the file downloads ? I already have an integer column in the base dedicated for this feature... ( link to some example will also be welcomed ) ...

How to get the number of loop when using an iterator, in C++?

Dear reader, I'm working on a aplication where I draw a couple of images, like this: void TimeSlice::draw(float fX, float fY) { list<TimeSliceLevel*>::iterator it = levels.begin(); float level_x = x; float level_y = y; while(it != levels.end()) { (*it)->draw(level_x,level_y); level_y += (*it)->height; ++it; } } Though th...

advance click counter mysql or flat file

Hi, First of all Thank You for looking. whats the best method for make an advance click counter (eg. order by views [today] | [yesterday] [this week] [last week] [this month] [last month] [all time] ). Is it better to use a flat file or mysql?. This is the MYSQL Structure i came up with. id (type: int(11)) link_id (type: int(11)) da...

Video Viewed Counter

Hi all, I need to make a video viewed counter. I have .MOV files using embeded/Object tags and application is ASP.NET. Is there any way that I can count hits on the videos using Jquery? ...

Check for linebreaks in textarea with jQuery

Hello. I want something like a counter for every linebreaks in a textarea. This is used when uploading a huge number of webbanners, so i need a simple counter for how many a user has added. Right now the counter works only when a user presses a link with a special bannersize. This is my code as it is right now: var i = 0; $('.size')...

__COUNTER__ equivalent on Xcode?

Hi! I am migrating a project from Linux to Xcode and I encountered a "version" problem.. I need a unique identifier at compile time for my dynamic stuff, on linux I was using the __ COUNTER__ preprocessor, but it seems that the gcc 4.2 used in Xcode doesn't know about __ COUNTER__ yet... So, I was wondering what I could do to solve th...

How do I build a flexible counter with 1000+ rows but few reads in Google App Engine?

I have a list of users that only administrators can see (= few reads). This list also displays a count of the number of users in the datastore. Because the list could grow larger than 1000 my first thought was to avoid a normal count() and instead use a sharded counter. However, the problem is that the admins also have access to various...

Math comparison operating in Django templates

i want to compare do simple math in django template like {% forloop.counter > 5 %} {% endfor %} how do i achieve this? ...

resetting "Issue ID" in Sharepoint site

I designed a site in share point. There is a column called "Issue ID (linked to item)" in ALL Issues view. I am using this column to list and identify the items which are created by employees. It increases by 1 as a new issue is created. Unfortunately, I have to reset this ID to 1 because during the test period I created and deleted b...

What are the tradeoffs when generating unique sequence numbers in a distributed and concurrent environment?

I am curious about the contraints and tradeoffs for generating unique sequence numbers in a distributed and concurrent environment. Imagine this: I have a system where all it does is give back an unique sequence number every time you ask it. Here is an ideal spec for such a system (constraints): Stay up under high-load. Allow as many...

Track Page Views using PHP

I'm looking for a way to track the number of visits to a page, without counting duplicates (like someone hitting refresh several times) and I'd like to figure out the best way to do it without keeping track of every single IP address to view the page. Perhaps a cookie? Any other suggestions? ...

How to add per day and total visitors counter

I am developing a website using php, mysql, javascript, html, css. I want to add a counter in this website. I already added a counter in this website, that counter counts every visitor and show total visitors. But my client requirement is different, he wants different counters. Example: Online user = 2 Today visitor = 20 Total visito...

Adding Counter to HTML Form and Calculate Credits

I have a simple HTML Form that allows the user to enter some text which is then sent as an SMS/TXT Message via an SMS Gateway. The user enters the message text into a textarea: <textarea rows="10" cols="40" id="smsbody" validate = "required:true" name="MessageBody"></textarea> They can enter as little or as much text as they like, how...

Java counter problem

I have to write a program that allows the user to input 10 single digit numbers, and then it reads the largest number out of the bunch. I need help just starting out with the counter. This is what I need, a) counter: A counter to count to 10 (that is, to keep track of how many numbers have been input and to determine when all 10 numbers...

Visit page without incrementing hit counter

I frequently visit a certain page on the web to view the hit-counter, but my visit is counted every time and it's inflating the number of actual hits. Is there a way to visit the page without adding another hit to the hit counter? ...

WPF: Visual studio like error buttons

I want to get this. Everything works so far, buttons act as filter and are bind to the grid control. All i want is the icons and counter on the button. Whats the correct way of implementing those? <ToggleButton x:Name="IsErrorShown" Margin="4" Width="100" Content="{lex:LocText Errors, Assembly=Client}"> I have tried adding image li...

need code for counting from string

dear all.. i want after i have been type 123A0001-123A0100 the result is 100. Or if 123A0123-123A0200 the result is 78. how do i do that?please help. thanks before. ...

Python for-loop counter error

Hello! I am attempting to script a short code to figure out the number of days it takes to reach a given principal in the bank due to daily interest. Using my code below does not yield any errors when run in IDLE, but the counter returns 0. Any ideas what I missed? def main(): # irrelevant code elided by msw, Bal, Int and Tar are nu...