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
_s2 = {1:1, 3:-1, 5:-1, 7:1} | |
def jacobi(a,n): | |
a = a % n | |
assert(a) | |
res = 1 | |
while not a&1: | |
res *= _s2[n % 8] | |
a = a//2 |
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
from hashlib import sha512,sha1 | |
import random,sys,struct | |
import SocketServer | |
import base64 as b64 | |
import os | |
import hmac | |
from time import time | |
password = open('password.txt','rb').read() | |
flag = open('flag.txt','rb').read() |
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
from hashlib import sha512,sha1 | |
import random,sys,struct | |
import SocketServer | |
import base64 as b64 | |
import os | |
import hmac | |
from time import time | |
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
// Modified version of https://github.com/cdiggins/type-inference/blob/5491b3454e02a86c2b7c7a91882b310fb687fed7/test.ts | |
// that demonstrates the inability to type expressions which require higher ranked types | |
import { TypeInference as ti } from "./type_inference"; | |
import { Myna as m } from "./node_modules/myna-parser/myna"; | |
var verbose = false; | |
// Defines syntax parsers for type expressions and a simple lambda calculus | |
function registerGrammars() |
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
function Child(...args) { | |
const {constructor} = Object.getPrototypeOf(homeObject); | |
const $this = Reflect.construct(constructor, args, new.target); | |
// initialize subclass properties | |
$this.x = 43; | |
return $this; | |
} | |
Object.setPrototypeOf(Child, Base); | |
Object.setPrototypeOf(Child.prototype, Base.prototype); |
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
function Child(...args) { | |
const {constructor} = Object.getPrototypeOf(homeObject); | |
const $this = Reflect.construct(constructor, args); | |
// initialize subclass properties | |
$this.x = 43; | |
return $this; | |
} | |
Object.setPrototypeOf(Child, Base); |
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
function Base() {} | |
Base.prototype.foo = function() {return 'foo in Base';}; | |
Base.bar = function() {return 'bar in Base';}; | |
function Child() {} | |
Object.setPrototypeOf(Child, Base); | |
Object.setPrototypeOf(Child.prototype, Base.prototype); | |
const homeCtor = Child; | |
const homeProto = Child.prototype; |
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
class Base { | |
foo() {return 'foo in Base';} | |
static bar() {return 'bar in Base';} | |
} | |
class Child extends Base { | |
foo() {return super.foo();} | |
static bar() {return super.bar();} | |
} | |
const obj = new Child; |
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
const obj = { | |
msg: 'Hello, ', | |
print() { | |
return this.msg + super.msg; | |
}, | |
}; | |
Object.setPrototypeOf(obj, { | |
msg: 'world!', | |
}); |
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
function Base() {} | |
Base.prototype.foo = function() {return 'foo in Base';}; | |
function Child() {} | |
Object.setPrototypeOf(Child, Base); | |
Object.setPrototypeOf(Child.prototype, Base.prototype); | |
const homeObject = Child.prototype; | |
Child.prototype.foo = function() {return 'foo in Child';}; | |
Child.prototype.bar = function() { |
NewerOlder