Skip to content

Instantly share code, notes, and snippets.

View yerson001's full-sized avatar
🤖
Working from home

Yhon Yerson Sanchez Yucra yerson001

🤖
Working from home
View GitHub Profile
@yerson001
yerson001 / final_code_ia.py
Created June 1, 2022 06:17 — forked from anirudhshenoy/final_code.py
Code for the Blog at:
from torch import nn
from time import time
import torch
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from skimage.util.shape import view_as_windows
torch.manual_seed(42)
@yerson001
yerson001 / LL1-parser-first-follow-sets.js
Created October 8, 2021 03:19 — forked from DmitrySoshnikov/LL1-parser-first-follow-sets.js
LL(1) Parser. Parsing table, part 1: First and Follow sets.
/**
* LL(1) parser. Building parsing table, part 1: First and Follow sets.
*
* NOTICE: see full implementation in the Syntax tool, here:
* https://github.com/DmitrySoshnikov/syntax/blob/master/src/sets-generator.js
*
* by Dmitry Soshnikov <[email protected]>
* MIT Style License
*
* An LL(1)-parser is a top-down, fast predictive non-recursive parser,
@yerson001
yerson001 / EjerciciosHaskell.hs
Last active July 26, 2021 16:19 — forked from edigreat/EjerciciosHaskell.hs
Ejercicios Haskell
module TareaHaskell where
import Data.List
{- Ejercicio 1
Una funcion para sumar matrices. Las matrices
pueden estar representadas como una lista de listas
-}
--Funcion auxiliar para sumar por renglon
sumaRenglon::Num a=>[a]->[a]->[a]
sumaRenglon [] [] = []
@yerson001
yerson001 / binary-tree.hs
Created May 24, 2021 18:29 — forked from mmagm/binary-tree.hs
haskell binary tree
data BinaryTree a = EmptyTree | Node a (BinaryTree a) (BinaryTree a)
deriving (Show)
treeInsert :: Ord a => a -> BinaryTree a -> BinaryTree a
treeInsert el EmptyTree = Node el EmptyTree EmptyTree
treeInsert el (Node a left right)
| el == a = Node el left right
| el < a = Node a (treeInsert el left) right
| el > a = Node a left (treeInsert el right)