Skip to content

Instantly share code, notes, and snippets.

View HectorTorres's full-sized avatar

Hector Torres HectorTorres

View GitHub Profile
import unittest
def function_square(a):
return a*a
class Test(unittest.TestCase):
def test_function_square(self):
self.assertEquals(function_square(2),4)
#run the program
def function_square(a):
return a*a
def test_function_square():
assert function_square(2) == 5
test_function_square()
#Run the file
#pytest test_pytest_01.py
En CMD o PowerShell abrir con permisos de administrador y poner:
wsl --install
wsl --set-default-version 2
Descargar archivo e instalar:
https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
En Microsoft Store
Buscar e instalar Python3.8
Buscar e instalar Visual Studio Code
import numpy as np
import tensorflow as tf
import cv2
from object_detection.utils import visualization_utils as vis_util
#import visualization_utils as vis_util
def create_category_index(label_path="C:/Users/gdlhtorr/Desktop/inference_tflite_od/model.txt"):
"""
To create dictionary of label map
Parameters
from datetime import datetime
import time
import pathlib
import sys
import base64
import json
import os
import numpy as np
import requests
import cv2
@HectorTorres
HectorTorres / sim900-arduino.c
Last active August 19, 2022 04:16
Arduino UNO SIM900
/*
Herramientas Tecnologicas Profesionales
www.hetpro-store.com
Tutorial Original:
https://tronixstuff.com/2014/01/08/tutorial-arduino-and-sim900-gsm-modules/
Comandos AT:
https://probots.co.in/Manuals/SIM900%20GSM%20Modem%20-%20Starter%20Guide.pdf
//Configuración de los motores.
//Motor 1
const int motorAPin1 = 5; // Pin 14 de L293
const int motorAPin2 = 6; // Pin 10 de L293
//Motor 2
const int motorBPin3 = 10; // Pin 7 de L293
const int motorBPin4 = 9; // Pin 2 de L293
void setup(){
@HectorTorres
HectorTorres / oledarduino.c
Created July 14, 2017 22:03
Arduino OLED display tutorial
/==========================================================//
// //
// OLED ssd1316 Test Code //
// Adafruit
// //
//==========================================================//
#include <avr/pgmspace.h>
#include <Wire.h>
//---------------Datos de la fuente y los graficos----------//
@HectorTorres
HectorTorres / cura-diodo.m
Created October 18, 2017 21:43
Curva del diodo en Matlab
close all
n=1;
Is=10e-12;
%Vd=0:10e-3:1;
Vd=0.65:10e-3:0.75;
Vt=26e-3;
Id=Is.*(exp(Vd./Vt)-1);
plot(Vd,Id,'LineWidth',2)
grid
legend('Corriente del diodo');
[DataBase]
Driver = SQL Server
Server = DESKTOP-0HHEA1Q\SQLEXPRESS
Database = testDB
UID = python
PWD = admin2