Skip to content

Instantly share code, notes, and snippets.

import arcade
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
MOVEMENT_SPEED = 3
class Ball:
def __init__(self, position_x, position_y, change_x, change_y, radius, color):
import arcade
SCREEN_WIDTH = 640
SCREEN_HEIGHT = 480
class Ball:
def __init__(self, position_x, position_y, radius, color):
# Take the parameters of the init function above,
@dfbarrero
dfbarrero / keras.md
Last active March 5, 2023 12:50
Keras + Tensorflow + GTX 3070 TI

Driver version 515.

conda create --name tf
conda activate tf
conda install -c conda-forge tensorflow=2.10 tensorflow-gpu pandas seaborn matplotlib scikit-learn jupyter
conda install -c conda-forge opencv

Interesting thread: tensorflow/tensorflow#58681

We can't make this file beautiful and searchable because it's too large.
label,pixel0,pixel1,pixel2,pixel3,pixel4,pixel5,pixel6,pixel7,pixel8,pixel9,pixel10,pixel11,pixel12,pixel13,pixel14,pixel15,pixel16,pixel17,pixel18,pixel19,pixel20,pixel21,pixel22,pixel23,pixel24,pixel25,pixel26,pixel27,pixel28,pixel29,pixel30,pixel31,pixel32,pixel33,pixel34,pixel35,pixel36,pixel37,pixel38,pixel39,pixel40,pixel41,pixel42,pixel43,pixel44,pixel45,pixel46,pixel47,pixel48,pixel49,pixel50,pixel51,pixel52,pixel53,pixel54,pixel55,pixel56,pixel57,pixel58,pixel59,pixel60,pixel61,pixel62,pixel63,pixel64,pixel65,pixel66,pixel67,pixel68,pixel69,pixel70,pixel71,pixel72,pixel73,pixel74,pixel75,pixel76,pixel77,pixel78,pixel79,pixel80,pixel81,pixel82,pixel83,pixel84,pixel85,pixel86,pixel87,pixel88,pixel89,pixel90,pixel91,pixel92,pixel93,pixel94,pixel95,pixel96,pixel97,pixel98,pixel99,pixel100,pixel101,pixel102,pixel103,pixel104,pixel105,pixel106,pixel107,pixel108,pixel109,pixel110,pixel111,pixel112,pixel113,pixel114,pixel115,pixel116,pixel117,pixel118,pixel119,pixel120,pixel121,pixel122,pixel123,pixel124,pix
@dfbarrero
dfbarrero / sprites.py
Created February 24, 2022 12:24
Example of sprites usage in Arcade. You will need the sprite located in https://learn.arcade.academy/en/latest/_images/character1.png. The original code has been taken from https://learn.arcade.academy/en/latest/chapters/25_sprites_and_walls/sprites_and_walls.html
""" Sprite Sample Program """
import arcade
# --- Constants ---
SPRITE_SCALING_BOX = 0.5
SPRITE_SCALING_PLAYER = 0.5
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
Date Monthly Mean Total Sunspot Number
0 1749-01-31 96.7
1 1749-02-28 104.3
2 1749-03-31 116.7
3 1749-04-30 92.8
4 1749-05-31 141.7
5 1749-06-30 139.2
6 1749-07-31 158.0
7 1749-08-31 110.5
8 1749-09-30 126.5
# Title: Moon probe evolution example
# Author: Mike Vella
#
# Modified by David F. Barrero
# TODO: Change blend crossover by an arithmetic crossover
#start_imports
import os
import math
import keras
from sacred import Experiment
from sacred.observers import MongoObserver, FileStorageObserver
ex = Experiment("keras-sacred")
#ex.observers.append(MongoObserver())
ex.observers.append(FileStorageObserver("cnn-experiment"))
@dfbarrero
dfbarrero / moonshot.py
Last active April 1, 2020 19:59
Moonshot Inspyred EC algorithm in Python 3.
# Title: Moon probe evolution example
# Author: Mike Vella
# Adapted by David F. Barrero
#start_imports
import os
import math
import pylab
import itertools
from matplotlib import pyplot as plt
@dfbarrero
dfbarrero / access.py
Created March 13, 2020 12:07
Example of private attributes in Python.
class Dog:
def __init__(self):
self.__name = "Unknown"
self.__age = 10
def setName(self, name):
self.__name = name
def getName(self):
return self.__name