Skip to content

Instantly share code, notes, and snippets.

View lpicanco's full-sized avatar
🤖
Machine Learning

Luiz Picanço lpicanco

🤖
Machine Learning
View GitHub Profile
@lpicanco
lpicanco / rangeTest.kt
Last active September 14, 2022 15:42
Sample range test using IntervalTree
import com.google.common.collect.BoundType
import com.google.common.collect.Range
import com.google.common.collect.TreeRangeMap
import org.junit.Test
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertFalse
import org.junit.jupiter.api.Assertions.assertTrue
class RangeTest {
data class Rule(val value: String, var updated: Boolean = false)
{
"a": "",
"abbatial": "abbashul",
"abhorred": "abhorrd",
"about": "bout",
"absorbed": "absorbd",
"abstinential": "abstinenshul",
"accelerometer": "accelerometr",
"accepts": "acceptz",
"access": "acces",
#/bin/bash
SCRIPT_NAME=$0
OPT=$1
FILES_PATH=$2
set -e
usage() {
echo -n "${SCRIPT_NAME} [OPTIONS] [FILE_PATH]
Recursively Encrypt/Decrypt files at given path
@lpicanco
lpicanco / export_to_json.py
Created May 3, 2019 03:06
export image to json - keras
import cv2 as cv
import argparse
import numpy as np
import json
def predict(image_file):
faces = process_image(image_file)
doc = json.dumps(faces.tolist())
print(doc)
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="rastro" targetNamespace="http://resource.webservice.correios.com.br/" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:tns="http://resource.webservice.correios.com.br/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<!-- <types>
<xsd:schema>
<xsd:import namespace="http://resource.webservice.correios.com.br/" schemaLocation="Rastro_schema1.xsd"/>
</xsd:schema>
</types> -->
<message name="RastroJson">
<part name="parameters" element="tns:RastroJson">
from ubidots import ApiClient
import RPi.GPIO as GPIO
import time
import wiringpi2 as wiringpi
def bin2dec(string_num):
return str(int(string_num, 2))
def finish():
wiringpi.digitalWrite(0, 0)
https://github.com/quankiquanki/skytrax-reviews-dataset/tree/master/data
@lpicanco
lpicanco / Dockerfile
Last active April 5, 2016 17:58
jenkins-devops
FROM simonqbs/jenkins-dind
MAINTAINER Luiz Picanço "lpicanco@gmail.com"
ENV PACKER_VERSION 0.8.6
RUN apt-get update && apt-get install -y \
python-pip python-dev curl sshpass && \
pip install ansible==2.0 && \
pip install docker-py==1.4.0 && \
public static MultivaluedMap<String, String> parseForm(InputStream entityStream)
throws IOException
{
char[] buffer = new char[100];
StringBuffer buf = new StringBuffer();
BufferedReader reader = new BufferedReader(new InputStreamReader(entityStream));
int wasRead = 0;
do
{
@lpicanco
lpicanco / pythonServer.sh
Last active December 16, 2019 12:58
Simple Python HTTP Server
#!/usr/bin/python
"""
Save this file as server.py
>>> python server.py 0.0.0.0 8001
serving on 0.0.0.0:8001
or simply
>>> python server.py