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 | |
# -*-coding:utf-8-*- | |
# usage: | |
# ./Watchdog.py <subfile> <commands> | |
# This script takes a <subfile> file and a list of <commands> which it immediately | |
# executes in a subprocess. | |
# It kills the subprocess and relaunches it whenever the file changes. | |
# |
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
# compiler | |
CC=clang++ | |
# linker | |
LD=$(CC) | |
# optimisation | |
OPT=-ggdb | |
# warnings | |
WARN=-Wall -Wextra | |
# standards | |
STD=c++14 |
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
# change application name here (executable output name) | |
TARGET=kernel | |
LINKERSCRIPT=link.ld | |
# compiler | |
CC=gcc | |
ASM=nasm | |
QEMU=qemu-system-i386 -kernel | |
LD=ld |
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> | |
union ConverterIntChar { | |
int i; | |
char c[4]; | |
}; | |
int main() | |
{ |
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 <iostream> | |
#include <vector> | |
using namespace std; | |
constexpr int MAXN = 100 * 1000; | |
int mark[MAXN], low[MAXN]; | |
bool visited[MAXN], iscutv[MAXN]; |
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 <algorithm> | |
#include <climits> | |
#include <iostream> | |
#include <queue> | |
#include <vector> | |
using namespace std; | |
const int maxn = 100'000; | |
using node = pair<long long, int>; | |
using link = pair<int, int>; |
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 <climits> | |
#include <cstring> | |
#include <iostream> | |
#include <queue> | |
#include <vector> | |
using namespace std; | |
constexpr int MAXN{100 * 1000}; | |
struct Edge { |
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
version: '3.1' | |
services: | |
mysql_inst: | |
image: mysql:latest | |
command: --default-authentication-plugin=mysql_native_password | |
# ports: | |
# - 8083:3306 | |
volumes: |
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
(ns bank-acc-sim.core | |
(:gen-class)) | |
(import '(java.util.concurrent Executors)) | |
(defn bank-sim [naccounts nthreads init-val niters] | |
(let [refs (map ref (repeat naccounts init-val)) | |
pool (Executors/newFixedThreadPool nthreads) | |
tasks (map |
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
all: default | |
default: waitpid waitpid_optimized | |
waitpid: waitpid.c Makefile | |
$(CC) -Wall -Werror -std=gnu17 -ggdb -o waitpid waitpid.c | |
waitpid_optimized: waitpid.c Makefile | |
$(CC) -Wall -Werror -std=gnu17 -Ofast -o waitpid_optimized waitpid.c |
OlderNewer