This is based on two other projects on codepen and is not quite done yet
A Pen by Benjamin Landers on CodePen.
This is based on two other projects on codepen and is not quite done yet
A Pen by Benjamin Landers on CodePen.
app.get('/test', function(req, res) { | |
try{ | |
fields.filter(function(name) { | |
if (thiz.restricted.indexOf(name) !== -1) { | |
throw "401"; | |
} | |
query.where(name).equals(val); | |
}); | |
}catch(e){ | |
res.error(401, 'Field is restricted.'); |
link = document.createElement('a'); | |
link.download = 'name.txt'; | |
link.href = 'data:text/plain;base64,'+btoa('exmaple text\n here') | |
link.click() |
order = enum {greater, equal, lesser} | |
comparator<a> = (a,a)order | |
@assert pure, terminates | |
fn sorted<a>(pair (List<a>,comparator<a>))bool { | |
(l, cmp) = pair | |
if l.length() <= 1 { | |
return true | |
} | |
return cmp(l[0],l[1]) != order.greater & sorted(l.tail()) |
function h(arr, N){ | |
let sum = 0; | |
// the special bounds checks don't include edges | |
for(let i = 2; i <= N-1; i++){ | |
for(let k = 1; k < i; k++){ | |
// if there is not a neighboring zero | |
if(![l(i-1,k),l(i+1,k),l(i-1,k-1),l(i+1,k+1),l(i,k-1),l(i,k+1)].map(j=>arr[j]).reduce((acc,z)=>acc||z===0,false)){ | |
sum += arr[l(i,k)]; | |
} | |
} |
function Exists(fn, range){ | |
return function(item){ | |
for(var i of range){ | |
if(fn(i)(item))return true; | |
} | |
return false; | |
}; | |
} | |
function Some(fn,ranges){ |
"1. ((~C->((~C->~C)->~C))->((~C->(~C->~C))->(~C->~C))) Axiom (A2) | |
2. (~C->((~C->~C)->~C)) Axiom (A1) | |
3. ((~C->(~C->~C))->(~C->~C)) Modus Ponens: 2, 1 | |
4. (~C->(~C->~C)) Axiom (A1) | |
5. (~C->~C) Modus Ponens: 4, 3 | |
6. (~C->(C->~C)) |
function Bus(){ | |
var valueQueue = []; | |
var promiseQueue = []; | |
return { | |
send:function(val){ | |
if(promiseQueue.length != 0){ | |
var toResolve = promiseQueue.shift(); | |
toResolve(val); | |
} else { | |
valueQueue.push(val); |
sub escaped_split { | |
my ($line) = @_; | |
# Free up three characters for temporary replacement | |
$line =~ s/%/%%/g; | |
$line =~ s/#/##/g; | |
$line =~ s/\?/\?\?/g; | |
# replace escaped \'s | |
$line =~ s/\\\\/%#\?/g; |