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 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): |
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
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(); |
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
#![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] |
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
#![no_std] | |
#![no_main] | |
#![feature(never_type)] | |
#![feature(unwrap_infallible)] | |
mod framebuffer; | |
#[panic_handler] | |
fn panic(_info: &core::panic::PanicInfo) -> ! { | |
loop {} |
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
#![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; |
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
#![no_std] | |
#![no_main] | |
#[panic_handler] | |
fn panic(_info: &core::panic::PanicInfo) -> ! { | |
loop {} | |
} | |
#[no_mangle] | |
pub extern "C" fn _start() -> u32 { |
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
#![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."); |
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
#![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."); |
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 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>, |
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 collections | |
import pprint | |
import sys | |
import attr | |
import numpy | |
import scipy.spatial | |
import graphviz | |
from cached_property import cached_property |