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 math | |
def find_number(guess,n): | |
lo = 0 | |
hi = 999999 | |
while guess != n: | |
#lo, hi = (guess + 1, hi) if guess < n else (lo, guess - 1) | |
#this if else block replaces that one line. | |
if guess < n: | |
lo = guess + 1 | |
hi = hi |
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
echo(""" | |
<style> | |
table { | |
border-collapse: collapse; | |
border: 1px solid black; | |
} | |
td { | |
border: 1px solid black; | |
width: 60px; | |
height: 60px; |
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
<!doctype html> | |
<html> | |
<head> | |
<!--[if IE]><script src="excanvas.js"></script><![endif]--> | |
<script src="jquery.js"></script> | |
<script> | |
function draw() { | |
function drawTile() { |
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
(function($) { | |
$.fn.heatmap = function(settings) { | |
var config = {'radius': 25, opacity: 0.5, centerValue: 10, | |
gradient : [0,167772262,336396403,504430711,672727155,857605496,1025311865,1193542778,1361445755,1529480062,1714226559,1882326399,2050229378,2218264197,2386232710,2571044231,2739013001,2906982028,3075081868,3243050383,3427796369,3595765395,3763734164,3931768213,4099736983,4284614554,4284745369,4284876441,4285007513,4285138585,4285334937,4285466009,4285597081,4285728153,4285924505,4286055577,4286186649,4286317721,4286514073,4286645145,4286776217,4286907289,4287103641,4287234713,4287365785,4287496857,4287693209,4287824281,4287955353,4288086425,4288283033,4288348568,4288414103,4288545431,4288610966,4288742293,4288807829,4288938900,4289004691,4289135763,4289201554,4289332625,4289398161,4289529488,4289595024,4289726351,4289791886,4289922958,4289988749,4290119820,4290185612,4290316683,4290382218,4290513546,4290579081,4290710409,4290776198,4290841987,4290907777,4290973822,429103961 |
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 base64 | |
from google.appengine.api import datastore | |
from google.appengine.api import datastore_errors | |
from google.appengine.api import datastore_types | |
import hashlib |
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
# http://www.openclipart.org/people/molumen/molumen_white_shark.svg | |
resp.headers['Content-type'] = "image/svg+xml" | |
echo("""<!-- Created with Inkscape (http://www.inkscape.org/) --> | |
<svg | |
xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:cc="http://web.resource.org/cc/" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:svg="http://www.w3.org/2000/svg" | |
xmlns="http://www.w3.org/2000/svg" |
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
echo(""" | |
<!doctype html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> | |
<script> | |
$(function(){ | |
var canvas = $('#canvas')[0] | |
var ctx = canvas.getContext("2d") |
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
echo(""" | |
<!doctype html> | |
<head> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> | |
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script> | |
<script> | |
(function ($) { | |
var initialized = false; | |
var initialized_started = false; |
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
Things that should (or maybe shouldn't be in JavaScript) | |
Tail recursion optimisation | |
Optional Dynamic scope (in addition to its lexical scope) | |
Method Missing es5? | |
method for accessing array elements. | |
call by name ? (maybe a bad idea) | |
see scope chain. | |
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 | |
//Use this script to automatically log into a site and grab protected info. | |
//code modified from | |
// http://www.knowledgesutra.com/forums/topic/38162-automatic-login-using-curl/ | |
//see also | |
//http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/ | |
// INIT CURL | |
$ch = curl_init(); | |
//needed for https | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1); |