In Git you can add a submodule to a repository. This is basically a sub-repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:
- Separate big codebases into multiple repositories.
| #include <iostream> | |
| #include <bitset> | |
| #include <vector> | |
| #include <cassert> | |
| namespace std { } | |
| using namespace std; | |
| typedef size_t (*pHashFunc)(const char*); |
The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.
The correct way of creating a private frok by duplicating the repo is documented here.
For this assignment the commands are:
git clone --bare git@github.com:usi-systems/easytrace.git
(draft; work in progress)
See also:
| // Primitive hash function that for a string returns a positive 32 bit int | |
| // Do not use in production, use murmur3 or fnv1 | |
| // You can improve this by changing 5 to 31 | |
| Object.defineProperty(String.prototype, 'hashCode', { | |
| value: function() { | |
| var hash = 0, i, chr; | |
| for (i = 0; i < this.length; i++) { | |
| chr = this.charCodeAt(i); | |
| hash = ((hash << 5) - hash) + chr; | |
| hash |= 0; // Convert to 32bit integer |