Skip to content

Instantly share code, notes, and snippets.

@douglasrizzo
douglasrizzo / jobs_puzzle.lp
Last active June 6, 2019 00:15
Jobs Puzzle in Answer Set Programming
% https://www.mcs.anl.gov/~wos/mathproblems/jobs.html
%%% people and genders
man(pete;steve).
woman(thelma;roberta).
person(P) :- man(P).
person(P) :- woman(P).
-man(P) :- woman(P).
-woman(P) :- man(P).
@douglasrizzo
douglasrizzo / bubblesort.py
Created July 30, 2019 20:31
Bubble sort in Python
# This is a simple implementation of bubblesort
# which I made during a Python lesson
from random import shuffle
# size of the list that will ne sorted
n = int(input('Size of the input vector: '))
l = list(range(n))
# shuffle list
@douglasrizzo
douglasrizzo / stitch.py
Last active September 18, 2019 18:01
Stitch multiple images into one using OpenCV
##############################################################################
# Copyright 2019 Douglas De Rizzo Meneghetti
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@douglasrizzo
douglasrizzo / grafo_computacional.ipynb
Last active November 27, 2019 23:29
grafo_computacional.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@douglasrizzo
douglasrizzo / ponteiros.c
Created May 21, 2020 01:11
Ponteiros em C
#include <stdio.h>
int main(void) {
int a = 7;
int* aPtr;
aPtr = &a; // aPtr guarda o endereço de a
printf(
"O endereço de a é %p"
"\nO valor de aPtr é %p",
@douglasrizzo
douglasrizzo / c_struct.c
Last active May 25, 2020 22:03
Structs and classes in C++
#include <stdio.h>
struct Vec2 {
float x, y;
};
int main() {
struct Vec2 v;
v.x = 1;
@douglasrizzo
douglasrizzo / saulo.ipynb
Created June 5, 2020 03:38
Ensinando Python pro Saulo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@douglasrizzo
douglasrizzo / wandb_pyg.ipynb
Created July 2, 2020 07:05
wandb_pyg.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@douglasrizzo
douglasrizzo / wandb_dict_forked_net.ipynb
Created July 2, 2020 07:05
wandb_dict_forked_net.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.