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/ruby | |
# | |
# If you want to understand how this script works, I'd recommend starting to read it | |
# at the "entry point" where it starts validating and parsing the arguments---just | |
# look for the lines interacting with ARGV to get the initial list of cards. From | |
# there you can follow how it generates the full set of candidate melds (which may | |
# overlap) and then how it builds a "tree" where each path to a leaf node defines a | |
# non-overlapping set of melds. | |
usage = "deadwood.rb: |
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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"regexp" | |
"time" | |
) | |
func getRandomBytes(n uint32) []byte { |
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 l putchar | |
int main(void) { | |
return ((((l(1 + (1 + (1 + (1 + ((((((((((((((((((((((1 + ((((((((l(1 + (1 + (1 + (1 + (1 + | |
(1 + (((((((1 + (1 + ((((((((((((((((((((1 + (((l(1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + | |
(1 + (1 + (1 + (1 + (1 + (1 + (1 + ((((((((((((((((1 + (((((((1 + ((((((((l(1 + (1 + (1 + | |
(1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + | |
(1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (((1 + (((1 + (((((( | |
(1 + ((((((((((1 + (((((1 + ((l(1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + | |
(1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + | |
(1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (1 + (((((((((((1 + ((((1 + ( |
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
void StreamPrintf(std::ostream stream, const char *format, ...) { | |
char buffer[1024]; | |
va_list args; | |
memset(buffer, 0, sizeof buffer); | |
va_start(args, format); | |
vsnprintf(buffer, (sizeof buffer) - 1, format, args); | |
va_end(args); | |
stream << buffer; | |
} |
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
package main | |
import ( | |
"fmt" | |
) | |
type type1 struct { | |
number 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 <errno.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
// A minimal-ish example of writing data to a child process' stdin. | |
int main(int argc, char **argv) { | |
char print_buffer[256]; | |
int stdin_pipe[2]; | |
int result; |
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
// TO COMPILE: | |
// gcc -shared -fPIC -o thread_create_hook.so thread_create_hook.c -ldl | |
// TO USE (needs an absolute path): | |
// LD_PRELOAD=`pwd`/thread_create_hook.so ./application_to_hook | |
#define _GNU_SOURCE | |
#include <dlfcn.h> | |
#include <pthread.h> | |
#include <stdio.h> | |
#include <stdlib.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
# This script reads all JSON result files and uses matplotlib to display a | |
# timeline indicating when blocks and threads from multiple jobs were run on | |
# GPU, including which SM they ran on. For this to work, all result filenames | |
# must end in .json. | |
# | |
# Usage: python view_blocksbysm.py [results directory (default: ./results)] | |
import argparse | |
import glob | |
import json | |
import math |
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
[ 347.582485] BUG: kernel NULL pointer dereference, address: 0000000000000028 | |
[ 347.582489] #PF: supervisor write access in kernel mode | |
[ 347.582490] #PF: error_code(0x0002) - not-present page | |
[ 347.582491] PGD 0 P4D 0 | |
[ 347.582494] Oops: 0002 [#1] PREEMPT SMP | |
[ 347.582496] CPU: 15 PID: 7937 Comm: python Not tainted 5.8.0+ #1 | |
[ 347.582497] Hardware name: Dell Inc. Precision Tower 7910/0NK5PH, BIOS A13 05/20/2016 | |
[ 347.582626] RIP: 0010:amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu+0x48d/0x900 [amdgpu] | |
[ 347.582628] Code: 03 c1 e8 96 bf b2 dd e9 94 fd ff ff 83 bd 40 ff ff ff 02 48 8b 85 78 ff ff ff 75 12 48 8b 90 30 02 00 00 4c 89 b0 90 02 00 00 <4c> 89 72 28 48 8b 13 48 83 bd 48 ff ff ff 00 48 89 90 90 03 00 00 | |
[ 347.582629] RSP: 0018:ffff9c00c2037cc0 EFLAGS: 00010246 |
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 <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
// A minimal-ish example of writing data to a child process' stdin. | |
int main(int argc, char **argv) { | |
char print_buffer[256]; | |
int stdin_pipe[2]; | |
int result; |
OlderNewer