Skip to content

Instantly share code, notes, and snippets.

View strangeglyph's full-sized avatar

strangeglyph strangeglyph

View GitHub Profile
environment.systemPackages = with pkgs;
let
agda-with-stdlib = agda.withPackages (agda-packages: with agda-packages; [
standard-library
]);
in [
agda-with-stdlib
];
#include <memory>
#include <unordered_map>
/// --------------
class ImplBase;
class Class {
std::unique_ptr<ImplBase> impl;
while True:
b=512
while b >= 0:
g = 512
while g >= 0:
r = 512
while r >= 0:
print("r={:>3}, g={:>3}, b={:>3}".format(r,g,b))
r -= 8
g -= 8
#[derive(Debug, Serialize, Deserialize)]
struct Thing {
value: String,
}
pub fn do_the_thing() {
let mut cfg = cfg::Config::default();
cfg.set("value", "didn't do the thing").unwrap();
cfg.merge(cfg::File::with_name("./thing.yml")).unwrap();
// ---
int[] lookupTable = new int[] {
0b00000000_00000000_00000000_00000000,
0b00000000_00000000_00000000_00000001,
0b00000000_00000000_00000000_00001000,
0b00000000_00000000_00000000_00001001,
0b00000000_00000000_00000000_01000000,
0b00000000_00000000_00000000_01000001,
0b00000000_00000000_00000000_01001000,
0b00000000_00000000_00000000_01001001,
0b00000000_00000000_00000010_00000000,
ENTRY(start)
SECTIONS {
. = 1M;
.boot :
{
KEEP(*(.multiboot_header))
}
global internal_cpuid
section .text
bits 64
; params:
; rdi - cpuid call
; rsi - pointer to a continous 16 bytes of memory
; which will be filled
internal_cpuid:
pub trait Formula {
type C: Clause;
fn get_unit(&self) -> Option<&Self::C>;
fn force_assignment(&mut self, lit: Literal, reason: &Self::C);
}
fn unit<F: Formula>(f: &mut F) -> bool {
let unit_clause = match f.get_unit() {
Some(x) => x,
None => return false
fmt=0 streamId3
[>>>] 03
[>>>] ff
[>>>] ff
[>>>] c2
[>>>] 00
[>>>] 02
[>>>] 17
[>>>] 14
[>>>] 00
type Rules<'a> = HashMap<ProdElem<'a>, Vec<Vec<ProdElem<'a>>>>;
type ParseTable<'a> = HashMap<ProdElem<'a>, HashMap<ProdElem<'a>, &'a Vec<ProdElem<'a>>>>;
fn mk_parse_table<'a>(rules: &Rules<'a>, first_set: &FirstSet<'a>, follow_set: &FollowSet<'a>) -> ParseTable<'a> {
let mut result = HashMap::new();
/// :t elem = ProdElem<'a>
/// :t productions = &Vec<Vec<ProdElem<'a>>