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
def update_stock(movements, stock, reference, min_stock): | |
if not stock: | |
stock = 0 | |
if not min_stock: | |
min_stock = 0 | |
output_string = '' |
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 java.util.*; | |
import java.io.*; | |
class Ejercicio4 { | |
public static BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); | |
// public static String[][] peliculas = new String[5][2]; | |
public static final byte director = 2; | |
public static final byte genero = 1; | |
public static final byte titulo = 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
// Crea una clase Finanzas que convierta dólares a euros y viceversa. | |
// Codifica los métodos de instancia dolaresToEuros y eurosToDolares. | |
// Prueba que la clase Finanzas funciona correctamente haciendo conversiones | |
// entre euros y dólares. Como requisitos la clase Finanzas tiene que tener: | |
// * Un constructor sin parámetros Finanzas(), que establecerá el cambio | |
// Dólar - Euro en 1.36 | |
// * Un constructor Finanzas (double cambio), que permitirá configurar el | |
// cambio dólar - euro |
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
def factorial_mutante (base, jump = 1): | |
errors = { | |
'101': 'El valor debe ser positivo o cero.', | |
'102': 'El valor no puede ser superior a 10.', | |
'103': 'El valor debe ser entero.', | |
'201': 'El salto debe ser positivo.', | |
'202': 'El salto no puede ser superior a 5.', | |
'555': 'Error desconocido.', | |
} | |
# Lo ideal seria crear una clase per error, suposo |
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
// Haz un programa en Java que solicite al usuario 5 títulos de películas y su género (mini base de | |
// datos de una videoteca). Almacena estos datos en un array multidimensional. | |
// El programa debe permitir que el usuario pueda realizar una búsqueda por palabras del título y | |
// por género. Para ello: | |
// a. Solicita al usuario una palabra de búsqueda del título. Busca en el array las | |
// coincidencias y muéstralas por consola, indicando título/s completo de la/s película/s | |
// junto su género. | |
// b. Solicita al usuario un género. Busca en el array y muestra por consola los títulos de las | |
// películas que coincidan con el género facilitado | |
import java.util.Arrays; |
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
// Haz un programa en Java obtenga la fecha actual del sistema y | |
// a. Permita obtener por separado y lo muestre por consola: el día del mes, | |
// el día de la semana y la hora (formato 24h). Revisa la documentación | |
// de las clases java.util.Calendar, java.util.GregorianCalendar para | |
// llevar a cabo este apartado. Por ejemplo si la fecha actual del | |
// sistema es Fri Aug 30 16:05:13 CEST 2013, la salida por consola sería | |
// Día del mes: 30 | |
// Día de la semana: 6 | |
// Hora del día (24Hrs): 16 | |
// b. Permita añadir un mes a la fecha actual y muestre la fecha calculada |
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 java.io.*; | |
import java.util.Arrays; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
//author: lion | |
public class main { | |
private static String paths[] = {"coches.txt", "Ventas.txt", "vendedores.txt"}; // default files are these, assumed to be in the same directory |
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
$ sudo apt-get install samba | |
$ sudo vi /etc/samba/smb.conf | |
# look for workgroup = WORKGROUP and change WORKGROUP for the workgroup name you set up on Windows | |
# look for the line #security = user and uncomment it | |
# save and exit | |
$ sudo echo -e "[sharedfolder]\n\tpath = /path/to/share/folder\n\tbrowsable = yes\n\tguest ok = no\n\tread only = yes\n\tcreate mask = 0755" >> /etc/samba/smb.conf | |
$ sudo smbpasswd -a `whoami` | |
$ sudo restart smbd && sudo restart nmbd |
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
#!/bin/bash | |
## author : Ricard Sole Casas | |
## description : Script that captures input by nfc-list and does what you tell it to do | |
## twitter : @codinglion | |
## github : http://github.com/codinglion | |
## gist : http://gist.github.com/codinglion | |
while true; do | |
input=`nfc-list | grep UID | cut -d ":" -f 2 | sed 's/ //g'` |
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
#!/bin/bash | |
## author @grumpylionking | |
createuser() | |
{ | |
echo "desired user name: " | |
read user | |
echo "desired group name: " | |
read group |