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
#include <errno.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/wait.h> | |
#include <unistd.h> | |
int write_all(int fd, const void *buf, size_t count) { | |
const char *cbuf = (const char *)buf; |
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 collections | |
import dataclasses | |
import sys | |
from typing import Iterable, Self | |
IGNORED_WORDS: frozenset[str] = frozenset([ | |
'adv', | |
'dis', | |
'eds', |
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
(defclass callable-class (standard-class function) | |
() | |
(:metaclass sb-mop:funcallable-standard-class)) | |
(defmethod sb-mop:validate-superclass ((class callable-class) superclass) | |
(or (typep superclass 'callable-class) | |
(typep superclass 'standard-class))) | |
(defmethod initialize-instance :after ((class callable-class) &rest rest &key &allow-other-keys) | |
(declare (ignore rest)) |
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 apt | |
import networkx as nx | |
def is_root(pkg: apt.package.Package) -> bool: | |
if not pkg.is_installed: | |
return False | |
if not pkg.is_auto_installed: | |
return True | |
if pkg.essential: |
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
module Grammar where | |
open import Category.Applicative | |
open import Data.Char using (Char) | |
open import Data.List using (List) | |
open import Data.List.NonEmpty using (List⁺; map; foldl₁; fromList) | |
open import Data.Maybe using (from-just) | |
open import Data.Nat using (ℕ; _+_; _*_) | |
open import Data.String using (String; toList) | |
open import Data.Unit | |
open import Function |
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
import sys | |
from typing import FrozenSet, Iterable, Iterator, List, NamedTuple, NewType, Sequence, Set | |
from frozendict import frozendict | |
from multiset import FrozenMultiset | |
# Text munging | |
def normalize(s: str) -> str: | |
return ''.join(c.lower() for c in s if c.isalnum()) |
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 futures::executor::*; | |
use futures::future::*; | |
use futures::task::*; | |
use futures_util::pin_mut; | |
use std::pin::*; | |
async fn use_me(i: i32) -> i32 { | |
i | |
} |
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
#include <charconv> | |
#include <iostream> | |
#include <string> | |
#include <system_error> | |
std::string to_hex(uint64_t val) { | |
char buf[16]; | |
auto [end, e] = std::to_chars(std::begin(buf), std::end(buf), val, 16); | |
if (e != std::errc()) { | |
throw std::system_error(std::make_error_code(e)); |
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
open import Level using () renaming (suc to lsuc) | |
open import Data.Empty | |
open import Data.Nat hiding (compare) | |
open import Data.Nat.Properties | |
open import Data.Product | |
open import Data.Sum | |
open import Data.Vec | |
open import Function | |
open import Relation.Nullary | |
open import Relation.Nullary.Negation |
NewerOlder