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
clc | |
clear all | |
#Definiendo variables iniciales | |
E=5; | |
R=1000; | |
I0=50e-9; | |
Vt=26e-3; | |
Vd=0:1e-3:5; # Vector de parametros independientes, voltaje | |
Id1=I0*(exp(Vd/Vt)-1); #Ecuacion del dido |
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
//Mendez Cruz Juan Daniel | |
//Carlos Chavez | |
//Control de temperatura por medio de dos sensores LM35 controlados por PIC16F887 | |
//Rangos de Temperatura baja>10 grados C,Temperatura media[10,30] grados C | |
//Temperatura alta> 40 grados C, para temperatura media se acciona un ventilador | |
//Para Temperatura alta se acciona segundo ventilador se dispara una alarma | |
#include <16F887.h> | |
#device ADC=10 //Resolución de 10 bits para ADC | |
#fuses INTRC_IO,NOCPD,NOWDT,NOPUT,NOLVP,NOBROWNOUT,MCLR |
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
<?php | |
// test/Unit/UserTest.php | |
namespace Tests\Unit; | |
use PHPUnit\Framework\TestCase; | |
class Password { | |
protected $password = ""; |
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
// tests.cpp | |
#include "whattotest.cpp" | |
#include <gtest/gtest.h> | |
TEST(SquareRootTest, PositiveNos) { | |
ASSERT_EQ(6, squareRoot(36.0)); | |
ASSERT_EQ(18.0, squareRoot(324.0)); | |
ASSERT_EQ(25.4, squareRoot(645.16)); | |
ASSERT_EQ(0, squareRoot(0.0)); | |
} |
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
// whattotest.cpp | |
#include <math.h> | |
double squareRoot(const double a) { | |
double b = sqrt(a); | |
if(b != b) { // nan check | |
return -1.0; | |
}else{ | |
return sqrt(a); | |
} |
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
# Se requiere definir una version minima de cmake, por compatibilidad | |
cmake_minimum_required(VERSION 3.22) | |
# Se requiere definir un nombre de proyecto. | |
project("Gtest") | |
# Buscar el paquete GTest | |
find_package(GTest REQUIRED) | |
# Vincular el archivo de salida con el de pruebas | |
add_executable(a.out test.cpp) |
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 math | |
def function_rectangle_type(a,b,c): | |
if (a == b) and (b == c): | |
return "Equilatero" | |
elif (a != b) and (b != c): | |
return "Escaleno" | |
else: | |
return "Isoceles" |
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
#include <iostream> | |
using namespace std; | |
int main() { | |
double n1, n2, n3; | |
cout << "Enter three numbers, enter or space between numbers: "; | |
cin >> n1 >> n2 >> n3; | |
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 math | |
def function_square(a): | |
return a*a | |
def function_square_root(a): | |
return math.sqrt(a) | |
def function_sum(a,b): | |
return a+b |
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 unittest | |
import math | |
def function_square(a): | |
return a*a | |
def function_square_root(a): | |
return math.sqrt(a) | |
def function_sum(a,b): |
NewerOlder