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 | |
""" |
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
infinite_loop_list = [1,2,3,4,5] | |
for i in range(len(infinite_loop_list)): | |
print( | |
( | |
infinite_loop_list[i % len(infinite_loop_list)] , | |
infinite_loop_list[(i+1) % len(infinite_loop_list)], | |
infinite_loop_list[(i+2) % len(infinite_loop_list)] | |
) | |
) |
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
let schema = { | |
type: Number, | |
min: 1900, | |
max: () => new Date().getFullYear(), | |
message: () => { | |
if(typeof this.max === 'function'){ | |
return `El valor debe estar entre ${this.min} y ${this.max()}` | |
} | |
return `El valor debe estar entre ${this.min} y ${this.max}` | |
} |
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 | |
import pandas as pd | |
N = 10000 | |
df = pd.DataFrame( | |
np.random.randint(999, 999999, size=(N, 7)), columns=list("ABCDEFG") | |
) | |
df["H"] = np.random.rand(N) | |
df["I"] = pd.util.testing.rands_array(10, N) |
NewerOlder