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
--[[ INVADERS THE GAME ]] | |
--[[ GALACTIC DEFENSE ]] | |
--[[ | |
Portable minidoc, PICO-8 built-in: | |
`cls()` - Clears the screen. | |
`spr(id, x, y, [w, h], [flip_x, flip_y])` - Draws a sprite at the specified position. | |
`btn(id)` - Checks if a button is pressed. | |
`btnp(id)` - Checks if a button was pressed in the current frame. | |
`map(x, y, [sx, sy], [sw, sh])` - Draws a map at the specified position. |
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
char * r(char* s){int j,i;char* r; | |
for (i = (0x0000000000000000 + 0x\ | |
0000000000000200 + 0x000000000000\ | |
0800 - 0x0000000000000A00);(s[i] \ | |
^ 0x0000000000000000);i++){};for | |
(j = (0x0000000000000000 + 0x0000\ | |
000000000200 + 0x0000000000000800\ | |
- 0x0000000000000A00) , i--;(j < i | |
) & !!(j < i);i-- , j++){r[j] = s[ | |
i];r[i] = s[j];};r[i + j + (0x000\ |
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
// unistd_msvc_min.h | |
# if defined(_WIN64) | |
typedef unsigned __int64 ino_t; | |
typedef __int64 ssize_t; | |
typedef __int64 suseconds_t; | |
typedef unsigned __int64 useconds_t; | |
# else | |
typedef unsigned __int32 ino_t; | |
typedef __int32 ssize_t; |
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
// cc u1.c -pedantic -Wno-newline-eof -o u1.executable | |
#include <stdio.h> | |
# if defined(_MSC_VER) | |
# include <windows.h> | |
static int usleep(__int64 usec) | |
{ | |
HANDLE timer; | |
LARGE_INTEGER fire; |
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
// C11 Clang Atomic support | |
# if defined(__clang__) | |
# if __has_feature(c_atomic) | |
# define HAVE_CLANG_ATOMICS 1 | |
# endif | |
# endif | |
# if defined(__GNUC__) && !defined(HAVE_CLANG_ATOMICS) |
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
#!/bin/sh | |
# | |
# # -*- coding: utf-8, tab-width: 3 -*- | |
# # | |
# ____ _____ ___ # | |
# | __|___ ) \ # | |
# _ _ _ _| |__ _/ /\ O / # | |
# | | | | | | |___ \( _)/ _ \ # |
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> | |
# define sys_malloc malloc | |
# define sys_realloc realloc | |
# define sys_free free | |
# define sys_memset memset | |
# define sys_memmove memmove | |
# define sys_scope_begin do { |
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
// cc -pedantic -Wno-newline-eof -std=c99 ping.c -o ping_server.cmd | |
// cc -pedantic -Wno-newline-eof -std=c99 pong.c -o pong_client.cmd | |
// >$ ./ping_server.cmd & ./pong_client.cmd | |
// cc -pedantic -Wno-newline-eof -std=c99 ping_pong.c -o pong_ping.cmd | |
// >$ ./pong_ping.cmd | |
// cc -pedantic -Wno-newline-eof -std=c99 ping_pong_macos_gcd.c -o ping_pong_2.cmd | |
// >$ ./ping_pong_2.cmd |
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
import numpy as np | |
# https://arxiv.org/abs/2001.04147 | |
# WEICA: nonlinear weighted ICA | |
# http://ww2.ii.uj.edu.pl/~spurek/publications/WeICA.pdf | |
# I ported this algorithm in C with `few changes` in step 4 and 5 | |
# to avoid terrible cancellation errors happening with single-precision | |
# floats e.g handling (mat_mul) Tall and Skinny matrix with float is always an issue. |
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
import matplotlib.pyplot as plt | |
import matplotlib.collections as collections | |
plt.style.use('bmh') | |
import numpy as np | |
# from scipy.signal import fftconvolve | |
# | |
# pitch_tracking_sine_wave | |
# |
NewerOlder