Skip to content

Instantly share code, notes, and snippets.

import sys
from collections import Counter
english_frequencies = [" ","E","T","A","O","I","N","S","R","H","D","L","U","C","M","F","Y","W","G","P","B","V","K","X","Q","J","Z"]
founds = open(sys.argv[1]).read()
grams = int(sys.argv[2])
#preprocess
founds = founds.replace(" ","")
founds = founds.replace('\n', "")
@RdlP
RdlP / cipher
Last active February 22, 2019 18:15
CGZNL YJBEN QYDLQ ZQSUQ NZCYD SNQVU BFGBK GQUQZ QSUQN UZCYD SNJDS UDCXJ ZCYDS NZQSU QNUZB WSBNZ QSUQN UDCXJ CUBGS
BXJDS UCTYV SUJQG WTBUJ KCWSV LFGBK GSGZN LYJCB GJSZD GCHMS UCJCU QJLYS BXUMA UJCJM JCBGZ CYDSN CGKDC ZDSQZ DVSJJ
SNCGJ DSYVQ CGJSO JCUNS YVQZS WALQV SJJSN UBTSX COSWG MTASN BXYBU CJCBG UWBKG JDSQV YDQAS JXBNS OQTYV SKCJD QUDCX
JBXQK BMVWA SNSYV QZSWA LWAKB MVWAS ZBTSS QGWUB BGJDS TSJDB WCUGQ TSWQX JSNRM VCMUZ QSUQN KDBMU SWCJJ BZBTT MGCZQ
JSKCJ DDCUE SGSNQ VUJDS SGZNL YJCBG UJSYY SNXBN TSWAL QZQSU QNZCY DSNCU BXJSG CGZBN YBNQJ SWQUY QNJBX TBNSZ BTYVS
OUZDS TSUUM ZDQUJ DSICE SGNSZ CYDSN QGWUJ CVVDQ UTBWS NGQYY VCZQJ CBGCG JDSNB JULUJ STQUK CJDQV VUCGE VSQVY DQASJ
UMAUJ CJMJC BGZCY DSNUJ DSZQS UQNZC YDSNC USQUC VLANB FSGQG WCGYN QZJCZ SBXXS NUSUU SGJCQ VVLGB ZBTTM GCZQJ CBGUS
ZMNCJ LUDQF SUYSQ NSYNB WMZSW TBUJB XDCUF GBKGK BNFAS JKSSG QGWDC USQNV LYVQL UKSNS TQCGV LZBTS WCSUQ GWDCU JBNCS
UESGN SUDSN QCUSW JBJDS YSQFB XUBYD CUJCZ QJCBG QGWQN JCUJN LALJD SSGWB XJDSU COJSS GJDZS GJMNL GSOJD SKNBJ STQC
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RdlP
RdlP / dct.c
Created November 1, 2017 19:46
Implementation of dct forward and inverse
#include <math.h>
void dct(float *dct_matrix, float *matrix, int N){
int i,j,u,v;
float Cu, Cv;
memset(dct_matrix, 0, N*N*sizeof(float));
float accum = 0;
for (u = 0; u < N; ++u){
for (v = 0; v < N; ++v){
if (u == 0){
#include <sys/types.h>
long ptrace(int param1, pid_t param2, void *param3, void *param4) {
return 0;
}
#include <stdio.h>
#include <sys/ptrace.h>
int main(int argc, char *argv[]) {
if (ptrace(PTRACE_TRACEME, 0, 1, 0) < 0) {
printf("¡Depurador detectado!.\n");
return 1;
}
printf("No hay depurador\n");
void print_tree_iterative(Node *root){
Stack *nodes = (Stack*)malloc(sizeof(Stack));
init_Stack(nodes);
push(nodes, root);
while (!empty(nodes)){
Node * node = pop(nodes);
if (node->right){
memcpy(node->right->code, node->code, node->depth);
node->right->code[node->depth] = 1;
#include <stdio.h>
#include <stdlib.h>
#define STACK_MAXSIZE 50
struct _Stack
{
Node *stk[STACK_MAXSIZE];
int top;
};
void print_tree(Node *root){
if (root->left){
memcpy(root->left->code, root->code, root->depth);
root->left->code[node->depth] = 1;
print_tree(root->left);
}
if (root->right){
memcpy(root->right->code, root->code, root->depth);
root->right->code[node->depth] = 1;
print_tree(root->right);
using UnityEngine;
using System.Collections;
using Emgu.CV;
using Emgu.CV.Util;
using Emgu.CV.UI;
using Emgu.CV.CvEnum;
using Emgu.CV.Structure;
using System.Runtime.InteropServices;
using System;
using UnityEngine.UI;