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
const Equipo = require("./modelo_equipo"); |
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
// Definimos nuestro modelo | |
class Equipo extends Model { | |
} |
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
await TuModelo.update({ | |
campo: "nuevo_valor", | |
otro_campo: "otro_valor", | |
// ... | |
}, { | |
where: { | |
campo: "determinada_condición", | |
otro_campo: "otra_condición (sería como usar and)", | |
} | |
}); |
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
await modeloEquipo.update({ | |
trabajadoreId: peticion.body.idTrabajador, | |
}, { | |
where: { | |
id: idEquipo, | |
} | |
}); |
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
/* | |
____ _____ _ _ _ | |
| _ \ | __ \ (_) | | | | |
| |_) |_ _ | |__) |_ _ _ __ _____| |__ _ _| |_ ___ | |
| _ <| | | | | ___/ _` | '__|_ / | '_ \| | | | __/ _ \ | |
| |_) | |_| | | | | (_| | | / /| | |_) | |_| | || __/ | |
|____/ \__, | |_| \__,_|_| /___|_|_.__/ \__, |\__\___| | |
__/ | __/ | | |
|___/ |___/ | |
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
float calcularVoltaje(float corriente, float resistencia) | |
{ | |
return corriente * resistencia; | |
} | |
float calcularResistencia(float corriente, float voltaje) | |
{ | |
return voltaje / corriente; | |
} |
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
/* | |
____ _____ _ _ _ | |
| _ \ | __ \ (_) | | | | |
| |_) |_ _ | |__) |_ _ _ __ _____| |__ _ _| |_ ___ | |
| _ <| | | | | ___/ _` | '__|_ / | '_ \| | | | __/ _ \ | |
| |_) | |_| | | | | (_| | | / /| | |_) | |_| | || __/ | |
|____/ \__, | |_| \__,_|_| /___|_|_.__/ \__, |\__\___| | |
__/ | __/ | | |
|___/ |___/ | |
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
int esFlotanteValido(char *cadena) { | |
int longitud = strlen(cadena); | |
// Quitar espacios, saltos de línea, etcétera | |
while (longitud > 0 && isspace(cadena[longitud - 1])) | |
longitud--; | |
if (longitud <= 0) return 0; | |
int i; | |
int haEncontradoElPunto = 0; | |
for (i = 0; i < longitud; ++i) { | |
// En caso de que sea un guión, y que no esté al inicio, no es válido |
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
int esEnteroValido(char cadena[LONGITUD_CADENA]) { | |
int longitud = strlen(cadena); | |
// Quitar espacios, saltos de línea, etcétera | |
while (longitud > 0 && isspace(cadena[longitud - 1])) | |
longitud--; | |
if (longitud <= 0) return 0; | |
int i; | |
for (i = 0; i < longitud; ++i) { | |
// En caso de que sea un guión, y que no esté al inicio, no es válido | |
if (cadena[i] == '-' && i > 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
cellImage(cell) { | |
if (cell === this.PLAYER_1) { | |
return "img/player1.png"; | |
} else if (cell === this.PLAYER_2) { | |
return "img/player2.png"; | |
} else { | |
return "img/empty.png" | |
} | |
}, |