Skip to content

Instantly share code, notes, and snippets.

@Scoppio
Scoppio / main.java
Created September 9, 2020 19:21
Unbranched Max, thread-unsafe
package com.abstractobserver
import com.google.common.base.Stopwatch;
import sun.misc.Unsafe;
import java.lang.reflect.Field;
import java.util.Random;
import java.util.concurrent.TimeUnit;
/**
@Scoppio
Scoppio / co.c
Created February 27, 2019 17:05 — forked from lpereira/co.c
#include <stdio.h>
#include <stdbool.h>
struct coro {
void *state;
};
struct range_coro {
struct coro base;
int cur, max, step;
@Scoppio
Scoppio / ecs.md
Created February 17, 2019 03:39 — forked from paniq/ecs.md
Entity Component Systems
@Scoppio
Scoppio / min-char-rnn.py
Created January 27, 2017 23:43 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@Scoppio
Scoppio / watermarking.py
Last active September 22, 2024 16:32
Watermark pictures inside a folder
# Coding: utf-8
# Python 3.5
# OpenCV 3.1.0
#
# Developed by Luana Coppio
#
__author__ = "Luana Scoppio"
__version__ = "1.0"
__date__ = "26 july 2016"
@Scoppio
Scoppio / consolerpg.py
Created October 18, 2016 04:57
A very simple console RPG mockup
from random import randint
class Character:
def __init__(self):
self.name = ""
self.health = 1
self.health_max = 1
def do_damage(self, enemy):
damage = min(max(randint(0, self.health) - randint(0, enemy.health), 0), enemy.health)
@Scoppio
Scoppio / jinx.py
Created May 4, 2016 02:45
A simple gradient descent devised to capture the match ID of a game in a specific day, month and year.
def save_Log( e):
with open("logFile.log", "a") as logFile:
timestamp = time.strftime("%d/%m/%y %H:%M:%S", time.localtime())
logFile.write( timestamp + " " +str(e) + "\n")
def findFirstMatch(region: str='br',
api_key: str='api_key.json',
verbosity: bool=False,
year: int=2016,
month: int=1,