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 std::fmt; | |
use std::clone::Clone; | |
use std::cmp::Eq; | |
#[derive(Debug)] | |
#[derive(Eq, Hash, PartialEq)] | |
struct Value(String); | |
impl Clone for Value { | |
fn clone(&self) -> Self { |
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 <cstdio> | |
#include <cstring> | |
#include <cstdint> | |
#include <stdlib.h> | |
#include <vector> | |
#include <chrono> | |
#include <unordered_set> | |
#include <string> | |
#include <sys/stat.h> | |
#include <assert.h> |
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 <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <limits.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
#include <sys/socket.h> | |
#include <sys/stat.h> | |
#include <sys/time.h> |
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 <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <limits.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
#include <sys/socket.h> | |
#include <sys/stat.h> | |
#include <arpa/inet.h> |
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 <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <limits.h> | |
#include <sys/mman.h> | |
#include <sys/stat.h> | |
#include <sys/socket.h> | |
#include <sys/stat.h> | |
#include <arpa/inet.h> |
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 | |
import random | |
import string | |
def rand_str(n): | |
return ''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(n)) | |
def rand_str_set(n, amount): | |
return {rand_str(n) for i in range(amount)} |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <time.h> | |
#include <assert.h> | |
static const size_t MIN_ROW_SIZE = sizeof(size_t) * 2; | |
int storage_row_empty(const char* row) { | |
return row[0] == '\0'; |
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 | |
import socket | |
import os | |
import json | |
class Lock: | |
def __init__(self, owner, member_set): | |
self.owner = owner |
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 socket | |
>>> server = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | |
>>> server.setblocking(False) | |
>>> server.bind("foo.sock") | |
>>> server.listen(1) | |
>>> connection, client_address = server.accept() | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/socket.py", line 293, in accept | |
fd, addr = self._accept() |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <signal.h> | |
#include <errno.h> | |
//--------system headers -------// | |
#include <unistd.h> | |
#include <sys/un.h> | |
#include <fcntl.h> |
NewerOlder