_id
stringlengths
2
6
title
stringlengths
0
58
partition
stringclasses
3 values
text
stringlengths
52
373k
language
stringclasses
1 value
meta_information
dict
q25400
train
function(render, fn) { if (typeof render === 'function') { fn = render; render = false; } // separate the tracking of the application over rendered pages if (render) { app.render('partials/analytics', function(error, html) { if (error) { return fn(e...
javascript
{ "resource": "" }
q25401
train
function(path, full, secure) { var root = ''; if (full) { root = app.set('url full'); } else { root = app.set('url prefix'); } // Remove preceding slash if one exists. if (path && path[0] === '/') { path = path.slice(1); } if (secure) { ...
javascript
{ "resource": "" }
q25402
train
function(user, size) { var email = (user.email || '').trim().toLowerCase(); var name = user.name || 'default'; var d = 'd=blank'; if (!size || size < 120) { d = 'd=' + encodeURIComponent( 'https://jsbin-gravatar.herokuapp.com/' + name + '.png' )...
javascript
{ "resource": "" }
q25403
train
function(path, secure) { var root = app.get('static url').replace(/.*:\/\//, ''); var proto = 'http'; if (path && path[0] === '/') { path = path.slice(1); } if (secure) { root = undefsafe(config, 'url.ssl.static') || undefsafe(config, 'url.static') || ...
javascript
{ "resource": "" }
q25404
clearMarks
train
function clearMarks(editor, arr, classes) { for (var i = 0; i < arr.length; ++i) { var mark = arr[i]; if (mark instanceof CodeMirror.TextMarker) { mark.clear(); } else { editor.removeLineClass(mark, "background", classes.chunk); editor.removeLineClass(mark, "background", cl...
javascript
{ "resource": "" }
q25405
updateMarks
train
function updateMarks(editor, diff, state, type, classes) { var vp = editor.getViewport(); editor.operation(function() { if (state.from == state.to || vp.from - state.to > 20 || state.from - vp.to > 20) { clearMarks(editor, state.marked, classes); markChanges(editor, diff, type, state.marke...
javascript
{ "resource": "" }
q25406
drawConnectors
train
function drawConnectors(dv) { if (!dv.showDifferences) return; if (dv.svg) { clear(dv.svg); var w = dv.gap.offsetWidth; attrs(dv.svg, "width", w, "height", dv.gap.offsetHeight); } clear(dv.copyButtons); var flip = dv.type == "left"; var vpEdit = dv.edit.getViewport(), vpOrig ...
javascript
{ "resource": "" }
q25407
train
function(bin) { var binSettings = {}; // self defence against muppertary if (typeof bin.settings === 'string') { try { binSettings = JSON.parse(bin.settings); } catch (e) {} } else { binSettings = bin.settings; } if ( binSettings && binSettings.processors ...
javascript
{ "resource": "" }
q25408
getLinks
train
function getLinks() { var links = [], alllinks, i = 0, length; alllinks = document.getElementsByTagName('a'); length = alllinks.length; for (; i < length; i++) { if ((' ' + alllinks[i].className).indexOf(' jsbin-') !== -1) { links.push(alllinks[i]); } } return links; }
javascript
{ "resource": "" }
q25409
peek
train
function peek(p) { var i = p || 0, j = 0, t; while (j <= i) { t = lookahead[j]; if (!t) { t = lookahead[j] = lex.token(); } j += 1; } return t; }
javascript
{ "resource": "" }
q25410
nobreaknonadjacent
train
function nobreaknonadjacent(left, right) { left = left || state.tokens.curr; right = right || state.tokens.next; if (!state.option.laxbreak && left.line !== right.line) { warning("W014", right, right.value); } }
javascript
{ "resource": "" }
q25411
identifier
train
function identifier(fnparam, prop) { var i = optionalidentifier(fnparam, prop); if (i) { return i; } if (state.tokens.curr.id === "function" && state.tokens.next.id === "(") { warning("W025"); } else { error("E030", state.tokens.next, state.tokens.next.value); } }
javascript
{ "resource": "" }
q25412
train
function () { var pn, pn1; var i = -1; var bracketStack = 0; var ret = {}; if (_.contains(["[", "{"], state.tokens.curr.value)) bracketStack += 1; do { pn = (i === -1) ? state.tokens.next : peek(i); pn1 = peek(i + 1); i = i + 1; if (_.contains(["[", "{"], pn.value))...
javascript
{ "resource": "" }
q25413
commentToken
train
function commentToken(label, body, opt) { var special = ["jshint", "jslint", "members", "member", "globals", "global", "exported"]; var isSpecial = false; var value = label + body; var commentType = "plain"; opt = opt || {}; if (opt.isMultiline) { value += "*/"; } ...
javascript
{ "resource": "" }
q25414
split_newlines
train
function split_newlines(s) { //return s.split(/\x0d\x0a|\x0a/); s = s.replace(/\x0d/g, ''); var out = [], idx = s.indexOf("\n"); while (idx !== -1) { out.push(s.substring(0, idx)); s = s.substring(idx + 1); ...
javascript
{ "resource": "" }
q25415
train
function (req, res) { var event = req.stripeEvent; var data = event.data.object; // takes care of unexpected event types var transactionMethod = stripeTransactions[event.type] || stripeTransactions.unhandled; transactionMethod(req, data, function (err){ if ( !err ) { r...
javascript
{ "resource": "" }
q25416
train
function (requested) { // No postMessage? Don't render – the event-stream will handle it. if (!window.postMessage) { return; } // Inform other pages event streaming render to reload if (requested) { sendReload(); jsbin.state.hasBody = false; } getPreparedCode().then(function (source...
javascript
{ "resource": "" }
q25417
updateArgHints
train
function updateArgHints(ts, cm) { closeArgHints(ts); if (cm.somethingSelected()) return; var state = cm.getTokenAt(cm.getCursor()).state; var inner = CodeMirror.innerMode(cm.getMode(), state); if (inner.mode.name != "javascript") return; var lex = inner.state.lexical; if (lex.info != "call"...
javascript
{ "resource": "" }
q25418
buildRequest
train
function buildRequest(ts, doc, query, pos) { var files = [], offsetLines = 0, allowFragments = !query.fullDocs; if (!allowFragments) delete query.fullDocs; if (typeof query == "string") query = {type: query}; query.lineCharPositions = true; if (query.end == null) { query.end = pos || doc.doc.g...
javascript
{ "resource": "" }
q25419
stringify
train
function stringify(o, simple) { var json = '', i, type = ({}).toString.call(o), parts = [], names = []; if (type == '[object String]') { json = '"' + o.replace(/\n/g, '\\n').replace(/"/g, '\\"') + '"'; } else if (type == '[object Array]') { json = '['; for (i = 0; i < o.length; i++) { ...
javascript
{ "resource": "" }
q25420
train
function (rawData) { var data = stringify(rawData); if (useSS) { sessionStorage.spike = data; } else { window.name = data; } return data; }
javascript
{ "resource": "" }
q25421
train
function () { var rawData = useSS ? sessionStorage.spike : window.name, data; if ((!useSS && window.name == 1) || !rawData) return data; try { // sketchy, but doesn't rely on native json support which might be a // problem in old mobiles eval('data = ' + rawData); ...
javascript
{ "resource": "" }
q25422
restore
train
function restore() { var data = store.get() || {}; addEvent('load', function () { //console.log('scrolling to', data.y); window.scrollTo(data.x, data.y); }); }
javascript
{ "resource": "" }
q25423
makeScope
train
function makeScope(prev, isCatch) { return {vars: Object.create(null), prev: prev, isCatch: isCatch}; }
javascript
{ "resource": "" }
q25424
train
function(cm) { if (CodeMirror.snippets(cm) === CodeMirror.Pass) { return CodeMirror.simpleHint(cm, CodeMirror.hint.javascript); } }
javascript
{ "resource": "" }
q25425
getHeaders
train
function getHeaders(config) { const headers = { 'X-Presto-User': config.user }; if (config.catalog) { headers['X-Presto-Catalog'] = config.catalog; } if (config.schema) { headers['X-Presto-Schema'] = config.schema; } return headers; }
javascript
{ "resource": "" }
q25426
send
train
function send(config, query) { if (!config.url) { return Promise.reject(new Error('config.url is required')); } const results = { data: [] }; return fetch(`${config.url}/v1/statement`, { method: 'POST', body: query, headers: getHeaders(config) }) .then(response => response.json()) ...
javascript
{ "resource": "" }
q25427
getSchema
train
function getSchema(connection) { connection.maxRows = 1000000; return runQuery(SCHEMA_SQL, connection).then(queryResult => formatSchemaQueryResults(queryResult) ); }
javascript
{ "resource": "" }
q25428
runMigrations
train
function runMigrations(db, currentVersion) { return new Promise((resolve, reject) => { const nextVersion = currentVersion + 1; if (!migrations[nextVersion]) { return resolve(); } if (debug) { console.log('Migrating schema to v%d', nextVersion); } migrations[nextVersion](db) ...
javascript
{ "resource": "" }
q25429
validateFunction
train
function validateFunction(path, driver, functionName) { if (typeof driver[functionName] !== 'function') { console.error(`${path} missing .${functionName}() implementation`); process.exit(1); } }
javascript
{ "resource": "" }
q25430
validateArray
train
function validateArray(path, driver, arrayName) { const arr = driver[arrayName]; if (!Array.isArray(arr)) { console.error(`${path} missing ${arrayName} array`); process.exit(1); } }
javascript
{ "resource": "" }
q25431
requireValidate
train
function requireValidate(path, optional = false) { let driver; try { driver = require(path); } catch (er) { if (optional) { console.log('optional driver ' + path + ' not available'); return; } else { // rethrow throw er; } } if (!driver.id) { console.error(`${path...
javascript
{ "resource": "" }
q25432
runQuery
train
function runQuery(query, connection, user) { const driver = drivers[connection.driver]; const queryResult = { id: uuid.v4(), cacheKey: null, startTime: new Date(), stopTime: null, queryRunTime: null, fields: [], incomplete: false, meta: {}, rows: [] }; return driver.runQuer...
javascript
{ "resource": "" }
q25433
getDrivers
train
function getDrivers() { return Object.keys(drivers).map(id => { return { id, name: drivers[id].name, fields: drivers[id].fields }; }); }
javascript
{ "resource": "" }
q25434
validateConnection
train
function validateConnection(connection) { const coreFields = ['_id', 'name', 'driver', 'createdDate', 'modifiedDate']; if (!connection.name) { throw new Error('connection.name required'); } if (!connection.driver) { throw new Error('connection.driver required'); } const driver = drivers[connection.d...
javascript
{ "resource": "" }
q25435
formatSchemaQueryResults
train
function formatSchemaQueryResults(queryResult) { if (!queryResult || !queryResult.rows || !queryResult.rows.length) { return {}; } // queryResult row casing may not always be consistent with what is specified in query // HANA is always uppercase despire aliasing as lower case for example // To account fo...
javascript
{ "resource": "" }
q25436
ensureBoolean
train
function ensureBoolean(value) { if (typeof value === 'boolean') { return value; } if (typeof value === 'string' && value.toLowerCase() === 'true') { return true; } else if (typeof value === 'string' && value.toLowerCase() === 'false') { return false; } else if (value === 1) { return true; } ...
javascript
{ "resource": "" }
q25437
isNumeric
train
function isNumeric(value) { if (_.isNumber(value)) { return true; } if (_.isString(value)) { if (!isFinite(value)) { return false; } // str is a finite number, but not all number strings should be numbers // If the string starts with 0, is more than 1 character, and does not have a perio...
javascript
{ "resource": "" }
q25438
fullUrl
train
function fullUrl(path) { const urlPort = port === 80 ? '' : ':' + port; const urlPublicUrl = publicUrl; const urlBaseUrl = baseUrl; return `${urlPublicUrl}${urlPort}${urlBaseUrl}${path}`; }
javascript
{ "resource": "" }
q25439
getCurrentPath
train
function getCurrentPath(){ try{ // FF, Chrome, Modern browsers // use their API to get the path of current script // a.b(); // console.log('wpStage1'); return document.currentScript.src; if(DOC.currentScript){ // FF 4+ return DOC.currentScript.src; } }catch(e){ // docume...
javascript
{ "resource": "" }
q25440
theRealInit
train
function theRealInit (){ createElement(); initEvent(); live2DMgr = new cManager(L2Dwidget) dragMgr = new L2DTargetPoint(); let rect = currCanvas.getBoundingClientRect(); let ratio = rect.height / rect.width; let left = cDefine.VIEW_LOGICAL_LEFT; let right = cDefine.VIEW_LOGICAL_RIGHT; let bottom = -...
javascript
{ "resource": "" }
q25441
createElement
train
function createElement() { let e = document.getElementById(config.name.div) if (e !== null) { document.body.removeChild(e); } let newElem = document.createElement('div'); newElem.id = config.name.div; newElem.className = 'live2d-widget-container'; newElem.style.setProperty('position', 'fixed'); ne...
javascript
{ "resource": "" }
q25442
initWebGL
train
function initWebGL() { var NAMES = ['webgl2', 'webgl', 'experimental-webgl2', 'experimental-webgl', 'webkit-3d', 'moz-webgl']; for (let i = 0; i < NAMES.length; i++) { try { let ctx = currCanvas.getContext(NAMES[i], { alpha: true, antialias: true, premultipliedAlpha: true, ...
javascript
{ "resource": "" }
q25443
tween
train
function tween(duration, fn, done, ease, from, to) { ease = fun(ease) ? ease : morpheus.easings[ease] || nativeTween var time = duration || thousand , self = this , diff = to - from , start = now() , stop = 0 , end = 0 function run(t) { var delta = t - start if (de...
javascript
{ "resource": "" }
q25444
nextColor
train
function nextColor(pos, start, finish) { var r = [], i, e, from, to for (i = 0; i < 6; i++) { from = Math.min(15, parseInt(start.charAt(i), 16)) to = Math.min(15, parseInt(finish.charAt(i), 16)) e = Math.floor((to - from) * pos + from) e = e > 15 ? 15 : e < 0 ? 0 : e r[i] = e.to...
javascript
{ "resource": "" }
q25445
getTweenVal
train
function getTweenVal(pos, units, begin, end, k, i, v) { if (k == 'transform') { v = {} for (var t in begin[i][k]) { v[t] = (t in end[i][k]) ? Math.round(((end[i][k][t] - begin[i][k][t]) * pos + begin[i][k][t]) * thousand) / thousand : begin[i][k][t] } return v } else if (typeof b...
javascript
{ "resource": "" }
q25446
by
train
function by(val, start, m, r, i) { return (m = relVal.exec(val)) ? (i = parseFloat(m[2])) && (start + (m[1] == '+' ? 1 : -1) * i) : parseFloat(val) }
javascript
{ "resource": "" }
q25447
train
function() { var _layout = this.options.layout; for (var i = 0; i < this._slides.length; i++) { this._slides[i].updateDisplay(this.options.width, this.options.height, _layout); this._slides[i].setPosition({left:(this.slide_spacing * i), top:0}); }; this.goToId(this.current_id, true, false); }
javascript
{ "resource": "" }
q25448
train
function(slide) { var slide_id = slide.unique_id; if (!TL.Util.trim(slide_id)) { // give it an ID if it doesn't have one slide_id = (slide.text) ? TL.Util.slugify(slide.text.headline) : null; } // make sure it's unique and add it. slide.unique_id = TL.Util.ensureUniqueKey(this.event_dict,slide_id); re...
javascript
{ "resource": "" }
q25449
train
function() { // counting that dates were sorted in initialization var date = this.events[0].start_date; if (this.eras && this.eras.length > 0) { if (this.eras[0].start_date.isBefore(date)) { return this.eras[0].start_date; } } return date; }
javascript
{ "resource": "" }
q25450
train
function() { var dates = []; for (var i = 0; i < this.events.length; i++) { if (this.events[i].end_date) { dates.push({ date: this.events[i].end_date }); } else { dates.push({ date: this.events[i].start_date }); } } for (var i = 0; i < this.eras.length; i++) { if (this.eras[i].end_date) { ...
javascript
{ "resource": "" }
q25451
train
function (/*Object*/ dest) /*-> Object*/ { // merge src properties into dest var sources = Array.prototype.slice.call(arguments, 1); for (var j = 0, len = sources.length, src; j < len; j++) { src = sources[j] || {}; TL.Util.mergeData(dest, src); } return dest; }
javascript
{ "resource": "" }
q25452
load
train
function load(type, urls, callback, obj, context) { var _finish = function () { finish(type); }, isCSS = type === 'css', nodes = [], i, len, node, p, pendingUrls, url; env || getEnv(); if (urls) { // If urls is a string, wrap it in an array. Otherwise assume it's an ...
javascript
{ "resource": "" }
q25453
train
function(scale) { var d = new Date(this.data.date_obj.getTime()); for (var i = 0; i < TL.Date.SCALES.length; i++) { // for JS dates, we iteratively apply flooring functions TL.Date.SCALES[i][2](d); if (TL.Date.SCALES[i][0] == scale) return new TL.Date(d); }; ...
javascript
{ "resource": "" }
q25454
train
function(scale) { for (var i = 0; i < TL.BigDate.SCALES.length; i++) { if (TL.BigDate.SCALES[i][0] == scale) { var floored = TL.BigDate.SCALES[i][2](this.data.date_obj); return new TL.BigDate(floored); } }; throw new TL.Error("invalid_scal...
javascript
{ "resource": "" }
q25455
train
function(n) { if(this.config.title) { if(n == 0) { this.goToId(this.config.title.unique_id); } else { this.goToId(this.config.events[n - 1].unique_id); } } else { this.goToId(this.config.events[n].unique_id); } }
javascript
{ "resource": "" }
q25456
train
function(n) { if(n >= 0 && n < this.config.events.length) { // If removing the current, nav to new one first if(this.config.events[n].unique_id == this.current_id) { if(n < this.config.events.length - 1) { this.goTo(n + 1); } else { this.goTo(n - 1); } } var event = this.config.eve...
javascript
{ "resource": "" }
q25457
train
function(id) { var hash = "#" + "event-" + id.toString(); if (window.location.protocol != 'file:') { window.history.replaceState(null, "Browsing TimelineJS", hash); } this.fire("hash_updated", {unique_id:this.current_id, hashbookmark:"#" + "event-" + id.toString()}, this); }
javascript
{ "resource": "" }
q25458
train
function () { var self = this; this.message.removeFrom(this._el.container); this._el.container.innerHTML = ""; // Create Layout if (this.options.timenav_position == "top") { this._el.timenav = TL.Dom.create('div', 'tl-timenav', this._el.container); this._el.storyslider = TL.Dom.create('div', 't...
javascript
{ "resource": "" }
q25459
setBadge
train
function setBadge(todos) { if (chrome.browserAction) { const count = todos.filter(todo => !todo.marked).length; chrome.browserAction.setBadgeText({ text: count > 0 ? count.toString() : '' }); } }
javascript
{ "resource": "" }
q25460
train
function(string, options) { options = options || {}; var separator = options.separator || '_'; var split = options.split || /(?=[A-Z])/; return string.split(split).join(separator); }
javascript
{ "resource": "" }
q25461
train
function(convert, options) { var callback = options && 'process' in options ? options.process : options; if(typeof(callback) !== 'function') { return convert; } return function(string, options) { return callback(string, convert, options); } }
javascript
{ "resource": "" }
q25462
httpClientInMemBackendServiceFactory
train
function httpClientInMemBackendServiceFactory(dbService, options, xhrFactory) { var backend = new HttpClientBackendService(dbService, options, xhrFactory); return backend; }
javascript
{ "resource": "" }
q25463
_loop2
train
function _loop2(i) { var node = nodeList[i]; stickies.some(function (sticky) { if (sticky._node === node) { sticky.remove(); return true; } }); }
javascript
{ "resource": "" }
q25464
TS2JS
train
function TS2JS(tsFile) { const srcFolder = path.join(__dirname, '..', 'src'); const distFolder = path.join(__dirname, '..', 'build', 'main'); const tsPathObj = path.parse(tsFile); return path.format({ dir: tsPathObj.dir.replace(srcFolder, distFolder), ext: '.js', name: tsPathObj.name, root: ts...
javascript
{ "resource": "" }
q25465
replaceCLIArg
train
function replaceCLIArg(search, replace) { process.argv[process.argv.indexOf(search)] = replace; }
javascript
{ "resource": "" }
q25466
loadHTML
train
function loadHTML(url, id) { req = new XMLHttpRequest(); req.open('GET', url); req.send(); req.onload = () => { $id(id).innerHTML = req.responseText; }; }
javascript
{ "resource": "" }
q25467
train
function (attributes) { // These are all documented with their property accessors below. this._cornerRadius = attributes ? attributes._cornerRadius : 0; this._insets = attributes ? attributes._insets : new Insets(0, 0, 0, 0); this._backgroundColor = attributes ? attribut...
javascript
{ "resource": "" }
q25468
train
function (capacity, lowWater) { if (!capacity || capacity < 1) { throw new ArgumentError(Logger.logMessage(Logger.LEVEL_SEVERE, "MemoryCache", "constructor", "The specified capacity is undefined, zero or negative")); } if (!lowWater || lowWater >=...
javascript
{ "resource": "" }
q25469
train
function (m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44) { this[0] = m11; this[1] = m12; this[2] = m13; this[3] = m14; this[4] = m21; ...
javascript
{ "resource": "" }
q25470
train
function (worldWindow) { WorldWindowController.call(this, worldWindow); // base class checks for a valid worldWindow // Intentionally not documented. this.primaryDragRecognizer = new DragRecognizer(this.wwd, null); this.primaryDragRecognizer.addListener(this); ...
javascript
{ "resource": "" }
q25471
train
function (pole) { // Internal. Intentionally not documented. this.north = !(pole === "South"); var limits = this.north ? new Sector(0, 90, -180, 180) : new Sector(-90, 0, -180, 180); GeographicProjection.call(this, "Uniform Polar Stereographic", false, limits); ...
javascript
{ "resource": "" }
q25472
train
function (target, callback) { GestureRecognizer.call(this, target, callback); // Intentionally not documented. this._rotation = 0; // Intentionally not documented. this._offsetRotation = 0; // Intentionally not documented. this.refer...
javascript
{ "resource": "" }
q25473
train
function (globe, positions, position, followTerrain) { var elevation = position.altitude; if (followTerrain) { elevation = globe.elevationAtLocation(position.latitude, position.longitude); } positions.push(new Position(position.latitude...
javascript
{ "resource": "" }
q25474
train
function (location, locations) { var result = false; var p1 = locations[0]; for (var i = 1, len = locations.length; i < len; i++) { var p2 = locations[i]; if (((p2.latitude <= location.latitude && location.latitude < p1.latitude) ||...
javascript
{ "resource": "" }
q25475
train
function (v1, v2) { var dot = v1.dot(v2); // Compute the sum of magnitudes. var length = v1.magnitude() * v2.magnitude(); // Normalize the dot product, if necessary. if (!(length === 0) && (length !== 1.0)) { dot /= leng...
javascript
{ "resource": "" }
q25476
train
function (sector, tileMatrixList) { if (!sector) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "TileMatrixSet", "constructor", "missingSector")); } if (!tileMatrixList) { throw new ArgumentError( ...
javascript
{ "resource": "" }
q25477
train
function () { TiledImageLayer.call(this, Sector.FULL_SPHERE, new Location(45, 45), 16, "image/png", "BingWMS", 256, 256); this.displayName = "Bing WMS"; this.pickEnabled = false; this.maxActiveAltitude = 10e3; this.urlBuilder = new WmsUrlBuil...
javascript
{ "resource": "" }
q25478
train
function (serverAddress, pathToData, displayName) { TiledElevationCoverage.call(this, { coverageSector: Sector.FULL_SPHERE, resolution: 0.00732421875, retrievalImageFormat: "application/bil16", minElevation: -11000, maxElevation...
javascript
{ "resource": "" }
q25479
train
function (sector, level, row, column) { if (!sector) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Tile", "constructor", "missingSector")); } if (!level) { throw new ArgumentError( Logger.lo...
javascript
{ "resource": "" }
q25480
train
function (geoTiffData, byteOffset, numOfBytes, isLittleEndian, isSigned) { if (numOfBytes <= 0) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "GeoTiffReader", "getBytes", "noBytesRequested")); } else if (numOfBytes <= 1) { ...
javascript
{ "resource": "" }
q25481
train
function (geoTiffData, byteOffset, numOfBytes, sampleFormat, isLittleEndian) { var res; switch (sampleFormat) { case TiffConstants.SampleFormat.UNSIGNED: res = this.getBytes(geoTiffData, byteOffset, numOfBytes, isLittleEndian, false); ...
javascript
{ "resource": "" }
q25482
train
function (colorSample, bitsPerSample) { var multiplier = Math.pow(2, 8 - bitsPerSample); return Math.floor((colorSample * multiplier) + (multiplier - 1)); }
javascript
{ "resource": "" }
q25483
train
function (target, callback) { GestureRecognizer.call(this, target, callback); // Intentionally not documented. this._scale = 1; // Intentionally not documented. this._offsetScale = 1; // Intentionally not documented. this.referenceDi...
javascript
{ "resource": "" }
q25484
train
function (o) { // The input argument is either an Event or a TapRecognizer. Both have the same properties for determining // the mouse or tap location. var x = o.clientX, y = o.clientY; var redrawRequired = highlightedItems.length > 0; // must redraw if w...
javascript
{ "resource": "" }
q25485
train
function (left, right, bottom, top, near, far) { if (!left || !right || !bottom || !top || !near || !far) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Frustum", "constructor", "missingPlane")); } // Internal. Intentionally no...
javascript
{ "resource": "" }
q25486
train
function (identifier, clientX, clientY) { /** * A number uniquely identifying this touch point. * @type {Number} * @readonly */ this.identifier = identifier; // Intentionally not documented. this._clientX = clientX; ...
javascript
{ "resource": "" }
q25487
train
function (top, left, bottom, right) { if (arguments.length !== 4) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "Insets", "constructor", "invalidArgumentCount")); } // These are all documented with their property accessors bel...
javascript
{ "resource": "" }
q25488
train
function (element) { if (!element) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "OwsServiceProvider", "constructor", "missingDomElement")); } var children = element.children || element.childNodes; for (var c = 0; c...
javascript
{ "resource": "" }
q25489
train
function (position, config) { if (!position) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "ColladaLoader", "constructor", "missingPosition")); } this.position = position; this.dirPath = '/'; this.ini...
javascript
{ "resource": "" }
q25490
train
function (target, callback) { GestureRecognizer.call(this, target, callback); /** * * @type {Number} */ this.numberOfTaps = 1; /** * * @type {Number} */ this.numberOfTouches = 1; ...
javascript
{ "resource": "" }
q25491
train
function (resolution) { if (!resolution) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "ElevationCoverage", "constructor", "missingResolution")); } /** * Indicates the last time this coverag...
javascript
{ "resource": "" }
q25492
train
function () { // CONUS Extent: (-124.848974, 24.396308) - (-66.885444, 49.384358) // TODO: Expand this extent to cover HI when the server NO_DATA value issue is resolved. TiledElevationCoverage.call(this, { coverageSector: new Sector(24.396308, 49.384358, -124.848974,...
javascript
{ "resource": "" }
q25493
train
function (shapeAttributes) { RenderableLayer.call(this, "Tectonic Plates"); if (shapeAttributes) { this._attributes = shapeAttributes; } else { this._attributes = new ShapeAttributes(null); this._attributes.drawInterior = false; this._attributes.d...
javascript
{ "resource": "" }
q25494
train
function (date) { if (date instanceof Date === false) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SunPosition", "getAsGeographicLocation", "missingDate")); } var celestialLocat...
javascript
{ "resource": "" }
q25495
train
function (date) { if (date instanceof Date === false) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SunPosition", "getAsCelestialLocation", "missingDate")); } var julianDate = th...
javascript
{ "resource": "" }
q25496
train
function (date) { if (date instanceof Date === false) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "SunPosition", "computeJulianDate", "missingDate")); } var year = date.getUTCFullYear(); va...
javascript
{ "resource": "" }
q25497
train
function (worldWindow) { var self = this; this.createPlayer(); // Intentionally not documented. this.slider = $("#timeSeriesSlider"); this.sliderThumb = $(this.slider.children('.ui-slider-handle')); this.timeDisplay = $("#timeSeriesDisplay");// $('<span style="position:...
javascript
{ "resource": "" }
q25498
train
function (options) { Renderable.call(this); options = options || {}; if (!options.objectNode) { throw new ArgumentError( Logger.logMessage(Logger.LEVEL_SEVERE, "KmlObject", "constructor", "Passed node isn't defined.") ); } this._node = opt...
javascript
{ "resource": "" }
q25499
train
function (starDataSource) { Layer.call(this, 'StarField'); // The StarField Layer is not pickable. this.pickEnabled = false; /** * The size of the Sun in pixels. * This can not exceed the maximum allowed pointSize of the GPU. * A w...
javascript
{ "resource": "" }