This file contains hidden or 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 os | |
import sys | |
import re | |
import tempfile | |
from ffmpeg import FFmpeg, Progress # use `python-ffmpeg` | |
from datetime import datetime, timedelta | |
from collections import OrderedDict | |
sys.path.append('../../') | |
from src.TwitchFfmpeg import TwitchFfmpeg, TwitchConfig |
This file contains hidden or 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
from PIL import Image | |
from os import path as p | |
import os | |
import argparse | |
def process_image(im): | |
size = im.size | |
menor = min(size) | |
return im.crop((0,0,menor,menor)) \ | |
.resize((256,256)) \ |
This file contains hidden or 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
from collections import namedtuple | |
Point = namedtuple('Point', ['x', 'y']) | |
def lagrange_interp(points): | |
def interp(x): | |
y = 0 | |
for pj in points: | |
l = 1 | |
xj = pj.x |
This file contains hidden or 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
def create_board(): | |
board = {} | |
for i in ["a","b","c"]: | |
for j in ["1","2","3"]: | |
board[i+j] = " " | |
return board | |
def ganador(board): | |
if board["a1"] == board["b1"] == board["c1"] and board["a1"] != " ": |
This file contains hidden or 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
alumno ~$ sudo apt install mysql-server mysql-client | |
[sudo] contraseña para alumno: | |
Leyendo lista de paquetes... Hecho | |
Creando árbol de dependencias | |
Leyendo la información de estado... Hecho | |
mysql-client ya está en su versión más reciente (8.0.32-0ubuntu0.20.04.2). | |
mysql-server ya está en su versión más reciente (8.0.32-0ubuntu0.20.04.2). | |
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 16 no actualizados. | |
alumno ~$ sudo mysql | |
Welcome to the MySQL monitor. Commands end with ; or \g. |
This file contains hidden or 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
$ sqlite3 DATOS.db | |
SQLite version 3.31.1 2020-01-27 19:55:54 | |
Enter ".help" for usage hints. | |
sqlite> .read tareas.sql | |
sqlite> .dump | |
PRAGMA foreign_keys=OFF; | |
BEGIN TRANSACTION; | |
CREATE TABLE personas( | |
id INTEGER PRIMARY KEY, | |
name TEXT |
This file contains hidden or 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
// TRANSITION DAG | |
////////////////////////////////////////////////////////////////////////////// | |
let areYou = { | |
value: " are you!", | |
transitions: [] | |
}; | |
let questionMark = { | |
value: "?", |
This file contains hidden or 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
function MyMap(){ | |
this.map = new Map(); | |
} | |
MyMap.prototype.set= function(k,v){ | |
this.map.set(JSON.stringify(k), v); | |
} | |
MyMap.prototype.get= function(k){ | |
return this.map.get(JSON.stringify(k)); | |
} |
This file contains hidden or 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
let grid = [ | |
[0, 0, 0], | |
[1, 1, 1], | |
[0, 0, 0] | |
]; | |
function vecinasPosibles(x,y,grid){ | |
return [ | |
[x-1,y-1],[x+0,y-1],[x+1,y-1], | |
[x-1,y+0], [x+1,y+0], |
This file contains hidden or 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
; Example code for Bisection method | |
; https://en.wikipedia.org/wiki/Bisection_method | |
(defn f | |
"Example function to apply algorithm on" | |
[x] | |
(+ 3 x)) | |
(defn distance | |
[a b] |
NewerOlder