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
/* | |
* for an intro to the Mandelbrot set: | |
* - https://simple.wikipedia.org/wiki/Mandelbrot_set | |
* | |
* for ppm format, see: | |
* - http://netpbm.sourceforge.net/doc/ppm.html | |
* | |
* install ImageMagick: | |
* debian/ubuntu: apt-get install imagemagick | |
* macos: brew install imagemagick |
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 <pthread.h> | |
#include <time.h> | |
// Data la definizione di prodotto scalare | |
// tra vettori enunciata qui sopra, | |
// scrivere un programma single-threaded | |
// che calcoli il prodotto scalare tra | |
// due vettori di double di grande |
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
/* | |
* raylib-lines.c | |
* | |
* To compile: | |
* clang -Wall $(pkg-config --cflags raylib) -o raylib-lines raylib-lines.c $(pkg-config --libs raylib) | |
* | |
* Copyright (C) 2022 Marco Pantaleoni. | |
*/ | |
#include <time.h> |
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> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <sys/wait.h> | |
const char *handle_child_process_output(const char *buffer, ssize_t count) { | |
// we just print it, but we could do any other processing here... | |
write(STDOUT_FILENO, buffer, (size_t)count); |
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> | |
#include <fcntl.h> | |
int main(void) { | |
/* set up pipe. */ | |
int pfd[2]; | |
if (pipe(pfd) < 0) { | |
perror("pipe()"); |
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 <stdint.h> | |
// NOTA: queste funzioni operano correttamente solo sulle piattaforme | |
// in cui float occupa esattamente 32 bit! | |
// (Solitamente vero in C99 e garantito in C99 su x86 e amd64) | |
// float_to_repr32() ritorna l'intero a 32 bit | |
// che "codifica" il float passato come argomento | |
// secondo IEEE754. |
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 <stdint.h> | |
#define STACK_SIZE 1000 | |
struct stack { | |
int elements[STACK_SIZE]; | |
int sp; | |
}; |
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 <stdint.h> | |
#define STACK_SIZE 1000 | |
// ATTENZIONE! | |
// qui utilizziamo delle variabili globali a titolo di esempio | |
// ma dovremmo invece utilizzare una struttura e passare | |
// il puntatore alla struttura a tutte le funzioni che operano |
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
package logging | |
import ( | |
"go.uber.org/zap/zapcore" | |
"go.uber.org/zap" | |
//"github.com/natefinch/lumberjack" | |
"gopkg.in/natefinch/lumberjack.v2" | |
"os" | |
"path" | |
"strings" |
NewerOlder