sysctl -a hw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Mongo Installation | |
| // Generate mongod with parameters | |
| echo "mongod --dbpath=~/data --nojournal" > mongod | |
| chmod a+x mongod | |
| // 1. Run the mongo deamon (mongod) | |
| cd ~/data | |
| ./mondog |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function mit18086_poisson | |
| %MIT18086_POISSON | |
| % Sets up and solves a 1d, 2d and 3d Poisson problem | |
| % on domain [0 1]^dim, with homogeneous Dirichlet b.c. | |
| % everywhere and constant right hand side. | |
| % Uses successive Kronecker products to construct | |
| % sparse system matrices | |
| % 03/2007 by Benjamin Seibold | |
| % http://www-math.mit.edu/~seibold/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Asyncronous for each | |
| async.forEach(messageIds, function(messageId, callback) { | |
| // Do stuff | |
| callback(); | |
| }, function(err) { | |
| if (err) return next(err); | |
| // Success | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let promiseToCleanTheRoom = new Promise(function(resolve, reject) { | |
| //cleaning the room | |
| let isClean = false; | |
| if (isClean) { | |
| resolve('Clean'); | |
| } else { | |
| reject('not Clean'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Implementation | |
| function sleep(ms){ | |
| return new Promise(resolve=>{ | |
| setTimeout(resolve,ms) | |
| }) | |
| } | |
| // Usage. Sleep two seconds | |
| await sleep(2000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <vector> | |
| #include <iostream> | |
| using namespace std; | |
| // Requires C++11 compiler | |
| int main(int argc, char const *argv[]) | |
| { | |
| vector<int> vec{5,7,2,32,9,45}; | |
| for_each(vec.begin(), vec.end(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| BasedOnStyle: LLVM | |
| AccessModifierOffset: -2 | |
| AlignAfterOpenBracket: true | |
| AlignEscapedNewlinesLeft: false | |
| AlignOperands: true | |
| AlignTrailingComments: true | |
| AllowAllParametersOfDeclarationOnNextLine: true | |
| AllowShortBlocksOnASingleLine: false | |
| AllowShortCaseLabelsOnASingleLine: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # module load python/3.6-anaconda-4.4 | |
| import csv | |
| with open("susy_full_normed_train.csv","rt", encoding="utf8") as source: | |
| rdr= csv.reader( source ) | |
| with open("susy_full_normed_train_low_features.csv","wt") as result: | |
| wtr= csv.writer( result ) | |
| for r in rdr: | |
| wtr.writerow( (r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7] ) ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if [[ $1 == "r" ]]; | |
| then | |
| rm -rf build | |
| mkdir build | |
| fi | |
| cd build | |
| # -DCMAKE_BUILD_TYPE=Release \ |