Skip to content

Instantly share code, notes, and snippets.

View kiramishima's full-sized avatar
🕹️
https://www.twitch.tv/kiramishima

Paul Arizpe kiramishima

🕹️
https://www.twitch.tv/kiramishima
View GitHub Profile
@kiramishima
kiramishima / constraints.sql
Last active November 22, 2023 03:38
Constraints 2
CREATE SCHEMA `empresa_x`;
USE `empresa_x`;
CREATE TABLE IF NOT EXISTS `Empleados` (
Id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
Nombre VARCHAR(30) NOT NULL CHECK ( Nombre != "" ),
ApellidoPaterno VARCHAR(30) NOT NULL CHECK ( ApellidoPaterno != "" ),
ApellidoMaterno VARCHAR(30) DEFAULT "X",
Sexo CHAR(1) NOT NULL CHECK(sexo IN ("H", "M")),
Edad INT NOT NULL CHECK ( Edad >= 18 ),
@kiramishima
kiramishima / constraints.sql
Created November 16, 2023 05:55
SQL Constraints
CREATE SCHEMA `urc`;
USE `urc`;
CREATE TABLE IF NOT EXISTS `estudiantes` (
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
nombre VARCHAR(25) NOT NULL,
apellido_paterno VARCHAR(20) NOT NULL,
apellido_materno VARCHAR(20) DEFAULT "X",
curp CHAR(18) NOT NULL UNIQUE CHECK(CHAR_LENGTH(curp) = 18),
curso ENUM("Matemáticas 1", "Historia 1", "Español 1", "Inglés 1") NOT NULL
@kiramishima
kiramishima / Instalación de Hadoop en Windows.md
Created September 18, 2023 04:04
Archivos de configuración Hadoop

Instalando Hadoop en Windows 10/11

Para instalar hadoop necesitamos las siguientes herramientas:

  1. Java JDK
  2. 7zip o WinRAR para descomprimir Haddop
  3. Terminal de windows o Powershell
@kiramishima
kiramishima / vending_machine.scala
Created April 5, 2023 20:36
Codigo Vending Machine en Scala
abstract class Machine {
def buy(product: String, money: Double): String
def isProductAvailable(product: String): Boolean
def isMoneyEnough(product: String, money: Double): Boolean
def completeRequest(product: String, money: Double): String
}
class VendingMachine extends Machine {
var chocolateBar = 0
var granolaBar = 0
@kiramishima
kiramishima / reporte_dinamico.py
Created October 25, 2022 18:23
Ejemplo codigo Reporte con Ploty
from sqlalchemy import create_engine, inspect
import pandas as pd
import plotly.express as px
from dash import Dash, dcc, html, dash_table
# Creamos la conexion
sql_schema = "postgresql://gow:ragnarok@local/videocentro"
engine = create_engine(sql_schema)
inspector = inspect(engine)
@kiramishima
kiramishima / nuevo_ingreso.sql
Last active October 12, 2022 05:41
DB Nuevo Ingreso
-- MySQL Script generated by MySQL Dump
-- Tue Oct 11 23:01:35 2022
-- Model: New Model Version: 1.0
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
-- -----------------------------------------------------
-- Schema nuevo_ingreso
@kiramishima
kiramishima / agricultor_io.sql
Created October 11, 2022 00:13
Base de datos Agricultor
-- MariaDB dump 10.19 Distrib 10.9.2-MariaDB, for Win64 (AMD64)
--
-- Host: localhost Database: agricultor.io
-- ------------------------------------------------------
-- Server version 10.9.2-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
@kiramishima
kiramishima / movies.sql
Created September 13, 2022 05:46
Archivo SQL para la Base de PostgresSQL
This file has been truncated, but you can view the full file.
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.3
-- Dumped by pg_dump version 9.6.3
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
@kiramishima
kiramishima / dump.sql
Last active September 11, 2022 07:11
Archivo SQL de la base de datos y registros, usada para los de videos de Introduccion a SQL
This file has been truncated, but you can view the full file.
INSERT INTO films VALUES (1, 'Intolerance: Loves Struggle Throughout the Ages', 1916, 'USA', 123, NULL, 'Not Rated', NULL, 385907);
INSERT INTO films VALUES (2, 'Over the Hill to the Poorhouse', 1920, 'USA', 110, NULL, NULL, 3000000, 100000);
INSERT INTO films VALUES (3, 'The Big Parade', 1925, 'USA', 151, NULL, 'Not Rated', NULL, 245000);
INSERT INTO films VALUES (4, 'Metropolis', 1927, 'Germany', 145, 'German', 'Not Rated', 26435, 6000000);
INSERT INTO films VALUES (5, 'Pandoras Box', 1929, 'Germany', 110, 'German', 'Not Rated', 9950, NULL);
INSERT INTO films VALUES (6, 'The Broadway Melody', 1929, 'USA', 100, 'English', 'Passed', 2808000, 379000);
INSERT INTO films VALUES (7, 'Hells Angels', 1930, 'USA', 96, 'English', 'Passed', NULL, 3950000);
INSERT INTO films VALUES (8, 'A Farewell to Arms', 1932, 'USA', 79, 'English', 'Unrated', NULL, 800000);
INSERT INTO films VALUES (9, '42nd Street', 1933, 'USA', 89, 'English', 'Unrated', 2300000, 439000);
INSERT INTO films VALUES (10, 'She Done Him Wrong', 1933, 'U
@kiramishima
kiramishima / App.java
Last active November 17, 2021 16:28
Guess Number
/*
* Author: Paul Arizpe
*/
import java.util.Scanner;
public class App {
public static void main(String[] args) throws Exception {
int x = (int)(100 * Math.random());
boolean isFound = false;
int tries = 0;