2010/11/30

ns-3 naming conventions

Functions or methods names: verb or adjectives: GetX, DoDispose, ClearArray, etc.
Predicated name for methods/functions with single return value: use Is, Has, or bool e.g., IsBroadcast();

Indentation: two space (not tab)
After , , :, and ; - put one space
Method return type: in column one
Method name: in column one
Variable name: e.g., CamelBlack - camelBlack UserName - userName
Function, property, event, or class name: CamelBlack (try to use descriptive names for classes and functions)
global variables - prefixed with a g_
global member function - prefixed with a m_
enume variables - suffixed with _e
defined types - optionally end with _t
define constant (static const class members, or enume constants) - all upper case letters

// declaring my-class.h
typedef struct {
uint32_t m_magicNumber;
uint32_t m_versionMajor;
} PcapFileHeader_t; // the trailing _t is optional

const uint8_t PORT_NUMBER = 17;

class MyClass
{
void MyMethod (int aVar);
int m_aVar;
static int m_anotherVar;
};

// implementing the my-class.cc

typedef struct {
uint32_t m_magicNumber;
uint32_t m_versionMajor;
} PcapFileHeader_t; // the trailing _t is optional

const uint8_t PORT_NUMBER = 17;

class MyClass
{
void MyMethod (int aVar);
int m_aVar;
static int m_anotherVar;
};

Portable integer types - uint8_t, int32_t, etc., instead of unsigned int/long;
One could use nested namespaces instead of ns3 namespace:

namespace ns3 {
namespace olsr {
...
} // namespace olsr
} // namespace ns3

namespace ns3 and namespace std shouldn't be used in the source code inside src/. and could be used in examples/, samples/, test/

2010/11/23

Socialnets and data mining

Interested workshop and CFP related to socialnets and data mining.

http://www.socialgamingplatform.com/msm09/
http://machine-learning.blogspot.com/2009/10/cfp-special-issue-of-international.html

2010/11/14

OneSwarm

OneSwarm doesn't anonymize BT behavior (also it doesn't use Tor for anonymity). But does it do anything clever like first search the OneSwarm network of friends for contents. It then searches files once using BT if it's not available?