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
VertexCircle[{xc_, yc_}, name_, {w_, h_}] := Disk[{xc, yc}, .1]; | |
z1Graph = | |
Graph[{-1 -> 1, Labeled[2 -> 0, "1-\[Delta]"], | |
Labeled[2 -> 1, "1/2"], Labeled[2 -> 2, "\[Delta]"], | |
Labeled[1 -> 0, "1-\[Delta]"], Labeled[1 -> 1, "1/2"], | |
Labeled[1 -> 2, "\[Delta]"], Labeled[0 -> 0, "1-\[Delta]"], | |
Labeled[0 -> 1, "1/2"], Labeled[0 -> 2, "\[Delta]"]}, | |
EdgeShapeFunction -> | |
GraphElementData["EdgeShapeFunction", "FilledArrow"], | |
VertexStyle -> LightGray, |
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
(define (n->an n) | |
(string->symbol | |
(string-append "a" (number->string n)))) | |
; (for/list [(n (in-range 1 101))] | |
(n->an n)) | |
(define B (for/list ([n (in-range 1 10)]) | |
(list 'define (list (n->an n) 'x) (list '* n 'x)))) |
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
(define (nand x . y) (not (and x y))) | |
(define (nor x . y) (not (or x y))) | |
(define training-data | |
(list | |
(list #f #f #f #t) | |
(list #f #f #t #f) | |
(list #f #t #f #f) | |
(list #f #t #t #t) |
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
#include <stdio.h> | |
#include <stdlib.h> | |
int length(char *str) | |
{ | |
int i; | |
i = 0; | |
while (str[i]) | |
++i; | |
return (i); |
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
#include <unistd.h> | |
void ft_putchar(c) | |
{ | |
write(1, &c, 1); | |
} | |
void print_array(char *arr) | |
{ | |
int x; | |
int y; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
void ft_putchar(char c) | |
{ | |
write(1, &c, 1); | |
} | |
int length(char *str) |
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
#include "ft_list.h" | |
t_list *ft_list_last(t_list *begin_list) | |
{ | |
if (begin_list == 0) | |
return begin_list; | |
while (begin_list->next) | |
begin_list = begin_list->next; | |
return (begin_list); | |
} |
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
#include "ft_list.h" | |
void ft_list_clear(t_list **begin_list) | |
{ | |
t_list *tmp; | |
if (&*begin_list == 0) | |
return ; | |
while (*begin_list->next) | |
{ |
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
#include <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
char *ft_strnstr(const char *haystack, const char *needle, size_t len) | |
{ | |
size_t i; | |
size_t j; | |
if (needle[0] == '\0') |
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
int ft_strcmp(const char *s1, const char *s2) | |
{ | |
int i; | |
i = 0; | |
while (s1[i] || s2[i]) | |
{ | |
if (s1[i] != s2[i]) | |
return ((unsigned char)s1[i] - (unsigned char)s2[i]); | |
++i; |