Skip to content

Instantly share code, notes, and snippets.

View huberflores's full-sized avatar

Huber Flores (El Magico) huberflores

View GitHub Profile
@huberflores
huberflores / statistical.R
Last active September 18, 2020 14:30
Statistical test analysis, Friedman and Pairwise Wilcoxon
suppressWarnings(library(tidyverse))
suppressWarnings(library(ggpubr))
suppressWarnings(library(rstatix))
mydata <- read.csv("mydata-fixedhold.csv", sep=",", header = T)
myvars <- c("id", "cigarette", "bottle", "cup")
newdata <- mydata[myvars]
# From socket module we import the required structures and constants.
from socket import AF_INET, SOCK_DGRAM, socket
if __name__ == '__main__':
print 'Application started'
# Creating a UDP/IP socket
s = socket(AF_INET, SOCK_DGRAM)
@huberflores
huberflores / Adb-wifi
Created September 16, 2018 13:33
Adb-wifi
# author Huber Flores
#Open Android Studio and connect your device via USB
#Computer and phone need to be connected to the same Network
#Open terminal
$ huberflo@hp8x-78:~$ adb tcpip 5555
restarting in TCP mode port: 5555
@huberflores
huberflores / distfit.R
Created April 5, 2016 14:57
Fitting data to a particular distribution
suppressMessages(library(fitdistrplus))
suppressMessages(library(logspline))
fileInput <- "/Users/hflores/Desktop/datasets/code-benchmarking/output70-t2large.csv"
codebenchmark = read.csv(fileInput, sep=";")
time <- codebenchmark$response
descdist(time, discrete = FALSE)
@huberflores
huberflores / lpmodel-basics.R
Last active August 6, 2018 14:13
Linear programming in R - basic example
#
#author Huber Flores
#
library(lpSolveAPI)
library(ggplot2)
library(reshape)
library(gridExtra)
@huberflores
huberflores / bluetooth1.dot
Last active December 27, 2015 01:33
social graph with graphivz
digraph Bluetooth {
graph [ dpi = 300 ];
p0-> p9;
p0-> p10;
p0-> p11;
p0-> p12;
p0-> p13;
p0-> p14;
p0-> p15;
p0-> p16;
@huberflores
huberflores / decision-engine.R
Last active November 11, 2015 11:07
A fuzzy logic engine for computational offloading - simulation version
#
# author Huber Flores
#
# The input of the engine is a dataset. For each tuple of the dataset a decision is expected
# Each attribute in the tuple is normalized in a 0-1 interval
library(iterators)
library(foreach)
@huberflores
huberflores / file.R
Created November 9, 2015 14:36 — forked from mollietaylor/file.R
Storing a Function in a Separate File in R
# calling the functions
# this is the file where we will call the functions in fun.R and times.R
times <- dget("times.R")
times(-4:4, 2)
source("fun.R")
mult(-4:4, 2)
@huberflores
huberflores / fuzzyLogic.R
Last active April 2, 2022 22:43
Fuzzy logic in R
#
# author Huber Flores
#
# Example of fuzzy logic in R
# The main idea is to have fuzzy sets for each of the dimensions
# each attribute in the dimension can be defined as a fuzzy set with their respective linguistic variables, terms and membership functions
library(sets)
@huberflores
huberflores / data-normalization.R
Created October 23, 2015 13:00
Normalization of data in a range using R
# author Huber Flores
# Normalizing data to a target range (a, b)
#original dataset
mydata <- c(26,33,45,77,15,100,66,21,89,55)
A = min(mydata)
B = max(mydata)