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
CXXFLAGS = -g -std=c++17 -Wall -Wextra -Wpedantic -Werror -pthread | |
all: t1 t1-sanitized | |
# Note: using implicit rule for .cpp files to create t1 | |
t1-sanitized: t1.cpp | |
$(CXX) $(CXXFLAGS) -o $@ $^ -fsanitize=thread | |
.PHONY: clean |
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
CXXFLAGS = -g -std=c++17 -Wall -Wextra -Wpedantic -Werror | |
all: p4 | |
# Note: using implicit rule for .cpp files to create p4 | |
.PHONY: clean test | |
test: p4 | |
./p4 && cat p4.output |
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 node | |
const http = require('http') | |
const url = require('url') | |
const qs = require('querystring') | |
function formHandler (request, response) { | |
response.write(`method: ${request.method}\n`) | |
response.write(`url: ${request.url}\n`) |
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
students = [ | |
['foo', 'junior'], | |
['bar', 'senior'], | |
['baz', 'junior'], | |
['quux', 'junior'], | |
['guacamole', 'senior'], | |
['spatula', 'junior'], | |
['firewood', 'senior'], | |
] |
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
CFLAGS= -g -std=c11 -Wall -Wextra -Wpedantic | |
TARGET=dieroll | |
$(TARGET): $(TARGET).c | |
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS) | |
test: $(TARGET) | |
./$< 100000 | |
clean: |
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
*.o | |
resource-allocation |
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
burncpu | |
multithread | |
mutex | |
semaphore |
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 <cstdlib> | |
#include <iostream> | |
#include <pthread.h> | |
using std::cout; | |
using std::cerr; | |
using std::endl; | |
// Don't forget to compile with -pthread |
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
*.o | |
send_string | |
receive_string |
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 <cstdlib> | |
#include <iostream> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <unistd.h> | |
using std::cout; | |
using std::cerr; | |
using std::endl; |
NewerOlder