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
| perm :: [Int] -> [ [Int]] | |
| perm [] = return [] | |
| perm (x:xs) = do ys <- perm xs | |
| zs <- insert x ys | |
| return zs | |
| insert :: a -> [a] -> [[a]] | |
| insert x xs = (return (x:xs)) | |
| `mplus` case xs of | |
| [] -> mzero |
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
| #+LaTeX_CLASS: beamer | |
| #+MACRO: BEAMERMODE presentation | |
| #+MACRO: BEAMERTHEME Antibes | |
| #+MACRO: BEAMERCOLORTHEME lily | |
| #+MACRO: BEAMERSUBJECT RMRF | |
| #+TITLE: Gobernabilidad de T.I | |
| #+AUTHOR: {Adolfo Builes \\ Santiago Bustamante} | |
| * Sobre la gobernabilidad de T.I |
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
| pLettera :: Parser Char Char | |
| pLettera = P (\inp -> case inp of | |
| ( s:ss ) | |
| | s == 'a' -> [('a',ss)] | |
| | otherwise -> [] | |
| otherwise -> [] | |
| ) |
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
| pLettera :: Parser Char Char | |
| pLettera = P (\inp -> case inp of | |
| ( s:ss ) | s == 'a' -> [('a',ss)] | |
| otherwise -> [] | |
| ) |
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
| Agregar iluminación local a la escena (Fórmula de Gouraud) | |
| Agregando las siguientes palabras claves al compilador: | |
| - global_settings {ambient_light color White} (luz ambiental de toda la escena) | |
| - finish {ambient 0.1} (Ka del objeto) | |
| - finish {diffuse 0.7} (Kd del 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 finishP = "finish" ~> "{" ~> ("ambient"|"difuse"|"phong"|"phong_size") ~ valueP <~ "}" ^^ | |
| { | |
| case "ambient" ~ color => ("ambient" ,color) | |
| case "difuse" ~ color => ("difuse" ,color) | |
| case "phong" ~ color => ("phong" ,color) | |
| case "phong_color" ~ color => ("phong_color" ,color) | |
| case "size" ~ color => ("size" ,color) | |
| } |
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
| newtype ZipList a = ZipList { getZipList :: [a] } | |
| instance Functor ZipList where | |
| fmap g (ZipList a) = ZipList $ fmap g a | |
| instance Applicative ZipList where | |
| pure a = ZipList [a] | |
| (ZipList fs) <*> (ZipList xs) = ZipList $ zipWith ($) fs xs |
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
| Con este ejemplo | |
| stereotype Property extens uml::Property | |
| El identifier que es Property, lo reconoce como el token STEREOTYPE y no como IDENTIFIER :(. | |
| Hay una opcion para evitar eso ? | |
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
| grammar Textuml; | |
| options{output=AST;} | |
| tokens{ | |
| ATTRIBUTE; | |
| CLASS; | |
| CLASS_DEF; | |
| FEATURE; | |
| IN; |
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 specularIllumination(h: Hit, l: LightSource): Color3f = { | |
| val direction = getLightDirection (h.location , l ) | |
| val reflected = reflectedVector (direction , h.normal ) | |
| val vrn = pow (reflected.dot(direction).toFloat , h.material.kn).toFloat; | |
| // val temp = (new Color3f(1,1,1)).scale (h.material.ks) | |
| val specular = vrn * h.material.ks | |
| val color = ***(l.color, h.material.pigment) | |
| color.scale (specular) | |
| return color |