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 math import sqrt | |
from rtree import index | |
from itertools import product | |
from PIL import Image | |
from random import shuffle | |
import numpy | |
# granularity of colour comonents | |
component_max = 64 | |
# values each colour component can take |
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 NESS upload marks bongo | |
// @namespace http://www.staff.ncl.ac.uk/christian.perfect | |
// @version 0.1 | |
// @description Set the fields in the NESS upload marks screen. | |
// @match https://ness.ncl.ac.uk/auth/marks/upload.php* | |
// @copyright 2014, Christian Perfect | |
// ==/UserScript== | |
document.querySelector('#ngl4').value=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
Other nonpolar boathouses | |
by Unmellifluously Foreseeable | |
Nonmobility blasphemed borchers nonequivocally, | |
Amid onto refuelling tightroped spiers, | |
Punctured lutanist nonprudently overharshly twistingly nonpestilential some, | |
Rive soothing regorged notwithstanding itinerantly boundingly nonextricably mendeleev! | |
Foreseeing graveled swirl unchancy whichever enormously, | |
Fruitlessly along attrited influence regorged pettit broilingly autarchically jacketless. | |
Various fimbriated cabled beyond suboptically surreptitiously turpentine, |
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
javascript:(function(){if(!window.currentBase) {window.currentBase = 10;}var digits = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';var subdigits = '\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089';var base = undefined;while(isNaN(base)) {base = parseInt(prompt('What base would you like?'));}var sub_base = base==10 ? '' : (base+'').split('').map(function(d){return subdigits[d]}).join('');function parseBaseInt(s,base) {var n = 0;var p = 1;for(var i=s.length-1;i>=0;i--) {n += digits.indexOf(s.charAt(i))*p;p *= base;}return n;}function toBase(n,b) {if(n===0) {return '0';}var s = '';while(n) {var m = n%b;s = digits[m]+s;n = (n-m)/b;}return s;}function comma(n){var re = new RegExp('(['+digits+']{3}(?!.*\\.|$))','g');return n.toString().split('').reverse().join('').replace(re, '$1,').split('').reverse().join('');}function changeBase(s,n,commas,currentBase) {currentBase = parseInt(currentBase) || window.currentBase;if(commas) {n = n.replace(/,/g,'');n = toBase(parseBaseInt(n,window.cu |
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
html.css('em,strong').each do |e| | |
if e.content.split.length <= 3 | |
e.search('//text()').each do |n| | |
if ends_with_space | |
n.content = n.text.gsub(/^\s/,"\u00A0") | |
end | |
n.content = n.text.gsub(/(?<=[\s\u00A0])\s/,"\u00A0") | |
ends_with_space = n.text.match(/\s$/) | |
end | |
end |
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 operator | |
import re | |
import random | |
words = [word.upper() for word in open('words.txt').read().split('\n')[:-1]] | |
class Hangman: | |
finished = False | |
def __init__(self,word): |
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
Album has 638 stickers | |
50 trials for each pool size | |
Collectors Waste Waste per collector | |
1 4054.360000 4054.360000 | |
2 4748.840000 2374.420000 | |
3 5328.000000 1776.000000 | |
4 5586.160000 1396.540000 | |
5 6429.320000 1285.864000 | |
6 6675.840000 1112.640000 | |
7 7084.840000 1012.120000 |
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
Album has 638 stickers | |
50 trials for each pool size | |
Collectors Waste Waste per collector Mean Min bought Mean Max bought | |
1 3921.400000 3921.400000 4559.400000 4559.400000 | |
2 4464.800000 2232.400000 2463.120000 3277.680000 | |
3 5422.080000 1807.360000 2009.160000 2993.760000 | |
4 5517.640000 1379.410000 1592.040000 2582.040000 | |
5 6359.600000 1271.920000 1459.800000 2700.000000 | |
6 6726.600000 1121.100000 1318.200000 2594.760000 | |
7 7176.520000 1025.217143 1213.560000 2506.800000 |
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 itertools import product,groupby | |
import re | |
import sys | |
alphabet = 'abcdefghijklmnopqrstuvwxyz' | |
#each letter is a grid of 6 dots | |
braille = ['100000','101000','110000','110100','100100','111000','111100','101100','011000','011100','100010','101010','110010','110110','100110','111010','111110','101110','011010','011110','100011','101011','011101','110011','110111','100111'] | |
alpha_to_braille = {a:b for a,b in zip(alphabet,braille)} |
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 itertools import product | |
# the size of the grid | |
columns = 5 | |
rows = 5 | |
# the cards we're given | |
cards = [1,2,3,21] | |
def valid_placement(card,place): |
OlderNewer