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
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.IO.Compression; | |
using System.Security.Cryptography; | |
using System.Text; | |
/// <summary>Utility for analyzing compiled Sourcemod plugins.</summary> | |
/// <remarks> | |
/// Adapted from nosoop's read_sm_plugin.py gist, thanks for making a robust utility that still works after all the years! |
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
#if defined _int64_included | |
#endinput | |
#endif | |
#define _int64_included | |
/// x < y | |
stock bool UInt32LT(int x, int y) { | |
/// why this works: | |
/// 0x80000000 < 0 -> has to be false:: | |
/// (0x80000000^0x80000000) < (0^0x80000000) |
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 <math.h> | |
#include <stdlib.h> | |
#include <inttypes.h> | |
struct Rational { | |
ssize_t numerator; | |
size_t denominator; | |
}; |
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 <math.h> | |
void gaussian(size_t const n, double A[n][n], double v[const restrict]) { | |
for( size_t k = 0; k < n-1; k++ ) { | |
/// Partial pivot | |
double cur_max = fabs(A[k][k]); | |
size_t m = k; | |
for( size_t i = k+1; i < n; i++ ) { | |
double const potential_max = fabs(A[i][k]); |
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> | |
/// a*b = min(a,b) | |
int min(int const a, int const b) { | |
return a < b? a : b; | |
} | |
void print_and(size_t const n, int const set[const static n]) { | |
for( size_t a=0; a < n; a++ ) { | |
for( size_t b=0; b < n; b++ ) { |
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
func epsilon() float64 { | |
eps := 1.0 | |
for eps+1 > 1 { | |
eps /= 2 | |
} | |
eps *= 2 | |
return eps | |
} |
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 <ctype.h> | |
#include <stdlib.h> | |
#include <inttypes.h> | |
#include <stdbool.h> | |
#include <string.h> | |
#include <stdarg.h> | |
#define FOR(counter, limit) for( size_t counter = 0; counter < (limit); counter++ ) |
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 <stdlib.h> | |
#include <stdbool.h> | |
#include <time.h> | |
struct Node { | |
struct Node *prev, *next; | |
int data; | |
}; |
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 <inttypes.h> | |
#include <time.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <string.h> | |
static size_t bits_popcount(uint64_t const x) { | |
size_t count = 0; |
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
# derivative estimator. | |
cont = True | |
while cont: | |
xs, ys = [], [] | |
while True: | |
a = input('enter X: ') | |
if len(a) < 1: | |
break | |
xs.append(float(a)) | |
NewerOlder