Archive for August, 2007

Static member variables in C++ class…

Thursday, August 23rd, 2007

I was thought I am an expert on C++, however today I still found something very simple BUT I didn’t know… It’s all about define a static variables in C++ class… :(

Static data members are not part of objects of a given class type; they are separate objects. As a result, the declaration of a static data member is not considered a definition. The data member is declared in class scope, but definition is performed at file scope. These static members have external linkage.

So the code should like this:

// static_data_members.cpp
class BufferedOutput
{
public:
   // Return number of bytes written by any object of this class.
   short BytesWritten()
   {
      return bytecount;
   }

   // Reset the counter.
   static void ResetCount()
   {
      bytecount = 0;
   }

   // Static member declaration.
   static long bytecount;
};

// Define bytecount in file scope.
long BufferedOutput::bytecount;

int main()
{
}

Shame I am…



Popularity: 11% [?]

Some new sort of spams…really boring

Friday, August 17th, 2007

Some days ago, I found something in Akismet spam lists looks like normal comments by real people and I , but now I found more of those sort of spam.

Obviously this is a new spam program which can take some keywords from your blog post and randomly select from some prepared template, it makes the spam look like someone comment on your posts.

Daniel | k.daniel@msn.com IP: 65.98.35.234

I couldn’t understand some parts of this article s inside X-Forwarded-For and how to handle | Inmates Are Running Asylum, but I guess I just need to check some more resources regarding this, because it sounds interesting.

Daniel | k.daniel@msn.com | IP: 64.22.110.34

I have to say, that I could not agree with you in 100% regarding gle Search box to blog post plugin | Inmates Are Running Asylum, but it’s just my opinion, which could be wrong :)

Fortunately Akismet can catch all those sort spam automatically! That’s nice, but it take me more time to review those spam list to see if I should deleted or save some real comment which was miss judged.

Popularity: 12% [?]

Close
E-mail It
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.