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
class Jar: | |
def __init__(self,mix): | |
self.mix = mix | |
#Yey map reduce! | |
self.q = reduce(lambda x, y:x+y,map(lambda key:mix[key], mix)) | |
def Likelyhood(self,data): | |
bag, color = data | |
mix = self.hypotheses[hypo][bag] | |
like = mix[color] | |
self.q = self.q -1 |
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 trackConv(google_conversion_id,google_conversion_label){var image=new Image(1,1);image.src="http://www.googleadservices.com/pagead/conversion/"+google_conversion_id+"/?label="+google_conversion_label+"&script=0";console.log(image);} |
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 makeTag(type,content){ | |
return $("<meta property='og:"+type+ "'" +" content='" +content + "'/>"); | |
} | |
jQuery('body').prepend('<div id="ogf"><small>Press enter key to get your meta</small>'+ | |
'<input id="fbtitle" value="Your Title" />'+ | |
'<input id="fbimage" value="Your image url" />'+ | |
'<input id="fburl" value="Your url" />'+ | |
'<input id="fbsite_name" value="Your sitename" />'+ | |
'<input id="fbtype" value="Your type" />'+ | |
'</div>').hide().slideDown(); |
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
#include <stdio.h> | |
// To execute C, please define "int main()" | |
double fac(double n){ | |
if(n == 0){ | |
return 1.0; | |
} | |
return n * fac(n-1); |
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
javascript:(function(){var a=document.head.innerHTML.match(/UA-\d+-\d/); | |
if (a){ | |
b=document.createElement("a"); | |
b.appendChild(document.createTextNode(a)); | |
b.setAttribute("style","background:#000;color:#fff;position:fixed;top:0;font-size:39px"); | |
} | |
else{ | |
b=document.createElement("span"); | |
b.setAttribute("style","color:red;height:50px;display:block;position:fixed;top:0"); | |
b.appendChild(document.createTextNode("no analytics found")); |
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
window.onload = function () { | |
var iframe = document.getElementById('IFwinEdit_Form_303282'); | |
var innerDoc = (iframe.contentDocument) ? iframe.contentDocument : iframe.contentWindow.document; | |
var submit = innerDoc.getElementById('submit'); | |
submit.setAttribute('class', 'subButton'); | |
}; |
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
javascript: (function (e, a, g, h, f, c, b, d) { | |
if (!(f = e.jQuery) || g > f.fn.jquery || h(f)) { | |
c = a.createElement("script"); | |
c.type = "text/javascript"; | |
c.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + g + "/jquery.min.js"; | |
c.onload = c.onreadystatechange = function () { | |
if (!b && (!(d = this.readyState) || d == "loaded" || d == "complete")) { | |
h((f = e.jQuery).noConflict(1), b = 1); | |
f(c).remove() | |
} |
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 scrolled(elementId, scrollHeight, cssAttribute, value) { | |
var el = document.getElementById(elementId); | |
if (window.pageYOffset >= scrollHeight) { | |
el.setAttribute('style', cssAttribute + ':' + value + ';'); | |
} else { | |
el.removeAttribute('style'); | |
} | |
} |
NewerOlder