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 numpy as np | |
# Initial Position | |
position = np.array([0,0]) | |
# Target position | |
[A,B] = (10,10) | |
# Basic movements | |
UP_RIGHT = np.array([1,2]) |
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
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Jan 30 00:31:22 2018 | |
@author: marco | |
""" | |
import itertools | |
import time |
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
using Godot; | |
public class HealthBar : Control { | |
private TextureProgress _healthBar; | |
private TextureProgress _healthBarUnder; | |
private Tween _updateTween; | |
[Export] private Color _healthyColor = Colors.Green; | |
[Export] private Color _cautionColor = Colors.Yellow; |
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 threading | |
from time import perf_counter, sleep, time | |
# Timing function | |
def timeit(func): | |
start = perf_counter() | |
func() | |
print(f"{func.__name__} took {perf_counter()-start}") |
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 threading | |
from time import perf_counter, sleep, time | |
from first_example import timeit | |
def task(n=35): | |
if n == 1: | |
return 0 | |
if n == 2: |
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 threading | |
from contextlib import suppress | |
from functools import partial | |
from urllib.error import URLError | |
from urllib.request import urlopen | |
from first_example import timeit | |
links = [ | |
"http://www.google.com/", |
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
""" | |
File: mlist.py | |
Author: Marco Aguiar | |
Github: https://github.com/yourname | |
MList: A MATLAB-like Matrix notation for Python inpired by f-string | |
Are you tired of the unergonomic notation for Python? | |
Are you tired of thinking: "Does the inner list represents a column or a row?"? | |
If none of the above, but still you want see some Python trickery, this is for you! |
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 abc | |
from dataclasses import dataclass | |
from sqlalchemy import Column, ForeignKey, Integer, String, Table | |
from sqlalchemy.engine.create import create_engine | |
from sqlalchemy.orm import polymorphic_union, registry, relationship | |
from sqlalchemy.orm.session import sessionmaker | |
# Create abstract so the parent can't be instantiated |
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
[ | |
{ | |
"source":"Blacksmith's Whetstone", | |
"target":"Armourer's Scrap", | |
"conversion_rate":1, | |
"path":[ | |
"Blacksmith's Whetstone", | |
"Armourer's Scrap" | |
], | |
"path_string":"Blacksmith's Whetstone -> Armourer's Scrap" |