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 Text.Read (readMaybe) | |
import System.Random | |
import System.IO | |
readGuess :: Integer -> IO Integer | |
readGuess no = do | |
let str = "Please enter your " ++ show no ++ "th guess:" | |
putStr str | |
hFlush stdout -- need that coz we don't print a \n | |
name <- getLine |
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> | |
/* | |
########## | |
# Solves # | |
########## | |
- (Derisis13) nope, OBOE, fixed it just after K0B4MB1 | |
- K0B4MB1 | |
- sparrow |
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> | |
int main() { | |
long admin = 0; | |
long s; | |
char name[100]; | |
fprintf(stdout, "\e[41mDEBUG:\e[49m %p\n", &s); | |
fprintf(stdout, "\e[41mDEBUG:\e[49m %ld %ld\n", sizeof s, sizeof &s); | |
printf("Whats ur name? "); | |
scanf("%100s", name); |
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 <time.h> | |
#include <stdlib.h> | |
#include <string.h> | |
/* | |
########## | |
# SOLVES # | |
########## | |
- sparrow |
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> | |
int main() { | |
int* state = (int*) calloc(sizeof(int),1024); | |
int* admin_flag = &state[1023]; | |
*admin_flag = 0; | |
free(state); | |
char* str = malloc(4096); |
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 <ESP8266WiFi.h> | |
#include <WiFiClient.h> | |
#include <ESP8266WebServer.h> | |
#include <ESP8266mDNS.h> | |
#ifndef STASSID | |
#define STASSID "MY-SSID" | |
#define STAPSK "PASSWORD" | |
#endif |
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
/* | |
Test on how are JS's switch-cases are working. | |
I was in an argument w/ someone saying they turn into jumptables, | |
so I coded this up quickly to check. | |
With a few calls (so JIT won't kick in) it is clear that this executes | |
every case every time we enter the switch, so it is clear that jump tables | |
are not used in general, but they still might be used as an optional optimization, | |
but only when possible. | |
*/ |
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
""" | |
BF interpreter in python, coded in half an hour just for fun | |
Warning! Python 3.10 is required! | |
""" | |
from sys import stdin, stdout | |
class BFPreter: | |
"""BD interpreter for a program""" | |
def __init__(self, program): |
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 subprocess | |
def strings(data): | |
process = subprocess.Popen(["strings"], stdin=subprocess.PIPE,stdout=subprocess.PIPE) | |
print("Created process") | |
process.stdin.write(data) | |
process.stdin.close() |
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 os | |
EXTENSIONS = ("lmu", "ldb", "lmt") | |
GOOD_DATA = { | |
"lmu": b"\x0aLcfMapUnit", | |
"ldb": b"\x0BLcfDataBase", | |
"lmt": b"\x0aLcfMapTree", | |
} |