Skip to content

Instantly share code, notes, and snippets.

View giuliano0's full-sized avatar
:shipit:

Giuliano Roberto Pinheiro giuliano0

:shipit:
View GitHub Profile
@giuliano0
giuliano0 / mult_persistence.py
Created March 28, 2019 17:49
My take on Multiplicative Persistence, inspired by this Numberphile video: https://www.youtube.com/watch?v=Wim9WJeDTHQ
from functools import reduce
def per(n):
k = 0 # k is the persistence
def per_rec(n, k):
digits = [int(c) for c in str(n)]
if len(digits) == 1:
print('persistence ' + str(k))
@giuliano0
giuliano0 / Witcher 3 decoction numbers
Last active January 7, 2018 15:28
WItcher 3 decoctions do not have numbers on them. Nothing does. But someone looked into the game files and posted it in the CD Projekt Red forums. And here they are, extra spacing for ease of reading.
Katakan Decoction - Increases Critical Hit Chance by 5%.
Arachas Decoction - 20% damage reduction bonus while at zero weight, 0% bonus while at full weight.
Cockatrice Decoction - All alchemy creations can be used one additional time (except Decoctions)
Archgriffin Decoction - Consumes 100% Stamina for 5% Enemy HP Reduction using a Strong Attack.
Also counts the damage the Strong Attack makes in the total (the damage total on screen does not
show the 5%, but only the strong attack damage).
Deathknight: https://discord.gg/0ez1cFfUH3ingV96
Demonhunter: https://discord.gg/zGGkNGC
Druid: https://discord.gg/0dWu0WkuetF87H9H
Hunter: https://discord.gg/0isczJ3lChodOl7j
Mage: https://discord.gg/0gLMHikX2aZ23VdA
Monk: https://discord.gg/0dkfBMAxzTkpxgNC
Paladin: https://discord.gg/jRd6Rn4
Priest: https://discord.gg/0f1Ta8lT8xZbLkBV
Rogue: https://discord.gg/0h08tydxoNi7DSNe
Shaman: https://discord.gg/0VcupJEQX0HuE5HH
@giuliano0
giuliano0 / index_vs_iterator_test.cpp
Last active May 29, 2016 02:31
Testing indexed loops versus iterators (compile and run with -std=c++11 -O[1-3])
#include <vector>
#include <iostream>
#include <chrono>
using namespace std;
int main() {
const size_t BIG = 200000000;
vector <int> v;
for (size_t i = 0; i < BIG; i++) {