Skip to content

Instantly share code, notes, and snippets.

Avatar

Guilherme Dantas guidanoli

View GitHub Profile
@guidanoli
guidanoli / bernoulli.c
Created Aug 28, 2019
Bernoulli distribution simulation
View bernoulli.c
/*
* bernoulli.c
*
* Bernoulli distribution simulation
*/
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
@guidanoli
guidanoli / pi.c
Created Aug 28, 2019
Approximation of Pi by probability
View pi.c
/*
* pi.c
*
* Approximation of Pi by the probability
* of a point to fall into the circle of
* a circumscribed square in the xy-plane.
*
* Inspired by Simulation Fifth Edition
* Book by Sheldon Ross
*/
@guidanoli
guidanoli / pow.c
Created Aug 22, 2019
Optimised power function for integer values
View pow.c
/*
* pow.c
*
* Optimised power function for integer values
*/
#include <assert.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@guidanoli
guidanoli / perm.c
Created Aug 21, 2019
Array permutation
View perm.c
/*
* perm.c
*
* Array permutation
*/
#include <assert.h>
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
@guidanoli
guidanoli / puc-prereq.py
Last active Jul 23, 2019
PUC Prerequisites graph
View puc-prereq.py
import urllib.request
import xlrd
import tkinter as tk
from tkinter import filedialog
# ############################################
# PUC Dependency Graph Viewer
# ############################################
# Guilherme Dantas, 7/23/2019
# ############################################
@guidanoli
guidanoli / eq2g
Created Oct 10, 2014
Equação do 2º grau
View eq2g
import javax.swing.*;
import java.math.*;
public class HelloWorld{
public static void main(String args[]){
double delta,a,b,c,x1,x2;
String vat; //vat=Valor ATual
JOptionPane.showMessageDialog(null,"Bem-vindo ao calculador de equação do 2º grau!");
vat = JOptionPane.showInputDialog("Insira o coeficiente a");
You can’t perform that action at this time.