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
(* langfc-src/scanner-parser/langf-hand-scanner.sml | |
* | |
* COPYRIGHT (c) 2011-2013 Matthew Fluet (http://www.cs.rit.edu/~mtf) | |
* All rights reserved. | |
* | |
* Rochester Institute of Technology | |
* 4005-711 | |
* Q20112,Q20122 | |
* | |
* COPYRIGHT (c) 2009 Matthew Fluet (http://tti-c.org/fluet) |
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
/* | |
* Copyright (c) 2023 Russell Harmon | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |
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
#!/bin/bash | |
set -e | |
set -o pipefail | |
statefile="$(mktemp --tmpdir=/run spark-dirty-pages.XXXXX)" | |
trap 'rm -f $statefile' INT HUP QUIT | |
function watch_iter { | |
declare -a dirty | |
readarray -t dirty < "$statefile" |
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
/** | |
* Create a generator that yields all hostnames. | |
* | |
* @param {NS} ns | |
* @param {String} hostname the host to start traversal at | |
* @param {Set} seen used for internal recursion | |
* @yields {String} a hostname | |
*/ | |
export function* getAllHostnames(ns, hostname = "home", seen = new Set()) { | |
seen.add(hostname); |
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
/** | |
* Pathto finds the path of servers between a source and destination. | |
* | |
* @param {NS} ns | |
* @param {String} dest the hostname to try to find a path to | |
* @param {String} src the hostname to start at | |
* @param {Array} tosrc used for internal recursion | |
* @param {Set} seen used for internal recursion | |
* @returns {Array} the path from src to dest, or null if no path exists | |
*/ |
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
<source> | |
type tail | |
path /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs/*.log | |
pos_file /var/lib/google-fluentd/pos/plex.pos | |
read_from_head true | |
tag plex | |
format multiline | |
format_firstline /^[^ ]+ \d{1,2}, \d{4} \d{2}:\d{2}:\d{2}/ | |
format1 /^(?<time>^[^ ]+ \d{1,2}, \d{4} \d{2}:\d{2}:\d{2}) [^ ]+ (?<severity>[^ ]+) - (?<message>(?:(?:Request|Completed): \[(?<remotehost>[^:]+):[^\]]+\] (?<method>[^ ]+) (?<path>[^? ]+)(?:\?(?<querystring>[^ ]+))? \([^\)]+\)(?: (?:TLS|GZIP))*(?: [0-9]+ms (?<bytes>[0-9]+) bytes (?<status>[0-9]+))?.*|.+))$/ | |
</source> |
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 <setjmp.h> | |
#include <stddef.h> | |
#include <string.h> | |
#define NORETURN __attribute__((noreturn)) | |
typedef void (*AllocCont)( void * ); | |
void NORETURN longjmp_on_return( AllocCont f, jmp_buf env, void *mem ) { |
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
Your compiler must support blocks. | |
To compile, run ONE of the following: | |
gcc -o ooc -std=c99 -fblocks ooc.c | |
clang -o ooc ooc.c | |
The output looks like this: | |
Integer: 1337 | |
String: "Hello World!" |
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
int main() { | |
int n = 1; | |
struct foo { | |
char a; | |
int b[n]; | |
}; | |
struct foo a; | |
a.a = 'a'; | |
a.b[0] = 1; | |
n = 2; |
NewerOlder