_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q10800 | equipFromInventory | train | function equipFromInventory (attributes, index, slotName) {
if (index >= attributes.inventory.length) {
throw new InventoryIndexError(index);
}
var item = attributes.inventory[index];
if (!slotName) {
slotName = item.slot;
}
if (!slotName) {
... | javascript | {
"resource": ""
} |
q10801 | isWearable | train | function isWearable (attributes, index) {
if (index >= attributes.inventory.length) {
throw new InventoryIndexError(index);
}
var item = attributes.inventory[index];
if (!requirements.met(attributes, item.requirements)) {
throw new RequirementsNotMetError();
... | javascript | {
"resource": ""
} |
q10802 | train | function (database, callback) {
var s = this,
querier = s._querier;
querier.connect();
async.waterfall([
function (callback) {
querier.showTables(database, function (err, tables) {
callback(err, tables);
});
... | javascript | {
"resource": ""
} | |
q10803 | train | function (database, table, callback) {
var s = this,
querier = s._querier;
querier.connect();
querier.descTable(database, table, function (err, data) {
| javascript | {
"resource": ""
} | |
q10804 | train | function (database, callback) {
var s = this,
querier = s._querier;
querier.connect();
async.waterfall([
function (callback) {
querier.showTables(database, function (err, tables) {
callback(err, tables);
});
... | javascript | {
"resource": ""
} | |
q10805 | train | function (database, table, callback) {
var s = this,
querier = s._querier;
querier.connect();
querier.selectKeyColumnUsage(database, table, function (err, data) {
querier.disconnect(); | javascript | {
"resource": ""
} | |
q10806 | train | function() {
var block_tpl_content = fs.readFileSync(
path.join(this.opts.templatePath, 'doc-block.hbs'));
this.tpl_block = this.hbs.compile(block_tpl_content.toString());
| javascript | {
"resource": ""
} | |
q10807 | Image | train | function Image() {
if (!this) return new Image();
this.url = null;
EventEmitter.call(this);
setTimeout(function timeout() {
if (this.onerror) this.on('error', | javascript | {
"resource": ""
} |
q10808 | train | function (zaproxy, statusFn, callback) {
var wait = function () {
statusFn(function (err, body) {
if (err) {
callback(err);
return;
}
if (body.status < 100) {
grunt.log.write('.');
| javascript | {
"resource": ""
} | |
q10809 | numberType | train | function numberType(mname, tpe, options) {
const doubles = options.themeDoubles.split(',')
if (doubles | javascript | {
"resource": ""
} |
q10810 | getCurrentConfigs | train | function getCurrentConfigs(bundle) {
dbgHWTest('getCurrentConfigs', bundle.calibrationInfoValid);
var defered = q.defer();
bundle.device.sReadMany(bundle.infoToCache)
.then(function(results) {
// bundle.currentDeviceConfigs
results.forEach(function(result) {
bundle.currentDe... | javascript | {
"resource": ""
} |
q10811 | train | function(bundle_deps) {
var patterns = [
'**',
'!dist/**',
'!plato/**',
'!cov-*/**',
'!test*/**',
'!config/**',
'!output/**',
'!coverage/**',
'!node_modules/**',
'!package.json', // this will be processed
'!Gruntfile.js',
'!Makefile',
'!m... | javascript | {
"resource": ""
} | |
q10812 | reset | train | function reset(schemas) {
var resolver = new Resolver(schemas);
// Reduce force sequential execution.
| javascript | {
"resource": ""
} |
q10813 | resetSchema | train | function resetSchema(result, schema) {
var knex = this.knex;
return knex.schema.hasTable(schema.tableName)
.then(function (exists) | javascript | {
"resource": ""
} |
q10814 | train | function ()
{
var heights = this.s.heights;
var max = 1000000;
heights.virtual = heights.row * this.s.dt.fnRecordsDisplay();
heights.scroll = heights.virtual;
if | javascript | {
"resource": ""
} | |
q10815 | train | function ()
{
var dt = this.s.dt;
var origTable = dt.nTable;
var nTable = origTable.cloneNode( false );
var tbody = $('<tbody/>').appendTo( nTable );
var container = $(
'<div class="'+dt.oClasses.sWrapper+' DTS">'+
'<div class="'+dt.oClasses.sScrollWrapper+'">'+
'<div class="'+dt.oClasses.sScroll... | javascript | {
"resource": ""
} | |
q10816 | train | function ()
{
if ( !this.s.dt.oFeatures.bInfo )
{
return;
}
var
dt = this.s.dt,
language = dt.oLanguage,
iScrollTop = this.dom.scroller.scrollTop,
iStart = Math.floor( this.fnPixelsToRow(iScrollTop, false, this.s.ani)+1 ),
iMax = dt.fnRecordsTotal(),
iTotal = dt.fnRecordsDisplay(),
iPo... | javascript | {
"resource": ""
} | |
q10817 | forEachChildren | train | function forEachChildren(proc, iterator) {
for (let id in proc.children) {
| javascript | {
"resource": ""
} |
q10818 | bindChild | train | function bindChild(proc, model, key, childCmd) {
const { logicClass, updateMsg, createArgs } = childCmd;
const originalModel = model[key];
let actualModel = originalModel || {};
let currProc = procOf(actualModel);
// Protect update of the model of the same type
if (updateMsg && (!currProc || !(currProc.log... | javascript | {
"resource": ""
} |
q10819 | bindComputedFieldCmd | train | function bindComputedFieldCmd(proc, model, key, computeVal) {
const { logger } = proc;
// Create getter function
const isMemoized = computeVal instanceof MemoizedFieldCmd;
const computeFn = isMemoized ? computeVal.computeFn : computeVal;
const safeComputeValue = () => safeExecFunction(logger, computeFn)
co... | javascript | {
"resource": ""
} |
q10820 | runLogicCreate | train | function runLogicCreate(proc, rehydrate) {
const { exec, logic, createArgs, model } = proc;
if (logic.create) {
const commandFactory = () => {
logic.model = !rehydrate ? undefined : model;
| javascript | {
"resource": ""
} |
q10821 | runModelObservers | train | function runModelObservers(proc) {
const observersIterator = (obs) => obs();
maybeForEach(proc.observers, | javascript | {
"resource": ""
} |
q10822 | execTask | train | function execTask(proc, taskObj) {
const { tasks, logger, model, sharedModel, config, logic } = proc;
const { task, executor, notifyCmd, successCmd, failCmd,
customArgs, execEvery, customExecId, id: taskId } = taskObj;
// If not in multi-thread mode or just need to cancel a tak –
// cancel all running task... | javascript | {
"resource": ""
} |
q10823 | train | function(template, map, fallback) {
if (!map)
return template;
return template.replace(/\$\{.+?}/g, (match) => {
| javascript | {
"resource": ""
} | |
q10824 | train | function(address, innerSize, writeValues)
{
return function (lastResults) {
var innerDeferred = q.defer();
var addresses = [];
var values = [];
var directions = [];
var numFrames;
var numValues;
// Flash memory pointer
... | javascript | {
"resource": ""
} | |
q10825 | train | function (name, pkgDir) {
if (!isString(name) || !isString(pkgDir) ||
S(name).isEmpty() || S(pkgDir).isEmpty() || !isDirectory.sync(pkgDir)) {
return 1
}
var scope = utils(name, pkgDir)
| javascript | {
"resource": ""
} | |
q10826 | train | function (name, pkgDir) {
if (!isString(name) || !isString(pkgDir) ||
S(name).isEmpty() || S(pkgDir).isEmpty() || !isDirectory.sync(pkgDir)) {
| javascript | {
"resource": ""
} | |
q10827 | train | function(grunt) {
var me = this;
this.hookChild(
grunt.util,
'spawn',
function(original, spawnArgs) {
var options = spawnArgs[0];
var callback = spawnArgs[1];
if (options.cmd === process.argv[0]) {
var module;
for (var i = 0; i < options.args.length; i++) {
if | javascript | {
"resource": ""
} | |
q10828 | train | function(year, monthIndex) {
if (year.year) {
year = year.year();
monthIndex = year.month();
}
| javascript | {
"resource": ""
} | |
q10829 | train | function(dateString) {
var match = dateString.match(DATE_REGEXP);
var year = this._validateYear(+match[1]);
var month = +match[2];
var isIntercalary = !!match[3];
| javascript | {
"resource": ""
} | |
q10830 | cleanMarks | train | function cleanMarks( o ) {
delete o[randKey];
for ( prop in o ) {
if ( p.hasOwnProperty( prop )
&& get_type( p[prop] ) == 'object'
| javascript | {
"resource": ""
} |
q10831 | match_objects_teardown | train | function match_objects_teardown( o, p, result ) {
if ( get_type( o ) == 'object' ) { cleanMarks( o ); }
if ( get_type( p | javascript | {
"resource": ""
} |
q10832 | query | train | function query( q, limit, offset ) {
var i, _l, res,
strict = true,
reverse = false;
if ( this.length === 0 || arguments.length === 0 ) {
return [];
}
if ( typeof q === 'object' && q != null
&& 'query' in q
&& arguments.l... | javascript | {
"resource": ""
} |
q10833 | wma | train | function wma(close, n = 5) {
let result = []
let len = close.length
if (len === 0 || n <= 0) {
return result
}
let avg = close[0]
result.push(avg)
let T_m = close[0]
let div = n * (n + 1) / 2
for (let i = 1; i < len; i++) {
if (i < n) {
T_m += close[i]
... | javascript | {
"resource": ""
} |
q10834 | ema | train | function ema(close, n = 5) {
let len = close.length
let result = []
if (len === 0 || n <= 0) {
return result
}
let | javascript | {
"resource": ""
} |
q10835 | kdj | train | function kdj(close, high, low, n = 5) {
let len = close.length
let k = []
let d = []
let j = []
if (len === 0 || n <= 0) {
return {k, d, j}
}
let ik = 50
let id = 50
let ij = 50
let rsv = (close[0] - low[0]) * 100 / (high[0] - low[0])
ik = 2 * ik / 3 + rsv / 3
id ... | javascript | {
"resource": ""
} |
q10836 | train | function(location, name) {
this.location = location;
this.name = name;
if (typeof localStorage === 'undefined' || localStorage === null) {
if (this.name) {
this.name = require('sanitize-filename')(this.name, {replacement: '_'});
require('mkdirp').sync(this.location);
}
| javascript | {
"resource": ""
} | |
q10837 | flatten | train | function flatten(matrix) {
const res = [];
// If the given matrix is not a matrix but a scalar.
if (!Array.isArray(matrix)) {
matrix = [
[matrix]
];
}
matrix.forEach((row) => {
// If the given matrix is a vector.
| javascript | {
"resource": ""
} |
q10838 | matrix | train | function matrix(rows, columns, values) {
// console.log(values);
const res = [];
let row = [];
let real;
values.forEach((v, i) => {
if (i % 2 == 0) {
real = v;
} else {
row.push({
real: real,
imag: v
| javascript | {
"resource": ""
} |
q10839 | Client | train | function Client(config) {
RED.nodes.createNode(this, config);
const port = String(Math.floor(Math.random() * (40000 - 30000 + 1)) + 30000);
// Start a DLPA-Node server.
// Options:
// --listen LISTEN Listening port.
// --host HOST Address of the DLPA serve... | javascript | {
"resource": ""
} |
q10840 | Server | train | function Server(config) {
RED.nodes.createNode(this, config);
// Start a DLPA server.
// Options:
// --port PORT Listening port number.
// --clients CLIENTS The number of clicents.
// --max-workers MAX_WORKERS
// The ma... | javascript | {
"resource": ""
} |
q10841 | updateAllDeps | train | function updateAllDeps (pPackageObject, pOutdatedPackages = {}, pOptions = {}) {
return Object.assign(
{},
pPackageObject,
Object.keys(pPackageObject)
.filter(pPkgKey => pPkgKey.includes('ependencies'))
.reduce(
(pAll, pDepKey) => {
| javascript | {
"resource": ""
} |
q10842 | train | function(index)
{
//Check the index value
if(index >= nutty._middlewares.length){ return; }
//Call the middleware
nutty._middlewares[index](args, function(error)
{
//Check for undefined error
if(typeof error === 'undefined'){ var error = null; }
//Check for error
if(error... | javascript | {
"resource": ""
} | |
q10843 | getEntityExtensions | train | function getEntityExtensions(entity) {
// Check if entity passed as instance or class
if (entity instanceof _entt2.default) {
// Return property configuration from instance
| javascript | {
"resource": ""
} |
q10844 | AerospikeStore | train | function AerospikeStore(options){
var self = this;
options = options || {};
Store.call(self,options);
self.prefix = null == options.prefix ? _default_prefix : options.prefix;
self.ns = null == options.ns ? _default_ns : options.ns;
self.st = null == options.st ? _default_set : options.st;
s... | javascript | {
"resource": ""
} |
q10845 | train | function($menu) {
// position to the lower middle of the trigger element
if ($.ui && $.ui.position) {
// .position() is provided as a jQuery UI utility
// (...and it won't work on hidden elements)
$menu.css('display', 'block').position({
... | javascript | {
"resource": ""
} | |
q10846 | train | function(e) {
e.preventDefault();
e.stopImmediatePropagation();
| javascript | {
"resource": ""
} | |
q10847 | train | function(e) {
// show menu
var $this = $(this);
if ($this.data('contextMenuActive') && $currentTrigger && $currentTrigger.length && $currentTrigger.is($this) && !$this.hasClass('context-menu-disabled')) {
| javascript | {
"resource": ""
} | |
q10848 | train | function(e) {
e.stopPropagation();
var opt = $(this).data('contextMenu') || {};
// obtain currently selected menu
if (opt.$selected) {
var $s = opt.$selected;
opt = opt.$selected.parent().data('contextMenu') || {};
opt.$sel... | javascript | {
"resource": ""
} | |
q10849 | train | function(e) {
var $this = $(this).closest('.context-menu-item'),
data = $this.data(),
opt = data.contextMenu,
root = data.contextMenuRoot;
| javascript | {
"resource": ""
} | |
q10850 | train | function(e) {
var $this = $(this),
data = $this.data(),
opt = data.contextMenu,
root = data.contextMenuRoot,
key = data.contextMenuKey,
callback;
// abort if the key is unknown or disabled or is a menu
i... | javascript | {
"resource": ""
} | |
q10851 | gulpResourceHints | train | function gulpResourceHints (opt) {
var options = helpers.options(opt)
helpers.reset()
return new Transform({
objectMode: true,
transform: function (file, enc, cb) {
if (file.isNull()) {
helpers.logger(PLUGIN_NAME, 'no file', true)
cb(null, file)
return
}
var fi... | javascript | {
"resource": ""
} |
q10852 | train | function(key, data, callback) {
'use strict';
/**
* Read scores by values.
*
* @param {Array} values
* @param {Function} callback
*/
var ReadScores = function(values, callback) {
var result = [];
/**
* Get scores recursive.
*/
var GetRecursive = function() {
if (!values.length) {
callb... | javascript | {
"resource": ""
} | |
q10853 | train | function(err, status) {
if (err) {
callback(err);
return;
}
if (status || status === 'OK') {
report.inserted += _.isNumber(status) ? status : 1;
| javascript | {
"resource": ""
} | |
q10854 | mustUnzip | train | function mustUnzip(file, mode){
if (mode){
return mode === 'tgz';
}
var extension = | javascript | {
"resource": ""
} |
q10855 | isDynamicProperty | train | function isDynamicProperty (propertyConfiguration) {
return propertyConfiguration
// Is defined as dynamic
&& propertyConfiguration.dynamic
// Dynamic option value is a function
| javascript | {
"resource": ""
} |
q10856 | train | function(name, language) {
name = (name || 'gregorian').toLowerCase();
language = language || '';
var cal = this._localCals[name + '-' + language];
if (!cal && this.calendars[name]) {
| javascript | {
"resource": ""
} | |
q10857 | train | function(year, month, day, calendar, language) {
calendar = (year != null && year.year ? year.calendar() : (typeof calendar === 'string' ?
| javascript | {
"resource": ""
} | |
q10858 | train | function(digits, powers) {
return function(value) {
var localNumber = '';
var power = 0;
while (value > 0) {
var units = value % 10;
localNumber = (units === 0 ? | javascript | {
"resource": ""
} | |
q10859 | CDate | train | function CDate(calendar, year, month, day) {
this._calendar = calendar;
this._year = year;
this._month = month;
this._day = day;
if (this._calendar._validateLevel === | javascript | {
"resource": ""
} |
q10860 | pad | train | function pad(value, length) {
value = '' + value; | javascript | {
"resource": ""
} |
q10861 | train | function(year, month, day) {
return this._calendar.newDate((year == null | javascript | {
"resource": ""
} | |
q10862 | train | function(year, month, day) {
if (!this._calendar.isValid(year, month, day)) {
throw ($.calendars.local.invalidDate || | javascript | {
"resource": ""
} | |
q10863 | train | function(year) {
var date = this._validate(year, this.minMonth, this.minDay,
$.calendars.local.invalidYear || $.calendars.regionalOptions[''].invalidYear);
| javascript | {
"resource": ""
} | |
q10864 | train | function(year, month) {
var date = this._validate(year, month, this.minDay,
$.calendars.local.invalidMonth | javascript | {
"resource": ""
} | |
q10865 | apply_write | train | function apply_write (key, value, err) {
var _reading = reading[key]
reading[key] = null
| javascript | {
"resource": ""
} |
q10866 | train | function (key, value) {
store[key] = value
//not urgent, but | javascript | {
"resource": ""
} | |
q10867 | send_commands | train | function send_commands(cmds, cb) {
function callback(value) {
if (cb) cb(value)
this.locked = false
}
function run() {
| javascript | {
"resource": ""
} |
q10868 | getDefPath | train | function getDefPath(defPath) {
// if path passed...
if(defPath) {
// if not url and not absolute...
if(!/^https?:/.test(defPath) && !path.isAbsolute(defPath)) {
// normalize path as relative to folder containing node_modules
return path.normalize(path.join(__dirname, '/../../../', defPath));
| javascript | {
"resource": ""
} |
q10869 | truncateSamples | train | function truncateSamples(samples) {
/** @type {number} */
let len = samples.length;
for (let i=0; i<len; i++) {
if (samples[i] > 1) {
| javascript | {
"resource": ""
} |
q10870 | Response | train | function Response(statusCode, headers, body) {
this.statusCode = statusCode;
this.headers = {};
for (var key in headers) | javascript | {
"resource": ""
} |
q10871 | train | function (menu, cmenu) {
var className = cmenu.className;
$.each(cmenu.theme.split(","), function (i, n) {
className += ' ' + cmenu.themePrefix + n;
});
// var $t = $('<div style="background-color:#ffff00; xwidth:200px; height:200px"><table style="" cellspacing=0 ce... | javascript | {
"resource": ""
} | |
q10872 | train | function (obj) {
var cmenu = this;
var label = obj.label;
if (typeof obj === "function") {
obj = {onclick: obj};
} // If passed a simple function, turn it into a property of an object
// Default properties, extended in case properties are passe... | javascript | {
"resource": ""
} | |
q10873 | train | function (cmenu) {
cmenu.shadowObj = $('<div class="' + cmenu.shadowClass + '"></div>').css({
display: 'none',
position: "absolute",
zIndex: 9998,
| javascript | {
"resource": ""
} | |
q10874 | train | function (x, y, e) {
var cmenu = this;
if (cmenu.shadow) {
cmenu.shadowObj.css({
width: (cmenu.menu.width() + cmenu.shadowWidthAdjust) + "px",
| javascript | {
"resource": ""
} | |
q10875 | train | function (clickX, clickY, cmenu, e) {
var x = clickX + cmenu.offsetX;
var y = clickY + cmenu.offsetY;
var h = $(cmenu.menu).height();
var w = $(cmenu.menu).width();
var dir = cmenu.direction;
if (cmenu.constrainToScreen) {
var $w = ... | javascript | {
"resource": ""
} | |
q10876 | train | function () {
var cmenu = this;
if (cmenu.shown) {
if (cmenu.iframe) {
$(cmenu.iframe).hide();
}
if (cmenu.menu) {
cmenu.menu[cmenu.hideTransition](cmenu.hideSpeed, ((cmenu.hideCallback) ? function () {
... | javascript | {
"resource": ""
} | |
q10877 | fnArraySwitch | train | function fnArraySwitch( aArray, iFrom, iTo )
{
var mStore = aArray.splice( iFrom, | javascript | {
"resource": ""
} |
q10878 | train | function( dt, opts )
{
var oDTSettings;
if ( $.fn.dataTable.Api ) {
oDTSettings = new $.fn.dataTable.Api( dt ).settings()[0];
}
// 1.9 compatibility
else if ( dt.fnSettings ) {
// DataTables object, convert to the settings object
oDTSettings = dt.fnSettings();
}
else if ( typeof dt === 'string' ) {
// j... | javascript | {
"resource": ""
} | |
q10879 | train | function ( a )
{
if ( a.length != this.s.dt.aoColumns.length )
{
this.s.dt.oInstance.oApi._fnLog( this.s.dt, 1, "ColReorder - array reorder does not "+
"match known number of columns. Skipping." );
return;
}
for ( var i=0, iLen=a.length ; i<iLen ; i++ )
{
var currIndex = $.inArray( i, a );
i... | javascript | {
"resource": ""
} | |
q10880 | train | function ( oState )
{
var i, iLen, aCopy, iOrigColumn;
var oSettings = this.s.dt;
var columns = oSettings.aoColumns;
oState.ColReorder = [];
/* Sorting */
if ( oState.aaSorting ) {
// 1.10.0-
for ( i=0 ; i<oState.aaSorting.length ; i++ ) {
oState.aaSorting[i][0] = columns[ oState.aaSorting[i][0... | javascript | {
"resource": ""
} | |
q10881 | train | function ( e, nTh )
{
var that = this;
/* Store information about the mouse position */
var target = $(e.target).closest('th, td');
var offset = target.offset();
var idx = parseInt( $(nTh).attr('data-column-index'), 10 );
if ( idx === undefined ) {
return;
}
this.s.mouse.startX = e.pageX;
this.... | javascript | {
"resource": ""
} | |
q10882 | train | function ( e )
{
var that = this;
if ( this.dom.drag === null )
{
/* Only create the drag element if the mouse has moved a specific distance from the start
* point - this allows the user to make small mouse movements when sorting and not have a
* possibly confusing drag element showing up
*/
i... | javascript | {
"resource": ""
} | |
q10883 | train | function ( e )
{
var that = this;
$(document).off( 'mousemove.ColReorder mouseup.ColReorder' );
if ( this.dom.drag !== null )
{
/* Remove the guide elements */
this.dom.drag.remove();
this.dom.pointer.remove();
this.dom.drag = null;
this.dom.pointer = null;
/* Actually do the reorder */
... | javascript | {
"resource": ""
} | |
q10884 | train | function ()
{
var aoColumns = this.s.dt.aoColumns;
this.s.aoTargets.splice( 0, this.s.aoTargets.length );
this.s.aoTargets.push( {
"x": $(this.s.dt.nTable).offset().left,
"to": 0
} );
var iToPoint = 0;
for ( var i=0, iLen=aoColumns.length ; i<iLen ; i++ )
{
/* For the column / header in ques... | javascript | {
"resource": ""
} | |
q10885 | train | function ()
{
var scrolling = this.s.dt.oScroll.sX !== "" || this.s.dt.oScroll.sY !== "";
var origCell = this.s.dt.aoColumns[ this.s.mouse.targetIndex ].nTh;
var origTr = origCell.parentNode;
var origThead = origTr.parentNode;
var origTable = origThead.parentNode;
var cloneCell = $(origCell).clone();
/... | javascript | {
"resource": ""
} | |
q10886 | train | function ()
{
var i, iLen;
for ( i=0, iLen=this.s.dt.aoDrawCallback.length ; i<iLen ; i++ )
{
if ( this.s.dt.aoDrawCallback[i].sName === 'ColReorder_Pre' )
{
this.s.dt.aoDrawCallback.splice( i, 1 );
break;
}
}
| javascript | {
"resource": ""
} | |
q10887 | train | function ()
{
$.each( this.s.dt.aoColumns, function (i, column) {
| javascript | {
"resource": ""
} | |
q10888 | train | function() {
return appdev.getMetadata(['./assets/functions.json']).then(function() {
if (!appdev.client.context['user-claims']) {
grunt.fail.fatal('failed to authenticate to Mozu');
done();
return false;
}
... | javascript | {
"resource": ""
} | |
q10889 | arrDel | train | function arrDel(arr, indexArr) {
// check params
if (arr == null) {
return [];
}else if(Object.prototype.toString.call(arr) !== "[object Array]"){
throw new TypeError('PARAM MUST BE ARRAY');
}
if(indexArr == null){
return arr
}else if(Object.prototype.toString.call(indexArr) !== "[object Array]")... | javascript | {
"resource": ""
} |
q10890 | getGesture | train | function getGesture(gestures, type) {
if (!gestures.length) return;
var types = _.pluck(gestures, 'type');
var index = | javascript | {
"resource": ""
} |
q10891 | timestampsPlugin | train | function timestampsPlugin(schema, options) {
// Add the fields to the schema
schema.add({
createdAt: {
type: Date,
'default': Date.now
},
updatedAt: {
type: Date,
'default': Date.now
},
deletedAt: {
type: Date,
sparse: true
}
});
// Define the pre | javascript | {
"resource": ""
} |
q10892 | train | function(date) {
if (this._calendar.name !== date._calendar.name) {
throw (_exports.local.differentCalendars || _exports.regionalOptions[''].differentCalendars).
replace(/\{0\}/, this._calendar.local.name).replace(/\{1\}/, date._calendar.local.name);
}
var c = (this._... | javascript | {
"resource": ""
} | |
q10893 | train | function(year) {
var date = this._validate(year, this.minMonth, this.minDay,
_exports.local.invalidYear | javascript | {
"resource": ""
} | |
q10894 | train | function(year, ord) {
var m = (ord + this.firstMonth - 2 * this.minMonth) %
this.monthsInYear(year) + this.minMonth;
this._validate(year, m, this.minDay,
| javascript | {
"resource": ""
} | |
q10895 | train | function(year, month, day) {
var date = this._validate(year, month, day,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
return | javascript | {
"resource": ""
} | |
q10896 | train | function(year, month, day) {
var date = this._validate(year, month, day,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
| javascript | {
"resource": ""
} | |
q10897 | train | function(year, month, day) {
this._validate(year, month, day,
| javascript | {
"resource": ""
} | |
q10898 | train | function(date, value, period) {
this._validate(date, this.minMonth, this.minDay,
_exports.local.invalidDate || _exports.regionalOptions[''].invalidDate);
var y = (period === 'y' ? value : date.year());
var m = (period === 'm' ? value : date.month());
var d = (period | javascript | {
"resource": ""
} | |
q10899 | train | function () {
//Get the object
var _this = this;
//Update options
var o = $.AdminLTE.options.controlSidebarOptions;
//Get the sidebar
var sidebar = $(o.selector);
//The toggle button
var btn = $(o.toggleBtnSelector);
//Listen to the click event
btn.on('click'... | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.