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 heapq | |
import matplotlib.pyplot as pp | |
import numpy as np | |
rng = np.random.default_rng() | |
k = 20 # Number of classes | |
n = 10_000_000 # Number of samples |
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 gc | |
import sys | |
from collections.abc import Iterable | |
from dataclasses import dataclass | |
import torch | |
from calmsize import size | |
def get_tensors(): |
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
GIMP Palette | |
Name: TUM Corporate | |
Columns: 0 | |
# Color palette with the official colors from TUM's corporate design [1]. | |
# | |
# [1] https://portal.mytum.de/corporatedesign/index_html/vorlagen/index_farben | |
0 101 189 Pantone 300 C | |
255 255 255 White | |
0 0 0 Black | |
0 82 147 Pantone 301 |
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
#!/usr/bin/env python | |
import argparse | |
import json | |
from pathlib import Path | |
from openpyxl import Workbook | |
from openpyxl.styles import Alignment, Font | |
WEEKDAYS = [ |
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
GIMP Palette | |
Name: colorblind (seaborn) | |
Columns: 0 | |
# | |
1 115 178 | |
35 176 253 | |
145 215 254 | |
222 143 5 | |
250 185 70 | |
252 220 162 |
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
#!/usr/bin/env julia | |
import Pkg | |
using UUIDs | |
using PackageCompiler | |
function flatten_dependencies(uuid::UUID, package_infos::Dict{UUID, Pkg.Types.PackageInfo}) | |
deps = Set{UUID}() | |
new = [uuid] | |
while !isempty(new) |
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
#include <iostream> | |
#include <string> | |
class Message { | |
public: | |
Message &operator=(const std::string &&msg) && { | |
std::cout << msg << std::endl; | |
return *this; | |
} |
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
#include <array> | |
#include <iostream> | |
#include <vector> | |
int main() { | |
std::vector<std::array<int, 2>> as{{1, 2}, {3, 4}, {7, -1}}; | |
int* buffer = (int*)as.data(); | |
for (int i = 0; i < as.size() * 2; i++) { | |
std::cout << buffer[i] << std::endl; |
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
x = X.find(params[:id]) | |
patch = Hana::Patch.new(JSON.parse(request.body.read)) | |
json = JSON.parse(HAL::Writers::XWriter.new(x).to_json) | |
patched = patch.apply(json) | |
HAL::Writers::XWriter.new(x).from_json(patched.to_json) | |
x.save |
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
// Loading | |
var resource = $.get("https://url/..."); | |
// Manipulating | |
var updated = doSomething(resource); | |
// Updating | |
$.patch(resource._links.self.href, diff(resource, updated)) |
NewerOlder