Questions tagged [count]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
3answers
254 views

Frequency distribution by range algorithm

I have an array of unsorted positive real numbers. I need to create a frequency distribution by their ranges. The simplest approach goes like this for num in numbers if (num > 0 and num < 10) ...
3
votes
2answers
1k views

Explanation to why Counting bits set, Brian Kernighan's way works

I found this link to count number of bits in a variable. I think it is pretty cool, but I can't figure out why it works. Can someone offer an explanation? Here is the code unsigned int v; // count ...
2
votes
3answers
860 views

Count unique visitors by group of visited places

I'm facing the problem of counting the unique visitors of groups of places. Here is the situation: I have visitors that can visit places. For example, that can be internet users visiting web pages, ...
5
votes
2answers
8k views

Is checking count/size/length less than 0 necessary in modern languages?

Is checking count/size/length less than 0 necessary in modern languages anymore? For instance, in C# I quote often will check if a collection's count is less than or equal to 0. I assume that this ...
10
votes
4answers
4k views

Number of Classes in a Namespace - Code Smell?

I have a C# library that's used by several executables. There's only a couple namespaces in the library, and I just noticed that one of the namespaces has quite a few classes in it. I've always ...