Serverless notes
- Serverless - framework to work with AWS
- Postman - tool to test API
// alignas C++11, C++14 | |
class alignas(32) Foo {...} | |
// address &foo is aligned to 32-byes boundary | |
Foo foo{}; | |
// it is not guarantee that address pFoo is aligned to 32-byes boundary | |
Foo* pFoo = new Foo(); |
# copy the code to $PROFILE.CurrentUserAllHosts | |
# and restard PowerShell. | |
# Now you can switch between different versions of Python using EnablePython <Version> | |
# or short aliases: py36, py37, py38 | |
Function Get-OriginalPath { | |
if (-not $env:ORIGINAL_PATH) { | |
$env:ORIGINAL_PATH = $env:PATH | |
} | |
return $env:ORIGINAL_PATH |
""" | |
Principal component analysis (PCA) | |
>>> np.random.seed(111) | |
>>> m = np.array([[3, 2], [2, 6]]) | |
>>> frobenius_norm(m) | |
7.280109889280518 | |
>>> power_iter(m, np.ones((2,1))) |
#include <iostream> | |
#include <future> | |
#include <condition_variable> | |
#include <mutex> | |
#include <thread> | |
#include <queue> | |
// One Way Channel a.k.a. Message Queue | |
template <typename T> |
import qualified Data.Vector.Storable as V | |
import qualified Numeric.LinearAlgebra as LA | |
-- | Process outputs for Multiclass Classification. | |
-- Takes number of labels and output vector y. | |
-- Returns matrix of binary outputs (One-vs-All Classification). | |
-- It is supposed that labels are integerets start at 0. | |
processOutputMulti :: Int -> Vector -> Matrix | |
processOutputMulti numLabels y = LA.fromColumns $ map f [0 .. numLabels-1] |
#!/usr/bin/env bash | |
IFS="$(printf '\n\t')" # eliminate whitespace in pathnames | |
# function real_path (path) | |
function real_path () { | |
[[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" | |
} | |
# function build_href (caption, url) |
#!/usr/bin/env python | |
# Finding the points of intersecion of two circles. | |
import math | |
class Point: | |
def __init__(self, x = 0, y = 0): | |
self.x = x | |
self.y = y |
#!/usr/bin/env bash | |
export PLATRORM=darwin-amd64-64 | |
# build and install utils | |
cd $HADOOP_INSTALL/src/c++/utils | |
chmod +x configure install-sh | |
./configure --prefix=$HADOOP_INSTALL/c++/$PLATFORM | |
make install |
#!/usr/bin/env bash | |
# global parameters | |
g_tmp_folder="ncdc_tmp"; | |
g_output_folder="ncdc_data"; | |
g_remote_host="ftp.ncdc.noaa.gov"; | |
g_remote_path="pub/data/noaa"; | |