Special parts needed:
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 requests | |
import ravenclient | |
import time | |
import datetime | |
from bs4 import BeautifulSoup as soup | |
url = 'https://www.mealbookings.cai.cam.ac.uk/?event=455&date=2015-06-09' | |
# line below does non-superhall | |
url = 'https://www.mealbookings.cai.cam.ac.uk/index.php?event=431&date=2015-05-24' |
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
template<int N> | |
std::array<float, N - 1> gradient(const std::array<float, N> &datain, float dx){ | |
std::array<float, N - 1> result; | |
for (unsigned long i = 0; i < N-1; i++){ | |
result[i] = (datain[i] + datain[i + 1]) / dx; | |
} | |
return result; | |
} |
- Install visual studio 2010 C++ express
- Uninstall C++ redistributables (x64 and x86)
- Install windows SDK
- Manually add vcvars file from here
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
[{"tompkins": 64.37, "firsts": 19.8, "name": "Sidney Sussex", "wine": 97507}, {"tompkins": 60.92, "firsts": 15.8, "name": "Newnham", "wine": 27263}, {"tompkins": 64.16, "firsts": 21.4, "name": "Fitzwilliam", "wine": 23028}, {"tompkins": 65.49, "firsts": 25.9, "name": "King's", "wine": 338559}, {"tompkins": 57.92, "firsts": 13.2, "name": "Hughes Hall", "wine": 14033.58}, {"tompkins": 60.51, "firsts": 18.9, "name": "Wolfson", "wine": 39647.1}, {"tompkins": 73.66, "firsts": 41.7, "name": "Trinity", "wine": 223291.98}, {"tompkins": 64.85, "firsts": 21.1, "name": "Caius", "wine": 96994}, {"tompkins": 68.94, "firsts": 28.1, "name": "Trinity Hall", "wine": 127186}, {"tompkins": 65.84, "firsts": 25.1, "name": "St John's", "wine": 260064}, {"tompkins": 66.51, "firsts": 26.9, "name": "St Catharine's", "wine": 62432}, {"tompkins": 66.76, "firsts": 24.7, "name": "Christ's", "wine": 71055}, {"tompkins": 66.05, "firsts": 23.0, "name": "Downing", "wine": 77798}, {"tompkins": 62.92, "firsts": 18.5, "name": "Girton", "wine": |
Want to fork your own gists? No fork button? No problem! Install this user script by clicking refork.user.js' "raw" link down below: ⇓
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
local ItemSet = {} | |
ItemSet.__index = ItemSet | |
ItemSet.new = function(mapping) | |
return setmetatable({mapping=mapping}, ItemSet) | |
end | |
-- internal functions | |
local _useItem = function(self, fn, name) | |
local i = self:slot(name) | |
turtle.select(i) |
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
merge = function(seqs) | |
local res = {} | |
while true do | |
--filter out empty sequences | |
local nonemptyseqs = {} | |
for _, seq in ipairs(seqs) do | |
if #seq > 0 then table.insert(nonemptyseqs, seq) end | |
end | |
--all sequences empty? we're done! | |
if #nonemptyseqs == 0 then return res end |
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
--quick implementation of python's id function. Fails for built in roblox objects | |
id = function(o) | |
return type(o) == "table" and o.__id__ or tonumber(tostring(o):sub(-8, -1). 16) | |
end | |
class = setmetatable({}, { | |
__call = function(_, name, implementer) | |
local cls = {__init__ = function() end, __name__ = name} | |
local instancemt = {} |
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
<snippet> | |
<content><![CDATA[for _, child in pairs(${1:parent}:GetChildren()) do | |
${0} | |
end]]></content> | |
<tabTrigger>children</tabTrigger> | |
<scope>source.lua</scope> | |
<description>iterate children</description> | |
</snippet> |