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
/* Modernizr 2.6.2 (Custom Build) | MIT & BSD | |
* Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-flexboxlegacy-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load | |
*/ | |
;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"functi |
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
<?php | |
$url = 'http://api.uwaterloo.ca/public/v1/?key=apikey&'; | |
$url .= 'service=publicationdetails&q='.$_GET['q']; | |
$get = json_decode(file_get_contents($url))->response->data; | |
$data['title'] = $get->Title; | |
$data['authors'] = $get->Authors; | |
$data['approved'] = $get->Approved; | |
$data['abstract'] = $get->Abstract; |
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
<?php | |
$url = 'http://api.uwaterloo.ca/public/v1/?'; | |
$url .= 'key=&service=staffinfo&q='.$q[0]; | |
$get = file_get_contents($url); | |
$json = json_decode($get); | |
$data['name'] = $json->response->data->Name; | |
$data['dept'] = $json->response->data->Department; |
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 java.util.Arrays; | |
/* Copyright (c) 2012 Kevin L. Stern | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
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
<?php | |
/* | |
Usage: |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<test> | |
<case>42</case> | |
</test> |
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
<?php | |
function fch($csm) | |
{ | |
if($csm < 0) | |
$csm += 4294967296.0; | |
$a = (int)fmod($csm, 10); | |
$t = 1; | |
$b = (int)($csm / 10); |
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
/* | |
* Galois linear feedback shift register (LFSR) in Java | |
* Copyright (c) 2012 Nayuki Minase | |
*/ | |
import java.math.BigInteger; | |
import java.util.Random; | |
/** |
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
def bestChange(denominations, amount): | |
if amount == 0: | |
return [] | |
for i in denominations: | |
if i <= amount: | |
return [i] + bestChange(denominations, amount-i) | |
denominations = [100, 50, 20, 10, 5, 2, 1] | |
amount = 109 |
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 | |
# ecole polytechnique - c.durr - 2009 | |
# Kuhn-Munkres, The hungarian algorithm. Complexity O(n^3) | |
# Computes a max weight perfect matching in a bipartite graph | |
# for min weight matching, simply negate the weights. | |
""" Global variables: | |
n = number of vertices on each side | |
U,V vertex sets |