Skip to content

Instantly share code, notes, and snippets.

View AlejandroVelasco's full-sized avatar
🎯
Focusing

Alejandro Velasco AlejandroVelasco

🎯
Focusing
  • IBW
  • El Salvador
  • 01:38 (UTC -06:00)
View GitHub Profile
int main() {
// Definir los números
int n1 = 10, n2 = 4, n3 = 6;
// Calcular la media aritmética
int media = (n1 + n2 + n3) / 3;
// Código para el microcontrolador, para demostrar el resultado.
DDRB |= (1 << PB5); // Establecer PB5 como salida
while (1) {
if (media >= 0 && media <= 255) {
main:
; Definir los números
ldi r16, 2 ; n1
ldi r17, 4 ; n2
ldi r18, 6 ; n3
; Calcular la media aritmética
add r16, r17 ; r16 = n1 + n2
add r16, r18 ; r16 = n1 + n2 + n3
ldi r19, 3 ; divisor
#include <iostream>
int main() {
int n1 = 2;
int n2 = 4;
int n3 = 0;
if (n1 == n2) {
n3 = 1;
} else {
n3 = 0;
; numeros_iguales.asm
;
; Created: 19/4/2024 07:53:30
; Author : Alejandro Velasco
;
; Replace with your application code
start:
.include "m328Pdef.inc"
@AlejandroVelasco
AlejandroVelasco / get_file_txt_frappe.py
Last active February 19, 2024 22:26
get_file_txt_frappe
def read_txt_file_from_attached_file(file_url=None, fcontent=None, filepath=None):
if file_url:
_file = frappe.get_doc("File", {"file_url": file_url})
filename = _file.get_full_path()
txtrs = open(filename)
#si es txt
#rs = txtrs.readlines()
#si es json
rs = json.loads(txtrs)
return rs
import pandas as pd
ruta_archivo = r"Punto_nuevo_CRM.xlsx"
nombre_hoja = "Result 1"
def extraer_data(nombre_hoja):
df = pd.read_excel(ruta_archivo, sheet_name=nombre_hoja)
return df