This is the resource repositry for my memory managment lecture / workshop series at Breda University of applied sciences - Games. It is mainly targeted for game developers
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 os | |
from collections import deque | |
from collections.abc import Iterator, Sequence | |
from typing import Final, Protocol | |
# Protocol is much like interfaces in go where you have objects implementing the methods | |
# defined under a class inherting the Protocol class. | |
class SeekableBytesFile(Protocol): | |
def seek(self, position: int, whence: int = ..., /) -> int: ... |
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
// Finding primes upto N | |
// From this video: https://www.youtube.com/watch?v=fwxjMKBMR7s | |
package snippets | |
import ( | |
"container/heap" | |
"fmt" | |
"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
from __future__ import annotations | |
import time | |
from heapq import heapify, heappush, heappop | |
import math | |
from io import StringIO | |
class NotFound(Exception): | |
def __init__(self, *args: object, msg: str) -> None: | |
super().__init__(*args, msg) |
Picking the right architecture = Picking the right battles + Managing trade-offs
- Clarify and agree on the scope of the system
- User cases (description of sequences of events that, taken together, lead to a system doing something useful)
- Who is going to use it?
- How are they going to use it?
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
0.0 TEL | Telepresence 0.73-1694-g146d6ec launched at Tue Jan 10 19:15:06 2023 | |
0.0 TEL | ./usr/local/bin/telepresence --mount=false --also-proxy=10.0.0.0/8 --run zsh | |
0.0 TEL | Using images version 0.73 (dev) | |
0.0 TEL | uname: uname_result(system='Darwin', node='192.168.1.2', release='21.5.0', version='Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:29 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T8101', machine='x86_64') | |
0.0 TEL | Platform: darwin | |
0.0 TEL | WSL: False | |
0.0 TEL | Python 3.9.6 (v3.9.6:db3ff76da1, Jun 28 2021, 11:49:53) | |
0.0 TEL | [Clang 6.0 (clang-600.0.57)] | |
0.0 TEL | BEGIN SPAN main.py:40(main) | |
0.0 TEL | BEGIN SPAN startup.py:83(set_kube_command) |
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
/* Useful celery config. | |
app = Celery('tasks', | |
broker='redis://localhost:6379', | |
backend='redis://localhost:6379') | |
app.conf.update( | |
CELERY_TASK_RESULT_EXPIRES=3600, | |
CELERY_QUEUES=( | |
Queue('default', routing_key='tasks.#'), |
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
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
"syscall" | |
) | |
func main() { |