Skip to content

Instantly share code, notes, and snippets.

View pzp1997's full-sized avatar

Palmer Paul pzp1997

View GitHub Profile
javascript:(function(){document.querySelector('video').playbackRate=parseFloat(prompt('Set the playback speed')||1)})()
javascript:(function(){clearInterval(window.autoscrollerBookmarkTimerID);var s=parseFloat(prompt('Set the scroll frequency in ms'));if(s){window.autoscrollerBookmarkTimerID=setInterval(function(){window.scrollBy(0,1)},s)}})()
javascript:(function(){document.head.appendChild(document.createElement("style")).innerText="html,img,video{-webkit-filter:invert(1)hue-rotate(180deg);filter:invert(1)hue-rotate(180deg)}body{background:#000}"})()
javascript:(function(){if(window.debugBordersStyleNode){document.head.removeChild(window.debugBordersStyleNode);window.debugBordersStyleNode=undefined}else{window.debugBordersStyleNode=document.createElement("style");window.debugBordersStyleNode.innerText="*{border:1px solid red}";document.head.appendChild(window.debugBordersStyleNode)}})()
javascript:!function(d)%7Bd.head.appendChild(d.createElement(%27style%27)).innerText%3D%27html,img,video%7B-webkit-filte
module Main exposing (main)
import Html
windows : List a -> List ( a, a )
windows list =
case list of
x :: ((y :: _) as xs) ->
( x, y ) :: windows xs
public class EuclidAglo {
// cd(x, y, z) <==> (x % z == 0) && (y % z == 0)
// gcd(x, y, z) <==> cd(x, y, z) && (\forall int k;; cd(x, y, k) ==> k <= z)
//@ requires true;
//@ ensures (x % \result == 0) && (y % \result == 0) && (\forall int k;; (x % k == 0) && (y % k == 0) ==> k <= \result);
public static int run(int x, int y) {
int n = x;
int m = y;
//@ maintaining (\forall int z;; ((x % z == 0) && (y % z == 0) && (\forall int k;; (x % k == 0) && (y % k == 0) ==> k <= z)) <==> ((n % z == 0) && (m % z == 0) && (\forall int k;; (n % k == 0) && (m % k == 0) ==> k <= z)));
data Can.Def
= Def (A.Located Name) [Pattern] Can.Expr
| TypedDef (A.Located Name) FreeVars [(Pattern, Type)] Can.Expr Type
data Can.Decls
= Declare Can.Def Can.Decls
| DeclareRec Can.Def [Can.Def] Can.Decls
| SaveTheEnvironment
data ModuleName.Canonical =
// COUNTERS FOR INSTRUMENTATION
var refEqSkippedNodes, refEqSkippedDescendants;
function _VirtualDom_diff(x, y)
{
var patches = [];
refEqSkippedNodes = 0;
refEqSkippedDescendants = 0;
_VirtualDom_diffHelp(x, y, patches, 0);
var canvasWidth = 500;
var canvasHeight = 500;
var g = 0.04;
var playerWidth = 30;
var playerHeight = 50;
var gameState = "start";
var playerX, projectile, balls, numArrowsUsed, startTime, timeElapsed;
reset();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
/* Source: Bootstrap 4.2.1 */
/* BEGIN BOOTSTRAP */
body {
import random
import pandas as pd
# Build data for experiment
def make_experiment(batch_size, group_size):
imgs = list(range(454, 920))
groups = []
for i in range(group_size, len(imgs)):
group = imgs[i - group_size:i]
<!-- You must include this JavaScript file -->
<script src="https://assets.crowd.aws/crowd-html-elements.js"></script>
<!-- For the full list of available Crowd HTML Elements and their input/output documentation,
please refer to https://docs.aws.amazon.com/sagemaker/latest/dg/sms-ui-template-reference.html -->
<!-- You must include crowd-form so that your task submits answers to MTurk -->
<crowd-form answer-format="flatten-objects">
<style media="screen">