Skip to content

Instantly share code, notes, and snippets.

View oodler577's full-sized avatar
🌴
On vacation

OODLER oodler577

🌴
On vacation
View GitHub Profile
@oodler577
oodler577 / output.txt
Last active November 11, 2021 18:53
example of "state" keyword in Perl
0 on 'a' ~> 1
1 on 'b' ~> 2
2 on 'b' ~> 1
1 on 'b' ~> 2
2 on 'a' ~> 0
0 on 'b' ~> 2
2 on 'a' ~> 0
0 on 'b' ~> 2
2 on 'a' ~> 0
0 on 'b' ~> 2
@oodler577
oodler577 / pi.c
Created May 14, 2021 04:52 — forked from bbengfort/pi.c
OpenMP parallel integration to compute Pi.
#include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#define MAX_THREADS 8
static long steps = 1000000000;
double step;
int main (int argc, const char *argv[]) {
@oodler577
oodler577 / interesting-example.pl
Created April 23, 2021 15:09
not trapping signal not sure why, ^C, kill -9, etc
#!/usr/bin/perl -w
$| = 1;
use sigtrap 'handler' => \&sigtrap, 'HUP', 'INT','ABRT','QUIT','TERM'; # ^C, etc
while(1){
print "Working...\n";
sleep(2);
}
sub sigtap(){
print "Caught a signal\n";