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
""" | |
Classic cart-pole system implemented by Rich Sutton et al. | |
Copied from http://incompleteideas.net/sutton/book/code/pole.c | |
permalink: https://perma.cc/C9ZM-652R | |
Continuous version by Ian Danforth | |
""" | |
import math | |
import gym |
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
public class Base64 | |
{ | |
public static String encode(byte[] data) | |
{ | |
char[] tbl = { | |
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P', | |
'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f', | |
'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v', | |
'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/' }; |
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
var grunt = require('grunt'); | |
grunt.initConfig({ | |
watch: { | |
php: { | |
files: ['src/**/*php', 'src/**/*js'], | |
tasks: ['default'], | |
options: { |
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
#Kasiski-Babbage cryptanalysis to get the text encripted with Vigenere | |
import fractions | |
import functools | |
import re #Import regular expresions | |
from collections import Counter | |
#---------------------------------------------------------------------------------------------- | |
#Search for the words with the given frecuency and length | |
# @originalString [string]: the original text |
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
MAX_KEY_LENGTH = 20 | |
PEAK_MIN_OFFSET = 4 | |
NUM_LETTERS = 26 | |
FIRST_LETTER = "A" | |
KEY_LENGTH_GUESS = 6 | |
def index_of_coincidence(s, shift): | |
"""Find the index of coincidence of s with itself shifted by shift""" |
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
public class Vigenere | |
{ | |
//declare instance variables for text and keyword | |
private String pt = ""; | |
private String key = ""; | |
Vigenere(){ //default constructor | |
pt = ""; | |
key = ""; | |
} |
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
alpha = 'abcdefghijklmnopqrstuvwxyz' | |
#alpha=[chr(i) for i in range(ord('a'), ord('z')+1)] | |
def codageCesar(t,n,d): | |
resultat = '' | |
alpha2 = alpha[len(alpha)-d:]+alpha[:len(alpha)-d] | |
for lettre in t: | |
resultat = resultat + alpha2[alpha.index(lettre)] | |
return resultat |
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
#!/usr/bin/env xdg-open | |
[Desktop Entry] | |
Version=1.0 | |
Type=Application | |
Name=Sublime Text | |
GenericName=Text Editor | |
Comment=Sophisticated text editor for code, markup and prose | |
Exec=/opt/sublime_text_3/sublime_text %F | |
Icon=/opt/sublime_text_3/Icon/48x48/sublime-text.png | |
Terminal=false |
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
public class Maze { | |
public int counter = 0; | |
public char[][] maze = | |
{{'#', '#', '#', '#', '#', '#', '#', '#', '#', '#'}, | |
{'#', ' ', ' ', ' ', '#', ' ', '#', ' ', ' ', '#'}, | |
{'#', ' ', ' ', ' ', '#', ' ', '#', ' ', '#', '#'}, | |
{'#', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '#'}, |
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
# Install https://github.com/rg3/youtube-dl/ first. | |
youtube-dl http://www.youtube.com/playlist\?list\=PLC0B137D835A3C970 -l --max-quality mp4 |
NewerOlder