Skip to content

Instantly share code, notes, and snippets.

View dionyziz's full-sized avatar
🐼

Dionysis Zindros dionyziz

🐼
View GitHub Profile
#include <cstdio>
using namespace std;
const int MAX_N = 15;
int A[MAX_N];
int n, k;
int main() {
import pprint, math
pp = pprint.PrettyPrinter()
class Piece:
def __init__(self, color):
self.color = color
def __repr__(self):
color_str_from_bool = {
dionyziz@puppy ~ % ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1): 56 data bytes
64 bytes from 1.1.1.1: icmp_seq=0 ttl=59 time=864.718 ms
64 bytes from 1.1.1.1: icmp_seq=1 ttl=59 time=237.562 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=59 time=36.199 ms
64 bytes from 1.1.1.1: icmp_seq=3 ttl=59 time=226.168 ms
64 bytes from 1.1.1.1: icmp_seq=4 ttl=59 time=18.690 ms
64 bytes from 1.1.1.1: icmp_seq=5 ttl=59 time=80.011 ms
Request timeout for icmp_seq 6
64 bytes from 1.1.1.1: icmp_seq=7 ttl=59 time=47.027 ms
import pprint
pp = pprint.PrettyPrinter()
class Piece:
def __init__(self, color):
self.color = color
def __repr__(self):
color_str_from_bool = {
const y = (t) => {
const b = ({b, t}) => {
return (n) => {
const a = () => {
return {b, t}
}
return t(b(a()))(n)
}
}
dionyziz@puppy ~/workspace/recursion-thm (master*) % cat examples/factorial.js
return (n) => {
if (n == 0) {
return 1
}
return n * eval(SELF)(n - 1)
}
dionyziz@puppy ~/workspace/recursion-thm (master*) % node compiler.js < examples/factorial.js > examples/factorial-compiled.js
dionyziz@puppy ~/workspace/recursion-thm (master*) % cat examples/factorial-compiled.js
(SELF => {return (n) => {
(SELF => {console.log(SELF)
})((({BStr, TStr}) => {
const AStr = ((BStr, TStr) => {
const escape = (str) => {
return str.replace(
/\\/g, '\\\\'
).replace(
/`/g, '\\\`'
).replace(
/\$/g, '\\$'
// v1
(w) => (function (w) { return "(w) => (" + w + ")" + "((function (w) { return \"" + w.replace(/\\/g, '\\\\').replace(/"/g, '\\\"') + "\" })(w))" })((function (w) { return "function (w) { return \"(w) => (\" + w + \")\" + \"((function (w) { return \\\"\" + w.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\\\"') + \"\\\" })(w))\" }" })(w))
// v2
(w) => ((w) => "(w) => (" + w + ")" + "(((w) => \"" + w.replace(/\\/g, '\\\\').replace(/"/g, '\\\"') + "\")(w))")(((w) => "(w) => \"(w) => (\" + w + \")\" + \"(((w) => \\\"\" + w.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\\\"') + \"\\\")(w))\"")(w))
class Bank {
constructor() {
this.attacker_balance = 1;
}
withdraw() {
if (this.attacker_balance == 1) {
console.log('Sending ' + this.attacker_balance + ' ETH to attacker');
send_money_to_attacker(this.attacker_balance);
}
import operator
from functools import partial, reduce
def flatten(node):
if not node:
return []
return flatten(node.left) + [node.val] + flatten(node.right)
def rangeSumBST(root, L, R):
return reduce(operator.add,