_id stringlengths 2 6 | title stringlengths 0 58 | partition stringclasses 3
values | text stringlengths 27 233k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q18400 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.SENSING_CURRENT,
"args0": [
{
"type": "field_dropdown",
"name": "CURRENTMENU",
"options": [
[Blockly.Msg.SENSING_CURRENT_YEAR, 'YEAR'],
[Blockly.Msg.SENSING_CURRENT_MONTH, 'MONTH'],
... | javascript | {
"resource": ""
} | |
q18401 | train | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_dropdown",
"name": "SOUND_MENU",
"options": [
['1', '0'],
['2', '1'],
['3', '2'],
['4', '3'],
['5', '4'],
['6', '5'],
... | javascript | {
"resource": ""
} | |
q18402 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.SOUND_SETEFFECTO,
"args0": [
{
"type": "field_dropdown",
"name": "EFFECT",
"options": [
[Blockly.Msg.SOUND_EFFECTS_PITCH, 'PITCH'],
[Blockly.Msg.SOUND_EFFECTS_PAN, 'PAN']
]
... | javascript | {
"resource": ""
} | |
q18403 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.SOUND_CHANGEEFFECTBY,
"args0": [
{
"type": "field_dropdown",
"name": "EFFECT",
"options": [
[Blockly.Msg.SOUND_EFFECTS_PITCH, 'PITCH'],
[Blockly.Msg.SOUND_EFFECTS_PAN, 'PAN']
]
... | javascript | {
"resource": ""
} | |
q18404 | train | function (str) {
str = str.split('Blockly.Msg.')[1].split(' ');
return {
key: str[0],
value: str
.splice(2, str.length)
.join(' ')
| javascript | {
"resource": ""
} | |
q18405 | train | function() {
this.jsonInit({
"type": "control_if_else",
"message0": Blockly.Msg.CONTROL_IF,
"message1": "%1",
"message2": Blockly.Msg.CONTROL_ELSE,
"message3": "%1",
"args0": [
{
"type": "input_value",
"name": "CONDITION",
"check": "Boolean"
... | javascript | {
"resource": ""
} | |
q18406 | train | function() {
var ALL_SCRIPTS = 'all';
var THIS_SCRIPT = 'this script';
var OTHER_SCRIPTS = 'other scripts in sprite';
var stopDropdown = new Blockly.FieldDropdown(function() {
if (this.sourceBlock_ &&
this.sourceBlock_.nextConnection &&
this.sourceBlock_.nextConnection.isConnec... | javascript | {
"resource": ""
} | |
q18407 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.CONTROL_REPEATUNTIL,
"message1": "%1",
"message2": "%1",
"lastDummyAlign2": "RIGHT",
"args0": [
{
"type": "input_value",
"name": "CONDITION",
"check": "Boolean"
}
],
"args1": ... | javascript | {
"resource": ""
} | |
q18408 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.DATA_SHOWVARIABLE,
"args0": [
{
"type": "field_variable",
"name": "VARIABLE"
}
| javascript | {
"resource": ""
} | |
q18409 | train | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_numberdropdown",
"name": "INDEX",
"value": "1",
"min": 1,
"precision": 1,
"options": [
["1", "1"],
| javascript | {
"resource": ""
} | |
q18410 | train | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_numberdropdown",
"name": "INDEX",
"value": "1",
"min": 1,
"precision": 1,
"options": [
["1", "1"],
| javascript | {
"resource": ""
} | |
q18411 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.DATA_ITEMOFLIST,
"args0": [
{
"type": "input_value",
"name": "INDEX"
},
{
"type": "field_variable",
"name": "LIST",
"variableTypes": [Blockly.LIST_VARIABLE_TYPE]
}
| javascript | {
"resource": ""
} | |
q18412 | train | function(options) {
var fieldName = 'VARIABLE';
if (this.isCollapsed()) {
return;
}
var currentVarName = this.getField(fieldName).text_;
if (!this.isInFlyout) {
var variablesList = this.workspace.getVariablesOfType('');
variablesList.sort(function(a, b) {
return Blockly.scr... | javascript | {
"resource": ""
} | |
q18413 | train | function(options) {
var fieldName = 'LIST';
if (this.isCollapsed()) {
return;
}
var currentVarName = this.getField(fieldName).text_;
if (!this.isInFlyout) {
var variablesList = this.workspace.getVariablesOfType('list');
for (var i = 0; i < variablesList.length; i++) {
var v... | javascript | {
"resource": ""
} | |
q18414 | checkConnection_ | train | function checkConnection_(yIndex) {
var dx = currentX - db[yIndex].x_;
var dy = currentY - db[yIndex].y_;
var r = Math.sqrt(dx * dx + dy * dy);
| javascript | {
"resource": ""
} |
q18415 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.MOTION_TURNRIGHT,
"args0": [
{
"type": "field_image",
"src": Blockly.mainWorkspace.options.pathToMedia + "rotate-right.svg",
| javascript | {
"resource": ""
} | |
q18416 | train | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_dropdown",
"name": "TOWARDS",
"options": [
[Blockly.Msg.MOTION_POINTTOWARDS_POINTER, '_mouse_'],
[Blockly.Msg.MOTION_POINTTOWARDS_RANDOM, '_random_']
]
... | javascript | {
"resource": ""
} | |
q18417 | train | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_dropdown",
"name": "TO",
"options": [
[Blockly.Msg.MOTION_GOTO_POINTER, '_mouse_'],
[Blockly.Msg.MOTION_GOTO_RANDOM, '_random_']
]
}
| javascript | {
"resource": ""
} | |
q18418 | train | function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "field_dropdown",
"name": "TO",
"options": [
[Blockly.Msg.MOTION_GLIDETO_POINTER, '_mouse_'],
[Blockly.Msg.MOTION_GLIDETO_RANDOM, '_random_']
]
}
| javascript | {
"resource": ""
} | |
q18419 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.MOTION_SETROTATIONSTYLE,
"args0": [
{
"type": "field_dropdown",
"name": "STYLE",
"options": [
[Blockly.Msg.MOTION_SETROTATIONSTYLE_LEFTRIGHT, 'left-right'],
[Blockly.Msg.MOTION_SETROTATIONS... | javascript | {
"resource": ""
} | |
q18420 | train | function() {
this.jsonInit({
"message0": Blockly.Msg.MOTION_ALIGNSCENE,
"args0": [
{
"type": "field_dropdown",
"name": "ALIGNMENT",
"options": [
[Blockly.Msg.MOTION_ALIGNSCENE_BOTTOMLEFT, 'bottom-left'],
[Blockly.Msg.MOTION_ALIGNSCENE_BOTTOMR... | javascript | {
"resource": ""
} | |
q18421 | validateStartEnd | train | function validateStartEnd(start, end) {
if (!start || !start.isValid) {
return new Invalid("missing or invalid start");
} else if (!end || !end.isValid) {
return new Invalid("missing or invalid end");
} else if (end < start) {
return new Invalid(
"end before start",
`The end | javascript | {
"resource": ""
} |
q18422 | clone | train | function clone(dur, alts, clear = false) {
// deep merge for vals
const conf = {
values: clear ? alts.values : Object.assign({}, dur.values, alts.values || {}),
loc: | javascript | {
"resource": ""
} |
q18423 | possiblyCachedWeekData | train | function possiblyCachedWeekData(dt) {
if (dt.weekData === null) {
dt.weekData = | javascript | {
"resource": ""
} |
q18424 | clone | train | function clone(inst, alts) {
const current = {
ts: inst.ts,
zone: inst.zone,
c: inst.c,
o: inst.o,
loc: inst.loc,
invalid: inst.invalid | javascript | {
"resource": ""
} |
q18425 | tsToObj | train | function tsToObj(ts, offset) {
ts += offset * 60 * 1000;
const d = new Date(ts);
return {
year: d.getUTCFullYear(),
month: d.getUTCMonth() + 1,
day: d.getUTCDate(),
hour: | javascript | {
"resource": ""
} |
q18426 | adjustTime | train | function adjustTime(inst, dur) {
const oPre = inst.o,
year = inst.c.year + dur.years,
month = inst.c.month + dur.months + dur.quarters * 3,
c = Object.assign({}, inst.c, {
year,
month,
day: Math.min(inst.c.day, daysInMonth(year, month)) + dur.days + dur.weeks * 7
}),
millisToAdd ... | javascript | {
"resource": ""
} |
q18427 | parseDataToDateTime | train | function parseDataToDateTime(parsed, parsedZone, opts, format, text) {
const { setZone, zone } = opts;
if (parsed && Object.keys(parsed).length !== 0) {
const interpretationZone = parsedZone || zone,
inst = DateTime.fromObject(
Object.assign(parsed, opts, {
zone: interpretationZone,
... | javascript | {
"resource": ""
} |
q18428 | normalizeUnit | train | function normalizeUnit(unit) {
const normalized = {
year: "year",
years: "year",
month: "month",
months: "month",
day: "day",
days: "day",
hour: "hour",
hours: "hour",
minute: "minute",
minutes: "minute",
second: "second",
seconds: "second",
millisecond: "millisecon... | javascript | {
"resource": ""
} |
q18429 | execFile | train | function execFile(cmd, args, opts) {
const deferred = Q.defer();
childProcess.execFile(cmd, args, opts, function(err, stdout, stderr) {
if (err) {
console.error("Error executing " + cmd + " " + args.join(" "));
console.error(stdout + stderr);
| javascript | {
"resource": ""
} |
q18430 | readPNG | train | function readPNG(file) {
const deferred = Q.defer();
const onerror = deferred.reject.bind(deferred);
const stream = fs.createReadStream(file);
stream.on("error", onerror);
pngparse.parseStream(stream, function(err, image) {
if (err) {
console.log("Failed to load " | javascript | {
"resource": ""
} |
q18431 | fftImage | train | function fftImage(image) {
const real = createMatrix();
const imag = createMatrix();
let idx = 0;
const nchan = image.channels;
const alphachan = 1 - (nchan % 2);
const colorchan = nchan - alphachan;
for (let y = 0; y < image.height; ++y) {
for (let x = 0; x < image.width; ++x) {
... | javascript | {
"resource": ""
} |
q18432 | createConfig | train | function createConfig(target /*: Target */, dev /*: boolean */,
minimize /*: boolean */) /*: Object */ {
const cssLoaders /*: Array<Object> */ = [{loader: 'css-loader'}];
if (minimize) {
cssLoaders[0].options = {importLoaders: 1};
cssLoaders.push({
loader: 'postcss-loader',
... | javascript | {
"resource": ""
} |
q18433 | train | function (tokens, stateMachine) {
// Recreate the argument string from KaTeX's array of tokens.
var str = "";
var expectedLoc = tokens[tokens.length - 1].loc.start
for (var i = tokens.length - 1; i >= 0; i--) {
if(tokens[i].loc.start > expectedLoc) {
// context.consumeArgs has eaten a spac... | javascript | {
"resource": ""
} | |
q18434 | execFile | train | function execFile(cmd, args, opts) {
return new Promise(function(resolve, reject) {
childProcess.execFile(cmd, args, opts, function(err, stdout, stderr) {
if (err) {
console.error("Error executing " + cmd + " " + args.join(" "));
console.error(stdout + stderr);
... | javascript | {
"resource": ""
} |
q18435 | getNormalizedPrimitive2D | train | function getNormalizedPrimitive2D ({ positions, cells, normals, uvs }, opt = {}) {
// Default to assuming the positions are a unit circle/box/etc
normals = normals ? expandVectorList(normals) : positions.map(p => vec3.normalize([], expandVector(p)));
// Planar UV across bounding box of mesh
uvs = uvs ||... | javascript | {
"resource": ""
} |
q18436 | getNormalizedPrimitive3D | train | function getNormalizedPrimitive3D ({ positions, cells, normals, uvs }, opt = {}) {
return {
positions, | javascript | {
"resource": ""
} |
q18437 | train | function(attributeName, skip) {
var skipDequantization = true;
if (typeof skip !== 'undefined')
skipDequantization = skip;
| javascript | {
"resource": ""
} | |
q18438 | initSymbols | train | function initSymbols() {
var i;
var symlen = AMsymbols.length;
for (i=0; i<symlen; i++) {
if (AMsymbols[i].tex) {
AMsymbols.push({input:AMsymbols[i].tex,
| javascript | {
"resource": ""
} |
q18439 | cpTypes | train | function cpTypes(typeAsset) {
const {dir, base} = path.parse(typeAsset);
let destDir = dir.split('build/types/')[1];
destDir = destDir.split('/');
destDir.splice(2, 0, 'dist');
destDir = | javascript | {
"resource": ""
} |
q18440 | templateParametersGenerator | train | function templateParametersGenerator (compilation, assets, assetTags, options) {
const xhtml = options.xhtml;
assetTags.headTags.toString = function () {
return this.map((assetTagObject) => htmlTagObjectToString(assetTagObject, xhtml)).join('');
};
assetTags.bodyTags.toString = function () {
return this... | javascript | {
"resource": ""
} |
q18441 | createHtmlTagObject | train | function createHtmlTagObject (tagName, attributes, innerHTML) {
return {
tagName: tagName,
voidTag: voidTags.indexOf(tagName) !== -1, | javascript | {
"resource": ""
} |
q18442 | extractHelperFilesFromCompilation | train | function extractHelperFilesFromCompilation (mainCompilation, childCompilation, filename, childEntryChunks) {
const helperAssetNames = childEntryChunks.map((entryChunk, index) => {
return mainCompilation.mainTemplate.hooks.assetPath.call(filename, {
hash: childCompilation.hash,
chunk: entryChunk,
... | javascript | {
"resource": ""
} |
q18443 | getChildCompiler | train | function getChildCompiler (mainCompiler) {
const cachedChildCompiler = childCompilerCache.get(mainCompiler);
if (cachedChildCompiler) { | javascript | {
"resource": ""
} |
q18444 | clearCache | train | function clearCache (mainCompiler) {
const childCompiler = getChildCompiler(mainCompiler);
// If this childCompiler was already | javascript | {
"resource": ""
} |
q18445 | addTemplateToCompiler | train | function addTemplateToCompiler (mainCompiler, templatePath) {
const childCompiler = getChildCompiler(mainCompiler);
const isNew | javascript | {
"resource": ""
} |
q18446 | compileTemplate | train | function compileTemplate (templatePath, outputFilename, mainCompilation) {
const childCompiler = getChildCompiler(mainCompilation.compiler);
return childCompiler.compileTemplates(mainCompilation).then((compiledTemplates) => {
if (!compiledTemplates[templatePath]) console.log(Object.keys(compiledTemplates), temp... | javascript | {
"resource": ""
} |
q18447 | hasOutDatedTemplateCache | train | function hasOutDatedTemplateCache (mainCompilation) {
const childCompiler = getChildCompiler(mainCompilation.compiler);
/**
* @type {WeakMap<HtmlWebpackChildCompiler, boolean>|undefined}
*/
let hasOutdatedChildCompilerDependenciesMap = hasOutdatedCompilationDependenciesMap.get(mainCompilation);
// Create ... | javascript | {
"resource": ""
} |
q18448 | isChildCompilerCacheOutdated | train | function isChildCompilerCacheOutdated (mainCompilation, childCompiler) {
// If the compilation was never run there is no invalid cache
if (!childCompiler.compilationStartedTimestamp) {
return false;
}
// Check if any dependent file was changed after the last compilation
const fileTimestamps = mainCompilat... | javascript | {
"resource": ""
} |
q18449 | getHtmlWebpackPluginHooks | train | function getHtmlWebpackPluginHooks (compilation) {
let hooks = htmlWebpackPluginHooksMap.get(compilation);
// Setup the | javascript | {
"resource": ""
} |
q18450 | createHtmlWebpackPluginHooks | train | function createHtmlWebpackPluginHooks () {
return {
beforeAssetTagGeneration: new AsyncSeriesWaterfallHook(['pluginArgs']),
alterAssetTags: new AsyncSeriesWaterfallHook(['pluginArgs']),
alterAssetTagGroups: new AsyncSeriesWaterfallHook(['pluginArgs']),
| javascript | {
"resource": ""
} |
q18451 | scrollInterpolator1 | train | function scrollInterpolator1 (index, carouselProps) {
const range = [3, 2, 1, 0, -1];
const inputRange = getInputRangeFromIndexes(range, index, | javascript | {
"resource": ""
} |
q18452 | flattenValues | train | function flattenValues (report) {
if (Object.prototype.toString.call(report.values) === '[object Array]') | javascript | {
"resource": ""
} |
q18453 | train | function(key, optionalDefaultValue) {
var data = this.storage.read(this._namespacePrefix + key)
| javascript | {
"resource": ""
} | |
q18454 | train | function(callback) {
var self = this
this.storage.each(function(val, namespacedKey) {
| javascript | {
"resource": ""
} | |
q18455 | super_fn | train | function super_fn() {
if (!oldFn) { return }
each(arguments, function(arg, i) {
| javascript | {
"resource": ""
} |
q18456 | set | train | function set(super_fn, key, val) {
var oldVal = this.get(key)
| javascript | {
"resource": ""
} |
q18457 | fixShortcut | train | function fixShortcut(name) {
if(isMac) {
name = name.replace("Ctrl", "Cmd");
} else {
name = | javascript | {
"resource": ""
} |
q18458 | getState | train | function getState(cm, pos) {
pos = pos || cm.getCursor("start");
var stat = cm.getTokenAt(pos);
if(!stat.type) return {};
var types = stat.type.split(" ");
var ret = {},
data, text;
for(var i = 0; i < types.length; i++) {
data = types[i];
if(data === "strong") {
ret.bold = true;
} else if(data === "v... | javascript | {
"resource": ""
} |
q18459 | toggleCodeBlock | train | function toggleCodeBlock(editor) {
var fenceCharsToInsert = editor.options.blockStyles.code;
function fencing_line(line) {
/* return true, if this is a ``` or ~~~ line */
if(typeof line !== "object") {
throw "fencing_line() takes a 'line' object (not a line number, or line text). Got: " + typeof line + ": " ... | javascript | {
"resource": ""
} |
q18460 | drawLink | train | function drawLink(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
var url = "http://";
if(options.promptURLs) {
url = prompt(options.promptTexts.link); | javascript | {
"resource": ""
} |
q18461 | drawImage | train | function drawImage(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = editor.options;
var url = "http://";
if(options.promptURLs) {
url = prompt(options.promptTexts.image); | javascript | {
"resource": ""
} |
q18462 | drawTable | train | function drawTable(editor) {
var cm = editor.codemirror;
var stat = getState(cm);
var options = | javascript | {
"resource": ""
} |
q18463 | drawHorizontalRule | train | function drawHorizontalRule(editor) {
var cm = editor.codemirror;
var stat = | javascript | {
"resource": ""
} |
q18464 | togglePreview | train | function togglePreview(editor) {
var cm = editor.codemirror;
var wrapper = cm.getWrapperElement();
var toolbar_div = wrapper.previousSibling;
var toolbar = editor.options.toolbar ? editor.toolbarElements.preview : false;
var preview = wrapper.lastChild;
if(!preview || !/editor-preview/.test(preview.className)) {
... | javascript | {
"resource": ""
} |
q18465 | _mergeProperties | train | function _mergeProperties(target, source) {
for(var property in source) {
if(source.hasOwnProperty(property)) {
if(source[property] instanceof Array) {
target[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);
} else if(
source[property] !== null &&
type... | javascript | {
"resource": ""
} |
q18466 | extend | train | function extend(target) {
for(var i = 1; i < arguments.length; i++) {
| javascript | {
"resource": ""
} |
q18467 | isLocalStorageAvailable | train | function isLocalStorageAvailable() {
if(typeof localStorage === "object") {
try {
localStorage.setItem("smde_localStorage", | javascript | {
"resource": ""
} |
q18468 | buildSpriteString | train | function buildSpriteString(icons) {
const symbols = Object.keys(icons)
.map(icon => toSvgSymbol(icon, icons[icon]))
.join('');
| javascript | {
"resource": ""
} |
q18469 | toSvg | train | function toSvg(name, attrs = {}) {
console.warn(
'feather.toSvg() is deprecated. Please use feather.icons[name].toSvg() instead.',
);
if (!name) {
throw new Error('The required `key` | javascript | {
"resource": ""
} |
q18470 | attrsToString | train | function attrsToString(attrs) {
return Object.keys(attrs)
| javascript | {
"resource": ""
} |
q18471 | replace | train | function replace(attrs = {}) {
if (typeof document === 'undefined') {
throw new Error('`feather.replace()` only works in a browser environment.');
}
const elementsToReplace | javascript | {
"resource": ""
} |
q18472 | replaceElement | train | function replaceElement(element, attrs = {}) {
const elementAttrs = getAttrs(element);
const name = elementAttrs['data-feather'];
delete elementAttrs['data-feather'];
const svgString = icons[name].toSvg({
...attrs,
...elementAttrs,
...{ class: classnames(attrs.class, elementAttrs.class) | javascript | {
"resource": ""
} |
q18473 | getAttrs | train | function getAttrs(element) {
return Array.from(element.attributes).reduce((attrs, | javascript | {
"resource": ""
} |
q18474 | processSvg | train | function processSvg(svg) {
return (
optimize(svg)
.then(setAttrs)
.then(format)
| javascript | {
"resource": ""
} |
q18475 | optimize | train | function optimize(svg) {
const svgo = new Svgo({
plugins: [
{ convertShapeToPath: false },
{ mergePaths: false },
| javascript | {
"resource": ""
} |
q18476 | setAttrs | train | function setAttrs(svg) {
const $ = cheerio.load(svg);
Object.keys(DEFAULT_ATTRS).forEach(key =>
| javascript | {
"resource": ""
} |
q18477 | nextPow2 | train | function nextPow2(size) {
return | javascript | {
"resource": ""
} |
q18478 | loadFromBuffer | train | function loadFromBuffer(input) {
var buf = new BunserBuf();
var result = buf.append(input, true);
if (buf.buf.readAvail()) {
throw Error(
'excess data found after input buffer, use BunserBuf instead');
| javascript | {
"resource": ""
} |
q18479 | byteswap64 | train | function byteswap64(buf) {
var swap = new Buffer(buf.length);
for (var i = 0; i < buf.length; i++) | javascript | {
"resource": ""
} |
q18480 | dumpToBuffer | train | function dumpToBuffer(val) {
var buf = new Accumulator();
// Build out the header
buf.writeByte(0);
buf.writeByte(1);
// Reserve room for an int32 to hold our PDU length
buf.writeByte(BSER_INT32);
buf.writeInt(0, 4); // We'll come back and fill this in at the end
dump_any(buf, val);
// Compute PDU l... | javascript | {
"resource": ""
} |
q18481 | forEach | train | function forEach(callback /* , thisArg */) {
var entries = getInternalParamsState(this).entries;
var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined, 3);
var i = 0;
| javascript | {
"resource": ""
} |
q18482 | sortBy | train | function sortBy (coll, iteratee, callback) {
var _iteratee = wrapAsync(iteratee);
return map(coll, (x, iterCb) => {
_iteratee(x, (err, criteria) => {
if (err) return iterCb(err);
iterCb(err, {value: x, criteria});
});
}, (err, results) => {
if (err) return cal... | javascript | {
"resource": ""
} |
q18483 | whilst | train | function whilst(test, iteratee, callback) {
callback = onlyOnce(callback);
var _fn = wrapAsync(iteratee);
var _test = wrapAsync(test);
var results = [];
function next(err, ...rest) {
if (err) return callback(err);
results = rest;
if (err === false) return;
_test(chec... | javascript | {
"resource": ""
} |
q18484 | every | train | function every(coll, iteratee, callback) {
return createTester(bool => !bool, res | javascript | {
"resource": ""
} |
q18485 | eachOfArrayLike | train | function eachOfArrayLike(coll, iteratee, callback) {
callback = once(callback);
var index = 0,
completed = 0,
{length} = coll,
canceled = false;
if (length === 0) {
callback(null);
}
function iteratorCallback(err, value) {
if (err === false) {
can... | javascript | {
"resource": ""
} |
q18486 | reduce | train | function reduce(coll, memo, iteratee, callback) {
callback = once(callback);
var _iteratee = wrapAsync(iteratee);
return eachOfSeries(coll, (x, i, iterCb) => {
_iteratee(memo, | javascript | {
"resource": ""
} |
q18487 | waterfall | train | function waterfall (tasks, callback) {
callback = once(callback);
if (!Array.isArray(tasks)) return callback(new Error('First argument to waterfall must be an array of functions'));
if (!tasks.length) return callback();
var taskIndex = 0;
function nextTask(args) {
var task = wrapAsync(tasks... | javascript | {
"resource": ""
} |
q18488 | some | train | function some(coll, iteratee, callback) {
return | javascript | {
"resource": ""
} |
q18489 | sortStrs | train | function sortStrs(strArr) {
return strArr.sort(function(s1, s2) {
var lowerCaseS1 = s1.toLowerCase();
var lowerCaseS2 = s2.toLowerCase();
if (lowerCaseS1 < lowerCaseS2) {
return -1;
| javascript | {
"resource": ""
} |
q18490 | forever | train | function forever(fn, errback) {
var done = onlyOnce(errback);
var task = wrapAsync(ensureAsync(fn));
function next(err) {
if (err) | javascript | {
"resource": ""
} |
q18491 | train | function (b) {
var a = this;
var sx = b.width / a.width;
var sy = b.height / a.height;
var m = matrix.create(); | javascript | {
"resource": ""
} | |
q18492 | train | function (state, subPropKey, key, transitionCfg, done) {
var el = this._el;
var stateObj = subPropKey ? state[subPropKey] : state;
var elObj = subPropKey ? el[subPropKey] : el;
var availableProp = stateObj && (key in stateObj)
&& elObj && (key in elObj);
var transiti... | javascript | {
"resource": ""
} | |
q18493 | train | function (cb, context) {
var zlevelList = this._zlevelList;
var z;
var i;
| javascript | {
"resource": ""
} | |
q18494 | train | function (opts) {
opts = opts || {};
if (this._singleCanvas && !this._compositeManually) {
return this._layers[CANVAS_ZLEVEL].dom;
}
var imageLayer = new Layer('image', this, opts.pixelRatio || this.dpr);
imageLayer.initContext();
imageLayer.clear(false, opts... | javascript | {
"resource": ""
} | |
q18495 | train | function (cb, context) {
context !== void 0 && (cb = bind(cb, context));
for (var key in this.data) {
| javascript | {
"resource": ""
} | |
q18496 | train | function (t) {
var p = someVectorAt(this.shape, t, true);
| javascript | {
"resource": ""
} | |
q18497 | fillArr | train | function fillArr(arr0, arr1, arrDim) {
var arr0Len = arr0.length;
var arr1Len = arr1.length;
if (arr0Len !== arr1Len) {
// FIXME Not work for TypedArray
var isPreviousLarger = arr0Len > arr1Len;
if (isPreviousLarger) {
// Cut the previous
arr0.length = arr1Len... | javascript | {
"resource": ""
} |
q18498 | catmullRomInterpolateArray | train | function catmullRomInterpolateArray(
p0, p1, p2, p3, t, t2, t3, out, arrDim
) {
var len = p0.length;
if (arrDim === 1) {
for (var i = 0; i < len; i++) {
out[i] = catmullRomInterpolate(
p0[i], p1[i], p2[i], p3[i], t, t2, t3
);
}
}
else {
... | javascript | {
"resource": ""
} |
q18499 | train | function (event, query, handler, context) {
return on(this, | javascript | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.