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 canComplete(gas, cost): | |
| # number of stations | |
| total = len(gas) | |
| # Overall iteration count | |
| iteration = 0 | |
| # Current eligible racer | |
| racer = None |
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
| from gevent import monkey, sleep | |
| from gevent.pywsgi import WSGIServer | |
| from flask import Flask | |
| monkey.patch_all() | |
| app = Flask(__name__) | |
| @app.route("/") | |
| def hello(): | |
| print 'request' |
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
| from gevent import monkey, sleep | |
| from gevent.wsgi import WSGIServer | |
| from flask import Flask, request | |
| from random import random | |
| monkey.patch_all() | |
| app = Flask(__name__) | |
| @app.route("/") | |
| def index(): |
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
| ######################################################### | |
| ### A) Installing and loading required packages | |
| ######################################################### | |
| if (!require("gplots")) { | |
| install.packages("gplots", dependencies = TRUE, repos = "http://cran.us.r-project.org") | |
| library(gplots) | |
| } | |
| if (!require("RColorBrewer")) { | |
| install.packages("RColorBrewer", dependencies = TRUE, repos = "http://cran.us.r-project.org") |
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
| // Making an anonymous recursive function | |
| // -------------------------------------- | |
| // 1. Create a basic *named* factorial function, which recursively calls itself | |
| function factorial(n) { | |
| if (n === 0) { | |
| return 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
| module.exports = function (settings) { | |
| settings = config(settings); | |
| settings.store = new MayflyStore(settings); | |
| var sessionMiddleware = session(settings); | |
| return function(req, res, next) { | |
| return sessionMiddleware(function(err) { | |
| if (err) { |
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
| ,"DL1 absolute FC","ΔarcR absolute FC","ΔargR absolute FC","ΔahrC absolute FC" | |
| argC,520.12,420.15,2.62,2.55 | |
| SGO_0177,342.42,77.38,78.53,71.72 | |
| argJ,319.95,325.64,2.13,2.13 | |
| argB,306.44,340.62,2.25,1.95 | |
| argG,269.33,45.37,63.27,62.38 | |
| argD,260.85,315.85,2.16,1.95 | |
| argH,207.89,39.66,53.09,55.01 | |
| SGO_1656,44.43,49.98 ,3.22,3.29 | |
| SGO_1105,28.94,56.81,3.06,3.53 |
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
| ######################################################### | |
| ### A) Installing and loading required packages | |
| ######################################################### | |
| if (!require("gplots")) { | |
| install.packages("gplots", dependencies = TRUE, repos = "http://cran.us.r-project.org") | |
| library(gplots) | |
| } | |
| if (!require("RColorBrewer")) { | |
| install.packages("RColorBrewer", dependencies = TRUE, repos = "http://cran.us.r-project.org") |
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
| var VALID_BOARD = [ | |
| [ 8,9,5,7,4,2,1,3,6 ], | |
| [ 2,7,1,9,6,3,4,8,5 ], | |
| [ 4,6,3,5,8,1,7,9,2 ], | |
| [ 9,3,4,6,1,7,2,5,8 ], | |
| [ 5,1,7,2,3,8,9,6,4 ], | |
| [ 6,8,2,4,5,9,3,7,1 ], | |
| [ 1,5,9,8,7,4,6,2,3 ], | |
| [ 7,4,6,3,2,5,8,1,9 ], |
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
| var VALID_BOARD = [ | |
| [ 8,9,5,7,4,2,1,3,6 ], | |
| [ 2,7,1,9,6,3,4,8,5 ], | |
| [ 4,6,3,5,8,1,7,9,2 ], | |
| [ 9,3,4,6,1,7,2,5,8 ], | |
| [ 5,1,7,2,3,8,9,6,4 ], | |
| [ 6,8,2,4,5,9,3,7,1 ], | |
| [ 1,5,9,8,7,4,6,2,3 ], | |
| [ 7,4,6,3,2,5,8,1,9 ], |