id | childId | groupId | sort | type | name |
---|---|---|---|---|---|
1 | 0 | 0 | 1 | text | Top field |
2 | 0 | 0 | 2 | mastergroup | Child 1 |
3 | 0 | 2 | 3 | text | First Name |
4 | 0 | 2 | 4 | text | Last Name |
2 | 1 | 2 | 2 | childgroup | Child 2 |
3 | 1 | 2 | 3 | text | First Name |
4 | 1 | 2 | 4 | text | Last Name |
2 | 2 | 2 | 2 | childgroup | Child 3 |
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
define(function (require) { | |
var a = require('a'), | |
b = require('b'); | |
// explicitly loading module | |
require('c'); | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/bluebird/1.2.2/bluebird.js"></script> | |
<script src="https://rawgithub.com/keithwhor/audiosynth/master/audiosynth.js"></script> | |
<script id="jsbin-javascript"> |
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
// Source: http://stackoverflow.com/a/18729931 | |
function toUTF8Array(str) { | |
var utf8 = []; | |
for (var i=0; i < str.length; i++) { | |
var charcode = str.charCodeAt(i); | |
if (charcode < 0x80) utf8.push(charcode); | |
else if (charcode < 0x800) { | |
utf8.push(0xc0 | (charcode >> 6), | |
0x80 | (charcode & 0x3f)); | |
} |
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
// Source: | |
// http://stackoverflow.com/a/2117523 and | |
// http://stackoverflow.com/a/8809472 | |
function generateUUID() { | |
var d = new Date().getTime(); | |
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = (d + Math.random()*16)%16 | 0; | |
d = Math.floor(d/16); | |
return (c == 'x' ? r : (r&0x7|0x8)).toString(16); | |
}); |
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
// custom assertion library | |
function AssertException(msg) { | |
this.msg = msg || 'AssertException'; | |
}; | |
AssertException.prototype.toString = function () { | |
return 'AssertException: ' + this.msg; | |
}; | |
function assert(exp, msg) { | |
if (!exp) | |
throw new AssertException(msg); |
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
/** | |
* Standard FIFO Queue, implemented with two stacks. | |
* @typedef {Object} Queue | |
* @property {function} enqueue - add an item to the back of the queue | |
* @property {function} dequeue - remove an item from the front of the queue | |
* @property {function} isEmpty - check whether or not the queue is empty | |
*/ | |
/** | |
* Standard FIFO Queue, implemented with two stacks. |
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
// draw a colored rule across the page | |
function drawRule(label, offset, options) { | |
// setting global color enum, step counter, and index | |
window.crColors = window.crColors || ['#000', '#f00', '#0f0', '#00f', '#ff0', '#0ff', '#f0f', '#fff']; | |
window.crStep = window.crStep || 0; | |
window.crOffset = window.crOffset || 0; | |
window.crOffsetScale = 200; | |
window.crIndex = window.crIndex || 9001 | |
// set defaults or compute values |
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
// see http://www.quirksmode.org/js/events_order.html for a fun read | |
// if you're wondering why all the type-coercion b.s., why not, since this function has to exist in the first place | |
function killEvent(e) { | |
e = e || window.event; | |
e.cancelBubble = true; | |
e.returnValue = !true; | |
return !!(e.stopPropagation && (e.stopPropagation() || e.preventDefault())); | |
} |
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 math | |
x1 = int(input('lin beg: ')) | |
x2 = int(input('lin end: ')) | |
y1 = int(input('log beg: ')) | |
y2 = int(input('log end: ')) | |
b = math.log( ( y2 / y1 ) / ( x2 - x1 ) ) | |
a = y2 / math.exp( b * x2 ) |