Instantly share code, notes, and snippets.

🐟
Working from home

# Mikael Souza mikaelsouza

🐟
Working from home
Created April 4, 2024 01:06
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 Solution: def __init__(self): self.visited = {} def startWalking(self, heights: List[List[int]], i: int, j: int): self.visited = {} up_left = self.walkThroughMatrix(heights, i, j, up_left=True) self.visited = {} down_right = self.walkThroughMatrix(heights, i, j, up_left=False) return up_left and down_right
Created January 4, 2023 02:23
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
 print("Hello World!")
Created January 4, 2023 02:22
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
 Testando
Created January 4, 2023 02:20
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
 mckdlmcdklsm
Created November 2, 2022 23:19 — forked from EduardoRFS/lc.ml
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
 type term = Var of string | Lam of string * term | App of term * term type value = Closure of ((string * value) list * string * term) let rec eval env term = match term with | Var var -> List.assoc var env | Lam (param, body) -> Closure (env, param, body) | App (lambda, argument) -> ( let lambda = eval env lambda in let argument = eval env argument in
Last active February 20, 2020 17:31
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 torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim MAX_SIZE = 3 device = torch.device('cpu') # generating vocab sentences = [
Last active January 13, 2020 20:43
Implementação de um HashMap simples em Python
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 HashMap(object): def __init__(self, bucket_size=10): self.bucket_size = bucket_size self.buckets = [None] * self.bucket_size def insert(self, key, value): hashed_key = hash(key) bucket_index = hashed_key % self.bucket_size self.buckets[bucket_index] = value
Created July 9, 2019 19:07
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 warnings import math from functools import reduce import collections from collections import defaultdict import numpy as np from keras.datasets import mnist from sklearn.tree import DecisionTreeClassifier from sklearn.preprocessing import KBinsDiscretizer from math import log2
Last active March 16, 2018 13:50
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 numpy as np import sklearn.datasets as datasets from keras import layers, models, utils def main(): # Loading dataset boston_dataset = datasets.load_boston() # Defining inputs and outputs of the neural network