This file contains hidden or 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
type TimeSeries = list[tuple[float, float]] | |
def normalize_time_series(time_series: TimeSeries, T_min: float, T_max: float) -> TimeSeries: | |
min_time = time_series[0][0] | |
max_time = time_series[-1][0] | |
return [ | |
(normalize_time(t, min_time, max_time, T_min, T_max), v) for (t, v) in time_series | |
] |
This file contains hidden or 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
# quick and dirty demo | |
class Foo | |
include(Module.new do | |
def self.included(including_class) | |
including_class.extend(StaticMethods) | |
including_class.prepend(Hooks) | |
end | |
module Hooks; end |
This file contains hidden or 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
// Highly condensed version of my code with only the relevant bits. | |
// Vertices are ending up outside of clip space after transforming with MVP | |
// matrices despite using the same numbers and glm functions as | |
// https://learnopengl.com/Getting-started/Coordinate-Systems | |
// Libs used: glium/glutin and nalgebra_glm as glm; | |
let cube: [Vertex; 4] = [ | |
// Front face: | |
Vertex { coord: [0.5, 0.5, 0.0], rgba: [1.0, 1.0, 1.0, 1.0] }, |
This file contains hidden or 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 python3 | |
from prioritize import MaxHeapq | |
import code | |
class Task: | |
tasks = [] | |
def __init__(self, *args, **kwargs): |
This file contains hidden or 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 python3 | |
from prioritize import MaxHeapq | |
import code | |
class Task: | |
tasks = [] | |
def __init__(self, *args, **kwargs): |
This file contains hidden or 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 python3 | |
from prioritize import MaxHeapq | |
import code | |
class Task: | |
tasks = [] | |
def __init__(self, *args, **kwargs): |