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
trait Nat {} | |
#[derive(Debug, PartialEq, Copy, Clone)] enum Zero{Zero} | |
#[derive(Debug, PartialEq, Copy, Clone)] enum Suc<N>{Suc(N)} | |
impl Nat for Zero{} | |
impl<N: Nat> Nat for Suc<N>{} | |
fn add_two<N: Nat>(n: N) -> Suc<Suc<N>> { Suc::Suc(Suc::Suc(n)) } |
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
<html> | |
<head> | |
<style> | |
/* The printing of Fizz or Buzz instead of numbers is just style. Moving the logic to CSS.*/ | |
p:nth-child(3n){ | |
visibility: hidden; | |
} | |
p:nth-child(3n)::before{ | |
visibility: visible; | |
font-size: medium; |
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
#! /usr/bin/env python3 | |
import math | |
import datetime | |
import csv | |
import matplotlib.pyplot as plt | |
import numpy as np | |
t_italy = None | |
italy = None |
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> | |
<head> | |
<style> | |
body { | |
counter-reset: bits; /*integer value of the binary number represented by checkboxes. */ | |
} |
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
#!/usr/bin/env python3 | |
from collections import Counter | |
import math | |
from Crypto.Cipher import AES | |
from Crypto import Random | |
def multlog2(x): | |
if x == 0: | |
return 0 | |
return x*math.log2(x) |
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
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | |
#include <linux/init.h> | |
#include <linux/module.h> | |
#include <linux/printk.h> | |
#ifndef __x86_64__ | |
#error "wrong arch" | |
#endif |