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 <iostream> | |
#include <random> | |
using namespace std; | |
void obfuscate2double(const char obfuscatedString[], int stringCount, double*& obfuscatedDouble, int& doubleCount) { | |
random_device rd; | |
mt19937 gen(rd()); | |
uniform_int_distribution<> pickRandom(3, 7); |
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
// Hash function by http://blog.naver.com/PostView.nhn?blogId=devmachine&logNo=220952781191 | |
// Hash const by http://www.sysnet.pe.kr/Default.aspx?mode=2&sub=0&pageno=0&detail=1&wid=1223 | |
#include <iostream> | |
using namespace std; | |
constexpr unsigned int HashCode(const char* str) { | |
return str[0] ? static_cast<unsigned int>(str[0]) + 0xEDB8832Full * HashCode(str + 1) : 8603; | |
} |
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 struct import * | |
base64table = """ | |
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ | |
"""[2:-2] | |
def base64encode(string, charset='utf-8'): | |
binariedString = ''.join(map(lambda x: bin(x)[2:].rjust(8,'0'),bytearray(string, charset))) |
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
start, end = [int(x) for x in input().split()] | |
sieve = list(range(0,end+1)) | |
primeList = [2] | |
for i in primeList: | |
for j in range(i*2, end+1, i): | |
sieve[j] = 0 | |
for j in range(i+1, end+1): |
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 Stack: | |
def __init__(self, maximum = 0): | |
self.__currentIdx = -1 | |
self.__list = list() | |
self.__maximum = maximum | |
def push(self, newElement): | |
if(self.__currentIdx + 1 < self.__maximum or self.__maximum == 0): | |
self.__currentIdx += 1 |
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
<script> | |
var prob = 0.8; | |
String.prototype.replaceAt = function(index, character) { | |
return this.substr(0, index) + character + this.substr(index + 1); | |
} | |
function randomRange(n1, n2) { | |
return Math.floor((Math.random() * (n2 - n1 + 1)) + n1); | |
} |
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
<script> | |
function clickme(){ | |
var display = document.getElementById('display'); | |
var sample = {a:1 , b:2 , c:3 , d:{q:1,w:2,e:3,f:{z:'hmm', x:'oh', c:'exe'}}}; | |
var i; | |
var allElement = 'window\r\n'; | |
allElement += inspect(window,1); | |
display.innerText = allElement; |
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 re | |
fileList = ['test.txt'] | |
funcList = { | |
'foo': ['first','second'], | |
'bar': ['hana','dul','saet'] | |
} | |
funcPatternList = ['({})\({}\)'.format(func, ('(.+?),'*len(funcList[func]))[:-1] ) for func in funcList] |
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 re | |
class CodeRefactor(): | |
def __init__(self): | |
pass | |
def __pos2keyRepl(self, m, maxArgs=32): | |
args = funcList[m.group(1)] | |
sub = [ args[key]+'='+val for val, key in zip(m.groups()[1:], range(0,32)) ] | |
return m.group(1)+'('+','.join(sub)+')' |
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 urllib.request, json | |
class Thanos: | |
def __init__(self): | |
print('Bye, World!') | |
self.MAX_RANDOM = 1024 | |
def finger_snap(self, world): |
OlderNewer