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
// raytracer for shadertoy https://www.shadertoy.com/view/wtsBz7 | |
// reference: | |
// https://www.scratchapixel.com/lessons/3d-basic-rendering/minimal-ray-tracer-rendering-simple-shapes/ray-sphere-intersection | |
#define MOVING | |
const float MAXFLOAT = 3.402823e+38; | |
const float EPSILON = 0.001; | |
const int MAX_BOUNCE = 4; |
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
""" | |
Requires | |
pillow | |
numpy | |
""" | |
from PIL import Image | |
from itertools import product | |
from math import sin, cos, sqrt, inf | |
from numpy import dot, subtract, multiply, add |
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
""" | |
Requires xlsxwriter and pillow | |
""" | |
import sys | |
from PIL import Image, ImageOps | |
import xlsxwriter | |
from itertools import product | |
HEIGHT = 100 |
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
#!/usr/bin/env python3 | |
import requests | |
import argparse | |
import pickle | |
import os | |
url = 'https://services.arcgis.com/CCZiGSEQbAxxFVh3/arcgis/rest/services/COVID19Portugal_view/FeatureServer/0/query' | |
import os, time, stat |
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
import requests | |
import re | |
import json | |
import logging | |
BEARER_RX = re.compile(r"Bearer \w{8}\-\w{4}\-\w{4}\-\w{4}\-\w{12}") | |
STATIONS_RX = re.compile( | |
r"{ id: \"(\w\w)\", nome: \"([^\"]*)\", coord: \"(-?\d*\.\d*),(-?\d*\.\d*)\" }") | |
DESTINATIONS_RX = re.compile( | |
r"case \"(\d*)\":.*\n.*return \[\"([^\"]*)\",\s*\"([^\"]*)\",\s*\"(\w\w)\"\];") |
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
SELECT Aluno.numero, Aluno.nome, SUM(Classificacao.nota >= 10.0) FROM Aluno | |
JOIN Classificacao ON Classificacao.id_aluno=Aluno.id | |
JOIN UC ON UC.id=Classificacao.id_uc and UC.id_area=1 | |
GROUP BY Aluno.id |
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
SELECT Aluno.numero, Aluno.nome, Classificacao.nota FROM Aluno | |
JOIN Classificacao ON Classificacao.id_aluno=Aluno.id | |
JOIN UC ON UC.id=Classificacao.id_uc and UC.id_area=1 |
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
-- phpMyAdmin SQL Dump | |
-- version 4.4.10 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: localhost | |
-- Generation Time: Dec 09, 2017 at 08:14 PM | |
-- Server version: 10.0.30-MariaDB-0+deb8u2 | |
-- PHP Version: 5.6.30-0+deb8u1 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
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
""" | |
gausskernel.py | |
Vasco Flores | |
unidim: | |
0.00081721 0.02804124 0.23392411 0.47442500 0.23392411 0.02804124 0.00081721 | |
sum: | |
0.9999901346984609 | |
bidim: |
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
""" vxf | |
Funcoes uteis para estudar Probabilidades e Estatistica | |
Exemplos de uso: | |
S(0, 5, lambda i: Bin(n=7, p=(4/6), x=i)) | |
""" | |
from math import factorial | |
from functools import reduce |
NewerOlder