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
| /* | |
| * Approach: Schemeless Data Storage in PostgreSQL | |
| * | |
| * This implementation utilizes the JSONB data type to achieve a schemeless (document-oriented) | |
| * architecture within a relational database. | |
| * | |
| * Advantages: | |
| * - Schema Flexibility: Allows storing diverse data structures without migrations. | |
| * - Development Speed: Faster iteration during early-stage development. | |
| * - Dynamic Attributes: Easily handle entities with unpredictable or sparse fields. |
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
| /* | |
| * Audit logging implementing blockchain-inspired principles. ( Postgres 18 ). | |
| * | |
| * This system ensures data integrity and traceability by chaining transaction logs | |
| * through cryptographic hashing. | |
| * | |
| * Advantages: | |
| * - High Integrity: Each log entry is linked to the previous one, making tampering detectable. | |
| * - Traceability: Complete history of changes (snapshots/deltas) for auditing and recovery. | |
| * - Non-repudiation: Provides a verifiable record of operations performed on the database. |
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 hashlib | |
| import hmac | |
| import time | |
| # Configuración | |
| N_BLOQUES = 10000000 | |
| MENSAJE_BASE = "Data_Block_" | |
| # --- 1. GENERACIÓN DE LAS CADENAS --- |
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 confluent_kafka import TopicPartition, Consumer, Producer | |
| from confluent_kafka.admin import AdminClient | |
| from confluent_kafka.cimpl import NewTopic | |
| message = {"topic": "my-topic", "payload": "mensajito"} | |
| config = { | |
| "producer_config": { | |
| "bootstrap.servers": "broker:port,broker:port", | |
| "security.protocol": "SSL", | |
| }, |
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
| # Para las keystore que piden Android | |
| keytool -genkey -v -keystore task.keystore -keyalg RSA -keysize 2048 -validity 10000 -alias tasks -storepass android -keypass android | |
| keytool -genkey -v -keystore task.jks -keyalg RSA -keysize 2048 -validity 10000 -alias tasks | |
| # Para virtualizar Android | |
| avdmanager create avd -n MyAVD -k "system-images;android-30;google_apis;x86_64" -d pixel | |
| # Instalar apks en el emulador | |
| adb install H:/Game/proyectos/lista_de_tareas/tasks.apk |
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
| extends Control | |
| # Referencias a los nodos ItemList y Button | |
| @onready var item_list = $ItemList | |
| @onready var add_button = $Button | |
| var db : SQLite # usando el addon godot-sqlite | |
| # Called when the node enters the scene tree for the first time. | |
| func _ready(): |
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 math | |
| import numpy as np | |
| def calculate_neigbor_vector(a, distance, degrees, height=0): | |
| a = np.array(a) | |
| radians = math.radians(degrees) | |
| x2 = a[0] + distance * math.cos(radians) | |
| y2 = a[1] + distance * math.sin(radians) | |
| z2 = a[2] + distance * math.sin(radians) * height | |
| return np.array((x2, y2, z2)) |
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 bpy | |
| import bmesh | |
| import numpy as np | |
| def create_mesh(): | |
| # Elimina todos los objetos en la escena | |
| bpy.ops.object.select_all(action='DESELECT') | |
| bpy.ops.object.select_by_type(type='MESH') | |
| bpy.ops.object.delete() | |
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 numpy as np | |
| a = np.array((0,0,0)) | |
| b = np.array((1,0,0)) | |
| M = ((a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2) |
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 numpy | |
| def calculate_triangle_vectors(a, b, distance, height=0): | |
| """ | |
| Calcula un punto con los parámetros dados para formar un triángulo. | |
| :param a: list. Ie (0,0,0) | |
| :param b: list. Ie (0,0,0) | |
| :param distance: float Ie, 1.0 | |
| :param height: int. Ie, 1 or -1 | |
| """ |
NewerOlder