histo for strings?
Is there an object or extrenal somewhere out there that can keep a running tally of how many times messages have been received? I have searched around but can’t find anything about this specifically.
generally, i’d suggest:
[symbol] -> [coll] -> [histo]
it’d be nice to see an example patch that illustrates what you’re after better…
Not really much in the way of an example patch needed to say what I was going for…
I was getting lists in the format "i s s" (ie. "1 2C On") and I was looking for a way to keep a running tally of how often each combination came up. I thought maybe if I could turn it into a string there would be some sort of match/histo hybrid.
I ended up going for a more hardcoded approach – using a combination of route and atoi to get unique ID #s for the various lists and feeding them into a series of histo objects. Not the most elegant solution, but it works because I have a pretty controlled # of messages I can receive.
I was trying to stay away from coll because I’ve read that its one of the slower objects for querying data, and timing is relatively crucial for my application. Of course… who knows if my abstraction is really any faster.
> I was getting lists in the format "i s s" (ie. "1 2C On")
you’ll need to be more specific. is the data arriving synchronously? can you use [sprintf]?
you could always use [checklist] by jasch.
it’s 3rd party:
my idea was simply to have a list of all your possible strings in [coll] (as the indexes) and then to query coll for the numbered index out of it’s middle-left outlet.
> I was trying to stay away from coll because I’ve read that its one of the slower objects for querying data,
this is simply not true.
there are some really really slow ones :)
Ah, I see now… the coll index thing seems like a pretty clean solution. I guess the stories I’ve heard about its slowness are probably in cases where there is MUCH more data involved.
What I was really looking for (and, it seems, doesn’t exist) is an object that would keep track of these lists *without* it being pre-meditated. In either case we’ve discussed in this thread, adding a new possible combination would require that I go into the code and "teach" that combination to the patch myself…. whereas, with histo, I don’t necessarily have to tell it ahead of time to expect a 6. It just starts tallying once it gets the first one…
The checklist object seems on the right track… but it’s not doing any of the tallying that I needed.
And, to clarify… the list is arriving synchronously from a pack object.
> Is there an object or extrenal somewhere out there that can keep a
> running tally of how many times messages have been received? I have
> searched around but can’t find anything about this specifically.
b -> counter
Ah sorry…. I should clarify:
I meant how many times various *specific* messages have been received. ie… if i get the message "go Dan go" an object that will keep a tally and say "you’ve received the message ‘go Dan go’ 12 times since I was last cleared"
b -> counter would certainly work if i was only trying to keep a tally of messages overall…. but I need more granularity than that.
as I mentioned earlier… I found a workaround for my particular situation but it seems to be an interesting topic for general discussion.