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
#!/bin/bash | |
# | |
# This script contains `sudo` command to download/update required packages and register system service for Massa. | |
# | |
# - download, make executable and run script: | |
# wget -qO massa.sh https://gist.githubusercontent.com/isezen/3e4646cdacc4ea985c3f2bd6f42dbd39/raw/massa.sh && chmod +x massa.sh && ./massa.sh | |
# - Just type `massa-client` to run. | |
# - to see the logs, type `see-logs`. | |
# | |
echo -e '' |
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
sudo apt-get purge bcmwl-kernel-source | |
sudo apt update | |
sudo update-pciids | |
sudo apt install firmware-b43-installer | |
sudo reboot #note that this will restart your computer | |
sudo iwconfig wlp3s0 txpower 10dBm | |
#sudo iwconfig wlp2s0 txpower 10dBm |
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
nrm <- function(x, min = 0, max = 1, range_x = range(x)) { | |
a <- (max - min)/(max(range_x) - min(range_x)) | |
b <- max - a * max(range_x) | |
a * x + b | |
} | |
panel <- function(x, y, ...) { | |
ok <- is.finite(x) & is.finite(y) | |
if (any(ok)) { | |
xx <- x[ok]; yy <- y[ok] | |
if (par("xlog")) xx <- log10(xx) |
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
Run R: | |
sudo PKG_CONFIG_PATH="/home/programs/anaconda3/lib/pkgconfig/" LD_LIBRARY_PATH="/home/programs/anaconda3/lib" R | |
run the command: | |
remotes::install_github("r-spatial/sf", configure.args = "--with-gdal-config=/home/programs/anaconda3/bin/gdal-config --with-geos-config=/home/programs/anaconda3/bin/geos-config --with-proj-include=/home/programs/anaconda3/include/ --with-proj-lib=/home/programs/anaconda3/lib/") |
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
def _split_n(x, n): | |
y = [x // n for i in range(n)] | |
for i in range(x % n): | |
y[i] += 1 | |
return y |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# pylint: disable=C0103, C0321, C0330 | |
"""1-D Bacterium class example""" | |
from random import randint as rnd | |
import gc | |
import time | |
from matplotlib import pyplot as plt | |
from datetime import datetime as dt |
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
library(class) | |
library(gmodels) | |
set.seed(6) | |
df <- data.frame(A = c(rnorm(30, 0), rnorm(30, 3)), | |
B = c(rnorm(30, 0), rnorm(30, 3)), | |
Group = factor(c(rep("G1", 30), rep("G2", 30)))) | |
# use 33% of data for training and 67% is for test | |
i <- sample(2, nrow(df), replace = TRUE, prob = c(0.67, 0.33)) | |
train.df <- df[i == 2, -3] # do not include last column | |
train.cl <- df[i == 2, 3] # training result cluters |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 os | |
if '__file__' in globals(): | |
cdir = os.path.dirname(os.path.realpath(__file__)) | |
else: | |
cdir = os.getcwd() |