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
[{"rowId":0,"title":"Tales From the Loop","comments":"","watchDates":["01/01/2020","06/21/2023"],"type":1,"rating":"7","id":"f0d8fdc6-295f-4960-b728-2777f6651aa4","updatedAt":1687338657590,"createdAt":1687338657590},{"rowId":1,"title":"The Man Who Shot Liberty Valance","comments":"","watchDates":["01/01/2022"],"type":0,"rating":"8","id":"14bc7fca-9cd4-491b-af24-8c64e1f414e0","updatedAt":1687338657591,"createdAt":1687338657591},{"rowId":2,"title":"Sinbad (Series)","comments":"I absolutely love this show. The production isn't great; the writing is at times all over the place. It's one of those Xena/Hercules-tier serials that should have endured for years and hundreds of episodes, but aired in 2012 when tv show renewals weren't passed out as liberally as they had a decade prior.\n\nIt's unfortunate, because this is for me a \"comfort show\" of sorts. I love Elliot Knight as Sinbad, and I'm incredibly disappointed he has such a small repertoire beyond the show. I'll certainly re-watch though, and ordered the DVD |
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
// ==UserScript== | |
// @name New Userscript | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://news.ycombinator.com/*?\? | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=ycombinator.com | |
// @grant none | |
// ==/UserScript== |
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 <pthread.h> // for POSIX threads | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> // for pause and sleep | |
void *thread_routine(void *arg) { | |
char *thread_id = (char *)arg; | |
while (1) { | |
printf("%s\n", thread_id); |
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> | |
typedef struct transition_t { | |
char* name; | |
char* target; | |
void (*action)(void); | |
} Transition; |
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 <arpa/inet.h> | |
#include <netinet/in.h> | |
#include <pthread.h> | |
#include <signal.h> | |
#include <stdbool.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <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 <stdlib.h> | |
#include <pthread.h> | |
#include <stdbool.h> | |
// canonical macro aliases from `semaphore.h` | |
#define P(sem) sem_wait(sem) | |
#define V(sem) sem_post(sem) | |
#define UP(sem) sem_wait(sem) | |
#define DOWN(sem) sem_post(sem) |
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 <pthread.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
typedef struct barrier { | |
uint32_t threshold; | |
uint32_t curr_wait; /* from 0 -> threshold - 1*/ | |
pthread_cond_t cv; | |
pthread_mutex_t mutex; /* perform mutually exclusive ops on a thread barrier */ | |
bool is_ready; /* is barrier disposition in progress? */ |
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 bash | |
gcc dining_philosopher.c -o main -lpthread | |
./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 <pthread.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <sysexits.h> | |
#include <errno.h> | |
// this code snippet demonstrates the 'transfer of computation' methodology, | |
// whereby two threads do not transfer data but a computation that acts upon | |
// this observed data |
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
// the following is an exact implementation of the algorithm Windows 10 uses when | |
// duplicating filenames | |
// dummy data | |
const allFiles = [ | |
'test', | |
'test - Copy (2)', | |
'test - Copy', | |
'name', | |
'othername' |
NewerOlder