sysctl -a hw
This file contains 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
for VARIABLE in 1e-1 1e-2 1e-3 1e-4 1e-5 1e-6 1e-7 1e-8 1e-9 1e-10 1e-11 1e-12 1e-13 1e-14 1e-15 1e-16 | |
do | |
echo ${VARIABLE} | |
exit | |
done |
This file contains 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
# 1e3 = 1k: 8MB | |
rows = 1e3 | |
cols = 1e3 | |
# # 1e4 = 10k: 8GB | |
rows = 1e4 | |
cols = 1e4 | |
# # 1e5 = 100k: 80GB | |
rows = 1e5 |
This file contains 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
import numpy as np | |
from sklearn import linear_model | |
# Load data | |
data = np.loadtxt('./heights_weights.csv', delimiter=',', skiprows=1) | |
X = data[:,0:2] | |
y = data[:,2] | |
# Fit (train) the Logistic Regression classifier | |
clf = linear_model.LogisticRegression(C=1e40, solver='newton-cg') |
This file contains 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 \ |
This file contains 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 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 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 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 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'); |