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
% Short permutation generator permutations(L,S) is true whenever S is a permutation | |
% of the elements of list L | |
permutations([],[]). | |
permutations( A, [R21 | X ] ) :- | |
append( L, [R21 | R22], A ), | |
append( L, R22, X2), | |
permutations( X2, X). |
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
// ==UserScript== | |
// @name Remove The Register article headline picture | |
// @namespace www.theregister.co.uk | |
// @description Remove headline image from articles | |
// @include http://www.theregister.co.uk/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var img = document.getElementsByClassName("article_img")[0]; |
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
#!/bin/bash | |
# | |
# This is the script I use to convert video files to a format | |
# that my iPad 1 is able to play | |
# | |
# You use this script like this | |
# toipad [-o <output folder>] [FILE]... | |
# where | |
# -o <outputfolder> is optional and tells the destination folder for converted files | |
# |
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
#!/bin/bash | |
# | |
# Often multimedia files downloaded from the internet contain | |
# as part of the filename things like the site from where they came | |
# the local language of the audio and such info that is not useful | |
# when you archive the file to your multimedia repository. | |
# | |
# This script renames a set of files, removing everything that does | |
# not look like part of the file name | |
# |
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
grep "^test\_.*(.*)" log.txt | awk '{ split($0,a,"(") ; split(a[2],b,")") ; print b[1] }' | uniq |
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 os | |
import re | |
import sys | |
import urllib.request | |
from urllib.parse import urlparse, urlunparse, ParseResult, urljoin | |
class M3UFile: | |
x_stream_inf = re.compile(r'#EXT-X-STREAM-INF:(?:.*),RESOLUTION=(\d+)x(\d+)(?:,(?:.*))*') |