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
''' | |
This module provides utilities for cryptographic operations, including HMAC-based message authentication and RSA | |
encryption/decryption. It includes functions for generating and verifying HMAC signatures, as well as RSA key | |
generation, encryption, and decryption. The module uses the `cryptography` library for RSA operations. | |
''' | |
import hmac | |
import hashlib | |
from cryptography.hazmat.primitives.asymmetric import rsa, padding | |
from cryptography.hazmat.primitives import serialization, hashes |
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
def sqrt_julia_regression(x, first_trial_root=1): | |
""" | |
Function that calculates the square root of an natural number using the Julia Regression Method. | |
Params: | |
x (int) - Natural input number | |
first_trial_root (int) - First root to try | |
Return (int): natural root found or None | |
""" | |
current_root = first_trial_root | |
current_square = first_trial_root**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
/* | |
============================================================================== | |
This file contains the basic framework code for a JUCE plugin processor. | |
============================================================================== | |
*/ | |
#include "PluginProcessor.h" | |
#include "PluginEditor.h" |
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
/* | |
Author: Filipe Chagas | |
filipe.ferraz0@gmail.com | |
*/ | |
#include "ccw_sort.h" | |
#include <math.h> | |
#define ABS(v) ((v >= 0) ? v : -v) | |
#define PI 3.14159265359 |
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
''' | |
By Filipe Chagas | |
''' | |
import os | |
from os.path import join as pjoin | |
from typing import * | |
def make_dir_tree(dir_tree: Union[dict, list], root: str = '', verbose: bool = False): | |
"""Creates a directory tree described in a dictionary. |
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
def buscar (cor, e_inicial): | |
fila = [e_inicial] | |
verificados = [] | |
while len(fila) > 0: | |
#Obter objeto da fila para verificacao | |
e_obtido = fila.pop() | |
verificados.append(e_obtido) | |
#Verificar objeto |
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
def buscar (e_inicial, cor): | |
fila = [e_inicial] | |
while len(fila) > 0: | |
#Obter um objeto da fila | |
e_obtido = fila.pop() | |
if e_obtido.cor == cor: | |
#Encontrado!! | |
return e_obtido |
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
class Elemento: | |
def __init__(self, cor): | |
self.cor = cor | |
self.adjacencias = [] | |
#Elementos do grafo | |
A = Elemento('Cinza') | |
B = Elemento('Roza') | |
C = Elemento('Vermelho') | |
D = Elemento('Verde') |
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
def buscar(nodo, nome): | |
if nodo <> None: | |
if nodo.nome == nome: | |
return nodo | |
else: | |
recebido = buscar(nodo.menor, nome) | |
if recebido <> None: | |
return recebido | |
else: | |
recebido = buscar(nodo.maior, nome) |
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
def percorrer_arvore(nodo): | |
if nodo <> None: | |
percorrer_arvore(nodo.menor) | |
nodo.imprimir() | |
percorrer_arvore(nodo.maior) |
NewerOlder