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(){"use strict";var BLOCKED_WORDS=["left","right","up","down","start","select","a","b","democracy","anarchy","oligarchy","bureaucracy","monarchy","alt f4","helix"];var BLOCKED_URLS=["nakedjenna","bit.ly","bitly","tinyurl","teespring","youtube.com/user","naked-riley","twitch.tv","ow.ly","steam-games-free","free-steam-games","cheap games"];var MINIMUM_MESSAGE_LENGTH=3;var MAXIMUM_NON_ASCII_CHARACTERS=2;var MINIMUM_DISTANCE_ERROR=2;var myWindow;try{myWindow=unsafeWindow}catch(e){myWindow=window}var $=myWindow.jQuery;var commands_regex=new RegExp("^(("+BLOCKED_WORDS.join("|")+")\\d?)+$","i");function min_edit(a,b){if(a.length===0)return b.length;if(b.length===0)return a.length;var matrix=[];for(var i=0;i<=b.length;i++){matrix[i]=[i]}for(var j=0;j<=a.length;j++){matrix[0][j]=j}for(var i=1;i<=b.length;i++){for(var j=1;j<=a.length;j++){if(b.charAt(i-1)==a.charAt(j-1)){matrix[i][j]=matrix[i-1][j-1]}else{matrix[i][j]=Math.min(matrix[i-1][j-1]+1,Math.min(matrix[i][j-1]+1,matrix[i-1][j]+1))}}}return |
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 count = 0; | |
function nextrow(row) { | |
var i,j; | |
for (i = 0; i < 5; i++) { | |
if (i == 4 && row[i] == 8) { | |
return null; | |
} else if (i == 4 || row[i] < row[i+1] - 1) { | |
row[i]++; | |
for (j=0; j<i; j++) row[j] = j; |
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
$ cargo run | |
Compiling cube v0.0.0 (file:///home/munksgaard/src/piston-examples/gfx_cube) | |
src/main.rs:51:29: 51:50 error: wrong number of lifetime parameters: expected 1, found 0 [E0107] | |
src/main.rs:51 static VERTEX_SRC: &'static gfx::ShaderSource<u8> = shaders! { | |
^~~~~~~~~~~~~~~~~~~~~ | |
src/main.rs:51:29: 51:50 error: wrong number of type arguments: expected 0, found 1 | |
src/main.rs:51 static VERTEX_SRC: &'static gfx::ShaderSource<u8> = shaders! { |
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
/* rndphrase.c | |
* | |
* Author: Philip Munksgaard <pmunksgaard@gmail.com> | |
* Date: 2014-12-29 | |
* | |
* This whole thing is pretty much a direct port of the implementation from | |
* brinchj's original rndphrase.js: | |
* https://github.com/brinchj/rndphrase | |
*/ |
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 | |
# | |
# Wakeup | |
# Author: Philip Munksgaard | |
# Description: Suspends the computer and wakes up at a specified | |
# time and starts playing a song. | |
# Note: does not ensure that sound is on and high enough! | |
wakeuptime=$1 | |
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
### Keybase proof | |
I hereby claim: | |
* I am Munksgaard on github. | |
* I am munksgaard (https://keybase.io/munksgaard) on keybase. | |
* I have a public key whose fingerprint is A8DB 29FF 0D46 722B EC5F 536A 9F88 3D7F D6D9 3E64 | |
To claim this, I am signing this object: |
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/env python2 | |
import urllib2 | |
def main(): | |
f = open('fil', 'r') | |
out = open('out', 'w') | |
for line in f: | |
h = urllib2.urlopen(line) | |
out.write(h.read()) |
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
#![feature(no_std)] | |
#![no_std] | |
#[prelude_import] | |
use std::prelude::v1::*; | |
#[macro_use] | |
extern crate "std" as std; | |
fn main() { | |
let v = | |
<[_] as | |
::std::slice::SliceExt>::into_vec(::std::boxed::Box::new([1, 2])); |
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 Data.List | |
import Text.Printf | |
type Point = (Int, Int) | |
ccw :: Point -> Point -> Point -> Int | |
ccw p1 p2 p3 = (fst p2 - fst p1) * (snd p3 - snd p1) | |
- (snd p2 - snd p1) * (fst p3 - fst p1) | |
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
(defun isInteger (n) | |
(= (round n) n)) | |
(defun isPentagonalNumber (p) | |
(let ((solution (/ (+ 1 (sqrt (+ 1 (* 24 p)))) 6))) | |
(isInteger solution))) | |
(defun test (p) | |
(/ (+ 1 (sqrt (+ 1 (* 24 p)))) 6)) |
OlderNewer