_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q47700 | train | function ( geometry, n ) {
var face, i,
faces = geometry.faces,
vertices = geometry.vertices,
il = faces.length,
totalArea = 0,
cumulativeAreas = [],
vA, vB, vC, vD;
// precompute face areas
for ( i = 0; i < il; i ++ ) {
face = faces[ i ];
if ( face instanceof THREE.Face3 ) {
vA ... | javascript | {
"resource": ""
} | |
q47701 | train | function( geometry ) {
var vertices = [];
for ( var i = 0, il = geometry.faces.length; i < il; i ++ ) {
var n = vertices.length;
var face = geometry.faces[ i ];
if ( face instanceof THREE.Face4 ) {
var a = face.a;
var b = face.b;
var c = face.c;
var d = face.d;
var va = geometry.... | javascript | {
"resource": ""
} | |
q47702 | train | function( ax, ay,
bx, by,
cx, cy,
px, py ) {
var aX, aY, bX, bY;
var cX, cY, apx, apy;
var bpx, bpy, cpx, cpy;
var cCROSSap, bCROSScp, aCROSSbp;
aX = cx - bx; aY = cy - by;
bX = ax - cx; bY = ay - cy;
cX = bx - ax; cY = by - ay;
apx= px -ax; apy= p... | javascript | {
"resource": ""
} | |
q47703 | addVertexEdgeMap | train | function addVertexEdgeMap(vertex, edge) {
if (vertexEdgeMap[vertex]===undefined) {
| javascript | {
"resource": ""
} |
q47704 | levenshteinForStrings | train | function levenshteinForStrings(a, b) {
if (a === b)
return 0;
const tmp = a;
// Swapping the strings so that the shorter string is the first one.
if (a.length > b.length) {
a = b;
b = tmp;
}
let la = a.length,
lb = b.length;
if (!la)
return lb;
if (!lb)
return la;
// Ign... | javascript | {
"resource": ""
} |
q47705 | caverphone | train | function caverphone(rules, name) {
if (typeof name !== 'string')
throw Error('talisman/phonetics/caverphone: the given name is not a string.');
// Preparing the name
name = deburr(name)
.toLowerCase()
.replace(/[^a-z]/g, '');
// Applying the rules
for (let i = 0, l = rules.length; i < l; i++) {... | javascript | {
"resource": ""
} |
q47706 | indexOf | train | function indexOf(haystack, needle) {
if (typeof haystack === 'string')
return haystack.indexOf(needle);
for (let i = 0, j = 0, l = haystack.length, n = needle.length; i < l; i++) {
if (haystack[i] === | javascript | {
"resource": ""
} |
q47707 | matches | train | function matches(a, b) {
const stack = [a, b];
let m = 0;
while (stack.length) {
a = stack.pop();
b = stack.pop();
if (!a.length || !b.length)
continue;
const lcs = (new GeneralizedSuffixArray([a, b]).longestCommonSubsequence()),
length = lcs.length;
if (!length)
con... | javascript | {
"resource": ""
} |
q47708 | customJaroWinkler | train | function customJaroWinkler(options, a, b) {
options = options || {};
const {
boostThreshold = 0.7,
scalingFactor = 0.1
} = options;
if (scalingFactor > 0.25)
throw Error('talisman/metrics/distance/jaro-winkler: the scaling factor should not exceed 0.25.');
if (boostThreshold < 0 || boostThresho... | javascript | {
"resource": ""
} |
q47709 | applyRules | train | function applyRules(rules, stem) {
for (let i = 0, l = rules.length; i < l; i++) {
const [min, pattern, replacement = ''] = rules[i];
if (stem.slice(-pattern.length) === pattern) {
const newStem = stem.slice(0, -pattern.length) + replacement,
| javascript | {
"resource": ""
} |
q47710 | genericVariance | train | function genericVariance(ddof, sequence) {
const length = sequence.length;
if (!length)
throw Error('talisman/stats/inferential#variance: the given list is empty.');
// Returning 0 | javascript | {
"resource": ""
} |
q47711 | genericStdev | train | function genericStdev(ddof, sequence) {
const | javascript | {
"resource": ""
} |
q47712 | withoutTranspositions | train | function withoutTranspositions(maxOffset, maxDistance, a, b) {
// Early termination
if (a === b)
return 0;
const la = a.length,
lb = b.length;
if (!la || !lb)
return Math.max(la, lb);
let cursorA = 0,
cursorB = 0,
longestCommonSubsequence = 0,
localCommonSubstring = 0;
... | javascript | {
"resource": ""
} |
q47713 | withTranspositions | train | function withTranspositions(maxOffset, maxDistance, a, b) {
// Early termination
if (a === b)
return 0;
const la = a.length,
lb = b.length;
if (!la || !lb)
return Math.max(la, lb);
let cursorA = 0,
cursorB = 0,
longestCommonSubsequence = 0,
localCommonSubstring = 0,
... | javascript | {
"resource": ""
} |
q47714 | createContext | train | function createContext(sentence) {
const context = new Array(sentence.length + 4);
context[0] = START[0];
context[1] = START[1];
for (let j = 0, m = sentence.length; j < m; j++)
| javascript | {
"resource": ""
} |
q47715 | transferCase | train | function transferCase(source, target) {
let cased = '';
for (let i = 0, l = target.length; i < l; i++) {
const c = source[i].toLowerCase() === source[i] ?
| javascript | {
"resource": ""
} |
q47716 | nysiis | train | function nysiis(type, name) {
if (typeof name !== 'string')
throw Error('talisman/phonetics/nysiis: the given name is not a string.');
// Preparing the string
name = deburr(name)
.toUpperCase()
.trim()
.replace(/[^A-Z]/g, '');
// Getting the proper patterns
const patterns = PATTERNS[type];
... | javascript | {
"resource": ""
} |
q47717 | frequencies | train | function frequencies(sequence) {
const index = {};
// Handling strings
sequence = seq(sequence);
for (let i = 0, l = sequence.length; i < l; i++) {
const element = | javascript | {
"resource": ""
} |
q47718 | relativeFrequencies | train | function relativeFrequencies(sequence) {
let index,
length;
// Handling the object polymorphism
if (typeof sequence === 'object' && !Array.isArray(sequence)) {
index = sequence;
length = 0;
for (const k in index)
length += index[k];
}
else {
| javascript | {
"resource": ""
} |
q47719 | dunningLogLikelihood | train | function dunningLogLikelihood(a, b, ab, N) {
const p1 = b / N,
p2 = 0.99;
const nullHypothesis = ab * Math.log(p1) + (a - ab) * Math.log(1 - p1),
alternativeHyphothesis = ab * Math.log(p2) | javascript | {
"resource": ""
} |
q47720 | colLogLikelihood | train | function colLogLikelihood(a, b, ab, N) {
const p = b / N,
p1 = ab / a,
p2 = (b - ab) / (N - a);
const summand1 = ab * Math.log(p) + (a - ab) * Math.log(1 - p),
summand2 = (b - ab) * Math.log(p) + (N - a - b + ab) * Math.log(1 - p);
let summand3 = 0;
if (a !== ab)
summand3 = ab * Ma... | javascript | {
"resource": ""
} |
q47721 | train | function( name, value ) {
if ( completed == null ) {
name = requestHeadersNames[ name.toLowerCase() ] =
| javascript | {
"resource": ""
} | |
q47722 | reflowText | train | function reflowText (text, width, gfm) {
// Hard break was inserted by Renderer.prototype.br or is
// <br /> when gfm is true
var splitRe = gfm ? HARD_RETURN_GFM_RE : HARD_RETURN_RE,
sections = text.split(splitRe),
reflowed = [];
sections.forEach(function (section) {
// Split the section by esc... | javascript | {
"resource": ""
} |
q47723 | fixNestedLists | train | function fixNestedLists (body, indent) {
var regex = new RegExp('' +
'(\\S(?: | )?)' + // Last char of current point, plus one or two spaces
// to allow trailing spaces
'((?:' + indent + ')+)' + // Indentation | javascript | {
"resource": ""
} |
q47724 | map | train | function map(tree, method, args) {
| javascript | {
"resource": ""
} |
q47725 | getPredicateFunction | train | function getPredicateFunction(predicate) {
let fn = predicate;
if (_.isString(predicate)) {
| javascript | {
"resource": ""
} |
q47726 | baseStatePredicate | train | function baseStatePredicate(state, full) {
if (full) {
return this.extract(state);
}
// Cache a state predicate function
const fn = getPredicateFunction(state);
return this.flatten(node => {
// | javascript | {
"resource": ""
} |
q47727 | cloneItree | train | function cloneItree(itree, excludeKeys) {
const clone = {};
excludeKeys = _.castArray(excludeKeys);
excludeKeys.push('ref');
_.each(itree, (v, k) => {
| javascript | {
"resource": ""
} |
q47728 | baseState | train | function baseState(node, property, val) {
const currentVal = node.itree.state[property];
if (typeof val !== 'undefined' && currentVal !== val) {
// Update values
node.itree.state[property] = val;
if (property !== 'rendered') {
| javascript | {
"resource": ""
} |
q47729 | resetState | train | function resetState(node) {
_.each(node._tree.defaultState, (val, prop) => {
| javascript | {
"resource": ""
} |
q47730 | run | train | async function run() {
const fetcher = new ChangelogFetcher({ base, futureRelease, futureReleaseTag, labels, owner, repo, token });
const releases = | javascript | {
"resource": ""
} |
q47731 | train | function (element, event) {
var pageX = (event.changedTouches) ? event.changedTouches[0].pageX : event.pageX;
var offsetx = pageX - $(element).offset().left;
if (!ltr) { offsetx = range.width() - offsetx };
if (offsetx | javascript | {
"resource": ""
} | |
q47732 | train | function (score) {
var w = score * itemdata('starwidth') * itemdata('step');
var h = range.find('.rateit-hover');
if (h.data('width') != w) {
range.find('.rateit-selected').hide();
| javascript | {
"resource": ""
} | |
q47733 | getRenderedCenter | train | function getRenderedCenter(target, renderedDimensions){
let pos = target.renderedPosition();
let dimensions = renderedDimensions(target);
let offsetX = dimensions.w / 2; | javascript | {
"resource": ""
} |
q47734 | getRenderedMidpoint | train | function getRenderedMidpoint(target){
let p = target.midpoint();
let pan = target.cy().pan();
let zoom = target.cy().zoom();
| javascript | {
"resource": ""
} |
q47735 | getPopper | train | function getPopper(target, opts) {
let refObject = getRef(target, opts);
let content = getContent(target, | javascript | {
"resource": ""
} |
q47736 | createOptionsObject | train | function createOptionsObject(target, opts) {
let defaults = {
boundingBox : {
top: 0,
left: 0,
right: 0,
bottom: 0,
w: 3,
h: 3,
},
renderedDimensions : () => ({w: 3, h: 3}),
| javascript | {
"resource": ""
} |
q47737 | ensureWindows | train | function ensureWindows () {
if (process.platform !== 'win32') {
log('This tool requires Windows 10.\n')
log('You can run a virtual machine using the free VirtualBox and')
log('the free Windows Virtual Machines found at http://modern.ie.\n')
log('For more information, please see the readme.')
proce... | javascript | {
"resource": ""
} |
q47738 | hasVariableResources | train | function hasVariableResources (assetsDirectory) {
const files = require('fs-extra').readdirSync(assetsDirectory)
const hasScale | javascript | {
"resource": ""
} |
q47739 | executeChildProcess | train | function executeChildProcess (fileName, args, options) {
return new Promise((resolve, reject) => {
const child = require('child_process').spawn(fileName, args, options)
child.stdout.on('data', (data) => log(data.toString()))
child.stderr.on('data', (data) => log(data.toString()))
child.on('exit', (c... | javascript | {
"resource": ""
} |
q47740 | isSetupRequired | train | function isSetupRequired (program) {
const config = dotfile.get() || {}
const hasPublisher = (config.publisher || program.publisher)
const hasDevCert = (config.devCert || program.devCert)
const hasWindowsKit = (config.windowsKit || program.windowsKit)
const hasBaseImage = (config.expandedBaseImage || program.... | javascript | {
"resource": ""
} |
q47741 | wizardSetup | train | function wizardSetup (program) {
const welcome = multiline.stripIndent(function () { /*
Welcome to the Electron-Windows-Store tool!
This tool will assist you with turning your Electron app into
a swanky Windows Store app.
We need to know some settings. We will ask you only once and s... | javascript | {
"resource": ""
} |
q47742 | logConfiguration | train | function logConfiguration (program) {
utils.log(chalk.bold.green.underline('\nConfiguration: '))
utils.log(`Desktop Converter Location: ${program.desktopConverter}`)
utils.log(`Expanded Base Image: ${program.expandedBaseImage}`)
utils.log(`Publisher: | javascript | {
"resource": ""
} |
q47743 | setup | train | function setup (program) {
return new Promise((resolve, reject) => {
if (isSetupRequired(program)) {
// If we're setup, merge the dotfile configuration into the program
defaults(program, dotfile.get())
logConfiguration(program)
resolve()
} else {
// We're not setup, let's do that... | javascript | {
"resource": ""
} |
q47744 | convertWithContainer | train | function convertWithContainer (program) {
return new Promise((resolve, reject) => {
if (!program.desktopConverter) {
utils.log('Could not find the Project Centennial Desktop App Converter, which is required to')
utils.log('run the conversion to appx using a Windows Container.\n')
utils.log('Cons... | javascript | {
"resource": ""
} |
q47745 | specialRequire | train | function specialRequire(name, fromDir) {
if (!fromDir) fromDir = process.cwd();
var paths = Module._nodeModulePaths(fromDir);
var | javascript | {
"resource": ""
} |
q47746 | _transform | train | function _transform() {
var codeIn = $('#codeIn').val();
try {
var codeOut = Streamline.transform(codeIn, {
runtime: _generators ? "generators" : "callbacks",
| javascript | {
"resource": ""
} |
q47747 | onFinished | train | function onFinished (msg, listener) {
if (isFinished(msg) !== false) {
defer(listener, null, | javascript | {
"resource": ""
} |
q47748 | isFinished | train | function isFinished (msg) {
var socket = msg.socket
if (typeof msg.finished === 'boolean') {
// OutgoingMessage
return Boolean(msg.finished || (socket && !socket.writable))
}
if (typeof msg.complete === 'boolean') {
| javascript | {
"resource": ""
} |
q47749 | attachFinishedListener | train | function attachFinishedListener (msg, callback) {
var eeMsg
var eeSocket
var finished = false
function onFinish (error) {
eeMsg.cancel()
eeSocket.cancel()
finished = true
callback(error)
}
// finished on first message event
eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish)
... | javascript | {
"resource": ""
} |
q47750 | attachListener | train | function attachListener (msg, listener) {
var attached = msg.__onFinished
// create a private single listener with queue | javascript | {
"resource": ""
} |
q47751 | createListener | train | function createListener (msg) {
function listener (err) {
if (msg.__onFinished === listener) msg.__onFinished = null
if (!listener.queue) return
var queue = listener.queue
listener.queue = null
| javascript | {
"resource": ""
} |
q47752 | patchAssignSocket | train | function patchAssignSocket (res, callback) {
var assignSocket = res.assignSocket
if (typeof assignSocket !== 'function') return | javascript | {
"resource": ""
} |
q47753 | parseLdOutput | train | function parseLdOutput(output) {
const libraryList = output.split('\n').filter(ln => ln.includes('=>'));
const result = {};
libraryList.forEach(s => {
| javascript | {
"resource": ""
} |
q47754 | BaseNode | train | function BaseNode (nodeId, log, connection, options) {
/**
* Unique current machine name.
* @type {string}
*
* @example
* console.log(node.localNodeId + ' is started')
*/
this.localNodeId = nodeId
/**
* Log for synchronization.
* @type {Log}
*/
this.log = log
/**
* Connection use... | javascript | {
"resource": ""
} |
q47755 | destroy | train | function destroy () {
if (this.connection.destroy) {
this.connection.destroy()
} else if (this.connected) {
this.connection.disconnect('destroy')
}
for (var i = 0; | javascript | {
"resource": ""
} |
q47756 | ServerNode | train | function ServerNode (nodeId, log, connection, options) {
options = merge(options, DEFAULT_OPTIONS)
BaseNode.call(this, nodeId, log, connection, options)
if (this.options.fixTime) {
throw new Error(
| javascript | {
"resource": ""
} |
q47757 | ClientNode | train | function ClientNode (nodeId, log, connection, options) {
options = merge(options, DEFAULT_OPTIONS)
| javascript | {
"resource": ""
} |
q47758 | Log | train | function Log (opts) {
if (!opts) opts = { }
if (typeof opts.nodeId === 'undefined') {
throw new Error('Expected node ID')
}
if (typeof opts.store !== 'object') {
throw new Error('Expected store')
}
if (opts.nodeId.indexOf(' ') !== -1) {
throw new Error('Space is prohibited in node ID')
}
/... | javascript | {
"resource": ""
} |
q47759 | add | train | function add (action, meta) {
if (typeof action.type === 'undefined') {
throw new Error('Expected "type" in action')
}
if (!meta) meta = { }
var newId = false
if (typeof meta.id === 'undefined') {
newId = true
meta.id = this.generateId()
}
if (typeof meta.time === 'undef... | javascript | {
"resource": ""
} |
q47760 | generateId | train | function generateId () {
var now = Date.now()
if (now <= this.lastTime) {
now = this.lastTime
| javascript | {
"resource": ""
} |
q47761 | each | train | function each (opts, callback) {
if (!callback) {
callback = opts
opts = { order: 'created' }
}
var store = this.store
return new Promise(function (resolve) {
function nextPage (get) {
get().then(function (page) {
var result
for (var i = page.entries.length... | javascript | {
"resource": ""
} |
q47762 | WsConnection | train | function WsConnection (url, WS, opts) {
this.connected = false
this.emitter = new NanoEvents()
if (WS) {
this.WS = WS
} else if (typeof WebSocket !== 'undefined') {
this.WS = | javascript | {
"resource": ""
} |
q47763 | isFirstOlder | train | function isFirstOlder (firstMeta, secondMeta) {
if (firstMeta && !secondMeta) {
return false
} else if (!firstMeta && secondMeta) {
return true
}
if (firstMeta.time > secondMeta.time) {
return false
} else if (firstMeta.time < secondMeta.time) {
return true
}
var first = split(firstMeta.... | javascript | {
"resource": ""
} |
q47764 | LoguxError | train | function LoguxError (type, options, received) {
Error.call(this, type)
/**
* Always equal to `LoguxError`. The best way to check error class.
* @type {string}
*
* @example
* if (error.name === 'LoguxError') { }
*/
this.name = 'LoguxError'
/**
* The error code.
* @type {string}
*
... | javascript | {
"resource": ""
} |
q47765 | _getStrategyGrouping | train | function _getStrategyGrouping(_class) {
return function () {
var replicationParams = _.toArray(arguments)
, replication = {"class": _class};
if (_class === methods.withSimpleStrategy.name) {
if (typeof replicationParams[0] === "undefined")
throw new Error("SimpleStrategy requires replic... | javascript | {
"resource": ""
} |
q47766 | _getAndGrouping | train | function _getAndGrouping(type) {
return function () {
var boolean = _.toArray(arguments);
this._statements.push({
grouping: "and",
type: | javascript | {
"resource": ""
} |
q47767 | _attachExecMethod | train | function _attachExecMethod(qb) {
/**
* Create the exec function for a pass through to the datastax driver.
*
* @param `{Object} options` optional argument passed to datastax driver upon query execution
* @param `{Function} cb` => function(err, result) {}
* @returns {Client|exports|module.exports}
*/... | javascript | {
"resource": ""
} |
q47768 | _attachStreamMethod | train | function _attachStreamMethod(qb) {
/**
* Create the stream function for a pass through to the datastax driver,
* all callbacks are defaulted to lodash#noop if not declared.
*
* @param `{Object} options` optional argument passed to datastax driver upon query execution
* @param `{Object} cbs` =>
* {
... | javascript | {
"resource": ""
} |
q47769 | _attachEachRowMethod | train | function _attachEachRowMethod(qb) {
/**
* Create the eachRow function for a pass through to the datastax driver.
*
* @param `{Object} options` optional argument passed to datastax driver upon query execution
* @param `{Function} rowCb` => function(row) {}
* @param `{Function} errorCb` => function(err) ... | javascript | {
"resource": ""
} |
q47770 | _attachBatchMethod | train | function _attachBatchMethod(qb) {
/**
*
* @param options
* @param cassakni
* @param cb
* @returns {Client|exports|module.exports}
*/
qb.batch = function (options, cassakni, cb) {
var _options
, _cassakni
, _cb;
// options is really cassakni, cassakni is cb
if (_.isArray(o... | javascript | {
"resource": ""
} |
q47771 | startWatch | train | function startWatch() {
var rp = path.join(rootPath, '/**/*.md')
watcher | javascript | {
"resource": ""
} |
q47772 | train | function (format) {
return function (data) {
var el = makeElement("img", [ "image-output" ]);
el.src = "data:image/" + format | javascript | {
"resource": ""
} | |
q47773 | resolveExecutablePath | train | async function resolveExecutablePath (cmd) {
let executablePath;
try {
executablePath = await fs.which(cmd);
if (executablePath && await fs.exists(executablePath)) {
return executablePath;
}
} catch (err) {
if ((/not found/gi).test(err.message)) {
log.debug(err);
} else {
| javascript | {
"resource": ""
} |
q47774 | tick | train | function tick() {
var moment = (new Date().getTime() - startDate)/1000;
x | javascript | {
"resource": ""
} |
q47775 | train | function (todo) {
model.remove(todo.id, function () {
todos.splice(todos.indexOf(todo), 1);
if (todo.completed) { | javascript | {
"resource": ""
} | |
q47776 | train | function (query, callback) {
if (!callback) {
return;
}
var todos = data.todos;
callback.call(undefined, todos.filter(function (todo) | javascript | {
"resource": ""
} | |
q47777 | train | function (updateData, callback, id) {
var todos = data.todos;
callback = callback || function () { };
// If an ID was actually given, find the item and update each property
if (id) {
for (var i = 0; i < todos.length; i++) {
if (todos[i].id === id) {
... | javascript | {
"resource": ""
} | |
q47778 | train | function (id, callback) {
var todos = data.todos;
for (var i = 0; i < todos.length; i++) {
if (todos[i].id == id) {
todos.splice(i, 1);
break;
| javascript | {
"resource": ""
} | |
q47779 | render | train | function render() {
return h('div', [
h('input', {
type: 'text', placeholder: 'What is | javascript | {
"resource": ""
} |
q47780 | train | function (title, callback) {
title = title || '';
callback = callback || function () { };
var newItem = {
title: title.trim(),
| javascript | {
"resource": ""
} | |
q47781 | train | function (query, callback) {
var queryType = typeof query;
callback = callback || function () { };
if (queryType === 'function') {
callback = query;
storage.findAll(callback);
} else if (queryType === 'string' || queryType === 'number') {
| javascript | {
"resource": ""
} | |
q47782 | train | function (callback) {
var todos = {
active: 0,
completed: 0,
total: 0
};
storage.findAll(function (data) {
data.forEach(function (todo) {
if (todo.completed) {
todos.completed++;
| javascript | {
"resource": ""
} | |
q47783 | isFileProcessable | train | function isFileProcessable(filepath) {
if (options.fileFilterRegex.length === 0) {
return true;
}
| javascript | {
"resource": ""
} |
q47784 | session | train | async function session(ctx, next) {
ctx.sessionStore = store
if (ctx.session || ctx._session) {
return next()
}
const result = await getSession(ctx)
if (!result) {
return next()
}
addCommonAPI(ctx)
ctx._session = result.session
// more flexible
Object.definePropert... | javascript | {
"resource": ""
} |
q47785 | deferSession | train | async function deferSession(ctx, next) {
ctx.sessionStore = store
// TODO:
// Accessing ctx.session when it's defined is causing problems
// because it has side effect. So, here we use a flag to determine
// that session property is already defined.
if (ctx.__isSessionDefined) {
return ne... | javascript | {
"resource": ""
} |
q47786 | getScriptData | train | function getScriptData(evt) {
//Using currentTarget instead of target for Firefox 2.0's sake. Not
//all old browsers will be supported, but this one was easy enough
//to support and still makes sense.
var node = evt.currentTarget || evt.srcElement;
//Remove t... | javascript | {
"resource": ""
} |
q47787 | completed | train | function completed() {
document.removeEventListener( "DOMContentLoaded", completed, false );
| javascript | {
"resource": ""
} |
q47788 | computePixelPositionAndBoxSizingReliable | train | function computePixelPositionAndBoxSizingReliable() {
// Support: Firefox, Android 2.3 (Prefixed box-sizing versions).
div.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
"box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;" + | javascript | {
"resource": ""
} |
q47789 | compareAscending | train | function compareAscending(a, b) {
return baseCompareAscending(a.criteria, | javascript | {
"resource": ""
} |
q47790 | compareMultipleAscending | train | function compareMultipleAscending(a, b) {
var ac = a.criteria,
bc = b.criteria,
index = -1,
length = ac.length;
while (++index < length) {
var result = baseCompareAscending(ac[index], bc[index]);
if (result) {
return result;
}
}
// Fixes an `Array#sort`... | javascript | {
"resource": ""
} |
q47791 | releaseArray | train | function releaseArray(array) {
array.length = 0;
if (arrayPool.length | javascript | {
"resource": ""
} |
q47792 | releaseObject | train | function releaseObject(object) {
object.criteria = object.value = null;
if (objectPool.length < | javascript | {
"resource": ""
} |
q47793 | shimTrimLeft | train | function shimTrimLeft(string, chars) {
string = string == null ? '' : String(string);
if (!string) {
return string;
}
if (chars == null) {
| javascript | {
"resource": ""
} |
q47794 | shimTrimRight | train | function shimTrimRight(string, chars) {
string = string == null ? '' : String(string);
if (!string) {
return string;
}
if (chars == null) {
| javascript | {
"resource": ""
} |
q47795 | trimmedLeftIndex | train | function trimmedLeftIndex(string) {
var index = -1,
length = string.length;
while (++index < length) {
var c = string.charCodeAt(index);
if (!((c <= 160 && (c >= 9 && c <= 13) || c == 32 || c == 160) || c == 5760 || c == 6158 ||
| javascript | {
"resource": ""
} |
q47796 | trimmedRightIndex | train | function trimmedRightIndex(string) {
var index = string.length;
while (index--) {
var c = string.charCodeAt(index);
if (!((c <= 160 && (c >= 9 && c <= 13) || c == 32 || c == 160) || c == 5760 || c == 6158 ||
(c >= 8192 && | javascript | {
"resource": ""
} |
q47797 | baseEach | train | function baseEach(collection, callback) {
var index = -1,
iterable = collection,
length = collection ? collection.length : 0;
if (typeof length == 'number') {
if (support.unindexedChars && isString(iterable)) {
iterable = iterable.split('');
}
while (++... | javascript | {
"resource": ""
} |
q47798 | baseEachRight | train | function baseEachRight(collection, callback) {
var iterable = collection,
length = collection ? collection.length : 0;
if (typeof length == 'number') {
if (support.unindexedChars && isString(iterable)) {
iterable = iterable.split('');
}
while (length--) {
| javascript | {
"resource": ""
} |
q47799 | baseForOwn | train | function baseForOwn(object, callback) {
var index = -1,
props = keys(object),
length = props.length;
| javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.