Skip to content

Instantly share code, notes, and snippets.

View ayaderaghul's full-sized avatar
🐉
Married to Anthony Gorman

Aya de Raghũl ayaderaghul

🐉
Married to Anthony Gorman
View GitHub Profile
@ayaderaghul
ayaderaghul / matha-auto.nb
Created June 27, 2015 12:15
draw accomodator in mathematica
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,
@ayaderaghul
ayaderaghul / pieces.rkt
Created November 30, 2015 22:01
mass production of definitions
(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))))
@ayaderaghul
ayaderaghul / trial.rkt
Created November 30, 2015 22:02
try GP in racket, #fail
(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)
@ayaderaghul
ayaderaghul / convert-input.c
Last active February 17, 2018 16:00
sudoku: to get input and convert into array of numbers..
#include <stdio.h>
#include <stdlib.h>
int length(char *str)
{
int i;
i = 0;
while (str[i])
++i;
return (i);
@ayaderaghul
ayaderaghul / test.c
Last active February 17, 2018 17:42
print char array
#include <unistd.h>
void ft_putchar(c)
{
write(1, &c, 1);
}
void print_array(char *arr)
{
int x;
int y;
@ayaderaghul
ayaderaghul / convert-input.c
Created February 17, 2018 18:54
sudoku: take input and print the matrix
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}
int length(char *str)
#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);
}
#include "ft_list.h"
void ft_list_clear(t_list **begin_list)
{
t_list *tmp;
if (&*begin_list == 0)
return ;
while (*begin_list->next)
{
#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')
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;