Write a function to detect if correct order of parentheses in a string. Let's assume the string will only ever contain parentheses.
(()) = good
(())) = bad
(()(())) = good
)() = bad
def preprocess(A): | |
return A | |
def solution(mat, i, j, m, n): | |
# write your solution here | |
sum1 = 0 | |
for ix in range(len(mat)): | |
row = mat[ix] | |
for jx in range(len(mat)): | |
column = row[jx] |
git init # create a git repo | |
* git status # show me status of all my stuff | |
* git add . # Add all the files in this folder to my change list | |
* git commit -m "First commit!" # | |
git log # shows you your commits | |
clear # TERMINAL: clear the terminal so you can think | |
git checkout file # reset the file |
onInputUp(cursor: CursorController) { | |
if(this.points.length > 2) { | |
let newStrokes = Array.from(this.strokes); | |
newStrokes.push(this.points); | |
this.setStrokes(newStrokes); | |
} | |
this.points = []; | |
} | |
setStrokes(arr:Array<Array<vec2>>) { |
let scale = 0.5; | |
let ox = deg; | |
let oy = 0; | |
let radians = deg * DEG_TO_RAD; | |
let xx = this.canvas.width * 0.5 + imageWidth * 0.5 * scale + ox; | |
let yy = this.canvas.height * 0.5 + imageHeight * 0.5 * scale + oy; | |
ctx.translate(xx,yy); | |
ctx.rotate(radians); | |
ctx.drawImage(image, 0, 0, imageWidth, imageHeight, -imageWidth * 0.5 * scale, -imageHeight * 0.5 * scale, imageWidth * scale, imageHeight * scale); |
(function loop(){ | |
window.gem = window.gem || $(".header-market-link[href*=gem] .price-right").get()[0] | |
window.gdax = window.gdax || $(".header-market-link[href*=gdax] .price-right").get()[0] | |
let gemPrice = parseFloat(gem.innerText); | |
let gdaxPrice = parseFloat(gdax.innerText); | |
console.log(Math.round(gdaxPrice - gemPrice), Math.round(gemPrice/gdaxPrice * 1000) / 1000) | |
setTimeout(loop, 200) | |
})() |
#define pow2(x) (x * x) | |
const float pi = atan(1.0) * 4.0; | |
const int samples = 25; | |
float gaussian(vec2 i, float sigma) { | |
return 1.0 / (2.0 * pi * pow2(sigma)) * exp(-((pow2(i.x) + pow2(i.y)) / (2.0 * pow2(sigma)))); | |
} | |
vec3 blur(sampler2D sp, vec2 uv, vec2 scale) { |
/** | |
* @copyright 2015 Apple Inc. All rights reserved. | |
* @author [email protected] | |
*/ | |
'use strict'; | |
var cachedValues = {}; | |
/** | |
* Returns URL parameter if available, if not returns `defaultValue` | |
* @param {String} name Name of URL parameter to look for |
/** | |
* A simple "event" emitter for | |
* Dart inspired by the classical | |
* stuff used in JavaScript/ActionScript. | |
*/ | |
library dart_events; | |
class EventEmitter { | |
Map<String, List<Function>> _listeners = new Map<String, List<Function>>(); |
Array.prototype.slice.call(document.querySelectorAll("canvas")).forEach(function(e){ e.parentNode.removeChild(e)}) |