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

How to iterate each record in a group

I want to add a column that iterates a value for a group. The dataframe is pre-sorted as I need: Index :|: GRP BY Col :|: New Col:| 0 :|: 1 :|: 0 :| 1 :|: 1 :|: 1 :| 2 :|: 1 :|: 2 :| 3 …
RMichalowski
  • 330
  • 1
  • 4
  • 11
1
vote
1 answer

BeagleBoard cycle counter

I do not succed to activate the cycle counter registrer on my beagleboard. I've read that I have to compile a linux module but I do not succed too. my linux kernel is 2.6.35.8-l7 This is the linux version proposed by…
webshaker
  • 159
  • 6
1
vote
2 answers

Good pratice for naming multiple iteration counters

My question is about general good practices of naming multiple iteration counters in different functions. Let's assume that I have 3 different functions and each of them has for loop. In the 1st one i used for(var i=0; i<5; i++) all other functions…
Luke_Nuke
  • 461
  • 2
  • 6
  • 23
1
vote
1 answer

Rails cause method not found error on Heroku

I created Rails 5.1.2 app and deployed to Heroku. At local, everything is all right, but when deployed to Heroku, below errors occured at starting…
myoo
  • 333
  • 2
  • 11
1
vote
0 answers

Why my CPU Time Spent & other counter didn't show up? [Hadoop 2.7.1]

This is what i get from the counter when i run my mapreduce jobs. How to get other counter like CPU Time Spent, physical memory (bytes), Virtual memory (bytes), etc to be shown in the terminal? File System Counters FILE: Number of bytes…
Andre
  • 25
  • 5
1
vote
3 answers

Javascript counter on key input instead of button?

So I have this counter that increments 'positive' and 'negative' values, it's working fine. Now I also want to assign keyboard key to increment the values, 'f' for negative and 'j' for positive. How do I do this? I have been fiddling with…
1
vote
1 answer

Need to change UIImageView with a Int generated by a button Swift

I'm creating an app that will control climate. The value changes, however, I cannot get different (Guage) images to display based on value. please help! Here is my code /* Fan Output Up */ @IBAction func FanOutputUpBtn(_ sender: Any) { let…
B.Slade
  • 143
  • 1
  • 8
1
vote
2 answers

Is there any method of making local 'defonce'? (Clojure)

Let's say I need to make a simple counter and I want counter to be incremented each time I call this function, but here is one unpleasant thing: defined 'counter' is not local and I can easily change its value from another space, that breaks…
errfrom
  • 243
  • 2
  • 8
1
vote
1 answer

Cheapest way to keep an accurate count of something on AWS, fault tolerant, accurately and without an RDS Instance

I am reasonably familiar with AWS, I use a stack of ASP.NET MVC and MySQL, as well as Redis for caching/messaging. Normally to keep a count of something, I would use a MySQL table to keep a count of something, for an action on my website. I can…
Luke
  • 22,826
  • 31
  • 110
  • 193
1
vote
2 answers

Require minimum results count in wordpress loop?

Is it possible to require a minimum number of results in a wordpress loop? And if the loop doesn't return enough posts, then you show a placeholder? Basically, I need to show 8 posts in a grid. If there aren't enough posts to fill all 8 spaces,…
LBF
  • 1,133
  • 2
  • 14
  • 39
1
vote
1 answer

React counter not incrementing, but adding 1 instead

I'm stumped, my react app isn't incrementing a counter as intended, instead of going 1,2,3,4,5, its going 1,11,111,1111,11111 ... My understanding is that you cant do this.state.count++ as that mutates the state which facebook says not to do, and…
cgraffeo
  • 63
  • 5
1
vote
1 answer

FCM onReceived method to implement Shortcut Badger library

I found this library (https://github.com/leolin310148/ShortcutBadger) to implement app icon counter badge in android. badge works when i implement in activity. but i want to implement this when push notification is received. i currently have the…
t.Oraps
  • 51
  • 1
  • 4
1
vote
2 answers

Using a counter in a loop within a loop = problems in excel vba

Hi thanks for your help. Im a total noob at excel but I have been teaching myself due to my research needs I created this basic code by adapting it from the youtube channel ExcelVbaIsFun Sub ZipCodeSum2() Dim dbsheet As Worksheet Set dbsheet =…
HJJ
  • 13
  • 4
1
vote
1 answer

Reset countdown time after StopCoroutine

I'm having trouble figuring out how to reset the inactivity countdown of my timer. I'm using a coroutine to take care of the countdown and then stopping the countdown via button press using StopCoroutine. But when the countdown dialog reinstatiates…
greyBow
  • 1,298
  • 3
  • 28
  • 62
1
vote
1 answer

Enable button when counter reaches zero

I have a button its disabled and i want to put a counter inside it, what i want to do is when the counter reaches zero it get enabled, how can i do that? in the code below the counter doesn't appear inside the button and i don't want the reset…
stephjhonny
  • 227
  • 3
  • 9
  • 22
1 2 3
99
100