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
(function() { | |
var root = (typeof exports == 'undefined' ? window : exports); | |
var config = { | |
// Ensure Content-Type is an image before trying to load @2x image | |
// https://github.com/imulus/retinajs/pull/45) | |
check_mime_type: true | |
}; |
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 jsToWorker = (function(win) { | |
var enabled = !!win.Worker, | |
blobBuilder = win.BlobBuilder || win.WebKitBlobBuilder || win.MozBlobBuilder, | |
urlFactory = win.URL || win.webkitURL, | |
stringToBlobUrl; | |
if (!enabled || !urlFactory || (!win.Blob && !blobBuilder)) { | |
var noop = function(){}; | |
noop.enabled = false; |
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
`` 'it' keyword replaces 'this' | |
`` variable declaration ':=' | |
`` lamda function '-->' | |
`` within an object literal ':prop = value' | |
`` loops | |
`` ----------------------------------------------------------------------------- |
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
public class SimulatedAnnealing | |
{ | |
public static final double DEFAULT_TEMPERATURE = 10000; | |
public static final double DEFAULT_COOL_RATE = 0.95; | |
static public double[] optimize(double[][] domain, SolutionCost costF, double stepSize) | |
{ | |
return optimize(domain, costF, DEFAULT_TEMPERATURE, DEFAULT_COOL_RATE, stepSize); | |
} |
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
#! /usr/bin/env python | |
import sys | |
import time | |
import urllib2 | |
from bs4 import BeautifulSoup | |
HOMEPAGE_URL = 'http://stackoverflow.com/' | |
TAG_PAGE_URL = 'http://stackoverflow.com/questions/tagged/web-scraping?sort=newest&pageSize=10' |
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 random | |
rng = random.SystemRandom() | |
TOTAL = 77.28 | |
USER_AGENTS = None | |
def get_agent(): | |
""" |
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
""" | |
Note: There are several variations to do the same thing (see # or). The idea | |
is to choose the best (one or so) of the variations and implement that. I.E. | |
these are different designs possibilities for the API. | |
""" | |
""" | |
Filtering | |
""" |