This file contains hidden or 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
limit_process() { | |
if (( $# < 2 )); then | |
echo "Usage: $0 size command ..." | |
return 1 | |
fi | |
size=$1 | |
command=(${@:2}) | |
# run the process, stop, and save the PID |
This file contains hidden or 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
// ISO C23 iterator for a non-const container | |
// compile with -std=c2x (gcc 13+, clang 16+) | |
struct iterator_base { | |
void *collection; | |
union { | |
void *state; | |
unsigned long size; | |
}; | |
unsigned long index; |
This file contains hidden or 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 <fcntl.h> | |
#include <stddef.h> | |
#include <stdio.h> | |
#include <stdbool.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <assert.h> | |
#include <poll.h> |
This file contains hidden or 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
diff --git a/mingw-w64-glib2/PKGBUILD b/mingw-w64-glib2/PKGBUILD | |
index 380874721..e20bc32df 100644 | |
--- a/mingw-w64-glib2/PKGBUILD | |
+++ b/mingw-w64-glib2/PKGBUILD | |
@@ -23,7 +23,7 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" | |
"${MINGW_PACKAGE_PREFIX}-meson" | |
"${MINGW_PACKAGE_PREFIX}-gtk-doc" | |
"${MINGW_PACKAGE_PREFIX}-python-setuptools") | |
-source=("https://download.gnome.org/sources/glib/${pkgver%.*}/glib-${pkgver}.tar.xz" | |
+source=("git+https://gitlab.gnome.org/Prince781/glib" |
This file contains hidden or 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 <stdbool.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <inttypes.h> | |
#include <Windows.h> | |
#define return_val_if_fail(expr, val)\ | |
do {\ | |
if (!(expr))\ |
This file contains hidden or 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
import random | |
from functools import reduce | |
import numbers | |
from math import sqrt, floor, ceil | |
# RV1 + RV2 = new RV | |
# same idea for other arithmetic ops | |
class RV: |
This file contains hidden or 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
// clang -fopenmp ptr-atmt.c -o ptr-atmt | |
#include <omp.h> | |
#include <stdio.h> | |
#pragma omp declare target | |
double *ptr; | |
void work(int i) | |
{ | |
// work on ptr[i] |
This file contains hidden or 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/env python3 | |
import argparse | |
import re | |
import math | |
def get_pitch_class(note): | |
try: | |
p = int(note) | |
return p |
This file contains hidden or 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 | |
# vim: tw=0 | |
if [ -z $SOFTWARE ]; then | |
echo "SOFTWARE undefined" | |
exit 1 | |
fi | |
mkdir -p $SOFTWARE | |
mkdir -p $SOFTWARE/usr/share/man |
This file contains hidden or 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
/* primes.c | |
* prints prime factorization of number | |
* `make primes` | |
*/ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
static const char *supers[] = { | |
"\u2070", |
NewerOlder