Environment Setup
For Mac
- Install brew - (https://brew.sh/)
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
import java.util.concurrent.Semaphore; | |
import java.util.concurrent.ThreadLocalRandom; | |
public class Main { | |
static Semaphore resource_1 = new Semaphore(1); | |
static Semaphore resource_2 = new Semaphore(1); | |
static Semaphore resource_3 = new Semaphore(1); | |
static class Proceso extends Thread { | |
char c = ' '; |
import numpy as np | |
from MathParser import PyMathParser | |
# Inicializamos el analizador de funciones | |
mathparser = PyMathParser() | |
mathparser.addDefaultFunctions() | |
mathparser.addDefaultVariables() | |
# Datos de entrada |
function validate_isRUT(rut) | |
{ | |
if (rut.length != 12){ | |
return false; | |
} | |
if (!/^([0-9])*$/.test(rut)){ | |
return false; | |
} | |
var dc = rut.substr(11, 1); | |
var rut = rut.substr(0, 11); |
import numpy as np | |
x = [1.00, 1.20, 1.40, 1.60, 1.80] | |
y = [0.242, 0.1942, 0.1497, 0.1109, 0.079] | |
f1 = [0, 0.1823216, 0.3364722, 0.4700036, 0.5877867] | |
f2 = [0.3678794, 0.3011942, 0.246597, 0.2018965, 0.1652989] | |
# Resolvemos juntos alguno producto escalares: | |
n = len(x) |
{ | |
"general_info": { | |
"name": "Barbacoa Carrasco", | |
"legal_name": "Arcadian Corporation LLC", | |
"address": "523 Avenue Street, New York", | |
"telephone": "(432) 421 693 812", | |
}, | |
"colors": { | |
"primary": { | |
"bg": "#F44336", |
const net = require ('net'); | |
const ip = "192.168.1.52"; | |
const port = 5000; | |
const client = new net.Socket(); | |
let currentUser = null; | |
const Gpio = require('onoff').Gpio; | |
const led_1 = new Gpio(17, 'out'); | |
const led_2 = new Gpio(27, 'out'); |
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
Flask run => ejecutar programada de python como servidor Flask | |
(app.py) | |
python init_database.py => ejecuta el programade cargar la base. | |
"Levantar el servidor" => Ejecutar el app.py. Escuchar solicitudes del nagador y devolver html. | |
Un servidor web => Programa que devuelve archivos .html |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
from escposprinter import * | |
from usb.core import find | |
def getAllPrinters(): | |
for i in find(find_all=True): | |
print(i) | |
def printInvoiceFooter(): |