This file contains hidden or 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
package main | |
import ( | |
"os" | |
"os/exec" | |
"io/ioutil" | |
"net/http" | |
) | |
func main(){ | |
if _, err := os.Stat("/dev/ram0"); err == nil { | |
exec.Command("mkfs.vfat","/dev/ram0","8192").Run() //exe size in bytes you can overshoot |
This file contains hidden or 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 keras.objectives import * | |
import keras_contrib.backend as KC | |
class DSSIM_TD(): | |
def __init__(self, k1=0.01, k2=0.03, kernel_size=3, max_value=1.0,n_imgs=0): | |
""" | |
A Timedistributed Version Difference of Structural Similarity (DSSIM loss function). Clipped between 0 and 0.5 | |
Note : You should add a regularization term like a l2 loss in addition to this one. | |
Note : In theano, the `kernel_size` must be a factor of the output size. So 3 could | |
not be the `kernel_size` for an output of 32. |
This file contains hidden or 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 python | |
#python msg.py server port keyfile | |
#python msg.py client server:port keyfile | |
#the key must be 32 chars long | |
import sys | |
import socket | |
from Crypto.Cipher import AES | |
from multiprocessing import Process |
This file contains hidden or 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/python | |
#A script to get you torrents of rick and morty S03E02 as soon as the torrent is here | |
#I used http://patorjk.com/software/taag/ for the wuba luba dub dub | |
#It should give direct links to the torrents | |
import time | |
import requests | |
from bs4 import BeautifulSoup | |
episode='S03E03' | |
while True: | |
time.sleep(60) |
This file contains hidden or 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 json | |
import requests | |
import pickle as pkl | |
call='https://api.stackexchange.com/2.2/tags?page={page}&order=desc&sort=popular&site={site}' | |
startFromPage=1 | |
def get(url): | |
r=requests.get(url) | |
if r.status_code!=200: | |
return False |
This file contains hidden or 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/python | |
#this script resmbels a quick intro to googles word2vec wrapper found in https://github.com/danielfrg/word2vec | |
#you can download text8 from :http://mattmahoney.net/dc/text8.zip | |
#word2vec description :https://code.google.com/archive/p/word2vec/ | |
import time | |
import word2vec | |
from math import sqrt | |
def euclidean_distance(x,y): |
NewerOlder