Questions tagged [counter]

A Counter is a container(/bag/multiset/etc.) that keeps track of how many times equivalent values are added.

In Python:

A Counter is a dict subclass for counting hashable objects. It is an unordered collection where elements are stored as dictionary keys and their counts are stored as dictionary values. Counts are allowed to be any integer value including zero or negative counts. The Counter class is similar to bags or multisets in other languages.

http://docs.python.org/library/collections.html#collections.Counter


5262 questions
1
vote
2 answers

Add a counter meeting specific conditions

Problem Statement Given the below data set which has two columns Column1 & Column 2, add another two more column called Counter and Counting time. The conditions to Initialize the counter and Counter time is as follows: The counter should be…
Tareva
  • 230
  • 1
  • 13
1
vote
1 answer

JS Count numbers one at the time

I have so far created 1. When an row is in view that elements slide in 2. Counters that counts up to a number. I would like to improve no 2 so that counters start only when in view and also that they don't all go off at once but first on the left…
Stack ant
  • 51
  • 7
1
vote
1 answer

VB.Net - Count +1 every time when creating a new row in database

I want some sort of label that is counting every record that is imported in the database. Do I need to use a for each loop? Can someone explain me how to do it, or set me on the right way to do it? With cmd .CommandText = "INSERT…
Klaas-Jelle Ras
  • 115
  • 1
  • 1
  • 12
1
vote
3 answers

Clear button only makes counter JLabel blank but does not reset it.

I have made this application: For example when I click on the clear button when the counter JLabel (pointsAvailable) is 19 then the counter JLabel goes blank as expected, however when I start adding points again it starts from 19 not 40 as set on…
Petr Cina
  • 21
  • 8
1
vote
2 answers

Create a counter in a for loop in R

I'm an unexperienced user of R and I need to create quite a complicated stuff. My dataset looks like this : dataset a,b,c,d,e are different individuals. I want to complete the D column as follows : At the last line for each individual in the col A,…
Lef Lef
  • 11
  • 2
1
vote
1 answer

tinyMCE word counter for on paste help needed

Good morning people, hope y'all are having a good time, first and foremost i want to thank y'all for your speedy response to my questions, a while ago i need a word counter for tinymce and i got some good response, this time i want when a user cut…
Cyberomin
  • 453
  • 2
  • 8
  • 22
1
vote
1 answer

making a counter with jquery-circle-progress plugin

with jquery-circle-progress plugin how do I make a counter which can count up to a definite number and the number should be taken from HTML markup.I have made it but it can't work!
1
vote
3 answers

simple php page session visit counter not working

I am having this strange issue and can't figure it out. On some websites I have this script works perfect... same code, same server settings... With php, there is a simple page view hit counter that stores locally in a txt file. Then I echo out the…
MuhuPower
  • 404
  • 3
  • 25
1
vote
2 answers

Fast/Efficient counting of list of space delimited strings in Python

Given the input: x = ['foo bar', 'bar blah', 'black sheep'] I could do this to get the count of each word in the list of space delimited string: from itertools import chain from collections import Counter c = Counter(chain(*map(str.split, x))) Or…
alvas
  • 115,346
  • 109
  • 446
  • 738
1
vote
0 answers

can i do simple addition using firebase values?

hi guys i have a database tree in firebase. Which im using for a download counter for each section of my app. as each user downloads an app it increments the value for that user by one. each user has its own branch for each app. is there a way to…
1
vote
1 answer

Appending unique mixed string using pandas or python

I have a table or df(if pandas has a better way) with one of the columns with multiple mixed character and string, i need to count them and append a unique mixed string to it, what would be best way to do a python loop or pandas has some syntax to…
sbradbio
  • 169
  • 1
  • 13
1
vote
1 answer

Variable that increments even if program closes

I'm making a program that remotely records video on a camera from a button press and will save the video file externally after I'm done recording. I need to know the name of the video file to access it, and each time the video saves, the number in…
smartzer
  • 89
  • 9
1
vote
1 answer

Using a Public Integer Variable as a Counter C#

I'm creating a Pokemon-type game in Visual Studio. I'm working on the Inventory form right now. My question is can I use a public count variable as a way to keep track of the inventory? Setting it: public int healthPotionCount = 0; Then if a…
Tarheel81
  • 13
  • 1
  • 7
1
vote
1 answer

pycryptodome: OverflowError: The counter has wrapped around in CTR mode

I am having difficulty with AES-CTR encryption using pycryptodome on Python 3. Data can be ~1000 bytes but when it gets long enough it breaks. I do not understand what this error supposedly means or how to get around it. from os import urandom from…
ArekBulski
  • 4,520
  • 4
  • 39
  • 61
1
vote
0 answers

Android step counter sensor stops counting up

I am building a tracking app that requires regular updates from the step counter. I have been working on this for a couple of months and have not faced any problems with the step counter so far. Now from one day to the next, the step counter is…
fjc
  • 5,590
  • 17
  • 36
1 2 3
99
100