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
% OWN macros | |
% vereinfacht den Befehl \texttt | |
\newcommand{\tttt}[1]{\texttt{#1}} | |
% vereinfacht den Befehl \textbf | |
\newcommand{\ttf}[1]{\textbf{#1}} | |
% vereinfacht den Befehl \textbf | |
\newcommand{\ttsl}[1]{\textsl{#1}} | |
\newcommand{\ttsf}[1]{\textsf{#1}} | |
% underline |
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
#!/bin/env python | |
import os | |
import re | |
from typing import Union, Dict | |
import discord | |
import discord.errors as d_errors | |
from discord.ext import commands | |
""" |
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 sys | |
import time | |
import numpy as np | |
""" | |
Just a quick non scientific performance test for iterables from python and numpy. | |
This is only meant to get a rough feeling for different performances. | |
""" |
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 random | |
from typing import Tuple, List | |
import numpy as np | |
import numpy.typing as npt | |
import torch | |
""" | |
This is a sub-task for the lecture 'computational itelligence' at the univeristy of bonn. | |
It places three images from the MNIST dataset 'randomized' on a 64x64 image. |
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
% NOTE: I do not guarantee that this is the best way of doing it | |
% but I wanna share it anyways since I can't really find any (commented) example code like this. | |
% --- | |
% command to print numbers one per line | |
% paste somewhere into your document (can be preamble or document itself) | |
% init counter variable | |
\newcount\i |
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 re | |
import discord | |
""" | |
A function that returns the matching role-id(s) in a list (as integers) | |
Needed Arguments: Comamnd-Context and Role-ID/ Role-Mention/ Role-Name (as a string) | |
The function will return a tuple of values that contains two values: | |
- A list with all matching role-id (should be one most of the times) | |
- The length of that list as secondary return value |
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
def conv(file: str, new="converted-file.txt", symbol=",", rep=".") -> str: | |
""" | |
Needs: filename | |
Optional: filename, symbol to replace, symbol to replace with | |
- reads data, replaces a symbol with an other symbol of choice | |
- writes new data in file and returns filename | |
""" | |
with open(file, "r") as f: #open file | |
read = f.read() #read content | |
repl = read.replace(symbol, rep) #replace symbol |
NewerOlder