Skip to content

Instantly share code, notes, and snippets.

View arturaugusto's full-sized avatar
👾

Artur arturaugusto

👾
View GitHub Profile
@arturaugusto
arturaugusto / image_gamma_correction.py
Created December 4, 2021 10:35 — forked from rkdgusrn1212/image_gamma_correction.py
Image Gamma Correction using Pillow in Python.
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
gray_img = Image.open('Lenna.png').convert("LA")#밝기와 알파값을 이용해서 Grayscale로 변환
gray_img.save("lenna_gray.png")#grayscale로 변환된 흑백 이미지를 출력
row = gray_img.size[0]
col = gray_img.size[1]
gamma1 = 0.88
@arturaugusto
arturaugusto / gh-pages-deploy.md
Created May 19, 2018 21:03 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@arturaugusto
arturaugusto / viewer.html
Created April 29, 2018 00:48 — forked from squallstar/viewer.html
Pinch gestures for pdf.js
<script type="text/javascript">
var gesturesSetUp = false;
var ua = navigator.userAgent.toLowerCase();
var isAndroid = ua.indexOf("android") > -1;
document.addEventListener('textlayerrendered', function (e) {
if (gesturesSetUp || e.detail.pageNumber !== PDFViewerApplication.page) {
return;
}

3 colheres pequenas de fermento bio 4 colheres medias farinha branca 2 colheres de açucar 100 ml agua morna 20 min

300 gramas farinha branca 150 ml agua morna 1 colher pequena de sal bater com colher de pau

@arturaugusto
arturaugusto / teste.html
Created February 12, 2016 18:26
autoValue problem solved on remove array item
<head>
<title>teste</title>
</head>
<body>
{{> insertBookForm}}
{{> removeItem}}
@arturaugusto
arturaugusto / numerical_tolerance_mc.js
Created September 22, 2015 19:51
Numerical tolerance associated with a numerical value on javascript
// JCGM_101_2008
// Numerical tolerance associated with a numerical value on javascript
// page 31
//Example 1
a=0.00035;n=2;parseFloat("1e"+(a/(Math.pow(10,n-1))).toExponential().split("e")[1])/2
//Example 2
a=0.0004;n=1;parseFloat("1e"+(a/(Math.pow(10,n-1))).toExponential().split("e")[1])/2
//Example 3
a=2;n=1;parseFloat("1e"+(a/(Math.pow(10,n-1))).toExponential().split("e")[1])/2
@arturaugusto
arturaugusto / exec_class_code.py
Last active September 4, 2015 19:50
Sample executing classes
from lantz import Feat
from lantz.messagebased import MessageBasedDriver
# Part 1: resources
# Create dict that will hold the classes
# Set string that contain the class definition
class_code = []
class_code.append({
"id": "abc",
@arturaugusto
arturaugusto / formating_functions
Created November 21, 2014 00:01
*Untested* functions to format numbers
fmt_nsignif <- function(x, n){
return(format(sprintf(signif(x, n), fmt=paste("%#.", n, "g", sep = "")), scientific=FALSE))
}
get_nsignif <- function(x){
str <- gsub("^([0\\s\\D])*", "", x, perl=TRUE)
n <- sum(nchar(strsplit(str, "\\.")[[1]]))
return(n)
}
formatToResolution = function(toFormat, model) {
toFormat <- as.numeric(toFormat);
modelResolution <- numberResolution(model);
digits <- modelResolution;
formatedNumber <- sprintf(paste("%.", toString(digits), "f", sep=""), round(toFormat, digits));
return(formatedNumber);
}
# Solve code fragment
solve_snippet = function(code_snippet, var_to_return = "u", code_inject_before = ""){
code_snippet <- paste(code_inject_before, ";", code_snippet, "; return(" ,var_to_return, ")" );
waveProc <- function(y, samples, sample_size, freq){
options(digits=10)
require("signal")
meas <- matrix(nrow = 50, ncol = 0)
dimnames(meas) = list(c(seq(1,50)), c() )
mag_list = c()
samples <- NROW(y)
n <- NROW(y)-1
T <- as.numeric(sample_size)*as.numeric(samples)
dt <- T / n