小编use*_*248的帖子

确定网站的唯一访问者

我正在用Apache2作为服务器创建一个django网站.我需要一种方法来确定我的网站(特别是每个页面)的唯一访问者的数量,以完全证明的方式.不幸的是,用户会有很高的动机试图"游戏"跟踪系统,所以我试图让它充分证明.

有没有办法做到这一点?

目前我正在尝试使用IP和Cookie来确定唯一身份访问者,但这个系统很容易被无头浏览器所迷惑.

django visitors unique web

5
推荐指数
1
解决办法
1923
查看次数

为什么根指针始终初始化为null?

我对以下代码非常困惑:

class Tree {
protected:
    struct Node {
        Node* leftSibling;
        Node* rightSibling;
        int value;
    };  
private:
    Node* root;
    int value;
.....
public:
    void addElement(int number) {
        if (root == NULL) {
            printf("This is the value of the pointer %lld\n",(long long)root);
            printf("This is the value of the int %d\n",value);
            ...
            return;
        }
        printf("NOT NULL\n");
    }
};


int main() {
    Tree curTree;
    srand(time(0));
    for(int i = 0;i < 40; ++i) {
        curTree.addElement(rand() % 1000);
    }
}
Run Code Online (Sandbox Code Playgroud)

curTree变量是main函数的本地变量,因此我预计它不会将其成员初始化为0,但它们都已初始化.

c++ variable-initialization

3
推荐指数
1
解决办法
453
查看次数

标签 统计

c++ ×1

django ×1

unique ×1

variable-initialization ×1

visitors ×1

web ×1