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
#set page(width: auto, height: auto, margin: 2cm) | |
#{ | |
let width = 10 | |
let height = 10 | |
let grid = ((false,) * width,) * height | |
let render_box(color) = box( | |
outset: -0.1cm, | |
radius: 4pt, |
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
Tapstabell: | |
Antall Kroner som kunne vært spart ved å bestille flere | |
0 0 | |
1 0 | |
2 0 | |
3 0 | |
4 1 | |
5 0 | |
6 0 | |
7 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 wpexec | |
om = ObjectManager { | |
Interest { | |
type = "node", | |
Constraint { "media.class", "=", "Video/Source" }, | |
}, | |
Interest { | |
type = "node", | |
Constraint { "media.class", "=", "Audio/Source" }, |
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
#include <iostream> | |
#include <vector> | |
struct Count { | |
int at, ca, tc; | |
int qw; | |
Count() : at(0), ca(0), tc(0), qw(0) {} | |
inline Count operator-(Count rhs) const { |
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
use std::path::PathBuf; | |
use anyhow::Result; | |
use clap::Parser; | |
use gix::date::Time; | |
use image::{GrayImage, Luma}; | |
#[derive(Parser)] | |
struct Opts { | |
image: PathBuf, |
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
import math | |
def fht(vector): | |
n = len(vector) | |
if n <= 1: | |
return vector[:] | |
elif n == 2: | |
return [vector[0] + vector[1], vector[0] - vector[1]] |
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
mod with_executor { | |
use std::{future::Future, sync::Arc, thread::JoinHandle, time::Duration}; | |
use smol::{future, Executor, Task}; | |
struct Handle { | |
executor: Arc<Executor<'static>>, | |
} | |
struct BackgroundExecutor { |
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
use std::ops::{Deref, DerefMut, Index, IndexMut}; | |
/// A container that can be indexed by `D`-dimensional indices. | |
/// | |
/// Generic arguments: | |
/// - `T`: element type | |
/// - `C`: type of the underlying container | |
/// - `D`: number of dimensions | |
/// | |
/// `C` must impl `Deref<Target = [T]>`, and `DerefMut` for mutable operations. |
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
use std::io::BufRead; | |
trait LendingIterator { | |
type Item<'a> | |
where | |
Self: 'a; | |
fn next(&mut self) -> Option<Self::Item<'_>>; | |
} |
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
#[derive(Copy, Clone, PartialEq, Eq, Debug)] | |
struct Interval { | |
start: i64, | |
end: i64, | |
} | |
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Debug)] | |
struct Endpoint { | |
time: i64, | |
end: End, |