query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Create an `$imports.$add(alias, source, symbol, value)` method call.
function createAddImportCall(alias, source, symbol, value) { return t.expressionStatement( t.callExpression( t.memberExpression(t.identifier("$imports"), t.identifier("$add")), [ t.stringLiteral(alias), t.stringLiteral(source), t.stringLiteral(symbol), v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add() {}", "function add(a, b) {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = { a, b };\n return ENGINE.runKernel(_kernel_names__WEBPACK_IMPORTED_MODULE_3__[\"Add\"], inputs);\n}", "function $__(arg)\n{\n return $_(arg).add(arg);\n}", "function ad...
[ "0.6105717", "0.5873032", "0.57411504", "0.5734335", "0.56577045", "0.5646336", "0.5608838", "0.5594749", "0.5594749", "0.5582509", "0.55792755", "0.54929125", "0.54833955", "0.545928", "0.5426519", "0.5426519", "0.54057753", "0.540351", "0.5389322", "0.5389322", "0.5389322",...
0.8588343
0
Return true if the current module should not be processed at all.
function excludeModule(state) { const filename = state.file.opts.filename; if (!filename) { // No filename was supplied when Babel was run, assume this file should // be processed. return false; } const excludeList = state.opts.excludeDirs || EXCLUDED_DIRS; const dirParts = pathMo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isMainModule(){\r\n return main_module;\r\n }", "function $IsModule(module) {\n return GetModuleInternalData(module) !== undefined;\n}", "isRunning() {\n return this._process !== null;\n }", "@bind\n isCustom(module) {\n return this.customModules[module] ? true : false\n }", "isBaseCo...
[ "0.6405366", "0.6170761", "0.5937329", "0.58804315", "0.58366966", "0.58255875", "0.5767981", "0.57580537", "0.57079995", "0.5680268", "0.5675146", "0.5675146", "0.5675146", "0.56681234", "0.5651905", "0.5648363", "0.5636723", "0.5620424", "0.5583535", "0.5554017", "0.5554017...
0.6185616
1
Return true if node is a `module.exports = ` assignment.
function isCommonJSExportAssignment(path) { const assignExpr = path.node; if (t.isMemberExpression(assignExpr.left)) { const target = assignExpr.left; if (t.isIdentifier(target.object) && t.isIdentifier(target.property)) { return ( target.object.name === "module" && target.property...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isExportAssignment(node) {\n return node.kind === ts.SyntaxKind.ExportAssignment;\n}", "function isNode(){\r\n\treturn typeof module !== 'undefined' && module.exports;\r\n}", "function isNode() {\n return (typeof module !== 'undefined' && this.module !== module);\n}", "function isNode() {\n r...
[ "0.7469965", "0.6849036", "0.66120106", "0.6416369", "0.6347798", "0.62745714", "0.61536455", "0.6089938", "0.60825604", "0.6076272", "0.5986078", "0.58219606", "0.58152807", "0.58152807", "0.5806438", "0.5798091", "0.5785656", "0.5785656", "0.57281834", "0.56851995", "0.5618...
0.74427444
1
Emit the code that generates the `$imports` object used by tests to mock dependencies.
exit(path, state) { if (state.aborted || state.importIdentifiers.size === 0) { return; } // Generate `import { ImportMap } from 'babel-plugin-mock/helpers'` const helperImport = t.importDeclaration( [ t.importSpecifier( t.ide...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preInstantiate(imports) {\n const extendedExports = {};\n\n function getString(memory, ptr) {\n if (!memory) return \"<yet unknown>\";\n return getStringImpl(memory.buffer, ptr);\n }\n\n // add common imports used by stdlib for convenience\n const env = (imports.env = imports.env || {});\n env...
[ "0.58243865", "0.54941195", "0.5466268", "0.5399771", "0.5379399", "0.5373958", "0.5339403", "0.527797", "0.5180192", "0.51786405", "0.51617485", "0.51605195", "0.5095005", "0.507796", "0.50690764", "0.5068273", "0.49781471", "0.49701488", "0.49280837", "0.4926007", "0.489954...
0.6024931
0
Check for and register CommonJS imports in toplevel variable declarations.
VariableDeclaration(path, state) { if (state.aborted) { return; } // Ignore non-top level CommonJS imports. if (path.parent.type !== "Program") { return; } // Find CommonJS (`require(...)`) imports in variable declarations. const imports = []...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolveImports() {\n let imports = {}\n imports.safeMath = true\n\n if (this.tokenStandard == 'ERC20') {\n imports.ERC20 = true\n imports.ownable = true\n }\n else if (this.tokenStandard == 'MINIME') {\n imports.approveCall = true\n imports.controllable = true\n...
[ "0.55606157", "0.54993147", "0.54847217", "0.5461374", "0.53852093", "0.53743356", "0.5359208", "0.5346315", "0.5338351", "0.53198403", "0.5297023", "0.5268461", "0.52573806", "0.5254556", "0.5226204", "0.5211064", "0.5176984", "0.5115684", "0.5112409", "0.50932145", "0.50923...
0.6264794
0
Replace references to identifiers with `$imports.` expressions which resolve either to the original import or the active mocks.
ReferencedIdentifier(child, state) { if (state.aborted) { return; } // Check if this a reference to an import. const name = child.node.name; const binding = child.scope.getBinding(name, /* noGlobal */ true); if (!binding || !state.importIdentifiers.has(binding....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fixImports() {\n const undefinedVariables = (0, _findUndefinedIdentifiers2['default'])(this.ast, this.config.get('globals'));\n const usedVariables = (0, _findUsedIdentifiers2['default'])(this.ast);\n const oldImports = this.findCurrentImports();\n const newImports = oldImports.imports.clone();\n\n ...
[ "0.68745095", "0.6081703", "0.584994", "0.57231104", "0.572032", "0.57029593", "0.56785136", "0.5388502", "0.53641367", "0.5345684", "0.5334469", "0.5289963", "0.5205935", "0.5195063", "0.503048", "0.5027474", "0.50159967", "0.50105435", "0.50097865", "0.5003643", "0.49829376...
0.6185581
1
Wrap callback to bind to `self`. If `cb` is given, use `cb` instead of original `callback`.
function wrap(cb) { var fn = (cb || callback).bind(self); fn.listener = callback; fn.c_win_id = self.cWindow.id; callback.__nw_cb = fn; return fn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setCallback(callback) {\n this._callback = callback;\n }", "function callbackWrapper(ch, cb) {\n return cb\n ? function (err, ok) {\n if (err === null) {\n cb(null, ok);\n } else cb(err);\n }\n : function () {};\n}", "wrapCallback(callback) {\r\n return (error, val...
[ "0.6761071", "0.66599846", "0.65393025", "0.64688736", "0.6391538", "0.63867944", "0.6320224", "0.62992775", "0.6289772", "0.6289729", "0.61687905", "0.61687905", "0.6099757", "0.60939467", "0.60672605", "0.6059944", "0.6051528", "0.59842974", "0.5933567", "0.590874", "0.5908...
0.6961583
0
Load Additional Resource Specific Properties
loadResource() { // Load Selects this.loadStorageTierSelect(this.storage_tier) this.loadPublicAccessTypeSelect(this.public_access_type) this.loadAutoTieringSelect(this.auto_tiering) this.loadVersioningSelect(this.versioning) this.loadSelect(this.kms_key_id, 'key', true, (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadOwnProperties(){\r\n \t\t\r\n\t}", "loadResource() {\n // Load Selects\n this.loadSelect(this.vcn_id, 'virtual_cloud_network', false)\n this.loadSelect(this.drg_id, 'dynamic_routing_gateways', true)\n // Assign Values\n this.vcn_id.property('value', this.resource.vcn_id)\n...
[ "0.6831083", "0.6528982", "0.6488016", "0.6452769", "0.6086367", "0.5761561", "0.5756454", "0.57291275", "0.5668463", "0.555575", "0.55384415", "0.55368143", "0.55316365", "0.5528356", "0.54571366", "0.545275", "0.54464346", "0.5418212", "0.5383317", "0.5372188", "0.53584576"...
0.6780875
1
FUNCION PARA LIMPIAR EL FORMULARIO SI SE TRATA DE UNA PLATILLA NUEVA
function LimpiarFormulario(){ if(obtener_valor( 'PLANTILLA' ) == '0'){ OcultarCampo( 'BUSCARPL', 0 ); asignar_valor( 'NB_PLANT' , ''); asignar_valor( 'ID_PLANT' , ''); asignar_valorM( 'PLANT' , '' , 1 , 1 ); asignar_valorM( 'PLANT' , '' , 1 , 2 ); asignar_valor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function procesoPrecio(){\n\n var getMinimo = minimo.slice(-1);\n var getMaximo = maximo.slice(-1);\n \nif(getMinimo != 0 && getMaximo != 0){\n formdata.append(\"minimo\",getMinimo);\n formdata.append(\"maximo\",getMaximo);\n}\n}", "function cambiar(){\n \t var compania;\n \t //Se toma el valo...
[ "0.6656747", "0.63669807", "0.6336377", "0.6332796", "0.6262062", "0.620787", "0.6205324", "0.6171882", "0.61710674", "0.6105043", "0.6104491", "0.60902697", "0.60893327", "0.60772705", "0.6068947", "0.60655093", "0.60639244", "0.6053031", "0.60418636", "0.6039914", "0.603022...
0.6525314
1
Function called whenever a client exits its `Experience`.
exit(client) { super.exit(client); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onLeave(client, consented) {\n this.manager.removeClientBySessionId(client.sessionId);\n this.broadcast(\"connected_clients\", this.manager.countPlayersOnline());\n }", "onDestroyed() {\n window.alert('Game over! You lost :(');\n }", "function exitHandler() {\n attack.stop();\n}", ...
[ "0.6223064", "0.619153", "0.6106131", "0.6079343", "0.6037259", "0.5924726", "0.591157", "0.58866686", "0.5884521", "0.58806723", "0.5878737", "0.58180606", "0.58142877", "0.5786256", "0.5771273", "0.5761032", "0.5757751", "0.5747062", "0.57442826", "0.57419443", "0.57413", ...
0.65854925
0
value replacing each letter by the letter 13 places further along in the alphabet. Wrapping back to the beginning if necessary
function rot13(value) { return value.replace(/[A-Za-z]/g, function (c) { return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".charAt( "NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm".indexOf(c) ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rot13(str) {\n var re = new RegExp(\"[a-z]\", \"i\");\n var min = 'A'.charCodeAt(0);\n var max = 'Z'.charCodeAt(0);\n var factor = 13;\n var result = \"\";\n str = str.toUpperCase();\n\n for (var i=0; i<str.length; i++) {\n result += (re.test(str[i]) ?\n String.fromCharCod...
[ "0.70641696", "0.7021144", "0.69501007", "0.69250035", "0.68982214", "0.6732496", "0.67256606", "0.6689915", "0.6684229", "0.6672601", "0.66461515", "0.66401964", "0.65806127", "0.64275044", "0.63939947", "0.63877356", "0.6378458", "0.6365757", "0.63595855", "0.6351557", "0.6...
0.73331964
0
A function that calls a transmission call on all nodes until the desired number of levels is added to the outbreak. It starts at the most recent level.
spread(levels) { for (let i = 0; i < levels; i++) { const maxLevel = this.cases.map(node => node.level).reduce((max, cur) => Math.max(max, cur), -Infinity); const possibleDonors = this.cases.filter(x => x.level === maxLevel); for (const donor of possibleDonors) { this.transmit(donor, thi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function len_depth_all() {\r\n var itr = 1;\r\n setInterval(function() {\r\n console.log(itr);\r\n load_result(itr);\r\n itr += 1;\r\n if (itr == 37) {\r\n JSON.stringify(len_depth_data);\r\n }\r\n },6000);\r\n \r\n}", "function walk(nodes) {\n for(var i = 0;i < nodes...
[ "0.55736476", "0.55457526", "0.5433484", "0.5383806", "0.53304756", "0.5321819", "0.52989894", "0.5257366", "0.5227107", "0.52095926", "0.51742715", "0.512751", "0.51191527", "0.5114931", "0.5103629", "0.51010936", "0.50996286", "0.508723", "0.5080792", "0.5074379", "0.505292...
0.6024154
0
Destroy DataTable reinitialise with runDatatable()
function destroyDatatable() { var $table = $('#searchresults').DataTable(); $table.destroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destoryDataTable(){\r\n\toTable.fnDestroy();\t\t\r\n\t// destroy doesn't really work. This next line removes extra html that gets inserted when the datatable\r\n\t// is initialized multiple times.\r\n\t$('#list table tr th').each(function(){\r\n\t\t$(this).html($(this).children('div').html());\r\n\t});\t...
[ "0.7009742", "0.6745244", "0.6692103", "0.66502464", "0.6620555", "0.65118015", "0.64812243", "0.644254", "0.63405716", "0.633388", "0.62372595", "0.62367827", "0.62137234", "0.61437994", "0.61243284", "0.61080194", "0.60921633", "0.60904694", "0.5990802", "0.5933564", "0.592...
0.75089467
0
check if it got checkpointed in dynamo
function checkpointed() { dyno.query({KeyConditions:{type:{ComparisonOperator:'EQ',AttributeValueList: ['shard']}}}, function(err, response) { var shards = response.Items; shards.forEach(function(s) { t.equal(s.status, 'leased', 'leased'); t.equal(s.instance, kine.config.instanceId, 'thi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get isCheckpoint() {\n return this.checkpoints.length > 0;\n }", "function hasChanges() {\n return datacontext.hasTransactionChanges();\n }", "checkTransactionsChange() {\n const transactions = JSON.stringify(this.getTransactions());\n const prevTransactions = localStorage.get...
[ "0.6477263", "0.58084667", "0.56561285", "0.5602671", "0.5496311", "0.5448951", "0.5448951", "0.544492", "0.5441325", "0.54311484", "0.54196763", "0.5339929", "0.53293246", "0.5294213", "0.5271223", "0.52493244", "0.5218903", "0.52063227", "0.52024627", "0.51738226", "0.51602...
0.75021577
0
Use formatTimeCallback to style the notch labels as you wish, such as with more detail as the number of pixels per second increases. Here we format as M:SS.frac, with M suppressed for times < 1 minute, and frac having 0, 1, or 2 digits as the zoom increases. Note that if you override the default function, you'll almost...
function formatTimeCallback(seconds, pxPerSec) { seconds = Number(seconds); var minutes = Math.floor(seconds / 60); seconds = seconds % 60; // fill up seconds with zeroes var secondsStr = Math.round(seconds).toString(); if (pxPerSec >= 25 * 10) { secondsStr = seconds.toFixed(2); } else if (pxPerSec >= 25 * 1)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatTimeTxt(inpMinutesNbr, inpFormatFlag) {\n\t\tvar rtnTxt;\n\n\t if ((inpMinutesNbr >= 0) && (inpMinutesNbr < 1440)) {\n\t var floatHour = inpMinutesNbr / 60.0;\n\t var hour = Math.floor(floatHour);\n\t var floatMinute = 60.0 * (floatHour - Math.floor(floatHour));\n\t va...
[ "0.6374434", "0.6251558", "0.61515623", "0.6040052", "0.59839445", "0.5981753", "0.5978354", "0.58885074", "0.58882725", "0.58861554", "0.5833356", "0.5831026", "0.5779738", "0.57766956", "0.57714033", "0.57527435", "0.5729265", "0.57199556", "0.57005984", "0.56809855", "0.56...
0.67183906
0
Return the cadence of notches that get labels in the primary color. EG, return 2 if every 2nd notch should be labeled, return 10 if every 10th notch should be labeled, etc. Note that if you override the default function, you'll almost certainly want to override formatTimeCallback, primaryLabelInterval and/or secondaryL...
function primaryLabelInterval(pxPerSec) { var retval = 1; if (pxPerSec >= 25 * 100) { retval = 10; } else if (pxPerSec >= 25 * 40) { retval = 4; } else if (pxPerSec >= 25 * 10) { retval = 10; } else if (pxPerSec >= 25 * 4) { retval = 4; } else if (pxPerSec >= 25) { retval = 1; } else if (pxPerSec * 5 >...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function primaryLabelInterval(pxPerSec) {\n var retval = 1;\n /*\n if (pxPerSec >= 25 * 100) {\n retval = 100;\n } else if (pxPerSec >= 25 * 40) {\n retval = 40;\n } else if (pxPerSec >= 25 * 10) {\n retval = 100;\n } else if (pxPerSec >= 25 * 4) {\n retval = 40;\n ...
[ "0.6551145", "0.6058911", "0.5699772", "0.55974597", "0.55324423", "0.5422409", "0.53942424", "0.5378973", "0.52118206", "0.5177422", "0.5168256", "0.51626945", "0.5145736", "0.5123452", "0.5065832", "0.50156826", "0.4998628", "0.49890137", "0.49651086", "0.4931848", "0.49300...
0.61571467
1
Return the cadence of notches to get labels in the secondary color. EG, return 2 if every 2nd notch should be labeled, return 10 if every 10th notch should be labeled, etc. Secondary labels are drawn after primary labels, so if you want to have labels every 10 seconds and another color labels every 60 seconds, the 60 s...
function secondaryLabelInterval(pxPerSec) { // draw one every 10s as an example return Math.floor(10 / timeInterval(pxPerSec)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function secondaryLabelInterval(pxPerSec) {\n // draw one every 10s as an example\n return Math.floor(2 / timeInterval(pxPerSec));\n}", "getTimeLabels() {\n\t\t// this.timeStart and this.timeStop are guaranteed to be integer multiples of 60.\n\t\tconst startHour = this.timeStart/60;\n\t\t// Hour and half-h...
[ "0.6806411", "0.62401617", "0.6225723", "0.5805684", "0.5729258", "0.56363726", "0.5558605", "0.5424176", "0.54194343", "0.53504926", "0.52473885", "0.5234039", "0.5209211", "0.52091163", "0.51850337", "0.5172587", "0.5142562", "0.50920856", "0.507177", "0.50699186", "0.50540...
0.6671307
1
Send the ID of clicked venue to the parent component
sendClickedVenue(key){ this.props.sendData(key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleClick(){\n this.dispatchEvent(new CustomEvent('selected',{\n detail:this.game.Id //return Game Id\n }))\n }", "function venuePage(){\n\tconsole.log(event.target);\n\tvenueIdCell = event.target.parentNode.lastChild;\n\twindow.location.href = \"venue/\" + venueIdCell.getAttribute(...
[ "0.6437024", "0.6216765", "0.61609125", "0.6127195", "0.61194044", "0.6099369", "0.60948485", "0.6086694", "0.5996655", "0.5996655", "0.5957807", "0.59505975", "0.5908654", "0.5884624", "0.58572507", "0.5840659", "0.5836936", "0.5816513", "0.58163834", "0.578498", "0.5784425"...
0.66965884
0
Returns the default style extension configured in the .angularcli.json file of a given project
function getDefaultStyleExt(host) { const filePath = '/.angular-cli.json'; const content = host.read(filePath) || new Buffer(""); const config = JSON.parse(content.toString()); return config.defaults.styleExt || 'css'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStylesPath(project) {\n const buildTarget = project.architect['build'];\n if (buildTarget.options && buildTarget.options.styles && buildTarget.options.styles.length) {\n const styles = buildTarget.options.styles.map(s => typeof s === 'string' ? s : s.input);\n // First, see if any o...
[ "0.5761865", "0.56896454", "0.547138", "0.53144383", "0.524342", "0.5241295", "0.5139752", "0.5060829", "0.5005649", "0.49981982", "0.4973899", "0.49613747", "0.49433476", "0.49211767", "0.49176946", "0.4877599", "0.48688093", "0.48574436", "0.48538005", "0.484771", "0.481379...
0.8386891
0
=========================================================================================================================== =========================================================================================================================== ========================================================================...
function get_idfacebook_from_url() { adverra_id_extractor(); function adverra_id_extractor() { text = ''; // iziToast.info({ // title: 'รอสักครู่', // position: 'topCenter', // timeout: 2000, // message: 'กำลังเช็ค ID...', // }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIDfromURL() {\n var url = window.location.href;\n var endofurl = url.split('=');\n var cur_uid = endofurl[endofurl.length-1];\n return cur_uid;\n}", "function extractIdFromUrl( url ) {\n if ( !url ) {\n return;\n }\n\n var matches = url.match( rWebUrl );\n retur...
[ "0.71797013", "0.68258715", "0.681971", "0.6768426", "0.6721131", "0.66487813", "0.6592369", "0.6592369", "0.65364033", "0.6526958", "0.64865935", "0.64473236", "0.64361084", "0.64030945", "0.63549143", "0.6323285", "0.6303792", "0.62533724", "0.62418306", "0.62318414", "0.62...
0.7561621
0
function to add buses icons using coordinates
function AddBus(Coordinates,label_marker) { var icon = { // car icon path: 'M29.395,0H17.636c-3.117,0-5.643,3.467-5.643,6.584v34.804c0,3.116,2.526,5.644,5.643,5.644h11.759 c3.116,0,5.644-2.527,5.644-5.644V6.584C35.037,3.467,32.511,0,29.395,0z M34.05,14.188v11.665l-2.729,0.351v-4.806L34.05,14.188z M32....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function icon(coords, custom_icon){\n\n let places_icon = L.icon({\n iconUrl: custom_icon,\n iconSize: [64, 64],\n iconAnchor: [35, 50],\n popupAnchor: [0, -50]\n });\n \n return L.marker(coords,{icon:places_icon})\n\n}", "renderLadybeetlesIcon() {\n const topMargin = ((3 / 40) * (this._s...
[ "0.62400764", "0.6192399", "0.6140504", "0.6078115", "0.60780126", "0.6072188", "0.6058222", "0.59996057", "0.58934313", "0.5880899", "0.5877429", "0.58330816", "0.5823151", "0.581935", "0.5806584", "0.5801265", "0.58004963", "0.578247", "0.5779512", "0.5766644", "0.576159", ...
0.6460315
0
fires when AddCompareComponent button is pressed
pushComponent(){ this.state.compareInstanceArr.push(<GitCompare key={this.state.objectKey} number={this.state.objectKey} deleteCompareInstance={this.deleteCompareInstance} setScoreArray={this.setScoreArray}/>); this.setState({ objectKey: this.state.objectKey+1 }, ()=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onClickADDComparison(){\n if(compname === \"\"){\n notification['warning']({\n message: 'Function Error',\n description:\n 'There is no company selected.',\n });\n }else{\n notification['success']({\n message: 'Operatio...
[ "0.66310465", "0.6231849", "0.59992975", "0.57387024", "0.57295007", "0.55726206", "0.5556014", "0.5541527", "0.55367446", "0.5536257", "0.5502024", "0.54838395", "0.54635394", "0.5394208", "0.5349884", "0.5345633", "0.53418404", "0.53004164", "0.5288246", "0.5280308", "0.527...
0.6472035
1
enables compare button when correct input detected
enableCompare(){ document.getElementById("finishIcon").style.display="none"; if(this.state.scoreArr.length >= 2 && this.state.scoreArr.length == this.state.compareInstanceArr.length){ for(var i = 0; i < this.state.compareInstanceArr.length; i++){ if(Object.keys(this.state.compareInstanceArr[i]).length <= 2){...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equalClickUpdate(){\n // display new value, set equalCLikedPrev to true, and reset variables\n if (equation != ''){\n equation = equation+displayVal;\n displayVal = eval(equation);\n displayValElement.value = displayVal;\n // change input background color if answer is 27\...
[ "0.6347529", "0.6160851", "0.615957", "0.61434066", "0.6138047", "0.6089997", "0.6074604", "0.60573256", "0.6041025", "0.6040006", "0.6000538", "0.59888077", "0.5930602", "0.59206444", "0.5910044", "0.59017414", "0.5895584", "0.5889152", "0.58591914", "0.58426744", "0.5796709...
0.6276257
1
draw the build buttons
draw_buttons(){ for(let item in build){ if(build[item].button !== false && (resources.all_available(build[item].button) || utilities.state_get('buttons').includes(item))){ // we have met the available resource requirements console.log(`Build button: ${build[item].titl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw_Buttons() {\r\n btnDown.drawButton(context1.context);\r\n btnUp.drawButton(context1.context);\r\n btnLeft.drawButton(context1.context);\r\n btnRight.drawButton(context1.context);\r\n btnFire.drawButton(context1.context);\r\n btnMiddle.drawButton(context1.context);\r\n }", "functi...
[ "0.7308096", "0.7069036", "0.70524865", "0.6566331", "0.65218097", "0.64901376", "0.64594865", "0.64529675", "0.6435108", "0.6408133", "0.6403675", "0.6370769", "0.6358919", "0.6340725", "0.6312733", "0.6301156", "0.6287945", "0.62877953", "0.6258992", "0.6258248", "0.6256183...
0.7492334
0
enable/disable build buttons based on resources
build_button_toggle(){ for(item in build){ // buttons we can see based on local storage if(utilities.state_get('buttons').includes(item)){ // do we have the resources available and does it not already exist if(resources.all_available(build[item].cost) && b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enableButtons()\n {\n //show buttons for updating and creating new workflow\n $(\"#perc-update-wf-save-cancel-block\").show();\n $(\"#perc-new-wf-save-cancel-block\").show();\n }", "draw_buttons(){\n for(let item in build){\n if(build[item...
[ "0.6410138", "0.6343021", "0.6164954", "0.6082211", "0.5904195", "0.58207554", "0.5762347", "0.5758078", "0.57405657", "0.57264924", "0.57109797", "0.57000643", "0.569336", "0.5685433", "0.5635899", "0.56061304", "0.5566342", "0.555876", "0.55550575", "0.5548391", "0.55472153...
0.77985126
0
Set up callbacks on payload setters in Api module This causes the displayMessage function to be called when messages are sent / received
function chatUpdateSetup() { var currentRequestPayloadSetter = Api.setRequestPayload; Api.setRequestPayload = function(newPayloadStr) { currentRequestPayloadSetter.call(Api, newPayloadStr); displayMessage(JSON.parse(newPayloadStr), settings.authorTypes.user); }; var currentResponsePayloadSe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chatUpdateSetup() {\n const currentRequestPayloadSetter = Api.setRequestPayload;\n Api.setRequestPayload = function (newPayloadStr) {\n currentRequestPayloadSetter.call(Api, newPayloadStr);\n displayMessage(JSON.parse(newPayloadStr), settings.authorTypes.user);\n };\n\n const current...
[ "0.6381942", "0.63167983", "0.6147207", "0.61404824", "0.6091013", "0.60772365", "0.6065075", "0.6057461", "0.60176796", "0.5813368", "0.57584774", "0.5746356", "0.57260686", "0.5711504", "0.56719184", "0.5660166", "0.56579196", "0.5630097", "0.5608789", "0.5592002", "0.55909...
0.63914675
0
Checks if the given typeValue matches with the user "name", the Watson "name", or neither Returns true if user, false if Watson, and null if neither Used to keep track of whether a message was from the user or Watson
function isUserMessage(typeValue) { if (typeValue === settings.authorTypes.user) { return true; } else if (typeValue === settings.authorTypes.watson) { return false; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isUserMessage(typeValue) {\n if (typeValue === settings.authorTypes.user) {\n return true;\n } else if (typeValue === settings.authorTypes.watson) {\n return false;\n }\n return null;\n}", "function check(name, value, type) {\n switch (type) {\n\n case 'object':\n case 'array':\n v...
[ "0.71420807", "0.5567757", "0.5518321", "0.5502521", "0.5502521", "0.5491711", "0.5491711", "0.5491711", "0.5485132", "0.5485132", "0.5485132", "0.5485132", "0.54830736", "0.53972435", "0.5388934", "0.5382603", "0.5372332", "0.5371155", "0.53037214", "0.5263425", "0.524812", ...
0.71633315
0
Scroll to the bottom of the chat window (to the most recent messages) Note: this method will bring the most recent user message into view, even if the most recent message is from Watson. This is done so that the "context" of the conversation is maintained in the view, even if the Watson message is long.
function scrollToChatBottom() { var scrollingChat = document.querySelector('#scrollingChat'); // Scroll to the latest message sent by the user var scrollEl = scrollingChat.querySelector(settings.selectors.fromUser + settings.selectors.latest); if (scrollEl) { scrollingChat.scrollTop = scrollEl.of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrollToChatBottom() {\n const scrollingChat = document.querySelector('#scrollingChat');\n\n // Scroll to the latest message sent by the user\n const scrollEl = scrollingChat.querySelector(settings.selectors.fromUser\n + settings.selectors.latest);\n if (scrollEl) {\n scrollingChat.s...
[ "0.8403551", "0.8313432", "0.82126814", "0.8170353", "0.8168666", "0.81674314", "0.80265236", "0.7980517", "0.7978438", "0.79680264", "0.7944458", "0.7919324", "0.79155445", "0.79152584", "0.7888171", "0.78649443", "0.7851005", "0.78398955", "0.78379446", "0.7798681", "0.7794...
0.84031546
1
Checks the various frames which could contain a dirty flag set to true to see if any of them are dirty. If so, returns true. Otherwise false.
function isAnyoneDirty() { // Default to current frame's value if one exists var areWeDirty = isDirty(); // First check if master/detail form layout exists, call detail frame's isDirty() method, as this is what will be set if (top.frameWorkspace.frameWorkspaceWrapper != null && top.frameWorkspace...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== nul...
[ "0.7093092", "0.7093092", "0.7093092", "0.7093092", "0.7093092", "0.7093092", "0.682822", "0.6391699", "0.6322303", "0.62930846", "0.62476295", "0.6055417", "0.60381746", "0.60381746", "0.60381746", "0.60381746", "0.60381746", "0.6010209", "0.5993732", "0.59806097", "0.598060...
0.743076
0
This version is used by Safari browsers when user attempts to navigate away from entire site or hits refresh, thus causing the entire window to fire a beforeunload event. Safari does not work with the event e argument in the confirmNavigationIfDirty(e) method used by other browsers.
function confirmNavigationIfDirtyWithoutEvent() { // If Any Frame's Data Has Changed Since Last Save - This is necessary because the beforeunload event is coming from the main window if (isAnyoneDirty()) { return "You are now leaving this page. If you continue, any unsaved data will be lost."; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmNavigationIfDirtyAndSafari()\r\n{\r\n var doNavigation = true;\r\n\r\n // Work-around for Safari, as it does not support beforeunload event within frames or iframes.\r\n // As of Safari Version 5.0.6, the behavior of onbeforeunload in frames is supported. This behavior only applies to\r\n ...
[ "0.8258664", "0.69188523", "0.65689355", "0.6526615", "0.65073085", "0.64339334", "0.63981205", "0.6386607", "0.6307159", "0.6307159", "0.6307159", "0.6307159", "0.6307159", "0.6307159", "0.6307159", "0.6307159", "0.6307159", "0.6307159", "0.6307159", "0.6307159", "0.6307159"...
0.7669061
1
Safari User Agent includes Version/... This extracts the .. string from the current user agent.
function extractSafariVersionString() { var safariVersionString = navigator.userAgent.match(safariVersionRegex)[firstMatchIndex]; if (safariVersionString != null) { safariVersionString = safariVersionString.substring(safariVersionStartIndex, safariVersionString.length); } return saf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detectUserAgentVersion() {\r\n return _opera ? (opera.version().replace(/\\d$/, \"\") - 0) // Opera10 shock\r\n : _float((/(?:IE |fox\\/|ome\\/|ion\\/)(\\d+\\.\\d)/.\r\n exec(_nu) || [,0])[1]);\r\n}", "Safari ():boolean {\n\n\t\treturn (this.agent.match(/Safari/i)...
[ "0.58309174", "0.5824679", "0.57227176", "0.57225645", "0.56951845", "0.5653622", "0.5595005", "0.5512232", "0.5503262", "0.5503262", "0.5503262", "0.5498809", "0.5484811", "0.54311794", "0.53481805", "0.5303275", "0.52496314", "0.5231935", "0.5192852", "0.51874346", "0.51777...
0.74173766
0
If the page is dirty and the user's browser is Safari, prompt using a standard dialog window to confirm navigation away from page with potentially unsaved data. Returns: true/false whether to navigate (used by calling methods)
function confirmNavigationIfDirtyAndSafari() { var doNavigation = true; // Work-around for Safari, as it does not support beforeunload event within frames or iframes. // As of Safari Version 5.0.6, the behavior of onbeforeunload in frames is supported. This behavior only applies to // Safari vers...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirmNavigationIfDirtyWithoutEvent()\r\n{\r\n // If Any Frame's Data Has Changed Since Last Save - This is necessary because the beforeunload event is coming from the main window\r\n if (isAnyoneDirty())\r\n {\r\n return \"You are now leaving this page. If you continue, any unsaved data ...
[ "0.672237", "0.62575877", "0.59405094", "0.59273875", "0.5912898", "0.5886983", "0.58628094", "0.58618027", "0.583511", "0.57845277", "0.56084436", "0.56031394", "0.55604696", "0.5503327", "0.54804194", "0.54740393", "0.5471574", "0.54558253", "0.5451709", "0.54410946", "0.54...
0.8327527
0
search an object match the criteria v
function searchObj(obj, criteria, multiple) { if(!criteria) return null; var arr = criteria.split(";"); if(arr.length < 1) return null; for(var i=0, max=arr.length; i<max; i++) arr[i] = arr[i].split("="); if(!multiple) return _searchObj(obj, arr); var ret = new Array(); _searchObj(obj,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SearchObj(obj, query) {\n this.itemData;\n\n for (var key in obj) {\n if (typeof obj[key] === 'object') {\n SearchObj(obj[key], query);\n }\n\n if (obj[key] == query) {\n itemData = obj;\n return false;\n ...
[ "0.68395555", "0.64844257", "0.639506", "0.6383068", "0.6344011", "0.634156", "0.6317991", "0.6266178", "0.6220723", "0.61299783", "0.6110999", "0.6078172", "0.60477704", "0.6024162", "0.59945387", "0.5984766", "0.5967965", "0.5891644", "0.58884156", "0.58580214", "0.5848853"...
0.65253097
1
=================================================================================================================== function is used to check if request is AJAX request ===================================================================================================================
function checkIfAJAXRequest(req) { return (req.headers && ((req.headers['x-requested-with'] && req.headers['x-requested-with'] === 'XMLHttpRequest') || (req.headers['content-type'].indexOf('application/json') !== -1)) ? true : false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isSyncAjax(objRequest) {\t\t\t\t \r\n\tif(objRequest.readyState == 4){ \r\n\t\tif(objRequest.status == 200){ \r\n\t\t\treturn true; \r\n\t\t} \r\n\t} \r\n return false; \r\n}", "function checkAjax()\n{\n\tvar request = null;\n\tif(window.XMLHttpRequest)\n\t{\n\t\trequest = new XMLHttpRequest()...
[ "0.772306", "0.71668667", "0.708278", "0.6645105", "0.64207524", "0.6400437", "0.6300273", "0.62539274", "0.6126493", "0.6015063", "0.6015063", "0.5987767", "0.59817266", "0.5963658", "0.5942972", "0.59212065", "0.5920424", "0.58939826", "0.5888927", "0.58738685", "0.581164",...
0.85226315
0
Constructor for Greeter objects
function Greeter(name) { this.name = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Greeter(name) {\n\tthis.name = name || 'John Doe'\n}", "function Greeter(phase) {\n this.phase = phase;\n}", "function Greeting(name){\n this.name = name\n}", "function createGreeter(greeting) {\n return { greet: function(name){\n return `${greeting}, ${name}!`\n }}\n }", "function...
[ "0.7989036", "0.75440735", "0.7108606", "0.6967308", "0.6879756", "0.6705544", "0.66689426", "0.66458887", "0.66380775", "0.6628541", "0.6601487", "0.6597247", "0.64749604", "0.6466061", "0.62795293", "0.6265655", "0.6265655", "0.62538165", "0.6240782", "0.6216606", "0.620192...
0.8064269
0
Listener on "Add Article" button that opens form to add new article
newArticleListener() { let newArticleBtn = document.querySelector("button.article-button") newArticleBtn.addEventListener("click", () => { let newsCreator = new Form("Add Article", "news-editor", newsInputs.articleInputs) let newsCreate = newsCreator.build() newsCreate.render(".form-conta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addArticleClicked(event){\n addResource(\"article\", this, event)\n }", "function addNewItem() { switchToView('edit-form'); }", "newNews () {\n new comp.div({className: \"newsForum\"},\n new comp.div({id: \"alert\"}),\n new comp.input({name: \"articleName\", placeholder: \"Article N...
[ "0.75857353", "0.6935377", "0.66790295", "0.6608493", "0.6581484", "0.6565209", "0.6558326", "0.6535797", "0.64936763", "0.6490795", "0.648682", "0.6454432", "0.640342", "0.63701993", "0.6364205", "0.62962234", "0.6221685", "0.61361945", "0.6128045", "0.6117931", "0.6117116",...
0.81462854
0
Updates the text shown on the flashcard after a button press.
function updateFront(){ document.getElementById("flashcard-content-front").innerHTML = currentText; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateText() {\n\t \tvar actionButton = document.getElementById(\"capture\");\n\t \t/* Check player's state. */\n\t \tif( _Nimbb.getState() == \"recording\" ) {\n\t \t \t/* Update link text. */\n\t \t \tactionButton.innerHTML = \"stop (\" + _Count + \")\";\n\t \t} else {\n\t \t \tactionButton.innerHTML...
[ "0.68086135", "0.65586096", "0.65331477", "0.6451533", "0.6413445", "0.6372362", "0.6286252", "0.6279449", "0.62715715", "0.62237", "0.6219819", "0.6214145", "0.6214145", "0.62014866", "0.6197282", "0.61097765", "0.61085737", "0.6084738", "0.6076628", "0.60685885", "0.6048381...
0.7408218
0
============================================================================== Request mesh data from server ==============================================================================
function LoadMesh(Addr, obj){ download(Addr) .then((mesh)=>{ console.groupCollapsed("Receiving Mesh..."); console.log("Loading model: "+ Addr); BindMesh(JSON.parse(mesh), obj); }) .catch((err)=>{console.log(err);}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRhinoLogoMeshes() {\n if( RHINOLOGO.doc!=null ) {\n alert(\"Model already loaded\");\n return;\n }\n req = new XMLHttpRequest();\n req.open(\"GET\", \"https://files.mcneel.com/rhino3dm/models/RhinoLogo.3dm\");\n req.responseType = \"arraybuffer\";\n req.addEventListener(\"lo...
[ "0.59864956", "0.59552103", "0.5936081", "0.5899307", "0.58685297", "0.5844052", "0.5781796", "0.57178485", "0.5701557", "0.56407595", "0.5639134", "0.56321454", "0.5613638", "0.55751497", "0.5539447", "0.55354905", "0.5512497", "0.5495441", "0.54886436", "0.5401377", "0.5395...
0.6791097
0
Creating object BookInformation with constructor
function BookInformation(bookIdFromArry, language, author, imgLink) { this.BookInformation = bookIdFromArry; this.title = bookIdFromArry.toUpperCase(); this.language = language; this.author = author; this.imgLink = imgLink; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Book(info) {\n this.image_url= info.imageLinks?info.imageLinks.thumbnail:'https://i.imgur.com/J5LVHEL.jpg';\n this.title = info.title || 'No title available';\n this.author=info.authors;\n this.description=info.description;\n this.isbn=info.industryIdentifiers ? info.industryIdentifiers[0].identif...
[ "0.79853004", "0.7661797", "0.76164466", "0.7615213", "0.75490254", "0.7533176", "0.7455207", "0.743607", "0.7417084", "0.7363623", "0.7363623", "0.7363623", "0.7363623", "0.7363623", "0.7358544", "0.73505497", "0.73269874", "0.7326754", "0.73123825", "0.7243", "0.72326183", ...
0.7861741
1
Function to be called when pattern loads
function onload() { // Create pattern pattern = context.createPattern(img, repeat); element.set('pattern', pattern); // be a cache element.set('patternSource', patternStr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onload() {\n // Create pattern\n pattern = context.createPattern(img, repeat);\n element.set('pattern', pattern); // be a cache\n\n element.set('patternSource', patternStr);\n }", "function onload() {\n // Create pattern\n pattern = context.createPattern(img, repeat);\n element.set...
[ "0.6544287", "0.6544287", "0.63000786", "0.63000786", "0.63000786", "0.63000786", "0.6296875", "0.6266845", "0.6242665", "0.6081814", "0.60112274", "0.5973996", "0.59369826", "0.5901322", "0.5875612", "0.58600295", "0.5858266", "0.584742", "0.584241", "0.5804467", "0.5800982"...
0.6614207
0
Parses given path string into an array of arrays of path segments
function parsePathString(pathString) { if (!pathString) { return null; } if (is_array_default()(pathString)) { return pathString; } var paramCounts = { a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parsePathString(pathString) {\n if (!pathString) {\n return null;\n }\n if (is_array_1.default(pathString)) {\n return pathString;\n }\n var paramCounts = {\n a: 7,\n c: 6,\n o: 2,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\...
[ "0.67439026", "0.6738907", "0.6678001", "0.66725636", "0.66703284", "0.664867", "0.66249996", "0.6608894", "0.65671355", "0.6550548", "0.64973867", "0.63995063", "0.6392483", "0.62828004", "0.62793", "0.6261612", "0.62583506", "0.62583506", "0.62583506", "0.6244482", "0.62339...
0.6788724
0
get candle shape's key points
function getCandlePoints(x, y, size) { var yValues = getCandleYValues(y); return [ { x: x, y: yValues[0] }, { x: x, y: yValues[1] }, { x: x - size / 2, y: yValues[2] }, { x: x - size / 2, y: yValues[1] }, { x: x + size / 2, y: yValues[1] }, { x: x + size / 2, y: y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPoints() {}", "function getKeyPoints() {\n let keyPoints = [];\n\n keyPoints.push(getTopOfObject(firstPart)); // 0\n\n keyPoints.push(getTopOfObject(aboutSection)); // 1\n keyPoints.push(getEndOfObject(aboutSection)); // 2\n\n keyPoints.push(getTopOfObject(slider)); // 3 Map the music\...
[ "0.6552277", "0.64377755", "0.60796994", "0.6006549", "0.60030603", "0.5979933", "0.59628105", "0.5953252", "0.589426", "0.5846755", "0.5835436", "0.5828016", "0.57570213", "0.5734582", "0.5676188", "0.5668488", "0.56656873", "0.56438035", "0.56242484", "0.5621073", "0.561586...
0.6534346
1
get direction after coordinate transpose
function getTransposedDirection(direction, coordinate) { if (coordinate.isTransposed) { switch (direction) { case DIRECTION.BOTTOM: return DIRECTION.LEFT; case DIRECTION.LEFT: return DIRECTION.BOTTOM; case DIRECTION.RIGHT: r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTransposedDirection(direction, coordinate) {\n if (coordinate.isTransposed) {\n switch (direction) {\n case constant_1.DIRECTION.BOTTOM:\n return constant_1.DIRECTION.LEFT;\n\n case constant_1.DIRECTION.LEFT:\n return constant_1.DIRECTION.BOTTOM;\n\n case constant_1.DIR...
[ "0.7007109", "0.68315387", "0.66310394", "0.63923657", "0.63457334", "0.6252032", "0.62200004", "0.6193777", "0.61754286", "0.6145356", "0.6126994", "0.60852647", "0.6051522", "0.603027", "0.6014995", "0.60136306", "0.60032856", "0.5981347", "0.59743804", "0.59739727", "0.594...
0.69127613
1
get direction after coordinate.scale
function getScaleDirection(direction, coordinate) { var x = coordinate.matrix[0]; var y = coordinate.matrix[4]; var d = direction; if (x < 0) { d = reflectX(d); } if (y < 0) { d = reflectY(d); } return d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getScaleDirection(direction, coordinate) {\n var x = coordinate.matrix[0];\n var y = coordinate.matrix[4];\n var d = direction;\n\n if (x < 0) {\n d = reflectX(d);\n }\n\n if (y < 0) {\n d = reflectY(d);\n }\n\n return d;\n}", "getDirection() {\n return Math.atan2(this.y, this.x);\n...
[ "0.8031364", "0.67217886", "0.6595799", "0.63549685", "0.6352864", "0.63284826", "0.6257105", "0.62403464", "0.62326574", "0.62326574", "0.62326574", "0.6207828", "0.6188422", "0.6188422", "0.6188422", "0.6188422", "0.6188422", "0.6183559", "0.6183559", "0.6155854", "0.610344...
0.8103174
0
Parses given path string into an array of arrays of path segments
function parsePathString(pathString) { if (!pathString) { return null; } if (is_array_1.default(pathString)) { return pathString; } var paramCounts = { a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parsePathString(pathString) {\n if (!pathString) {\n return null;\n }\n if (is_array_default()(pathString)) {\n return pathString;\n }\n var paramCounts = {\n a: 7,\n c: 6,\n o: 2,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\...
[ "0.6788724", "0.6738907", "0.6678001", "0.66725636", "0.66703284", "0.664867", "0.66249996", "0.6608894", "0.65671355", "0.6550548", "0.64973867", "0.63995063", "0.6392483", "0.62828004", "0.62793", "0.6261612", "0.62583506", "0.62583506", "0.62583506", "0.6244482", "0.623393...
0.67439026
1
definissons la fonction loadSong
function loadSong(){ song.src = songs[currentSong]; songtitle.textContent = (currentSong + 1) + ". " + songs[currentSong]; nextSongTitle.innerHTML = ("<b>Next Song: </b>") + songs[currentSong + 1]; song.volume = volumeSlider.value; song.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadSong(song) {\n title.innerText = song;\n audio.src = `music/${song}.aac`;\n}", "function loadSong(song) {\n cover.src = song.coverPath;\n disc.src = song.discPath;\n title.textContent = song.title;\n artist.textContent = song.artist;\n duration.textContent = song.duration;\n}", "function lo...
[ "0.77717197", "0.77610624", "0.7754805", "0.7749779", "0.7707947", "0.75864285", "0.752218", "0.743337", "0.7366229", "0.73356044", "0.7303128", "0.7286082", "0.71211046", "0.7074824", "0.7074824", "0.6982097", "0.69790727", "0.69740146", "0.695673", "0.69537276", "0.6947722"...
0.7929362
0
when the mouse is pressed the canvas will change to a random value between 1 and 100000 each value between 0 and 100000 has a pattern specific to that number i.e. 5 will always look the same even if the canvas is reloaded
function mouseReleased() { actRandomSeed = random(100000); loop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mousePressed(){\ngrid.randomize();\n}", "function keyPressed() {\n var size = random(0, width / 5);\n drawWeb(mouseX, mouseY, size);\n}", "function mousePressed() {\n // Selects a random int for r from 0-255\n r = random(255);\n // Selects a random int for g from 0-255\n g = random(255);...
[ "0.71060723", "0.695062", "0.69270444", "0.6920973", "0.67479926", "0.674526", "0.6665315", "0.66484886", "0.6634221", "0.6627397", "0.66115725", "0.65763116", "0.65718055", "0.6562494", "0.6484267", "0.6407063", "0.6395668", "0.63819784", "0.6358451", "0.6337353", "0.6333562...
0.7113989
0
given a module type, build kgraphchild
function buildKGraphChild(skin_data, n) { // labels: [ { text: "n2" } ], var template = findSkinType(skin_data, n.type); var type = template[1]['s:type']; if (type == 'join' || type == 'split' || type == 'generic') { var inPorts = getPortsWithPrefix(template, 'in'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildChildren(reflection, parent) {\n var modules = reflection.getChildrenByKind(td.models.ReflectionKind.SomeModule);\n modules.sort(function (a, b) {\n return a.getFullName() < b.getFullName() ? -1 : 1;\n });\n ...
[ "0.60079503", "0.58421755", "0.57609826", "0.52612865", "0.51972264", "0.51766676", "0.51211375", "0.51014596", "0.5081543", "0.50296646", "0.50296646", "0.5015939", "0.50104755", "0.5002001", "0.5002001", "0.5002001", "0.4982921", "0.4977679", "0.49683568", "0.49676177", "0....
0.59617925
1
returns an array of ports that are going a specific direction the elements in this array are obects whose members are key and value where key is the port name and value is the connection array
function getCellPortList(cell, direction) { var ports = _.filter(_.flatMap(cell.connections, function(val, key) { return {key:key, value:val}; }), function(val) { return cell.port_directions[val.key] == direction; }); return ports; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPorts(data) {\n const ports = {};\n const group = [];\n for (let i = 0; i < data.length; i++) {\n const origin = data[i].origin;\n const sourcePosition = data[i].sourcePosition;\n const destination = data[i].destination;\n const targetPosition = data[i].targetPosition;\n\n ...
[ "0.6656572", "0.63216084", "0.6260047", "0.60091865", "0.5921068", "0.5858163", "0.57776", "0.5696989", "0.56435883", "0.55782795", "0.5458296", "0.5404092", "0.54026043", "0.53158134", "0.52834815", "0.5184587", "0.5167549", "0.51629543", "0.5159198", "0.5148062", "0.5145242...
0.6851056
0
returns a reformatted module a flat module has a list of nodes that include all input and output ports
function getReformattedModule(module) { var ports= toArray(module.ports); var inputPorts = _.filter(ports, function(p) { return p.direction=='input'; }); var outputPorts = _.filter(ports, function(p){ return p.direction=='output'; }); var cells = toArray(module.cells); inputP...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addSplitsJoins(module)\n{\n var allInputs = [];\n var allOutputs = [];\n module.nodes.forEach(function(n)\n {\n n.inputPorts.forEach(function(i)\n {\n allInputs.push(',' + i.value.join() + ',');\n });\n n.outputPorts.forEach(function(i)\n {\n ...
[ "0.61959743", "0.5370116", "0.5315659", "0.5289143", "0.5262412", "0.52539515", "0.5213035", "0.5198238", "0.5172972", "0.5169794", "0.5168625", "0.50491583", "0.5028357", "0.50171906", "0.4995993", "0.49937153", "0.49931794", "0.49780864", "0.49412194", "0.4935949", "0.49330...
0.78012806
0
converts input ports with constant assignments to constant nodes
function addConstants(module) { // find the maximum signal number var maxNum=-1; module.nodes.forEach(function(n) { n.outputPorts.forEach(function(p) { maxNum = _.max([maxNum, _.max(p.value)]); }); }); // add constants to nodes var signalsByConstantName = {}; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizePort(val){cov_12fvjqzcov().f[0]++;const port=(cov_12fvjqzcov().s[9]++,parseInt(val,10));cov_12fvjqzcov().s[10]++;if(isNaN(port)){cov_12fvjqzcov().b[1][0]++;cov_12fvjqzcov().s[11]++;// named pipe\nreturn val;}else{cov_12fvjqzcov().b[1][1]++;cov_12fvjqzcov().s[12]++;if(port>=0){cov_12fvjqzcov().b[2...
[ "0.5271582", "0.51478696", "0.50554603", "0.49949437", "0.49130005", "0.49005696", "0.4854687", "0.48433748", "0.4828099", "0.48217976", "0.47935757", "0.4787652", "0.4775579", "0.47635353", "0.47594705", "0.4736407", "0.46996152", "0.46525842", "0.46432745", "0.46393037", "0...
0.62088215
0
solves for minimal bus splits and joins and adds them to module
function addSplitsJoins(module) { var allInputs = []; var allOutputs = []; module.nodes.forEach(function(n) { n.inputPorts.forEach(function(i) { allInputs.push(',' + i.value.join() + ','); }); n.outputPorts.forEach(function(i) { allOutputs....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getData () {\n let data = []\n // console.log(this.objects)\n for (let key in this.objects) {\n if (key === 'indexDBId') continue\n for(let key2 in this.objects[key]) {\n if (key2 === 'indexDBId') continue\n data.push(this.objects[key][key2])\n } \n }\n\n let Compo...
[ "0.53990406", "0.5379713", "0.5366121", "0.5264618", "0.5150844", "0.514155", "0.50506973", "0.49885657", "0.49836934", "0.49605775", "0.48510697", "0.48493543", "0.48310667", "0.48275292", "0.47781685", "0.4775589", "0.47729546", "0.47572517", "0.4726081", "0.47157046", "0.4...
0.61589074
0
returns the index of the string that contains a substring given arrhaystack, an array of strings
function indexOfContains(needle, arrhaystack) { for (var i in arrhaystack) { if (arrayContains(needle, arrhaystack[i])) { return i; } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchStringInArray (str, strArray) {\n str = getRootUrl(str);\n for (var j=0; j<strArray.length; j++) {\n if (strArray[j].match(str)) return j;\n }\n return -1;\n}", "function contains(arr, str){\n\tvar i;\n\tfor(i = 0; i < arr.length; i++){\n\t\tif(arr[i][0] === str){\n\t\t\treturn ...
[ "0.747659", "0.73847675", "0.73292345", "0.71583873", "0.7056896", "0.6986613", "0.69576746", "0.6904502", "0.68529344", "0.6852224", "0.68516713", "0.68233347", "0.6820444", "0.68113333", "0.67822134", "0.672447", "0.66776353", "0.66474533", "0.66337955", "0.66093314", "0.65...
0.76119137
0
Write a function positiveNumbers which is given an array of numbers and returns a new array containing only the positive numbers within the given array. positiveNumbers([1, 3, 5, 3, 0]) [1, 5, 0] positiveNumbers([1, 2, 3]) [1, 2, 3] positiveNumbers([1, 2, 3]) []
function positiveNumbers(given) { let newArray = []; for (let i = 0; i < given.length; i++) // if (given[i] >= 0) { // newArray.push(given[i]); // } given[i] >= 0 && newArray.push(given[i]); return newArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function posNumbers(numbers) {\n const positiveNums = [];\n for (let num of numbers) {\n if (num > 0) {\n positiveNums.push(num);\n }\n}\n return positiveNums; \n}", "function positiveNumbers(posArray) {\n\n}", "function getPositiveNum(array) {\n let positiveNumArray = [];\n for...
[ "0.803593", "0.799422", "0.7938376", "0.78728676", "0.7667948", "0.76405036", "0.75267434", "0.7511433", "0.74846333", "0.74770105", "0.7400017", "0.7281161", "0.72576946", "0.7203089", "0.7172236", "0.71273506", "0.7124226", "0.71007484", "0.6993866", "0.6872002", "0.6865495...
0.8168778
0
FIN funciones COOKIES Funcion para eliminar nuestra Cookie
function eliminarCookie(){ deleteCookie("visitas"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteCookie(nombre){\n setCookie(nombre,\"\",0);\n }", "function eraseCookie(c_name){\n createCookie(c_name,\"\",-1);\n}", "function borrarCookies() {\n $.removeCookie('user_name');\n $.removeCookie('email');\n $.removeCookie('id');\n $.removeCookie('nivel');\n $.removeCookie('maxN...
[ "0.82365686", "0.8038631", "0.80160904", "0.7883474", "0.7849566", "0.7796086", "0.77747947", "0.7773497", "0.7768966", "0.7699556", "0.7674193", "0.76472634", "0.7645036", "0.76172066", "0.760665", "0.75976276", "0.7575433", "0.7573439", "0.7551745", "0.7548159", "0.75472414...
0.8236069
1
Extend usage options (e.g. `File.write(options)`) with collection configuration (which also includes adapter defaults)
function extendOptions(cid, options) { if (cid) { return _.extend({}, adapterConf, collectionConfs[cid], options); } return _.extend({}, adapterConf, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExtraOptions(){}", "function ExtraOptions() {}", "function ExtraOptions() {}", "extend(options) {\n this.prepare.forEach(item => {\n if (!options[item]) throw new Error(item + ' method is not available');\n this[item] = options[item];\n });\n }", "function Ex...
[ "0.6149194", "0.61052", "0.61052", "0.60585916", "0.5890328", "0.5890328", "0.5769442", "0.55285496", "0.5510602", "0.5492078", "0.5489446", "0.54874754", "0.5479551", "0.54573804", "0.54138666", "0.5404769", "0.5404769", "0.5404769", "0.5404769", "0.5404769", "0.53937554", ...
0.6360396
0
This function resizes the sidebarcontent and maincontainer containers when the application is started or the window is resized. Important: If you change the constants in this function, you must also change the appropriate constants in the stylesheet.
function resizeContainers() { var em = parseFloat(getComputedStyle(document.body).fontSize); //Calculate how many pixels an em is document.getElementById("sidebar-content").style.maxHeight = //This is the main content of the sidebar String(innerHeight - em * 8) + "px"; document.getElementById("main-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeContainers() {\n\tvar padding = 5;\n\n\t// mainContainer\n\t// =======================================================\n\tvar mainContainerHeight\t\t\t\t= $('#mainWindow').outerHeight(true);\n//\tconsole.log('mainContainerHeight: ' + mainContainerHeight);\n\n\tvar mainContainerWidth\t\t\t\t= $('#mai...
[ "0.70550954", "0.68700975", "0.68485004", "0.6783666", "0.6674024", "0.6640299", "0.65961176", "0.6440369", "0.643734", "0.63540715", "0.63282424", "0.63228905", "0.6318747", "0.6316261", "0.62852347", "0.6248112", "0.62359613", "0.6209637", "0.6206084", "0.6180788", "0.61766...
0.7161855
0
=============================================================== =============================================================== self update neonjs invoke parameters (in json format)
function updateInvokeParamsJs() { //console.log("updating js json..."); invokefunc = ""; if ($("#invokefunctionjs")[0].value != "Main") invokefunc = $("#invokefunctionjs")[0].value; // method var arrayparam = []; //console.log("function is "+invokefunc); var neonJSParams = []; if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_params () {\n\t\tvar config = Jupyter.notebook.config;\n\t\tfor (var key in params) {\n\t\t\tif (config.data.hasOwnProperty(key)) {\n\t\t\t\tparams[key] = config.data[key];\n\t\t\t}\n\t\t}\n\t}", "update(x0, y0, height, horizon, theta){\n this.worker.postMessage({\n cmd: 'set_params',\n\n...
[ "0.6447131", "0.6396118", "0.5702382", "0.56957036", "0.56312144", "0.55015105", "0.5490077", "0.54623306", "0.5422614", "0.54211706", "0.54208827", "0.53426975", "0.53426975", "0.53426975", "0.53426975", "0.53426975", "0.53426975", "0.53426975", "0.5339749", "0.5328884", "0....
0.71763426
0
Empty endpoint to verify a TOTP token
verifyTOTPToken (request, reply) { reply(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getServerOTP() {\n var authnData = {\n \"authId\": AUTH_ID,\n \"hint\": \"GET_SERVER_OTP\" //dont change this value.\n };\n authenticate(authnData);\n}", "function verifyTOTP(secretKey, totpToken) {\n\tlet result = speakeasy.totp.verify({\n\t\tsecret: secretKey,\n\t\tencoding: \"b...
[ "0.68602246", "0.6628446", "0.65466434", "0.64527047", "0.6450262", "0.6388824", "0.625586", "0.6246161", "0.62149984", "0.617344", "0.6139442", "0.60803574", "0.6080254", "0.6005257", "0.59478515", "0.59478074", "0.59401876", "0.5839752", "0.5839621", "0.58356893", "0.582184...
0.76815706
0
Enables TOTP for current user
enable (request, reply) { const user = request.params.currentUser; const that = this; if (user.totp === true) { // TOTP is already enabled, user needs to disable it first this.log.warn('2FA already enabled. No need to reenable.', { security: true, fail: true, request: request}); return rep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async enable({ user, otp }) {\n const [secret, token] = otp.split(':');\n if (!authenticator.verify({ token, secret })) {\n throw Boom.unauthorized('Invalid OTP');\n }\n // store authenticator secret\n await setUserData(user.id, USER_DATA_KEY, secret);\n }", "disa...
[ "0.7540961", "0.6296425", "0.62108827", "0.61829364", "0.60008097", "0.59562314", "0.5875457", "0.5795025", "0.5749338", "0.57443625", "0.5627459", "0.5602496", "0.5557864", "0.55480254", "0.54990405", "0.54955316", "0.54703796", "0.5403485", "0.53752244", "0.53600204", "0.53...
0.72745293
1
Disables TOTP for current user
disable (request, reply) { const user = request.params.currentUser; const that = this; if (user.totp !== true) { // TOTP is already disabled this.log.warn('2FA already disabled.', { security: true, fail: true, request: request}); return reply(Boom.badRequest('2FA is already disabled.')); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "unblockUser() {\r\n\r\n }", "async disable({ user }) {\n await unsetUserData(user.id, USER_DATA_KEY);\n }", "function disableUser(){\n newUser.enabled = false;\n grasshopper.request(adminToken).users.update(newUser).then(loadInactiveUser).done();\n }", "fun...
[ "0.6433285", "0.6418532", "0.63051623", "0.6217881", "0.60911816", "0.60069263", "0.59790766", "0.5975799", "0.5950534", "0.5948179", "0.5948179", "0.5948179", "0.5948179", "0.5948179", "0.59245133", "0.59031475", "0.587607", "0.5845471", "0.58152914", "0.5806327", "0.5738297...
0.7427536
0
create function to check if last question displayed
function checkLastQuestion() { if (currentQuestion === questionCards.length) { clearTimeout(intervalId); displayScore(); } else { // run function to clear question, display next displayQuestion(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lastQuestion () {\n return questions[currentTheme][questions[currentTheme].length - 1].answered;\n}", "function IsLastQuestion(id){\n\t$.get( \"datalayer.php\", { task: \"isLastQuestion\", id: id} )\n\t\t.done(function( data ) {\t \n\t\t \tvar obj = JSON.parse(data);\n\t\t\tif (data == \"true\")\n\t\...
[ "0.7460977", "0.70028627", "0.686495", "0.6815484", "0.67568165", "0.67426807", "0.669494", "0.6612488", "0.6608409", "0.65458256", "0.6498444", "0.6488045", "0.6485679", "0.6467685", "0.6463999", "0.645787", "0.6444414", "0.6417522", "0.64110196", "0.6385896", "0.63657624", ...
0.7999558
0
Creates a search criteria object from a query parameters object.
function SearchCriteria(params) { if (params) { this.textQuery = params.q; this.countryCode = params.c; this.audienceIds = params.a; // csv this.themeIds = params.t; // csv this.specified = true; } else { this.specified = false; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildSearchQuery() {\n if (this.get('invalidSearchTerm') || isEmpty(this.get('searchTerm'))) {\n return {};\n }\n const searchTerm = this.get('searchTerm');\n const query = {};\n\n if (this.get('searchType.date')) {\n if (dateHelper.isValidDate(searchTerm, '...
[ "0.6409584", "0.63920105", "0.5890803", "0.5677729", "0.56559503", "0.5612228", "0.55634975", "0.55423784", "0.5467766", "0.5454903", "0.5428742", "0.5423363", "0.541431", "0.5404528", "0.53943276", "0.5381705", "0.53717226", "0.5361228", "0.5342625", "0.53188306", "0.5310216...
0.7240312
0
SnakeOrLadder represents a snake or ladder object. To create a snake the head value must be greater then the tail value. To create a ladder the head value must be great then the tail value.
function SnakeOrLadder(head, tail){ var snakeOrLadderSelf = this; var head = Math.abs(head); var tail = Math.abs(tail); snakeOrLadderSelf.getHead = function() { return head; } snakeOrLadderSelf.getTail = function() { return tail; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createSnake() {\n //starting x and y position of left snake (4, 4)\n snake1 = new Snake(bit(4,6), RIGHT, \"brown\", \"gray\", \"black\", \"blue\");\n if(no_of_players == 2) {\n snake2 = new Snake(bit(64,6), LEFT, \"orange\", \"yellow\", \"green\", \"purple\")\n }\n }", "function SnakeN...
[ "0.55777645", "0.5517771", "0.5368215", "0.52626884", "0.517189", "0.5132699", "0.50284916", "0.50017554", "0.4985123", "0.4975027", "0.49710733", "0.49633735", "0.49311912", "0.4916746", "0.4909991", "0.49071747", "0.49018443", "0.48877212", "0.48729172", "0.48677504", "0.48...
0.77796495
0
Send new leaderboard rankings
function sendRankings() { var myRank = new Rank(highscoreName, lpm); var xhr = new XMLHttpRequest(); xhr.open('POST', 'http://10.123.17.197:8080/submitscore', true); xhr.setRequestHeader('content-type', 'application/json;charset=UTF-8'); xhr.send(JSON.stringify(myRank)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateUserRank (username) {\n this.waitlistRank[username].updateRankScore()\n }", "async function ranking(msg)\n{\n\tvar records = module.exports.totalXP;\n\tvar rankings = [];\t\n\t\n\t/* Create a list of ranking records of names and XPs */\n\tfor(var i=0; i<records.length; i++)\n\t{\tvar name = records[i]...
[ "0.67062604", "0.6415427", "0.63510835", "0.6330323", "0.6306243", "0.6223678", "0.6209903", "0.61949646", "0.6151125", "0.6118706", "0.60755503", "0.6064409", "0.6063244", "0.60456145", "0.6025979", "0.599782", "0.5993979", "0.5959186", "0.5955926", "0.59400296", "0.589928",...
0.7857433
0
Given a column, return the row that a tile should be placed at, taking into account the current tiles on the board
function rowToPlaceAt(col, board) { var row = -1; while (isTileBelowEmpty(row, col, board)) { row++; } return row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findSpotForCol(column){\n for(let row = this.height - 1; row >= 0; row--){\n if(!this.board[row][column]){\n return row;\n }\n }\n return null;\n }", "function findSpotForCol(col) {\n // find the correct row index\n for (let possibleRow = HEIGHT - 1; possibleRow >= 0; possibleRow--) ...
[ "0.7427996", "0.7145105", "0.69956434", "0.6769038", "0.6758395", "0.67097515", "0.6619871", "0.6616353", "0.66142374", "0.6559334", "0.65571797", "0.6555478", "0.6535325", "0.65175694", "0.65175694", "0.64654416", "0.6452806", "0.64218223", "0.6419412", "0.6411887", "0.63678...
0.80457395
0
Can't write this like a typical field resolver, as it has to point to the account, which is outside this Profiles service. So we return a reference to the external Account type, setting the id property in the returned object to accountId, because id is the key that connects the Account to other types across service bou...
account(profile, args, context, info) { return { __typename: "Account", id: profile.accountId }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAccount(id)\n {\n if (typeof(id) == \"object\")\n id = id.id\n\n return this.accounts.find(x => x.id == id) || null\n }", "getAccount(accountKey) {\n const account = this.getItem(accountKey);\n if (msalCommon.AccountEntity.isAccountEntity(account)) {\n return account;...
[ "0.6233428", "0.5896152", "0.58922416", "0.5827136", "0.58259195", "0.58046716", "0.5798638", "0.57083994", "0.5688386", "0.5605341", "0.5586351", "0.5586351", "0.5580154", "0.5573641", "0.5564735", "0.5495861", "0.5480732", "0.5450114", "0.54466814", "0.54148823", "0.5387814...
0.64703506
0
Given an array of Boolean values and a logical operator, return a Boolean result based on sequentially applying the operator to the values in the array. Examples booleans = [True, True, False], operator = "AND" True AND True > True True AND False > False return False booleans = [True, True, False], operator = "OR" True...
function logicalCalc(array, op) { //your code here // primam niz boolean-a to je arrayy // primam operator - to je op // treba da vratim rezultat koga dobijem tako sto na sve elemente niza primenim ovaj operator i rez ce biti ili true ili false let res = array[0]; for (i = 1; i < array.length; i++) { if (op ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testBooleanLogic (arr){\n for (var i = 0; i < arr.length; i++) {\n if(arr[i] === true){\n return true;\n }\n }\n return false;\n}", "function makeBooleanClause(arrayVar, operator) {\n if(typeof(arrayVar) == 'string')\n return arrayVar;\n var clause = '';\n for(var i = 0; i ...
[ "0.6594345", "0.65915364", "0.6398487", "0.6161579", "0.61186415", "0.61186415", "0.61186415", "0.61186415", "0.61186415", "0.60977584", "0.5956863", "0.5832519", "0.5825564", "0.57880616", "0.57404125", "0.57337373", "0.57021165", "0.56882244", "0.56742346", "0.5596218", "0....
0.768744
0
Eval the code to extract the value of the initial state
getExampleInitialState(compiledCode) { if (compiledCode.indexOf('initialState') === -1) { return {}; } return this.props.evalInContext(` var state = {}, initialState = {}; try { ${compiledCode}; } catch (err) {} return initialState; `)(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Evaluate() {}", "handleEval(e) {\n let value = this.state.prevVal + this.state.curVal;\n this.setState({\n prevVal: value + \"=\",\n curVal: eval(value)\n });\n }", "function InstructionState() {}", "function InstructionState() {}", "function evaluate(expression, state) {\n evalExpress...
[ "0.63213176", "0.61980075", "0.6102058", "0.6102058", "0.60724485", "0.6068804", "0.6044091", "0.60108143", "0.58742464", "0.5812104", "0.57651085", "0.57445586", "0.5637833", "0.5635666", "0.5634193", "0.56045556", "0.5597171", "0.5548124", "0.5544133", "0.5536955", "0.55320...
0.65279675
0
function for adding keywords associated with file type
function onAddKeywordFileType(event) { var keyword = $("#txt-keyword-filetype").val(); keyword = keyword.split(","); var existsNewKeywords = false; for (var i = 0; i < keyword.length; i++) { keyword[i] = keyword[i].trim(); // Remove leading and trailing whitespace var exists = false; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(type, name){\n if (typeof type != 'string') return;\n this._keyword_map[type] = (type in this._keyword_map) ? this._keyword_map[type] : [];\n\n //If name is an array then check it for strings.\n if (name instanceof Array){\n name.forEach((singleName) => {\n if (typeof singleName == 'str...
[ "0.6360083", "0.59004104", "0.5808784", "0.5808784", "0.5774705", "0.5770067", "0.5770067", "0.5770067", "0.5770067", "0.5770067", "0.5761599", "0.5761599", "0.57053375", "0.5672429", "0.5652124", "0.5614918", "0.55636793", "0.54119503", "0.5390591", "0.5367105", "0.5364108",...
0.661377
0
function for deleteing keywords associated with file type
function onRemoveKeywordFileType(event) { var tag = $(event.target).closest(".tag"); var keyword = tag.find('span').text(); filetype_keyword_delete_ajax_submit(keyword, tag); $("#id-keywords-filetype-msg").hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deleteAudioFile(type){\t\t\n\t\tif(type=='content') {\n\t\t\tconst activityContent = this.state.activityContent;\n\t\t\tactivityContent['filename'] = '';\n\t\t\tthis.setState({\n\t\t\t\tactivityContent:activityContent,\n\t\t\t})\n\t\t} else {\n\t\t\tconst textFields = this.state.textFields;\n\t\t\ttextFields ['pro...
[ "0.6312409", "0.5943326", "0.5840541", "0.57140607", "0.56715316", "0.5653394", "0.56461364", "0.5548172", "0.5502835", "0.5471807", "0.5434951", "0.5427453", "0.5422459", "0.54223806", "0.5421129", "0.541762", "0.5414051", "0.5368311", "0.5366826", "0.53623796", "0.52836245"...
0.74167144
0
Display toggle for Add Author/Contributor radio buttons
function onAddContributorTypeChange() { const type = $(this).attr("data-contributor-type"); const isHydroShareUser = type === "hs-user"; // Toggle form visibility $("#add-contributor-dialog div[data-contributor-type]").hide(); $("#add-contributor-dialog div[data-contributor-type...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleInterestExplanation() {\n let interestDisplay = document.getElementById(\"toggle-other-interests\");\n if(otherInterest.checked) {\n interestDisplay.style.display = \"block\";\n otherChecked = true;\n } else {\n interestDisplay.style.display = \"none\";\n otherCh...
[ "0.6114837", "0.59026295", "0.5892441", "0.5859129", "0.5788155", "0.5706884", "0.5704276", "0.5685984", "0.5640154", "0.5631194", "0.5567451", "0.55599385", "0.5554214", "0.5546033", "0.55420303", "0.55388683", "0.5525745", "0.5525742", "0.5514126", "0.54963046", "0.5487572"...
0.65520555
0
======================================================================== Dataset ======================================================================== Class to manage a set of numerical values.
function Dataset() { this.data = []; this.max = 0; this.min = 0; this.range = 0; this.size = 0; Object.defineProperty( this, 'length', { get: function() { return this.data.length; } } ); if( ( arguments.length > 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DataSet(){\n\tthis.values = new Array();\n\t\n\t\n\tDataSet.prototype.size = function(){\n\t\treturn this.values.length;\n\t}\n\t\n\t\n\tDataSet.prototype.has = function(value){\n\t\tfor(var i=0;i< this.values.length;i++){\n\t\t\tif(this.values[i] == value){\n\t\t\t\treturn true;\n\t\t\t} \n\t\t}\n\t\tret...
[ "0.6465325", "0.6027703", "0.58007836", "0.5792012", "0.56167245", "0.55145645", "0.53949016", "0.5368621", "0.53673613", "0.53619146", "0.5361651", "0.53442883", "0.53301364", "0.5300554", "0.5291713", "0.5228274", "0.52004254", "0.51933265", "0.51553476", "0.5133973", "0.51...
0.6696219
0
======================================================================== PlotLayer ======================================================================== A specialized Layer class for handling the data series plots.
function PlotLayer( area ) { //initialize the base Layer state Layer.call( this, area ); //the list of data series in the chart this.series = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Chart( width, height ) {\n\n //this is the vertical inset of the plotting area\n var yinset = 48;\n\n //the plotting area's position and dimensions\n var plot_rect = new ns.Rect(\n 0, yinset, width, ( height - ( 2 * yinset ) )\n );\n\n //root DOM elemen...
[ "0.6180038", "0.6052701", "0.6022352", "0.5996175", "0.5858206", "0.5742383", "0.5652581", "0.5505468", "0.54473186", "0.538618", "0.53472114", "0.53234893", "0.53113204", "0.5307519", "0.5307519", "0.52971923", "0.52927464", "0.525985", "0.5234075", "0.5226877", "0.5219972",...
0.6948624
0
======================================================================== Series ======================================================================== Class to manage a data series in a chart.
function Series() { this.ys = arguments.length > 0 ? arguments[ 0 ] : new Dataset(); this.xs = arguments.length > 1 ? arguments[ 1 ] : null; this.size = this.ys.size; this.plot = 'straight'; this.ylimits = new ns.Limits( 0, 0 ); Object.defineProperty( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Series(Modality, Notes, seriesId) {\n this.Modality = Modality;\n this.Notes = Notes;\n this.seriesId = seriesId;\n}", "function Series(lines, index, min, max) {\n _classCallCheck(this, Series);\n\n this.lines = lines;\n this.index = index;\n this.min = min;\n this.max = max;\n this...
[ "0.6955568", "0.6824418", "0.67454636", "0.67146724", "0.66655034", "0.64470816", "0.63312626", "0.6324277", "0.62174827", "0.618338", "0.61092484", "0.60872024", "0.6062485", "0.597857", "0.5948358", "0.5903253", "0.58929574", "0.58919173", "0.58318126", "0.58175665", "0.580...
0.7607723
0
Generate a property configuration for a sequence property.
function make_sequence_conf( index ) { return { 'enumerable' : true, 'get' : function() { return this.data[ index ]; }, 'set' : function( value ) { this.data[ index ] = value; } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_sequence( properties ) {\n var props = properties instanceof Array\n ? properties : properties.split( ' ' );\n var num_props = props.length;\n var sequence = function() {\n if( arguments.length != num_props ) {\n throw new Error( 'Invalid numb...
[ "0.64799017", "0.5375376", "0.51247877", "0.5070774", "0.5028805", "0.48257926", "0.48069024", "0.48069024", "0.4724342", "0.47034124", "0.46899477", "0.46638325", "0.46588156", "0.4623411", "0.4623411", "0.46032405", "0.45804578", "0.45336", "0.45325634", "0.45146286", "0.45...
0.58752716
1
Testing to see if the createLegalPlacements function in the CountTransitiveClosurePossibilities class returns the correct positions given a medium size matrix
function test_countTransitiveClosurePossibilities2() { it('Test functions in CountTransitiveClosurePossibilities class', () => { allLegalLinePlacementsExpectedAnswer = [ [2, 3, 4, 5], [4, 5], [1, 2, 3], [2, 3, 4], [0, 1, 2, 3], [0, 1] ]; let graphClosure = new app._test.GraphClosure(6); let...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIslands(matrix) {\n let count = 0;\n \n for (let i = 0; i < matrix.length; i++) {\n for (let j = 0; j < matrix[i].length; j++) {\n // if we hit 1\n if (matrix[i][j] == 1) {\n // and our top and left is either zero or outside the area\n if ((i - 1) < 0 || ma...
[ "0.62000495", "0.6009003", "0.60087013", "0.59497344", "0.5914887", "0.589455", "0.58617663", "0.58327013", "0.57500505", "0.57118285", "0.5684488", "0.5683734", "0.5674521", "0.56549674", "0.5594128", "0.55929685", "0.5581315", "0.5580699", "0.5567474", "0.55607194", "0.5532...
0.6495966
0
Selects the Nth Word on Page
function SelectWord(PageNumber, WordNumber) { this.selectPageNthWord(PageNumber, WordNumber); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "nth (index) {\n if (!_.isNumber(index)) throw new Error('invalid value for nth')\n return processTerm.call(this, (value, req) => {\n _.set(req, 'options.nth', Math.ceil(index))\n return value\n })\n }", "function firstOrNth() {\n\n }", "function d3SelectPage(i) {\n return d3.select(\"#po...
[ "0.6621263", "0.652138", "0.62869483", "0.6135506", "0.6082955", "0.59892935", "0.594655", "0.58767843", "0.5852674", "0.5818085", "0.5774434", "0.5764284", "0.57355165", "0.5715184", "0.56474805", "0.560884", "0.5583968", "0.55832064", "0.5559301", "0.5558602", "0.55449367",...
0.72229743
0
starship bounding shpere initialisation
function starship_bs_creation() { const material = new THREE.MeshBasicMaterial({ color: 0xffff00 }) const geometry = new THREE.SphereGeometry(25, 15, 15) geometry.computeBoundingSphere(); star_ship_bs = new THREE.Mesh(geometry, material); star_ship_bs.visible = false scene.add(star_ship_bs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createStarship(){\n this.starship = new Starship(40, this._canvas.height / 2);\n }", "constructor(x, y){\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.endpoint = false; //used to determine if another strand can be joined to this point when drawing\n\t\tthis.strands = []; //array of connected strands\n\t}...
[ "0.70910263", "0.61443794", "0.6045037", "0.60130376", "0.6010827", "0.5948935", "0.59196454", "0.5790995", "0.576041", "0.5756626", "0.57496756", "0.56963956", "0.5692014", "0.5684365", "0.5675715", "0.5664245", "0.5649006", "0.5646085", "0.5635801", "0.56026584", "0.5594065...
0.67478126
1
======================================================= DRAW LOADING LINE FUNCTION
function drawLoadingLine() { const value = p.millis() - p.timeOfStart; p.loadingWidth = p.map(value, 0, p.props.gameTime*1000, 0, p.width, true); p.push(); p.fill('blue'); p.noStroke(); p.rect(0, 0, p.loadingWidth, 2); p.pop(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawLines() {\n}", "function drawLines() {\n}", "_drawLines(lines) {\n const webgl = this.webgl;\n lines.forEach((line) => {\n if (line.visible) {\n webgl.useProgram(this._progLine);\n const uscale = webgl.getUniformLocation(this._progLine, \"usca...
[ "0.7102501", "0.7102501", "0.708018", "0.6868208", "0.67975026", "0.6788359", "0.66909033", "0.6675404", "0.6660203", "0.6603524", "0.6540393", "0.653284", "0.6525039", "0.6512284", "0.6495255", "0.64593714", "0.6453391", "0.6444784", "0.6444784", "0.6444784", "0.6444784", ...
0.7233913
0
get wine by wine ID
async function getWinesByID(id) { try { const winesById = await db.any(`select * from wines where id=$1`, [id]); console.log(winesById) return winesById; } catch (err) { console.log(err) return []; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getWeatherFromWoeid() {\n const API_URL_WOEID = `${API_URL_LOC}${woeid}/`\n const fetchWeatherWoeid = await fetch(API_URL_WOEID)\n const weatherData = await fetchWeatherWoeid.json()\n setIsLoading(false)\n setIsNearestLoc(false)\n setWoeid(weatherData)\n }", "function getWines(e...
[ "0.60247284", "0.60160255", "0.5927914", "0.5851029", "0.58375984", "0.5737524", "0.56649166", "0.56490344", "0.5622502", "0.5602523", "0.55088305", "0.5479149", "0.5470351", "0.5467655", "0.5422386", "0.54073614", "0.5390661", "0.53735495", "0.53709614", "0.536855", "0.53663...
0.62485945
0
get wines by user ID
async function getWinesByUserID(user_id) { try { const wines = await db.any(`select * from wines where user_id=$1`, [user_id]); console.log(wines) return wines; } catch (err) { console.log(err) return []; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function favoriteWinesByUser(user_id) {\n try {\n const wines = await db.any(`SELECT wines.id, wines.wine_name, wines.wine_name, wines.wine_price, wines.wine_store, wines.wine_label, wines.comments, wines.wine_rating, favorite_wines.user_id \n FROM wines \n INNER JOIN favorite_wines\n...
[ "0.6622037", "0.61872077", "0.60645366", "0.5908487", "0.5746474", "0.5679772", "0.56139225", "0.55933964", "0.5581783", "0.55800784", "0.5509538", "0.5494953", "0.5484553", "0.54349667", "0.5434399", "0.54239416", "0.5416667", "0.53950554", "0.53706867", "0.53420746", "0.533...
0.7014791
0
update wine without image
async function updateWineWOImage(id, wine_name, wine_type, wine_price, wine_store, comments, wine_rating) { const result = await db.result(` update wines set wine_name=$2, wine_type=$3, wine_price=$4, wine_store=$5, comments=$6, wine_rating=$7 where id=$1;`, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updatePixels() {\n textureAsset.uploadData(updateView);\n }", "function updateWindowRegion(X, wid, x, y, width,height)\n\t\t{\n\t\t\t// updating the coordinated image.\n \t\tX.GetImage(2, root, x, y, width, height, 0xffffffff, function(err,image) {\n\n \t\t\t// after getting the...
[ "0.61415225", "0.6049717", "0.6029128", "0.5595583", "0.55668855", "0.55414826", "0.55187035", "0.5497203", "0.54959697", "0.5481522", "0.54693764", "0.54693764", "0.54693764", "0.54693764", "0.54693764", "0.54693764", "0.54693764", "0.54693764", "0.54693764", "0.54630834", "...
0.64287
0
favorite wines by user ID
async function favoriteWinesByUser(user_id) { try { const wines = await db.any(`SELECT wines.id, wines.wine_name, wines.wine_name, wines.wine_price, wines.wine_store, wines.wine_label, wines.comments, wines.wine_rating, favorite_wines.user_id FROM wines INNER JOIN favorite_wines ON...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFavorite(item){\n for(var i=0; i< favorites.length; i++){\n if(favorites[i].id === item.id) return true;\n }\n return false;\n}", "function getFavoritesByUserID(userid){\n return db('yfusers as y')\n .join('favorites as f', 'f.user_id', 'y.id')\n .join('livereviews as ...
[ "0.6363125", "0.62305576", "0.6186748", "0.6136128", "0.60956633", "0.60078603", "0.5976517", "0.5955967", "0.59511876", "0.59299296", "0.59108996", "0.5884413", "0.5866006", "0.5860322", "0.5850336", "0.5832887", "0.5828992", "0.58263594", "0.5812269", "0.58034927", "0.57926...
0.63054955
1
Delete from favorite wines
async function deleteFavWine(wine_id, user_id) { const delFavWine = await db.one(`DELETE from favorite_wines WHERE wine_id=$1 and user_id=$2;`, [wine_id, user_id]) if (delFavWine.rowCount === 1) { return id; } else { return null; }}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteFavorite(data) {\n dbPromised.then(function(db) {\n var tx = db.transaction('teams', 'readwrite');\n var store = tx.objectStore('teams');\n store.delete(data);\n return tx.complete;\n }).then(function() {\n console.log(\"team di hapus.\");\n getSavedTeams();\n }).catc...
[ "0.6762703", "0.64962494", "0.64388573", "0.63891226", "0.6352579", "0.62485605", "0.6247013", "0.62405497", "0.6238892", "0.61843795", "0.6184301", "0.6180418", "0.61554193", "0.6143523", "0.6133622", "0.6129045", "0.6126363", "0.611121", "0.61079556", "0.6094645", "0.607630...
0.697341
0
Listens routing:request events and pass request details to request().
listenRequests() { this.request(event.detail.request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "listenRequests() {\n this.request(event.detail.request);\n }", "function onRequest(request, response){\n // request and response are objects. this function is called whenever a request\n // is received.\n console.log(\"Request received.\")\n var pathname = ur...
[ "0.7475521", "0.73622835", "0.73548746", "0.73060656", "0.68444866", "0.6703234", "0.66873336", "0.66407704", "0.6515654", "0.6505374", "0.6505374", "0.6505374", "0.6505374", "0.6505374", "0.6505374", "0.6505374", "0.65015244", "0.65015244", "0.65015244", "0.65015244", "0.650...
0.7553543
0
Build alternative paths if default values exist
buildPathsWithDefaultValues() { var defaults = this.route.defaults; var keysDefaults = Object.keys(defaults); var newPath = this.route.path; var defaultsBag = []; for (var i = 0; i < keysDefaults.length; i++) { var t = keysDefaults.length - (i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function defaultPath() {\n var dirname = parsedPath.dirname;\n var name = parsedPath.name;\n\n if (name === 'template' || name === 'index') {\n name = '';\n }\n return _path.posix.join('/', dirname, name, '/');\n }", "function defaultPath() {\n var dirname = parsedPath.dirname;\n var n...
[ "0.6329429", "0.6329429", "0.5884967", "0.55499995", "0.5301177", "0.5289111", "0.5289103", "0.51683944", "0.51318824", "0.51318824", "0.51306134", "0.50728184", "0.50728184", "0.5067147", "0.50554544", "0.50537837", "0.50537837", "0.50537837", "0.50537837", "0.50537837", "0....
0.7154136
0
Listens routing:request events and pass request details to request().
listenRequests() { this.request(event.detail.request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "listenRequests() {\n this.request(event.detail.request);\n }", "function onRequest(request, response){\n // request and response are objects. this function is called whenever a request\n // is received.\n console.log(\"Request received.\")\n var pathname = url.parse(...
[ "0.7553543", "0.73622835", "0.73548746", "0.73060656", "0.68444866", "0.6703234", "0.66873336", "0.66407704", "0.6515654", "0.6505374", "0.6505374", "0.6505374", "0.6505374", "0.6505374", "0.6505374", "0.6505374", "0.65015244", "0.65015244", "0.65015244", "0.65015244", "0.650...
0.7475521
1
Window object execute this function when a popstate event fired. It looks 'popstatable' flag in the state. If its value is true then send a request to request() function with 'mode':'loadonly' because window.location is already changed by the browser itself and there is no need to push a state again. We need only load ...
popstate(event) { /* * Request is passed here from a History API state. */ var request = event.state; /* * Page should be reloaded if request is not popstatable. */ if (!(request === unde...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firePopState() { // 630\n var o = document.createEvent ? document.createEvent('Event') : document.createEventObject(); // 631\n if (o.initEvent) { ...
[ "0.60633284", "0.6005912", "0.5961832", "0.5920309", "0.5840041", "0.5753967", "0.54378873", "0.54272145", "0.53712416", "0.5334039", "0.532395", "0.5323475", "0.53018796", "0.52836406", "0.52530164", "0.5246997", "0.52459854", "0.5232509", "0.52141696", "0.52057886", "0.5190...
0.6808911
0
So we can allow passing (rules, start) directly to Parser for backwards compatibility
static fromCompiled(rules, start) { if (rules.ParserStart) { start = rules.ParserStart; rules = rules.ParserRules; } var rules = rules.map(r => new Organizator_Nearley_Rule(r.name, r.symbols, r.postprocess)); return new Organizator_Nearley_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(rules, main) {\n this.main = main\n this.rules = {}\n for(var i=0; i<rules.length; i++) {\n this.rules[rules[i].type] = rules[i]\n rules[i].parser = this\n } \n }", "constructor(tokenizer, rules, main) {\n super(tokenizer)\n this...
[ "0.6503968", "0.6204409", "0.596398", "0.5835956", "0.5780569", "0.5773759", "0.57528114", "0.56827414", "0.5565173", "0.5543982", "0.55088633", "0.550855", "0.5487078", "0.5477029", "0.5460692", "0.54318005", "0.5403355", "0.5403355", "0.53844696", "0.5383799", "0.5383799", ...
0.64152604
1
Sets interval to callCurrentPosition every second and sets firebase tracerInGame to true
componentDidMount() { this.callCurrentPosition(); this.interval = setInterval(this.callCurrentPosition, 1000); this.timerInterval = null; this.countdownInterval = null; this.initialLat = null; this.initialLon = null; this.gameTime = null; this.captureDist = null; let updates = {}; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGameInterval() {\n drawCard();\n gameInterval = setInterval(drawCard, 3000);\n }", "function startGame() {\n const interval = setInterval(() => {\n console.log(\"run interval\", timer);\n setTimer((prevTimer) => {\n if (prevTimer > 0) {\n re...
[ "0.6292947", "0.6154882", "0.61057764", "0.6087713", "0.6083297", "0.6078405", "0.6042531", "0.5961787", "0.59187865", "0.5879265", "0.5866455", "0.5845242", "0.5843227", "0.583761", "0.5826966", "0.58169454", "0.5802075", "0.57914454", "0.5779711", "0.57753253", "0.5767379",...
0.6634859
0
Helps calculate countdown distance using linearly distributed increments between minTime and maxTime
calcCountdownAmount(myDist) { if (myDist < this.minDist) { return this.maxTime; } else if (myDist > this.maxDist) { return this.minTime; } let numCountdownTimes = 1 + Math.floor((this.maxTime - this.minTime) / this.timeIncrements); //Calculate range of distance for each time incremen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function distOverTime(input) {\n let [speed1, speed2, timeInSec] = [input[0], input[1], input[2]];\n let distance1 = speed1 * timeInSec / 60 / 60;\n let distance2 = speed2 * timeInSec / 60 / 60;\n console.log(1000 * Math.abs(distance1 - distance2));\n}", "function cycle(nbr,min,max){let r=max-min;if(...
[ "0.6550259", "0.5863946", "0.5818419", "0.57254267", "0.5722384", "0.5710402", "0.56911016", "0.56399465", "0.5615035", "0.5591914", "0.55863494", "0.55822134", "0.55721885", "0.5565931", "0.5565931", "0.5565931", "0.55644053", "0.5524038", "0.5518783", "0.5498196", "0.546635...
0.7422302
0
Sets current state variables to firebase
setFirebase() { let updates = {}; updates[`/currentSessions/${this.props.sessionKey}/showDirection/`] = this.state.showDirection; updates[`/currentSessions/${this.props.sessionKey}/showDistance/`] = this.state.showDistance; updates[`/currentSessions/${this.props.sessionKey}/distance/`] = this.state.dist...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setSirenState(state) {\n firebase.database().ref('Utume_202/motion_detectors/sensor_1').set({\n siren: state,\n state: state\n });\n}", "update(state){\ndatabase.ref('/').update({gamestate:state})\ngameState=state;\n}", "init(username) {\n // syncState creates a two way databinding between ...
[ "0.6596039", "0.655113", "0.65303195", "0.65274173", "0.63710326", "0.63702226", "0.635503", "0.6323249", "0.6295662", "0.626518", "0.62584984", "0.62479204", "0.6219987", "0.6194217", "0.61639017", "0.6163567", "0.6143767", "0.6135855", "0.6125248", "0.61249405", "0.6106711"...
0.7014746
0
Returns direction coordinates for traitor's direction line, which is in the opposite direction as the tracer's
calcDirectionCoordsForTraitor(lat1, lon1, lat2, lon2) { //Line will be around 1000m long or something const multiplier = 1000 / this.calcDistance(lat1, lon1, lat2, lon2); return ([{ latitude: lat2 + ((lat1 - lat2) * multiplier), longitude: lon2 + ((lon1 - lon2) * multiplier) }, { l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "GetDirection()\n {\n //AddStatus(\"Entering GetDirection\");\n let x=this.x;\n if(x==0)x=.00000000001;\n let dir=(Math.atan(this.y/x))/this.toRadian;\n //AddStatus(dir);\n if (x<0)dir+=180;\n if (x>0 && this.y<0)dir+=360;\n //AddStatus(dir);\n return dir;\n }", "getDirection() {\n ...
[ "0.69106126", "0.67619276", "0.65544873", "0.65479124", "0.6486418", "0.63404644", "0.62055904", "0.61704344", "0.61650693", "0.6161023", "0.6105557", "0.60730577", "0.60691303", "0.6066318", "0.6010832", "0.59880036", "0.5971381", "0.5960961", "0.5920719", "0.59142995", "0.5...
0.717353
0
Determines whether traitor is in captureDist and whether deflect was pulled. If no winner, resets state
determineWinner() { firebase.database().ref(`/currentSessions/${this.props.sessionKey}`) .once('value', snapshot => { let traitorLat = snapshot.val().traitorLatitude; let traitorLon = snapshot.val().traitorLongitude; let traitorDeflect = snapshot.val().deflectOn; let dist = this.ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkWinningCondition() {\n\tif (matchedCards.length === 16) {\n\t\tstopTimer();\n\t\toverlay();\n\t} else {\n\t\treturn false;\n\t}\n}", "function winConditions() {\n let notADraw = false;\n display();\n\n function compareVariables(a, b, c) {\n if (a === b && b === c && c === a) {...
[ "0.633529", "0.62604225", "0.6215089", "0.62031525", "0.6175108", "0.61372495", "0.61312044", "0.6044584", "0.60378224", "0.60345626", "0.6024184", "0.60163265", "0.60108495", "0.59903145", "0.5958778", "0.5940054", "0.5925789", "0.59120107", "0.59061515", "0.58967745", "0.58...
0.6436923
0
Helper function to set winner to Firebase and send to end screen
gameWonActions(winnerString, triggerDist) { let saveEndTime = this.gameTime - this.state.currentTime; let updates = {}; updates[`/currentSessions/${this.props.sessionKey}/gameWinner/`] = winnerString; updates[`/currentSessions/${this.props.sessionKey}/endTime/`] = saveEndTime; if (triggerDist !== nu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "determineWinner() {\n firebase.database().ref(`/currentSessions/${this.props.sessionKey}`)\n .once('value', snapshot => {\n let traitorLat = snapshot.val().traitorLatitude;\n let traitorLon = snapshot.val().traitorLongitude;\n let traitorDeflect = snapshot.val().deflectOn;\n let dist =\n ...
[ "0.68458253", "0.6760252", "0.6752528", "0.67485857", "0.673123", "0.67232615", "0.6668385", "0.6611797", "0.6455419", "0.64541006", "0.64412683", "0.64385086", "0.6425256", "0.6346945", "0.6315155", "0.6312443", "0.630749", "0.630422", "0.6281598", "0.62613165", "0.625995", ...
0.69863874
0
Retrieves the topic from the parameter object
function getTopic(parameters) { if (!isUndefined(parameters.Topic)) { return parameters.Topic; } else { return ''; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get topic() {\n\t\treturn this.__topic;\n\t}", "get topic () {\n\t\treturn this._topic;\n\t}", "get topic () {\n\t\treturn this._topic;\n\t}", "function getTopic(topic){\n\n\t\t// Get correct title and subtitle\n\t\tif (topic === \"income\"){\n\t\t\ttitel = \"Yearly income\";\n\t\t\tsubtitel = \"x 1000 euro\...
[ "0.7121586", "0.7069455", "0.7069455", "0.6518278", "0.63280725", "0.6289245", "0.62517506", "0.6202517", "0.61975944", "0.6110482", "0.6018918", "0.59805006", "0.5927808", "0.590261", "0.5890797", "0.58530873", "0.5845907", "0.5775007", "0.5745329", "0.57440823", "0.57440823...
0.8057608
0
Walker Boys ( March 18, 2011 Description: Plays an animated sprite using a sprite sheet Instruction: Assign script to a gameObject with a material/texture (sprite sheet) Function arguments: columnSize number of frames across (horizontal) rowSize number of frames down (vertical) colFrameStart where frame starts (remembe...
function aniSprite (columnSize : int, rowSize : int, colFrameStart : int, rowFrameStart : int, totalFrames : int, framesPerSecond : float, indexReset : float)// function for animating sprites { var index : int = (Time.time-indexReset) * framesPerSecond; // time control fps index = index % totalFrames; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animSprite(image, frameWidth, frameHeight, numCols, numRows) {\n this.image = image;\n\t\n\t//this.frameDuration = frameDuration;\n\tthis.frameWidth = frameWidth;\n\tthis.frameHeight = frameHeight;\n\tthis.numCols = numCols || 16;\n\tthis.numRows = numRows || 7;\n\t\n\tthis.currentCol = 0;\n\tthis.curr...
[ "0.70458454", "0.68010813", "0.65780634", "0.6568113", "0.6466285", "0.6380842", "0.61872786", "0.61791533", "0.6136085", "0.61344653", "0.6090483", "0.6042783", "0.60274", "0.602006", "0.5969916", "0.5966107", "0.59478563", "0.5942572", "0.593116", "0.59235275", "0.5922471",...
0.7566185
0
=============================== UTILITIES =============================== / determine basic eligibility of each user Checks: user.createdAt (Date) if > 1 week ago, user is eligible contactMeta.unSubbed (Boolean) if 'false', user is eligible
function basicEligibility (user) { let unSubbed = user.contactMeta.unSubbed let createdInMs = new Date(user.createdAt).getTime() let weekInMs = 7 * 24 * 60 * 60 * 1000 let tooSoon = createdInMs + weekInMs > Date.now() // if user has unSubbed or it's too soon, user is not eligible return !((unSubbed || tooS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function complianceUserNeeds(pricing, userNeeds) {\n // var everyUserNeedIsSatisfied = true;\n const compliance = {};\n userNeeds.forEach((userNeed) => {\n // var existsCompliantPlan = false;\n Object.keys(userNeed).forEach((userNeedMetric) => {\n const effectiveLimitations = p2.e...
[ "0.65025514", "0.58975375", "0.58705187", "0.5638067", "0.5627169", "0.5574566", "0.5549108", "0.554451", "0.5530356", "0.5498954", "0.5421145", "0.5391005", "0.53870225", "0.5371159", "0.53688407", "0.5345941", "0.53358203", "0.5326517", "0.531841", "0.530548", "0.5278146", ...
0.8171282
0
determine what type of engagement email to send eligibile user Checks for existence of `user.name`, a required field when updating a user profile.
function addEligibilityType (user) { if (!user.name) { user.engageType = 'profile' } else { user.engageType = 'post' } return user }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmail () {\n var scriptProps = PropertiesService.getScriptProperties();\n var myEmail = scriptProps.getProperty('userEmail');\n if (myEmail == null) {\n return '✗ You still need to set up your email address. Go to 🔍 Career Hacking™ > 📧 Set Email Address.';\n } else {\n return 'Your follow...
[ "0.60876614", "0.59759796", "0.5899561", "0.58023316", "0.57234985", "0.5578995", "0.5573941", "0.55658704", "0.55296177", "0.55199784", "0.5519497", "0.5516277", "0.55113685", "0.55050194", "0.55050194", "0.5503644", "0.5503643", "0.5475832", "0.5459322", "0.54341257", "0.54...
0.6569585
0