View database_base.py
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 hashlib | |
from sqlalchemy import create_engine, MetaData, text | |
from sqlalchemy.exc import DatabaseError | |
from sqlalchemy.orm import sessionmaker, declarative_base | |
class Database: | |
def __init__(self, **kwargs): | |
self.username = kwargs.get('username', 'root') |
View ProductosAdapter.java
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
@NonNull | |
@Override | |
public Filter getFilter() { | |
return new Filter() { | |
@Override | |
protected FilterResults performFiltering(CharSequence charSequence) { | |
String filterString = charSequence.toString().toUpperCase(); | |
FilterResults filterResults = new FilterResults(); | |
if (filterString == null || filterString.length() == 0) { |
View tips mejora logica.txt
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
Hay varios pasos que puedes seguir para mejorar tu lógica en la programación: | |
Practica regularmente. La práctica es clave para mejorar en cualquier habilidad, y la programación no es una excepción. Busca problemas y desafíos en línea y trata de resolverlos utilizando tus habilidades de programación. | |
Aprende y utiliza diferentes lenguajes de programación. Cada lenguaje tiene sus propias características y fortalezas, y aprender múltiples lenguajes te ayudará a desarrollar una comprensión más profunda de la lógica de la programación en general. | |
Lee y estudia el código de otros programadores. La mejor manera de aprender es imitando a los que ya son buenos en lo que hacen. Lee el código de otros programadores y trata de entender cómo se resuelven los problemas. | |
Participa en comunidades de programación en línea. Las comunidades de programación en línea son una excelente manera de aprender de otros programadores y compartir tus propios conocimientos y habilidades. |
View tips productividad.txt
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
Hay varios pasos que puedes seguir para mejorar tu productividad al desarrollar código para un proyecto: | |
Identifica tus objetivos y prioriza tus tareas. Esto te ayudará a enfocarte en lo que realmente importa y te permitirá avanzar de manera eficiente. | |
Usa herramientas para gestionar tu tiempo y tus tareas, como un calendario o una lista de tareas pendientes. Esto te ayudará a organizarte y a mantener el control sobre lo que tienes que hacer. | |
Establece un horario de trabajo y trata de cumplirlo de manera consistente. Dedica un tiempo específico a cada tarea y evita distracciones como el teléfono o las redes sociales. | |
Utiliza técnicas de programación eficientes y evita escribir código de manera repetitiva. Esto te ayudará a ahorrar tiempo y a mantener tu código limpio y fácil de mantener. |
View repair_mysql.cmd
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
# Una vez dentro, ejecuta el comando mysqlcheck. Este comando posee multitud de opciones, que puedes encontrar en la documentación oficial de MySQL. Para este tema la que necesitamos es: | |
mysqlcheck -uroot -p --all-databases --auto-repair |
View module.html
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
let mixin_parametros = { | |
data() { | |
return { | |
clave: null, | |
tipo: 0, | |
valor_texto: null, | |
valor_numerico: null, | |
valor_booleano: false, | |
descripcion: null | |
} |
View console_1.sql
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
with recursive | |
p as ( | |
select cast(:fecha_desde as date) fecha_desde , | |
cast(:fecha_hasta as date) fecha_hasta | |
), | |
fechas as ( | |
select cast(p.fecha_desde as date) fecha | |
from p | |
union | |
select date_add(f.fecha, interval 1 day) |
View utils.html
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
{% macro render_field(field) %} | |
{% if field.type != 'HiddenField' %} | |
<div class="field {% if field.errors %} error {% endif %}"> | |
{{ field.label }} | |
<div class="ui input"> | |
{{ field }} | |
</div> | |
{% if field.errors %} | |
<span>{{ field.errors[0] }}</span> | |
{% endif %} |
View schedule_task.py
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
# programming a scheduled task | |
import time | |
import schedule | |
def main(): | |
pass | |
if __name__ == '__main__': | |
task_timeout_min_minutes = 15 | |
task_timeout_max_minutes = 25 |
View json_encodings.py
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
class BetterJsonEncode(JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, date): | |
return obj.isoformat() | |
if isinstance(obj, datetime): | |
return obj.isoformat() | |
if isinstance(obj, decimal.Decimal): | |
return float(obj) | |
if hasattr(obj, '__getitem__') and hasattr(obj, 'keys'): | |
return dict(obj) |
NewerOlder