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
use std::borrow; | |
use wgpu::util::DeviceExt as _; | |
// =========== | |
// === Run === | |
// =========== |
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
#![feature(portable_simd)] | |
use std::{ | |
hint::black_box, | |
time::{Duration, Instant}, | |
}; | |
trait IntoInput<T: Copy> { | |
fn into_input(self) -> T; | |
} |
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 docker | |
import discord | |
import asyncio | |
import sqlite3 | |
import io | |
import functools | |
import os | |
from os import listdir | |
from os.path import isfile, join | |
from datetime import datetime, timedelta, timezone |
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
// =========== | |
// === Run === | |
// =========== | |
pub fn run(s: &str) -> u64 { | |
let (times, distances) = parse_input(s); | |
let times = &[times.0, times.1, times.2, times.3]; | |
let distances = &[distances.0, distances.1, distances.2, distances.3]; | |
let wins0 = simulate_race(times[0] as u16, distances[0]) as u64; |
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
pub fn run(s: &str) -> u64 { | |
let (times, distances) = parse_input(s); | |
let times = &[times.0, times.1, times.2, times.3]; | |
let distances = &[distances.0, distances.1, distances.2, distances.3]; | |
let wins0 = simulate_race(times[0] as u16, distances[0]) as u64; | |
let wins1 = simulate_race(times[1] as u16, distances[1]) as u64; | |
let wins2 = simulate_race(times[2] as u16, distances[2]) as u64; | |
let wins3 = simulate_race(times[3] as u16, distances[3]) as u64; | |
let counter = wins0 * wins1 * wins2 * wins3; | |
counter |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#[inline] | |
fn is_hex_prefixed_matches(s: &str) -> bool { | |
matches!(s.as_bytes(), [b'0',b'x', ..] | [b'0',b'X', ..]) | |
} | |
#[inline] | |
fn is_hex_prefixed_unsafe(s: &str) -> bool { | |
let x = | |
unsafe { ((*s.as_ptr() as u16) << 8) | (*s.as_ptr().add((s.len() > 1) as usize)) as u16 }; | |
(x ^ 0x3078) & (x ^ 0x3050) == 0 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" type="text/css" | |
href="https://cdn.jsdelivr.net/gh/spiermar/[email protected]/dist/d3.flameGraph.min.css" | |
integrity="sha256-w762vSe6WGrkVZ7gEOpnn2Y+FSmAGlX77jYj7nhuCyY=" | |
crossorigin="anonymous" | |
/> | |
</head> |
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
# Mnemosyne configuration file. | |
# This file contains settings which we deem to be too specialised to be | |
# accesible from the GUI. However, if you use some of these settings, feel | |
# free to inform the developers so that it can be re-evaluated if these | |
# settings need to be exposed in the GUI. | |
# Science server. Only change when prompted by the developers. | |
science_server = "mnemosyne-proj.dyndns.org:80" |
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 curio import run | |
from curio.socket import * | |
import os | |
import sys | |
from common import send_message, read_message, b8zs_encode | |
DEFAULT_HOST = '127.0.0.1' | |
DEFAULT_PORT = 8080 |
NewerOlder