Skip to content

Instantly share code, notes, and snippets.

import numpy
import itertools
class BinFunc:
"""Binary functions, represented as a truth table. This lets us
compare binary functions, and build sets of binary functions. Normal
Python functions don't let us do that.
"""
def __init__(self, table):
zero_ref_mut!(FOO, u32);
fn main() {
let mut val: u32 = 2;
// initialize static FOO
// fzero acts like a MutexHandle
// while it's in scope, FOO is used to store &mut val
let mut fzero = FOO.claim(&mut val).unwrap();
#![no_std]
#![no_main]
#![feature(never_type)]
#![feature(unwrap_infallible)]
#![feature(arbitrary_self_types)]
#![feature(alloc_error_handler)]
// unfortunately new asm doesn't let you set stack pointer...
#![feature(llvm_asm)]
#[macro_use]
#![no_std]
#![no_main]
#![feature(never_type)]
#![feature(unwrap_infallible)]
mod framebuffer;
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
#![no_std]
#![no_main]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}
fn color(fb: &blueloader_info::Framebuffer, c: (u8, u8, u8)) -> u32 {
use bitintr::Pdep;
#![no_std]
#![no_main]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}
#[no_mangle]
pub extern "C" fn _start() -> u32 {
#![no_std]
#![no_main]
#![feature(abi_efiapi)]
use uefi::prelude::*;
use core::fmt::Write;
#[entry]
fn efi_main(image: Handle, st: SystemTable<Boot>) -> Status {
uefi_services::init(&st).expect_success("Failed to initialize services.");
#![no_std]
#![no_main]
#![feature(abi_efiapi)]
use uefi::prelude::*;
use core::fmt::Write;
#[entry]
fn efi_main(image: Handle, st: SystemTable<Boot>) -> Status {
uefi_services::init(&st).expect_success("Failed to initialize services.");
use plotters::prelude::*;
use plotters::chart::SeriesAnno;
use plotters::coord::{AsRangedCoord, Shift};
use plotters::element::{DynElement, PointCollection};
use std::ops::{Deref, DerefMut, Range};
pub struct AutoRange<'a, 'b, DB: DrawingBackend, X: Clone, Y: Clone> {
chart: ChartBuilder<'a, 'b, DB>,
xrange: Range<X>,
yrange: Range<Y>,
import collections
import pprint
import sys
import attr
import numpy
import scipy.spatial
import graphviz
from cached_property import cached_property