.gitignoreshould be copied from this repository
The ignored files includeOS Temporary files(Mac temporary files are included inside)Development & Distribution FoldersVscodeJetBrainsMatlabPython(spyder project settings are ignored inside)waf(python binary files are ignored inPython)
- Modularity
All modules are imported bygit submoduleand stored in the folderModules.
git submodule add [repository ssh link] Modules/[repository name]
- Git Branch Management
mainis the branch to store the latest code (testing scripts and testing data shouldn't be involved).debugis the branch where we edit and test neweset codes (with data stored inside).- How to update the change from
debugtomain
First, we need to submit all changes indebugto the remote. (Now, we stay atdebug)
Then, we need to delete the testing scripts, testing data and extra modules only used ingit checkout main git merge debug
debug.
Any extra module inModules/(files) and.gitmodules(import syntax) has to be deleted manually.
Now, we can submit the change to main.git add . git commit -m "merge from debug: [the description of new traits]" git push - How to update the change from
README.mdcategory- Install doctoc
npm i doctoc -g - Create the category
doctoc README.md
- Install doctoc
Python&Matlabshould use similar defination of classes, properties and methods (100% similar is the best).- CamelCase naming style
- class names use capital letters
- properties and methods use lower cases.
- multiple words use
_to separate - private methods, private properties or private functions use
_in the beginning - constant variables use in all uppercase
- spacing
1 line spacing for class methods or different logic blocks
2 line spacing for classes and functions (class methods are not included).
- Modulation Class Programming Rules (
Mod_xxx)- constructor
We load all parameters about this modulation itself. For example, OFDM requires subcarrier number, FFT size and subcarrier spacing. - modulate
We load a vector of symbols into. - set_channel
Set the chararistics of the channel, such as delays, Doppler shifts, path gains and etc.. - pass_channel
We pass our symbols through the channel. Here, we need to provide a SNR scalar to add the noise (the signal power is nomarlised to 1). - demodulate
We demodulate the and give they - get_H
provide the channel matrix (all variants should be based on this function)
- constructor
- Detection Class Programming Rules (
Detect_xxx)- constructor
We load the constellation map inside. - detect
We usey,Handnoise powerto detect. If we need other parameters, we should add them in this process.
- constructor
- Nerual Network Detection Class Programming Rules (
Detect_NN_xxx)
-
Class Construction The construction is done when defining the type of a variable.
class Father{ public: Father(){ }; Father(int a){ }; }; Father alon; Father david(1);
When we assign a class variable with the construction method, we actually created a nameless object of this class and assign this object to the object.
Please note that the class cannot have any members over base C/C++ types.
class Child{ private: Father * father; public: Child(){ this->father = NULL; }; Child(Father * father){ this->father = father; }; }; Child alonSon; alonSon = Child(); // error: Child has a member out of base types in C/C++
-
Operator Overload & Friend Methods
- For single parameter operators, we suggest you to overload it as a method of the class because you can have a pointer
thisto use.Please note that we don't need to put 1st parameter as the method input, because it is presumes to be the instance of this class pointed by
thisclass A{ private: int num; public: // please note we have to nominate this method as const, so `this` will be pointed to a const place without change int GetNum() const{ } bool operator == (const A& a){ // the input is presumed to be const, so `this` in `GetNum()` must be const return this->num == a.GetNum(); } } - For multiple parameter operators, we suggest you to overload it as a friend method. If so, you can directly visit parameters' private attributes and lower the memory cost.
Please note that every parameter has to be given and friend methods do not belong to this class
// define a friend method directly class A{ private: int num; public: friend bool operator == (const A& a1, const A& a2){ // visit parameters' private attributes and lower the memory cost return a1.num == a2.GetNum(); } } // define a friend method directly class A{ private: int num; public: friend bool operator == (const A& a1, const A& a2); } bool operator == (const A& a1, const A& a2){ // visit parameters' private attributes and lower the memory cost return a1.num == a2.GetNum(); }
- For single parameter operators, we suggest you to overload it as a method of the class because you can have a pointer
-
Class Inheritance
- If the child class does not define its constructor, it will call its parent's constructor (of no parameter)
- If the child class defines its constructor (with/without parameters), it will call its parent's constructor (of no parameter)
- If users define a constructor with parameters in the parent class, the compiler won't provide a default constructor of no parameter and its child class must have a constructor explicitly calling its parent's constructor. Please note that the parent constructor has to have at least one parameter same to parameters in the child constructor.
class father{ public: string f_a; father(string f_a){ this->f_a = f_a; cout << "father" << endl; } }; class son : public father{ public: string f_a; // Wrong! This way presumes that the parent class has a constructor with same parameters but it is not true in this example //son(string f_a){ //} // The parent only has a constructor with parameters, so we have to explicitly call it in the child constructor // Way 1: Call parent constructor with constants son(string f_a):father("father"){ cout << "son (way 1)" << endl; } // Way 2: Transfer the parameters to the parent construtor son(string f_a, int a):father(f_a){ cout << "son (way 2)" << endl; } };
-
Polymorphism
The parent class can call its method based on its instance of which subclass. However this requires the method in the parent class to be virtual
class A{
public:
// define a virtual method in the parent class to support polymorphism
virtual void foo(){
cout<<"A::foo() is called"<<endl;
}
// pure virtual function when we don't want to intialize this method in the parent class
virtual int area() = 0;
};
class B: A{
public:
void foo(){
cout<<"B::foo() is called"<<endl;
}
};
int main(void){
A *a = new B();
a->foo(); // Here a is of A, but it uses foo() in B
return 0;
}- use the handle class insteald of the value class. See https://au.mathworks.com/help/matlab/matlab_oop/comparing-handle-and-value-classes.html
% the handle class defination
classdef [your class name] < handle- the dimension format is
[row, column]
- use numpy as the base type to do any Math operation
- the dimension format is
[..., (batch-size), row, column]. Python codes need to support dynamic dimensions (greater than or equal to 2).
***.ps1 cannot be loaded because running scripts is disabled on this system error- Open PowerShell Console by selecting
Run as Administrator - type
Get-ExecutionPolicyto see ifRestricted(which is the reason) - type
Set-ExecutionPolicy RemoteSigned - type
Y
- Open PowerShell Console by selecting
node -v || node --versioncheck versionnvm lslist installed versions of node (via nvm)nvm install 6.9.2install specific version of nodenvm use 8.0Use the latest available 8.0.x releasenvm run 6.10.3 app.jsRun app.js using node 6.10.3nvm exec 4.8.3 node app.jsRun nodeapp.jswith the PATH pointing to node 4.8.3nvm alias default 6.9.2set default version of nodenvm alias default nodeAlways default to the latest available node version on a shellnvm install nodeInstall the latest available versionnvm use nodeUse the latest versionnvm install --ltsInstall the latest LTS versionnvm use --ltsUse the latest LTS versionnvm set-colors cgYmWSet text colors to cyan, green, bold yellow, magenta, and white
vboxuser is not in the sudoers file .This incident will be reported!
add$usernameintosudo
su root
adduser vboxuser sudo- Can't open terminals in
Shared Folder
sudo adduser $username vboxsf
We firstly create CMakeLists.txt under the project folder. Then, we create the build folder by
cmake .Then we go into build and run make
cd build
make- cannot login
# check service status
service pveproxy statusCluster not ready - no quorum(500): this happens because some hosts are out of a cluster
# check the status to verify
pvecm status
# check recorded nodes (might be unavailable)
pvecm nodes
# delete unavailable nodes
pvecm delnode <NodeName>
# delete unavailable nodes from UI
cd /etc/pve/nodes/
rm -rf <NodeFolderName>
# reset active computer number to 1 (this computer in the cluster)
pvecm expected 1- If you want to build an environment to test AI using mature 3rd party libraries
conda create -n dev python=3.9 -y
conda activate dev
pip install -U pandas scipy scikit-learn matplotlib
pip install spyder
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
pip install tensorflow==2.13.*
pip install setuptools wheel twineTWINE_USERNAME: token
TWINE_PASSWORD: pypi-xxxx