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
anade un hijo al composite
anadirHijo(componente){ this.hijos.push(componente); //Agregamos un hijo a este composite componente.setParent(this); //Al hijo de este composite le decimos que este es el padre }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isComposite() {\n return true;\n }", "function Composite () {\n\n // this.id = idCount ++;\n // this.name = '';\n\n this.parent = undefined;\n this.children = [];\n\n // this.visible = true;\n\n\n}", "function MASH_ImplicitComposite(tmpID, tmpLeft, tmpTop, tmpWidth, tmpHeight, tmpZIndex, tmpStyl...
[ "0.6114244", "0.59866756", "0.5603491", "0.52766347", "0.52766347", "0.52766347", "0.52766347", "0.52679443", "0.5243618", "0.52428657", "0.5223884", "0.5200266", "0.51784784", "0.5099981", "0.5085347", "0.5071333", "0.50688535", "0.50575966", "0.5038831", "0.5012294", "0.499...
0.6678654
0
Removemos un hijo del composite
removerHijo(componente){ componenteIndex = this.hijos.indexOf(componente); this.hijos.splice(componenteIndex,1); componente.setParent(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeAllGBeaconComposite(){\n this.clearSpecifiedHash(COMPOSITE);\n}", "function deleteElement() {\n context.clearRect(0, canvas.height - canvas.height / 5.7, canvas.width, canvas.height / 5.7);\n object.forEach((element, value) => {\n if (element.name == arguments[0]) {\n ...
[ "0.6290296", "0.61161923", "0.60522336", "0.6036926", "0.60306484", "0.59874713", "0.5949524", "0.594898", "0.594898", "0.59457266", "0.59282357", "0.5921774", "0.58943146", "0.585835", "0.5819191", "0.5819191", "0.5812978", "0.5774023", "0.57599527", "0.57424873", "0.5733684...
0.68575805
0
Retorna si es un composite
isComposite() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCompositeType(type) {\n return isObjectType(type) || isInterfaceType(type) || isUnionType(type);\n }", "function isCompositeType(type) {\n return isObjectType(type) || isInterfaceType(type) || isUnionType(type);\n}", "function isCompositeType(type) {\n return isObjectType(type) || isInterf...
[ "0.6897041", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.68200296", "0.65611637", "0.64985687", "0.6396883", "0.6396883", "0.6396883", "0.6396883", "0.6396883", "0.6396883", "0.6396883", "0.5945262", "0.5889401", "0.5868655", "0.5850...
0.7811058
0
======================================================================================================================== FUNCTIONS ======================================================================================================================== randomly selected guessWord from wordBank.
function selectGameWord(){ return wordBank[Math.floor(Math.random() * wordBank.length)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickWordFrom(wordBank) {\n return wordBank[Math.floor(Math.random() * wordBank.length)];\n}", "function chooseWord () {\n\t\tword = wordArray[Math.floor(Math.random() * wordArray.length)];\n\t\tguessesLeft = (wordArray.length + 1) * 2;\n\t\tfor (var i = 0; i < word.length; i++) {\n\t\t\thiddenWord.pu...
[ "0.8175995", "0.7848451", "0.78220505", "0.77894396", "0.77839106", "0.7776206", "0.7677435", "0.76732004", "0.76072955", "0.7506499", "0.750238", "0.74526656", "0.7422386", "0.74136376", "0.7399853", "0.73975605", "0.73442215", "0.7332335", "0.7324769", "0.73196787", "0.7290...
0.7919463
1
Returns the requested includes
getRequestedIncludes () { return this.requestedIncludes }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAddToIncludesForResource(resource) {\n let relationshipPaths;\n\n if (this.hasQueryParamIncludes()) {\n relationshipPaths = this.request.queryParams.include.split(\",\");\n } else {\n let serializer = this.serializerFor(resource.modelName);\n relationshipPaths = serializer.getKeysForIncl...
[ "0.6952398", "0.6520299", "0.64882046", "0.63730496", "0.63171685", "0.6249452", "0.6149937", "0.60147506", "0.59868217", "0.5953049", "0.5883156", "0.5815963", "0.57320917", "0.56990564", "0.5563274", "0.54560834", "0.5407672", "0.5379628", "0.53655964", "0.53489363", "0.534...
0.82975805
0
Get an instance if the serializer, if not set, use setting from the config
getSerializer () { if (!this.serializer) { const Config = ioc.use('Adonis/Src/Config') this.setSerializer(Config.get('bumblebee.serializer', 'plain')) } return this.serializer }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function serializerFor(container, type, defaultSerializer) {\n return container.lookup('serializer:'+type) ||\n container.lookup('serializer:application') ||\n container.lookup('serializer:' + defaultSerializer) ||\n container.lookup('serializer:-def...
[ "0.5958743", "0.56369686", "0.5620456", "0.5619275", "0.5503056", "0.54762983", "0.5282407", "0.5262769", "0.52182966", "0.51329875", "0.5132302", "0.5113855", "0.50138485", "0.49571463", "0.49386913", "0.49058855", "0.48742488", "0.48323107", "0.48133615", "0.48100272", "0.4...
0.68095213
0
Add all the resources along the way to a nested include
_autoIncludeParents () { let parsed = [] // for each resource that is requested for (let include of this.requestedIncludes) { // we split it by '.' to get the recursions let nested = include.split('.') // Add the first level to the includes let part = nested.shift() parsed.pu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAddToIncludesForResource(resource) {\n let relationshipPaths;\n\n if (this.hasQueryParamIncludes()) {\n relationshipPaths = this.request.queryParams.include.split(\",\");\n } else {\n let serializer = this.serializerFor(resource.modelName);\n relationshipPaths = serializer.getKeysForIncl...
[ "0.64293766", "0.612499", "0.5915703", "0.5890226", "0.5652088", "0.55960166", "0.5532109", "0.540457", "0.53472936", "0.53393847", "0.5334017", "0.53159577", "0.53129435", "0.52890986", "0.5213106", "0.5172492", "0.516064", "0.5151516", "0.5131646", "0.5124941", "0.5112357",...
0.66658694
0
An element fills the viewport
elementFillPage(element, container) { let margin = `${(window.innerHeight - element.offsetHeight) / 2}px`; container.style.height = `${window.innerHeight}px`; element.style.marginTop = margin; element.style.marginBottom = margin; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillInner(element) {\n Object.defineProperty(element, \"fillInner\", {\n value: function () {\n if (this.element.width !== window.innerWidth ||\n this.element.height !== window.innerHeight) {\n this.element.width = window.innerWidth;\n ...
[ "0.6437152", "0.6317831", "0.6030431", "0.60026085", "0.58605504", "0.575778", "0.57055277", "0.5582787", "0.557242", "0.5557416", "0.5538169", "0.5537025", "0.5513983", "0.54968935", "0.5490226", "0.5432424", "0.5426255", "0.53976727", "0.53598446", "0.52972263", "0.5288369"...
0.66598856
0
An element fills the viewport when it is resized
elementFillPageOnResize(element, container) { window.addEventListener("resize", () => { this.elementFillPage(element, container); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_resize() {\n this._onChangeViewport({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }", "function fitToWindow(element)\n {\n var enabledElement = cornerstone.getEnabledElement(element);\n var defaultViewport = cornerstone.getDefaultViewport(enabledElement.can...
[ "0.6748309", "0.6591487", "0.6494964", "0.6443326", "0.6370289", "0.6319855", "0.6295127", "0.62832224", "0.62774897", "0.6250024", "0.6249684", "0.6231793", "0.6219775", "0.6212943", "0.617867", "0.61575687", "0.61500555", "0.61499757", "0.61499757", "0.61499757", "0.6149975...
0.697954
0
20 2. Simple function call 2.1 Simple function call => this = (Using strict mode)
function call1() { 'use strict' ; console.log(this); // undefined }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function a(param1, param2) {\n console.log(this); // In strict mode, default value of this is going to be undefined\n}", "function fn(){\n 'use strict' //when used it causes the value of this when called without an object to be undefined.\n console.log(this);\n}", "function strictMode() {\n // 'use str...
[ "0.6998382", "0.69261104", "0.68110174", "0.67638594", "0.66650975", "0.6625623", "0.65923184", "0.6581003", "0.65288275", "0.65030587", "0.6462624", "0.64409167", "0.6436806", "0.6433026", "0.6403401", "0.63955605", "0.63924164", "0.6322015", "0.62963885", "0.62963885", "0.6...
0.7292289
0
get architecture name for lib/flicliblinuxhci folder
function getArch() { switch (process.arch) { case "arm": return "armv6l"; case "x32": case "ia32": return "i386"; case "x64": return "x86_64"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "architecture(){\n return os.arch()\n }", "translateArch (arch) {\n switch (arch) {\n case 'ia32': return 'i386'\n case 'x64': return 'amd64'\n case 'armv7l':\n case 'arm':\n return 'armhf'\n // arm64 => arm64\n default: return arch\n }\n }", "function detec...
[ "0.7208224", "0.669075", "0.6414687", "0.6383476", "0.63788044", "0.6241677", "0.6222926", "0.6112446", "0.60385746", "0.5959913", "0.5823425", "0.5522827", "0.55204093", "0.54620165", "0.5299229", "0.52845204", "0.52567685", "0.52474856", "0.51869", "0.51377904", "0.5090773"...
0.6710558
1
Load the state from local storage.
load() { this.state_ = JSON.parse(localStorage.getItem(this.key_)) || this.defaultState_; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load() {\n var val = localStorage.getItem(STORE);\n\n if (!val) {\n val = '{\"board\": \"Workflow\", \"lists\": [ {\"header\": \"To do\", \"items\": []}, {\"header\": \"In progress\", \"items\": []}, {\"header\": \"Blocked\", \"items\": []}, {\"header\": \"Done\", \"items\": []} ] }';\n }\...
[ "0.8186176", "0.77962357", "0.76884586", "0.7659339", "0.75934476", "0.75912523", "0.7551959", "0.7550609", "0.75503653", "0.73248", "0.7300838", "0.7288206", "0.7285897", "0.72333807", "0.7201955", "0.71999353", "0.70870227", "0.7075192", "0.7073757", "0.7006453", "0.7004831...
0.8353694
0
Save and persist the current state.
save() { localStorage.setItem(this.key_, JSON.stringify(this.state_)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save() {\n\n if ( this.state === false ) return;\n this.data.meta.saved = Date.now();\n this.data.meta.version++;\n var saveObject;\n try {\n saveObject = JSON.stringify(this.data);\n } catch (e) {\n this.error = \"Cannot save to local storage\";\n ...
[ "0.7317984", "0.7201752", "0.7092787", "0.7060714", "0.69951797", "0.6960319", "0.6951925", "0.691961", "0.69156504", "0.68906343", "0.67712665", "0.67456585", "0.67108786", "0.6660786", "0.66600144", "0.66535044", "0.6644797", "0.6606006", "0.6603291", "0.656681", "0.6556748...
0.72067064
1
Returns a last character of given string [s]
function lastCharacter(s){return(s[s.length-1])}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLastChar(string) {\n return string[string.length - 1];\n}", "function lastCharacter(str) {\n return str.slice(-1);\n}", "function lastCharacter(str) {\n return str.slice(-1);\n}", "function returnLastCharacter(aString) {\n\n return aString[aString.length - 1];\n \n}", "function lastL...
[ "0.83150136", "0.80307704", "0.801459", "0.79941875", "0.77904516", "0.77740115", "0.7659514", "0.76367337", "0.7572962", "0.74979526", "0.7450425", "0.7395404", "0.7322414", "0.7234691", "0.71810937", "0.7122364", "0.70777", "0.68984365", "0.68505174", "0.68345165", "0.67675...
0.89645106
0
Applies all constraints for a given system.
doConstraints() { this.constraint_set.forEach((constraint, _) => { constraint.constrain(this.s1, this.s2); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static applyConstraints(query) {\n if (query.have.length === 0) {\n return;\n }\n const newQuery = query.newQuery();\n this.addHasWhereConstraints(query, newQuery);\n this.addHasConstraints(query, newQuery.get());\n }", "processSystems() {\n for (var i = 0, l...
[ "0.56974566", "0.54999554", "0.5454266", "0.5077775", "0.5044007", "0.4967931", "0.49370086", "0.49177906", "0.48199832", "0.47167596", "0.47124478", "0.47114503", "0.46944398", "0.46910945", "0.4676865", "0.46420828", "0.45987463", "0.45830527", "0.45367277", "0.4534182", "0...
0.7058699
0
check for duplicates in items array and add qty if it exists if not just push into array
function checkForDuplicates(items, item){ let obj = items.find(obj => (obj.id === item.id)&&(obj.color === item.color)); if ( obj ) { console.log('you already have the same item in the same color'); var index = items.indexOf(obj); console.log(index); items[index].qty += 1; } else { items.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeDuplicated(items) {\n return items.reduce((uniqCartItems, currentCartItem) => {\n\n // Sums quantities if duplicate item\n let uniqIndex = uniqCartItems.findIndex((uniqCartItem) => { return uniqCartItem.item_id === currentCartItem.item_id })\n\n if (uniqIndex >= 0) {\n uniqCartItems[un...
[ "0.72413963", "0.6820708", "0.6500723", "0.6453106", "0.630402", "0.6270575", "0.62474906", "0.6197243", "0.6179893", "0.6159245", "0.6135632", "0.6104802", "0.60923684", "0.60809296", "0.6066457", "0.60638934", "0.60486823", "0.602605", "0.5992545", "0.5974982", "0.5969851",...
0.7091459
1
Given an event's allDay status and start date, return what its fallback end date should be. TODO: rename to computeDefaultEventEnd
function getDefaultEventEnd(allDay, marker, context) { var dateEnv = context.dateEnv, options = context.options; var end = marker; if (allDay) { end = startOfDay(end); end = dateEnv.add(end, options.defaultAllDayEventDuration); } else { end = dateEnv.add(end, options.defaultT...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDefaultEventEnd(allDay, marker, context) {\n var dateEnv = context.dateEnv, options = context.options;\n var end = marker;\n if (allDay) {\n end = startOfDay(end);\n end = dateEnv.add(end, options.defaultAllDayEventDuration);\n }\n else {\n ...
[ "0.73792607", "0.62989044", "0.6095795", "0.6095567", "0.60192484", "0.60192484", "0.5980034", "0.5980034", "0.5980034", "0.5980034", "0.5980034", "0.5980034", "0.5980034", "0.5934866", "0.58901364", "0.58901364", "0.58901364", "0.5879051", "0.5879051", "0.5862929", "0.586292...
0.7379146
1
applies the mutation to ALL defs/instances within the event store
function applyMutationToEventStore(eventStore, eventConfigBase, mutation, context) { var eventConfigs = compileEventUis(eventStore.defs, eventConfigBase); var dest = createEmptyEventStore(); for (var defId in eventStore.defs) { var def = eventStore.defs[defId]; dest.defs[defId] = applyMutati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyMutationToEventStore(eventStore, eventConfigBase, mutation, context) {\n var eventConfigs = compileEventUis(eventStore.defs, eventConfigBase);\n var dest = createEmptyEventStore();\n for (var defId in eventStore.defs) {\n var def = eventStore.defs[defId];\n ...
[ "0.68634754", "0.67085457", "0.67085457", "0.67085457", "0.6651558", "0.6651558", "0.606483", "0.57602245", "0.5543792", "0.54483336", "0.54054356", "0.53865194", "0.5361616", "0.5358589", "0.53522754", "0.53517604", "0.5346278", "0.53412986", "0.5329985", "0.5322661", "0.529...
0.676365
1
BUG: if `event` was supplied, all previouslygiven `eventSources` will be wiped out
function handleEventSources(inputs, context) { var unfoundSources = hashValuesToArray(context.getCurrentData().eventSources); var newInputs = []; for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) { var input = inputs_1[_i]; var inputFound = false; for (var i = 0; i < un...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleEventSources(inputs, context) {\n var unfoundSources = hashValuesToArray(context.getCurrentData().eventSources);\n var newInputs = [];\n for (var _i = 0, inputs_1 = inputs; _i < inputs_1.length; _i++) {\n var input = inputs_1[_i];\n var inputFound = false;\...
[ "0.6707795", "0.65303636", "0.6480905", "0.6479163", "0.6365367", "0.6339981", "0.6290609", "0.6198843", "0.6185379", "0.612394", "0.6103067", "0.6077639", "0.6034176", "0.60079867", "0.59857607", "0.59857607", "0.59857607", "0.59857607", "0.59857607", "0.59857607", "0.597898...
0.6763046
0
Computes an automatic value for slotLabelInterval
function computeLabelInterval(slotDuration) { var i; var labelInterval; var slotsPerLabel; // find the smallest stock label interval that results in more than one slots-per-label for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) { labelInterval = (0,_fullcalendar_common__WEBPACK_IMPOR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeLabelInterval(slotDuration) {\n var i;\n var labelInterval;\n var slotsPerLabel;\n // find the smallest stock label interval that results in more than one slots-per-label\n for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) {\n labelInterval = cre...
[ "0.69613665", "0.6639707", "0.6291259", "0.5738033", "0.5610192", "0.5606154", "0.55482984", "0.54373205", "0.5395312", "0.5362787", "0.5362787", "0.5343172", "0.5324658", "0.5296881", "0.52412593", "0.52384967", "0.52384967", "0.5221934", "0.5194561", "0.5194561", "0.5194561...
0.69776034
0
This function is not supported for use within components and is meant for configuring runtime feature flags during app initialization.
function setFeatureFlag(name, value) { const isBoolean = isTrue(value) || isFalse(value); if (!isBoolean) { const message = `Failed to set the value "${value}" for the runtime feature flag "${name}". Runtime feature flags can only be set to a boolean value.`; if (undefined !== 'production') { throw ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFeatureFlag(name, value) {\n const isBoolean = isTrue(value) || isFalse(value);\n if (!isBoolean) {\n const message = `Failed to set the value \"${value}\" for the runtime feature flag \"${name}\". Runtime feature flags can only be set to a boolean value.`;\n if (process.env.NODE_EN...
[ "0.7197256", "0.711115", "0.711115", "0.711115", "0.711115", "0.711115", "0.711115", "0.7058632", "0.70094115", "0.62846863", "0.60039246", "0.5991949", "0.5983187", "0.591876", "0.5853905", "0.58134484", "0.57395625", "0.56942266", "0.554981", "0.5500305", "0.54933363", "0...
0.7163145
1
EXPERIMENTAL: This function acts like a hook for Lightning Locker Service and other similar libraries to sanitize vulnerable attributes. This API is subject to change or being removed.
function sanitizeAttribute(tagName, namespaceUri, attrName, attrValue) { // locker-service patches this function during runtime to sanitize vulnerable attributes. // when ran off-core this function becomes a noop and returns the user authored value. return attrValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sanitizeAttributes (object) {\n\t\tObject.keys(this.attributeDefinitions).forEach(attribute => {\n\t\t\tif (this.attributeDefinitions[attribute].serverOnly) {\n\t\t\t\tdelete object[attribute];\n\t\t\t}\n\t\t});\n\t\treturn object;\n\t}", "attrs(obj) {\n const parent = policyPath[policyPath.length - 2];\n...
[ "0.64455056", "0.63595915", "0.62119853", "0.6161747", "0.6103974", "0.60943836", "0.6079971", "0.60154533", "0.59978026", "0.5986827", "0.5811925", "0.58101374", "0.57871485", "0.5757436", "0.5756099", "0.57075083", "0.5690273", "0.5686759", "0.56728244", "0.5672428", "0.567...
0.666635
0
dynamic children means it was generated by an iteration in a template, and will require a more complex diffing algo.
function markAsDynamicChildren(children) { FromIteration.set(children, 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderChildren() {\n const children = this.config.elements;\n return map(children, (child) => {\n const el = this.$createElement(\n this.getElementTag(child.type),\n {\n staticClass: `${this.$options.name}-item`,\n props: {\n definition: child,\...
[ "0.64891785", "0.6477647", "0.63401526", "0.6253663", "0.6206355", "0.61447805", "0.61325073", "0.612705", "0.60774344", "0.6049193", "0.60175866", "0.6009553", "0.59865975", "0.5984544", "0.5975684", "0.5974689", "0.5966343", "0.595457", "0.595457", "0.595457", "0.595457", ...
0.69941264
0
The recursion doesn't need to be a complete traversal of the vnode graph, instead it can be partial, when a custom element vnode is found, we don't need to continue into its children because by attempting to disconnect the custom element itself will trigger the removal of anything slotted or anything defined on its sha...
function recursivelyDisconnectChildren(vnodes) { for (let i = 0, len = vnodes.length; i < len; i += 1) { const vnode = vnodes[i]; if (!isNull(vnode) && isArray$1(vnode.children) && !isUndefined$3(vnode.elm)) { // vnode is a VElement with children if (isUndefined$3(vnode.ctor)) { // it is ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "receive(nextElement) {\n // store previous rendered result\n const instance = this.publicInstance\n const prevRenderedComponent = this.renderedComponent\n const prevRenderedElement = prevRenderedComponent.currentElement\n const nextType = nextElement.type\n const nextProps = nextElement.props\n\n...
[ "0.5625295", "0.54817057", "0.54817057", "0.54817057", "0.5470436", "0.54619527", "0.5457312", "0.54417896", "0.54395074", "0.5433978", "0.54220265", "0.5389422", "0.53808904", "0.53808904", "0.53808904", "0.53734976", "0.5363615", "0.53628045", "0.53628045", "0.5345023", "0....
0.71580577
0
for shadow DOM components and the root element itself for light DOM) without having to go into snabbdom. Especially useful when the reset is a consequence of an error, in which case the children VNodes might not be representing the current state of the DOM.
function resetComponentRoot(vm) { const { children, renderer } = vm; const rootNode = getRenderRoot(vm); for (let i = 0, len = children.length; i < len; i++) { const child = children[i]; if (!isNull(child) && !isUndefined$3(child.elm)) { renderer.remove(child.elm, rootNode); } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prepareElementRoot() {\r\n aria( P.$root[0], 'hidden', true )\r\n }", "function prepareElementRoot() {\n aria( P.$root[0], 'hidden', true )\n }", "initialize(){super.initialize();this.constructor._getUniqueStyles();this.renderRoot=this.createRenderRoot();// Note, if renderRoot is n...
[ "0.67088276", "0.6674362", "0.6307023", "0.6217455", "0.6211721", "0.6182053", "0.61753905", "0.6164966", "0.6135144", "0.6087784", "0.60825145", "0.6072051", "0.60707396", "0.60707396", "0.60707396", "0.60698587", "0.60605586", "0.6051315", "0.6051315", "0.6010984", "0.59883...
0.72633004
0
Copyright (c) 2018, salesforce.com, inc. All rights reserved. SPDXLicenseIdentifier: MIT For full license text, see the LICENSE file in the repo root or EXPERIMENTAL: This function provides access to the component constructor, given an HTMLElement. This API is subject to change or being removed.
function getComponentConstructor(elm) { let ctor = null; if (elm instanceof HTMLElement) { const vm = getAssociatedVMIfPresent(elm); if (!isUndefined$4(vm)) { ctor = vm.def.ctor; } } return ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BaseComponent() {\n return Reflect.construct(HTMLElement, [], new.target);\n }", "constructor() {\n\t\tsuper(); // this is needed to inherit HTMLElement properties and is standard JavaScript\n\t\tconsole.log('Component created…');\n\t\t// initialise a variable. _ indicates private to component but t...
[ "0.7451197", "0.6816434", "0.67119116", "0.67119116", "0.67119116", "0.67119116", "0.67119116", "0.66886216", "0.6687125", "0.6687125", "0.6687125", "0.6687125", "0.6687125", "0.6687125", "0.6687125", "0.6682034", "0.6654772", "0.6648079", "0.66309243", "0.6548077", "0.652374...
0.7183572
1
Copyright (c) 2018, salesforce.com, inc. All rights reserved. SPDXLicenseIdentifier: MIT For full license text, see the LICENSE file in the repo root or EXPERIMENTAL: This function detects whether or not a Node is controlled by a LWC template. This API is subject to change or being removed.
function isNodeFromTemplate(node) { if (isFalse$3(node instanceof Node)) { return false; } // TODO [#1250]: skipping the shadowRoot instances itself makes no sense, we need to revisit // this with locker if (node instanceof ShadowRoot) { return false; } if (useSyntheticShadow...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasCustomTemplate() {\n const template = this.templates ? this.templates.first : undefined;\n const menuTemplate = this.dropdown && this.dropdown.templates ?\n this.dropdown.templates.first : undefined;\n return Boolean(template && template !== menuTemplate);\n }", "function _i...
[ "0.5694678", "0.56119835", "0.5544326", "0.5526973", "0.55150926", "0.5465108", "0.53473675", "0.5250401", "0.5244863", "0.5195452", "0.51708287", "0.5158084", "0.5120199", "0.5105402", "0.50464046", "0.49554387", "0.49554387", "0.4955107", "0.49206153", "0.49202532", "0.4919...
0.58982944
0
Handle the animation ending, update to next hello
handleAnimationEnd() { this.isAnimating = false; this.index = (this.index + 1) % greetings.length; setTimeout(() => this.updateGreeting(), 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "end() {\n this.toggleAnimation().resetAngle().execute().updateHistory();\n }", "function animationEnd() {\n animatingDetail = 0\n }", "function handleAnimationEnd() {\r\n node.classList.remove(`${prefix}animated`, animationName);\r\n resolve('Animation ended');\r\n ...
[ "0.68351114", "0.68162763", "0.6813838", "0.6813838", "0.67940694", "0.6764827", "0.67581916", "0.6713359", "0.6703651", "0.66597486", "0.66184443", "0.65944725", "0.6568141", "0.65102667", "0.64907527", "0.647758", "0.6427227", "0.6413631", "0.6362637", "0.63558275", "0.6255...
0.7995177
0
Update to the next greeting and start animating
updateGreeting() { this.isAnimating = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleAnimationEnd() {\n this.isAnimating = false;\n this.index = (this.index + 1) % greetings.length;\n setTimeout(() => this.updateGreeting(), 500);\n }", "function updateGreeting(){\n \n $(\"#greeting-block\").animate({opacity: '0'}); //fade out the greeting-block\n setTimeout(function()...
[ "0.74317336", "0.68556726", "0.6791454", "0.6344262", "0.6256458", "0.6211329", "0.6210664", "0.619964", "0.61563516", "0.61352307", "0.61330897", "0.61088866", "0.609784", "0.608528", "0.60616165", "0.6009788", "0.6009788", "0.6004337", "0.5974364", "0.59574646", "0.5926764"...
0.77703595
0
Compare the attributes of two nodes for equality
function compareAttrs(a, b) { var attr, attrName; for (let i = 0, len = a.length; i < len; i++) { attr = a[i]; attrName = attr.name; if (!b[attrName] || b[attrName].value !== attr.value) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareNodes(a, b) {\n let aChildren = a.childNodes || [];\n let bChildren = b.childNodes || [];\n let aAttributes = a.attributes || [];\n let bAttributes = b.attributes || [];\n if (a.nodeType !== b.nodeType || (a.tagName !== b.tagName)) {\n return false;\n }\n if (a.nodeType === 3 && a.data !=...
[ "0.6703369", "0.66290057", "0.6559671", "0.63509226", "0.6336044", "0.62554103", "0.62554103", "0.61724496", "0.6123169", "0.6101918", "0.6075346", "0.60695505", "0.60151887", "0.60040736", "0.59787583", "0.5911555", "0.584209", "0.5832224", "0.582131", "0.5799288", "0.579928...
0.72236395
0
Compare DOM nodes for equality
function compareNodes(a, b) { let aChildren = a.childNodes || []; let bChildren = b.childNodes || []; let aAttributes = a.attributes || []; let bAttributes = b.attributes || []; if (a.nodeType !== b.nodeType || (a.tagName !== b.tagName)) { return false; } if (a.nodeType === 3 && a.data !== b.data) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareNode(actual, expected) {\n expect(actual.nodeName).toEqual(expected.nodeName);\n expect(actual.getAttribute(\"href\")).toEqual(expected.getAttribute(\"href\"));\n expect(actual.classList.value).toEqual(expected.classList.value);\n if (\n actual.nodeName === \"A\" ||\n (actual.nodeName ===...
[ "0.7129265", "0.70121056", "0.70021206", "0.6916719", "0.6888093", "0.68592894", "0.68267375", "0.6728501", "0.67013824", "0.6693936", "0.65240353", "0.65043116", "0.65004176", "0.6462412", "0.64455146", "0.63242", "0.6287874", "0.62798256", "0.622289", "0.61558944", "0.60847...
0.7540089
0
start the Game show ranking users
function showLead(){ var sortedUsers = users.sort(function(a,b){ return b.points > a.points; }) console.reset(); console.log("Here the ranking of Users\n") sortedUsers.forEach(function(value){ console.log(value.name + "............" + value.points + " points"); }) setTimeout(startUser,5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showLeaderboard() {\n\tif (cnt === 0) {\n\t\tstartClick.remove();\n\t}\n\t$('h1').text('Leaderboard');\n\t// Remove game deck and score panel\n\t$('.score-panel').remove();\n\t$('.deck').remove();\n\t// Insert restart game option\n\t$('div.container').after('<section class=\"container rank-panel\"></secti...
[ "0.64791244", "0.64196754", "0.61820203", "0.61476403", "0.6137669", "0.6115975", "0.6024779", "0.59954655", "0.597592", "0.595192", "0.59494704", "0.59411985", "0.5934016", "0.5905661", "0.58988565", "0.58911234", "0.58783036", "0.5868646", "0.58089924", "0.5806209", "0.5779...
0.67969096
0
const prettify = json => JSON.stringify(json, null, 2);
function prettyLog(json){ console.log(prettify(json)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prettyPrintJson (jsonObject) {\n return JSON.stringify(jsonObject, null, 2);\n}", "function prettyPrint(x) {\n return JSON.stringify(x,null,2);\n}", "function prettyPrint(value) {\n return JSON && JSON.stringify ? JSON.stringify(value) : value;\n }", "function pretty(json) {\n ret...
[ "0.77141553", "0.76411635", "0.75123274", "0.7464939", "0.7464939", "0.7464765", "0.7464765", "0.7464765", "0.7464765", "0.74253243", "0.74116236", "0.7284273", "0.72785765", "0.7001599", "0.68467927", "0.675271", "0.669348", "0.6687917", "0.6644815", "0.65346855", "0.6534239...
0.7659801
1
This method draws rabbit
draw_rabbit(color="#fff") { this.leave_footprint(); if(this.direction == "E"){ let line_top = s.line(this.x, this.y, this.x+d/2, this.y+d/4) let line_bottom = s.line(this.x, this.y+d/2, this.x+d/2, this.y+d/4) let line_left = s.line(this.x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _drawRubberbanding(ctx)\n {\n var item = MODEL.instance.selectedItem();\n if (MODEL.instance.mode() === MODEL.Modes.CONSTRUCT && MASS.isMass(item))\n {\n var [x1, y1] = _metersToPixels(item.s).get();\n item = MODEL.instance.hoveredItem();\n var [x2,...
[ "0.67221665", "0.6599095", "0.65436006", "0.6503992", "0.6450109", "0.6401575", "0.6363196", "0.6344976", "0.6335952", "0.6328754", "0.6326789", "0.63145345", "0.63107723", "0.63060236", "0.6299479", "0.62934923", "0.6283215", "0.6239924", "0.62303", "0.6217879", "0.61800194"...
0.7309374
0
Create the `showPage` function to hide all of the items in the list except for the ten you want to show. Pro Tips: Keep in mind that with a list of 54 students, the last page will only display four. Remember that the first student has an index of 0. Remember that a function `parameter` goes in the parens when you initi...
function showPage(list, page) { let startIndex = (page * number) - number; let endIndex = page * number; // hide all the student item const studentList = document.getElementsByClassName('student-item cf'); for(let i = 0; i < studentList.length; i++) { studentList[i].style.display = 'none'; } // show...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showPage(pageNumber, studentList) {\r\n $(list).hide();\r\n for (let i = 0; i < studentList.length; i += 1) {\r\n if (i < pageNumber*10 && i >= pageNumber*10-10) {\r\n studentList[i].style.display = 'block';\r\n }\r\n }\r\n}", "function showPage(list, page){\r\n let startIndex = (page *...
[ "0.80721533", "0.8027091", "0.795152", "0.7910481", "0.786427", "0.7800827", "0.7746168", "0.7713944", "0.7707196", "0.76881623", "0.7673195", "0.7649742", "0.76475924", "0.76064485", "0.76064265", "0.7562643", "0.7532301", "0.7480111", "0.74668014", "0.7446551", "0.744551", ...
0.8360113
0
General JS Functions////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// return the last two authorizations for user
async function getMainPageAuthorization(role, address){ //get all authorizations for user to show it on startpage var personalDataAuthohorization = await getAuthorization(role, address); var lastTwoEntriesAuto; //if the authorization list is larger then 2, get the last two entries from the list if(p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get mostActiveUser() {\n }", "function get3PAuthorizationUrls() {\r\n var service = connector.getOAuthService();\r\n if (service == null) {\r\n return '';\r\n }\r\n return service.getAuthorizationUrl();\r\n}", "function getUserRoles() {\n return $(\"#editor-common-metadata\").attr(\"data-object-user...
[ "0.5774478", "0.561443", "0.5385492", "0.51710165", "0.5141918", "0.5055412", "0.4951651", "0.48891717", "0.48707378", "0.4847743", "0.48419622", "0.481381", "0.48066267", "0.4803826", "0.47999865", "0.4795698", "0.4778321", "0.47772384", "0.47571868", "0.47389257", "0.472751...
0.6623482
0
return last two treatments for user
async function getMainPageTreatment(role, address){ //get last treatments for user to show it on startpage var treatmentData = await getTreatment(role, address); var lastTwoEntriesTreat; //if the treatment list is larger then 2, get the last two entries from the list if(treatmentData.length >= 2) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getLastActive(user) {\n\tvar lastTime = null;\n\tvar receipt = await getAllFunctionCalls(contractAddress,\"add_IOU\");\n\treceipt.forEach(val => {\n\t\tvar debtor = val[\"from\"];\n\t\tvar creditor = \"0x\"+val[\"input\"].substr(34,40);\n \t\tif(debtor == user.toLowerCase() || creditor == user.toLow...
[ "0.5583842", "0.5457647", "0.5412606", "0.53963447", "0.52507716", "0.5204579", "0.5178574", "0.5106159", "0.5036363", "0.5035434", "0.502275", "0.5008935", "0.50072515", "0.49929073", "0.49824753", "0.49799165", "0.4973824", "0.4951387", "0.49405354", "0.49376833", "0.492389...
0.5696571
0
get standarised clientX and clientY
function client(f) { try { return [(f.clientX || f.originalEvent.clientX || f.originalEvent.touches[0].clientX), (f.clientY || f.originalEvent.clientY || f.originalEvent.touches[0].clientY)]; } catch (e) { return ['x', 'y']; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clientInCamCoords( clientX, clientY ) {\n\n // mouse pointer in camera coordinates:\n var mcc = new THREE.Vector3( (clientX - 0.5*canvas.width)/(0.5*canvas.width),\n (0.5*canvas.height - clientY)/(0.5*canvas.height),\n 0);\n ...
[ "0.6677374", "0.65916777", "0.6324433", "0.6198241", "0.61671746", "0.6113738", "0.6090589", "0.60011375", "0.5956332", "0.5946607", "0.588741", "0.58712655", "0.5867676", "0.58513933", "0.5847526", "0.5847526", "0.5817264", "0.57986104", "0.5794016", "0.5774937", "0.577087",...
0.6917698
0
Reads through the configured path scans the matching files for messages.
function scanAndProcessMessages () { var stream = readdirp(scanPath, { fileFilter: fileFilterer }); // Remove skipped checks for our mapping skipChecks.forEach(function (checkName) { delete messageChecks[checkName]; }); // TODO: Actually do something meaningful/useful with these handlers. stream...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pathnameMessages(pathname) {\n var done = _.chan();\n\n _.messages.queryPathname(pathname)\n .then(function(messages) {\n _.putAsync(done, messages);\n messages.forEach(put);\n })\n .catch(function(err) {\n _.putAsync(errors, err);\n })\n .then(function() {\n done.clos...
[ "0.6026551", "0.59412307", "0.59412307", "0.5870623", "0.57177794", "0.5700581", "0.560284", "0.5462519", "0.53951865", "0.53400147", "0.5299924", "0.5293636", "0.5288478", "0.5250742", "0.5238229", "0.52205455", "0.52089584", "0.52013206", "0.5187657", "0.516498", "0.5163449...
0.6990836
0
Only one of these two functions, onTrackEventResizedLeft or onTrackEventResizedRight, is run during resizing. Since all the max/min data is prepared ahead of time, we know the w/x values shouldn't grow/shrink past certain points.
function onTrackEventResizedLeft( trackEvent, x, w, resizeEvent ) { if ( x < min ) { resizeEvent.blockIteration( min ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleMoveOrResize() {\n if( boundsInfo && boundsInfo.hasBeenQueried() ) {\n update();\n }\n }", "_resizeHandler() {\n const that = this;\n\n if (!that._isVisible()) {\n that._renderingSuspended = true;\n return;\n }\...
[ "0.643423", "0.63722396", "0.63103837", "0.6289012", "0.6182513", "0.6170283", "0.6133581", "0.6129775", "0.6129249", "0.6072127", "0.60665715", "0.60524863", "0.6045269", "0.5998611", "0.59887964", "0.5972855", "0.5958565", "0.59215665", "0.5901309", "0.58947015", "0.5894471...
0.7584469
0
recupere une variable d'environnement dans le contexte , et si non trouve, prend la valeur par defaut
function getEnvParam(param,defaut=undefined) { var env = process.env; var value = env[param]; if (value === undefined) { return defaut; } else { return value; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGlobalVariable(){\n\treturn;\n}", "function environ(variable, defaultValue) {\n return process.env.hasOwnProperty(variable) ?\n process.env[variable] : defaultValue;\n}", "function varPrueba() {\r\n var x = 70;\r\n if (true) {\r\n var x= 50;\r\n console.log(x); // Aqui...
[ "0.62167716", "0.60585535", "0.60059893", "0.5957153", "0.58438814", "0.58074945", "0.5734143", "0.5734143", "0.5734143", "0.57281727", "0.5724539", "0.5707314", "0.5706732", "0.5666714", "0.56645465", "0.566397", "0.56616616", "0.5625305", "0.5608241", "0.5574148", "0.550903...
0.6515309
0
Gets location data from form inputs
_getInputLocation() { var lat = parseFloat(this.$lat.val()); var lng = parseFloat(this.$lng.val()); if (lat && lng) { return { lat: lat, lng: lng }; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPosition(position)\n{\n // set the form values to the location data\n $(\"#latitude\").val(position.coords.latitude);\n $(\"#longitude\").val(position.coords.longitude);\n \n console.log(position.coords.latitude + \", \"+position.coords.longitude)\n \n}", "function getLocationValue1...
[ "0.7035234", "0.65758437", "0.6383545", "0.63770485", "0.6333174", "0.6294707", "0.6218543", "0.6208683", "0.620343", "0.6182122", "0.6142265", "0.61355054", "0.612144", "0.6106048", "0.6104797", "0.6065214", "0.60395056", "0.60190207", "0.6014151", "0.6003753", "0.60029006",...
0.6752946
1
Destroys the locationpicker plugin.
_destroy() { this.$pac.off('place_changed'); this.$lat.off('input'); this.$lng.off('input'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n this.handles.off('.zf.slider');\n this.inputs.off('.zf.slider');\n this.$element.off('.zf.slider');\n\n Foundation.unregisterPlugin(this);\n }", "destroy() {\n this.$element.off('.zf.orbit').find('*').off('.zf.orbit').end().hide();\n Foundation.unregisterPlugin(this);\n }", "f...
[ "0.6844384", "0.6745257", "0.66780025", "0.6584123", "0.65595645", "0.64827704", "0.6356485", "0.63494706", "0.63484865", "0.63484865", "0.63305736", "0.6300242", "0.6300242", "0.6300242", "0.62471294", "0.6227746", "0.6221226", "0.62095374", "0.6195898", "0.618644", "0.61499...
0.6782582
1
class for performing particular functionality for the Repository Explorer
function RepositoryExplorer() { document.body.oncontextmenu=this.suppressDefault; // actionStatus actionStatus['new_folder'] = new actionProperties('', 'new_folder', 'images/new_folder_enabled.gif', 'images/new_folder_disabled.gif', 'new_folder_menu', null); actionStatus['new_resource'] = new acti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RepositoryBrowserControllerProxy() {\n\n // This function is called after the Save dialog has been used\n this.remoteSave = function( filename, solution, path, type, overwrite ) {\n save_to_solution( filename, solution, path, type, overwrite );\n\n \n }\n}", "function repoShow(){\n...
[ "0.60507274", "0.5976597", "0.5828493", "0.5771569", "0.5758001", "0.57543194", "0.56240135", "0.56141657", "0.5603341", "0.5591237", "0.55871457", "0.5544539", "0.5473919", "0.5463182", "0.5416006", "0.540082", "0.53838986", "0.53377897", "0.53259945", "0.52783084", "0.52754...
0.690194
0
Prerender the tiles to make drawing fast.
function preRenderImage() { // draw each layer in order // eslint-disable-next-line no-cond-assign for (let layerIndex = 0, layer; (layer = tileEngine.layers[layerOrder[layerIndex]]); layerIndex++) { for (let dataIndex = 0, len = layer.data.length; dataIndex < len; dataIndex++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\r\n // This animation job updates the state of actual tiles, so it has nothing of its own to draw\r\n }", "function preRenderImage() {\n let tile, tileset, image, x, y, sx, sy, tileOffset, w;\n\n // draw each layer in order\n for (let i = 0, layer; layer = tileEngine.layers[l...
[ "0.68502665", "0.68345344", "0.6820741", "0.67370415", "0.6700986", "0.66726756", "0.6647923", "0.662552", "0.6615704", "0.65806437", "0.65806437", "0.6548794", "0.6529148", "0.6515103", "0.64280105", "0.6368945", "0.6352775", "0.63495266", "0.6329094", "0.63263065", "0.63256...
0.68683714
0
Activate the left and right button to control carousel
activateCarousel() { const btnLeft = document.querySelector(".control-btn-prev"); const btnRight = document.querySelector(".control-btn-next"); if (btnLeft) btnLeft.addEventListener("click", utils.prev); if (btnRight) btnRight.addEventListener("click", utils.next); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enableLeftRightNavigation()\n{\n if (prevBtn) {\n prevBtn.addEventListener('click', function (evt) {\n evt.stopPropagation();\n rotator.prev();\n });\n }\n if (nextBtn) {\n nextBtn.addEventListener('click', function (evt) {\n evt.stopPropagation();\n rotator.next();\n })...
[ "0.7116466", "0.6793227", "0.678757", "0.67714447", "0.6633094", "0.6594541", "0.65940225", "0.6532275", "0.65235245", "0.65185416", "0.65153056", "0.6506872", "0.6502109", "0.6465911", "0.6453687", "0.64507395", "0.64197904", "0.63541996", "0.6292165", "0.62607294", "0.62568...
0.79585296
0
Keeps idx within the bounds of [0, length), looping back to 0 when over, and length1 when under
function boundedIdx(idx, length) { return (idx % length + length) % length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nidx (idx, length) {\n\treturn idx == null ? 0 :\n\t\tidx < 0 ? Math.max(idx + length, 0) :\n\t\tidx > 0 ? Math.min(length, idx) :\n\t\tObject.is(idx, -0) ? length : 0\n}", "function utilWrap(index, length) {\n if (index < 0)\n index += Math.ceil(-index/length)*length;\n return index ...
[ "0.6646385", "0.6246702", "0.623565", "0.6118265", "0.5990513", "0.5844647", "0.5780518", "0.5733587", "0.5652789", "0.5623148", "0.5616994", "0.5587476", "0.5566223", "0.5545398", "0.5539679", "0.5536445", "0.5506937", "0.54835844", "0.5441533", "0.5437393", "0.5404902", "...
0.71325696
0
megamenu overflow fix js
function megamenuOverflow_fix(){ var sub_menu = $('#main-menu .sub-menu'); sub_menu.each(function(){ var __this = $(this); var submenu_position = __this.position(); var submenu_position_offset = __this.offset(); var leftValue = submenu_position_offse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function auto_width_megamenu(){\n var full_width = parseInt($('.container').innerWidth());\n //full_width = $( document ).width();\n var menu_width = parseInt($('.vertical-menu-content').actual('width'));\n $('.vertical-menu-content').find('.vertical-dropdown-menu').each(function(){\n ...
[ "0.6807977", "0.6602486", "0.63990116", "0.63614154", "0.6358682", "0.6328145", "0.62673193", "0.62520635", "0.6229333", "0.62289554", "0.61275893", "0.61086655", "0.61055845", "0.60915405", "0.60875076", "0.6058885", "0.6051755", "0.6048887", "0.6048887", "0.5989717", "0.598...
0.73023045
0
takes a string and returns the appropriate r literal string with escapes.
function escape_r_literal_string(s) { return (s == null) ? "NULL" : ("\"" + s.replace(/\\/g, "\\\\").replace(/"/g, "\\\"") + "\""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lrcEscapeStr(str) {\n return \"'\" + (\"\"+str).replace(/\\\\/g, '\\\\\\\\').replace(/'/g, '\\\\\\'').htmlize() + \"'\";\n}", "function escapeRegString(string) {\n return string.replace(/[\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&')\n}", "function string_backslashEscape(string) {\n...
[ "0.6579633", "0.6055443", "0.6050323", "0.59117424", "0.5880508", "0.5880508", "0.58223176", "0.58011526", "0.57872003", "0.57866174", "0.5780064", "0.5780064", "0.57794166", "0.57794166", "0.5763184", "0.5747051", "0.574492", "0.574492", "0.5738429", "0.5738429", "0.5725294"...
0.76777714
0
Create a new signal counter. The number of successful signals will be counted in in the signaled property. The number of cancellations will be counted in the cancelled property. The lastName property will be set when a specific callback is signaled or cancelled. A new ConditionVariable.wait() callback with the specifie...
function SignalCounter() { var self = this; this.signaled = 0; this.cancelled = 0; this.lastName = undefined; this.getCallback = function getCallback(name) { return { result: function(signaled) { self.lastName = name; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SemaphoreCounter() {\n var self = this;\n this.acquired = 0;\n this.cancelled = 0;\n this.lastName = undefined;\n this.getCallback = function getCallback(name) {\n return {\n result: function(acquired) {\n self.lastName = name...
[ "0.633472", "0.53612983", "0.5273483", "0.5201381", "0.5160677", "0.49960977", "0.49837208", "0.48297843", "0.48251784", "0.48218292", "0.482093", "0.481715", "0.48111686", "0.48063883", "0.47941488", "0.4784593", "0.4784528", "0.4757212", "0.47497976", "0.4744624", "0.469737...
0.77305573
0
Return the next signal name.
function nextName() { return NAME + nameCount++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextName() {\n\t\treturn \"S\" + nameNumber++;\n\t}", "function asNextName(index) {\n var enumerableKeys = this.enumerableKeys;\n release || assert(enumerableKeys && index > 0 && index < enumerableKeys.length + 1);\n return enumerableKeys[index - 1];\n}", "uniqueName(prefix) { return `${prefix}${th...
[ "0.68567187", "0.6477575", "0.589626", "0.5841532", "0.5643991", "0.5602754", "0.5565037", "0.55030674", "0.5490711", "0.54619795", "0.54523695", "0.5416751", "0.5416751", "0.5416751", "0.540451", "0.53996676", "0.53996676", "0.53918535", "0.5374641", "0.53560805", "0.5356080...
0.701033
1
var dictList = [hole1, hole2, hole3, hole4, hole5, hole6, mancala1, hole7, hole8, hole9, hole10, hole11, hole12, mancala2];
function holeClicked(hole){ var num = parseInt(hole.slice(4, ), 10); if(count % 2 != 0 && num >= 8){ alert("Player One's turn"); return; }else if (count % 2 == 0 && num <= 6){ alert("Player Two's turn"); return; } while (dict[hole] != 0){ dict[hole] -= 1; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_list( arr, value ){\n\n var list = [];\n arr.map( function( inst ){\n\n var key = inst[ value ] || 0;\n if ( list.indexOf( key ) < 0 ){\n list.push( key );\n }\n });\n\n // console.log('[ list ]', list)\n\n return list;\n }", ...
[ "0.56976473", "0.55660665", "0.5498917", "0.5408242", "0.5387831", "0.5371359", "0.52966726", "0.5243235", "0.52109826", "0.5181098", "0.5175352", "0.5168578", "0.5168206", "0.51211417", "0.511574", "0.50917083", "0.50497293", "0.50256795", "0.50240046", "0.50132465", "0.4986...
0.58117896
0
Scan an alphanumeric string
scanAlphaNumeric() { let chars = []; while (this.currentCharacter && Lexer.isAlphaNumeric(this.currentCharacter)) { chars.push(this.currentCharacter); this.advance(); } return chars.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scan()\r\n{\r\n var str = document.getElementById(\"displaytext\").value;\r\n var n = str.scan(/sample/i);\r\n document.getElementById(\"demo\").innerHTML = n;\r\n}", "function alphanumeric(inputtxt) {\n for (let i=0; i < inputtxt.length ;i++){\n var char1 = inputtxt.charAt(i);\n ...
[ "0.68152857", "0.65092725", "0.63276273", "0.614291", "0.6142003", "0.6038861", "0.5963451", "0.596082", "0.59123266", "0.58727753", "0.58445734", "0.5843261", "0.5827959", "0.58271515", "0.5819924", "0.57835686", "0.57570606", "0.5754546", "0.5736532", "0.5722673", "0.569800...
0.66560084
1
authorizes extension in Todist and fetch projects followed by showing it
function authorizeAndFetchProjects() { var todoistOauth = new OAuth2('todoist', { 'client_id': "21b13def0a134167bfd1695ad87c134f", "client_secret": "d5cf8b4ea94c46f18d25e7bf1e80b901", "state": "asdf", "api_scope": "data:read" }); todoistOauth.authorize(function() { fetchProjects(todoistOaut...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchProjects(accessToken) {\n // 2. exchange code for accessToken\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function(event) {\n if (xhr.readyState == 4) {\n if(xhr.status == 200) {\n var response = JSON.parse(xhr.responseText);\n showAllProjects(response);\n ...
[ "0.67164654", "0.60573894", "0.5917176", "0.5862824", "0.5777145", "0.5774731", "0.5755822", "0.57095927", "0.56886625", "0.5618711", "0.56022817", "0.5597369", "0.55893993", "0.55661577", "0.554199", "0.5539807", "0.55359805", "0.5532865", "0.55222183", "0.5476971", "0.54766...
0.6887265
0
fetches projects using granted access token
function fetchProjects(accessToken) { // 2. exchange code for accessToken var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function(event) { if (xhr.readyState == 4) { if(xhr.status == 200) { var response = JSON.parse(xhr.responseText); showAllProjects(response); } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function authorizeAndFetchProjects() {\n var todoistOauth = new OAuth2('todoist', {\n 'client_id': \"21b13def0a134167bfd1695ad87c134f\",\n \"client_secret\": \"d5cf8b4ea94c46f18d25e7bf1e80b901\",\n \"state\": \"asdf\",\n \"api_scope\": \"data:read\"\n });\n \n todoistOauth.authorize(function() {\n ...
[ "0.75235856", "0.6496033", "0.6235749", "0.62076813", "0.6173921", "0.6094821", "0.60652256", "0.60621685", "0.60562336", "0.605466", "0.6027512", "0.602114", "0.5981156", "0.59737635", "0.59606016", "0.59319824", "0.5918691", "0.5913999", "0.59103626", "0.58938956", "0.58930...
0.74702454
1
send event data following the generic template
sendLocalEventGenericMessage(recipientId, events) { var messageData = { recipient: { id: recipientId }, message: { attachment: { type: "template", payload: { template_type: "generic", elements: [] } } } }; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendWebEvent(type,data){\n data = JSON.stringify({ type: type, data: data });\n console.info(\"WebEvent Send: \" + data);\n EventBridge.emitWebEvent(data);\n }", "send(event, data) {\n\t\tthis.connection.emit(event, data);\n\t}", "function handleEvent(eventName) \n{\n return function(servic...
[ "0.6494621", "0.64857614", "0.6399891", "0.62136096", "0.62111044", "0.6174085", "0.6161322", "0.61477625", "0.6140591", "0.6108427", "0.6107854", "0.60939735", "0.6006966", "0.5989828", "0.59841084", "0.5971674", "0.59642667", "0.5960597", "0.5925281", "0.5918263", "0.587505...
0.6946253
0
Calls when territoryAddress list item is clicked
function show_address_details() { $(".territoryAddress").on("click", function() { $("#viewAddressDetails").html("<div class=\"loadingImage\"> <img alt=\"Circle loading images.\" class=\"center-block\" src=\"../images/logo/loading_image.gif\"/></div>"); // Get ID of the closest 'li'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addressListItem(addr) {\n if (addr.used) {\n return '<a class=\"used\">' + addr.address + '</a>';\n }\n return '<a href=\\\"' + address_add_url + '?_to_field=id&amp;_popup=1&amp;ip_address=' +\n addr.address + '&amp;subnet=' + current_subnet + '\"onclick=\"return...
[ "0.62234414", "0.61529654", "0.61046475", "0.5996437", "0.59293467", "0.59089226", "0.5836575", "0.58351034", "0.57360345", "0.57310474", "0.56909513", "0.5682045", "0.5672365", "0.56370527", "0.55710304", "0.5554788", "0.5525651", "0.5523277", "0.5484465", "0.5464226", "0.54...
0.64095885
0
Symmetrizes the point at the given coordinates, and draws them on the given graphics context,using the global stroke width and the graphics context's stroke style.
function drawPoint(gfx, x, y) { for (const [sx, sy] of getSymmetryPoints(x, y)) { gfx.beginPath(); gfx.arc(sx, sy, strokeWidth / 2, 0, Math.PI * 2, false); gfx.fill(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderAxis(center, point_X, point_Y, point_Z,drawingContext){\n \n drawingContext.lineWidth = 5;\n \n // Disegno di rosso l'asse X e definisco un rettangolo alla fine della linea\n drawingContext.strokeStyle = \"red\";\n \n ...
[ "0.5980464", "0.5861877", "0.58394986", "0.57653385", "0.57536185", "0.57336545", "0.5719587", "0.56867", "0.56811225", "0.566312", "0.5656791", "0.5625676", "0.56205356", "0.5603344", "0.56013364", "0.5587573", "0.556563", "0.55638546", "0.55632675", "0.5543657", "0.55380183...
0.6786089
0
Symmetrizes the line between the given coordinates, and draws them on the given graphics context, using the global stroke width and the graphics context's stroke style.
function drawLine(gfx, x0, y0, x1, y1) { const starts = getSymmetryPoints(x0, y0); const ends = getSymmetryPoints(x1, y1); gfx.lineWidth = strokeWidth; gfx.beginPath(); for (let i = 0; i < starts.length; i++) { gfx.moveTo(starts[i][0], starts[i][1]); gfx.lineTo(ends [i][0], ends [i][1]); } gfx.stroke(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawSolidLine(startX, startY, endX, endY, width, color)\n {\n this.ctxPlot.beginPath();\n this.ctxPlot.strokeStyle = color;\n this.ctxPlot.lineWidth = width;\n this.ctxPlot.moveTo(startX, startY);\n this.ctxPlot.lineTo(endX, endY);\n this.ctxPlot.stroke();\n }", "f...
[ "0.6809159", "0.6721677", "0.66260713", "0.659103", "0.6540252", "0.652199", "0.6517225", "0.644999", "0.6431507", "0.6410886", "0.63992214", "0.63944644", "0.63695085", "0.63561", "0.6340499", "0.6313281", "0.62842524", "0.628401", "0.6224224", "0.6197945", "0.61686504", "...
0.677719
1
Returns an array of pairs representing the symmetries of the given point coordinates, based on the current global rotation symmetry and mirror settings.
function getSymmetryPoints(x, y) { // The coordinate system has its origin at the center of the canvas, // has up as 0 degrees, right as 90 deg, down as 180 deg, and left as 270 deg. const ctrX = width / 2; const ctrY = height / 2; const relX = x - ctrX; const relY = ctrY - y; const dist = Math.hypot(relX, rel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sym() {\n const arrOfArrs = [...arguments];\n let output = arrOfArrs[0];\n for (let i = 1; i < arrOfArrs.length; i++) {\n output = symOfTwo(output, arrOfArrs[i]);\n }\n\n return output.sort((a, b) => a - b); // order the output\n}", "function getDirections(point) {\n let directions = [];\n dir...
[ "0.5623398", "0.55107313", "0.54319173", "0.54237723", "0.54104877", "0.5282306", "0.5282306", "0.5199209", "0.5079195", "0.5069336", "0.50357205", "0.50315785", "0.50315785", "0.50315785", "0.50315785", "0.50227636", "0.50227636", "0.5009897", "0.50015825", "0.4997596", "0.4...
0.7365265
0
Refreshes the guide canvas based on the base canvas, and draws guidelines if enabled.
function redrawGuideCanvas() { guideGfx.drawImage(baseCanvas, 0, 0); if (!showGuidelines) return; const halfwidth = width / 2; const halfheight = height / 2; guideGfx.lineWidth = 1; guideGfx.beginPath(); const dist = Math.min(halfwidth, halfheight); guideGfx.arc(halfwidth, halfwidth, dist, Math.PI * 2, fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearBaseCanvas() {\n\tbaseGfx.fillStyle = backgroundColor;\n\tbaseGfx.fillRect(0, 0, width, height);\n\tbaseGfx.fillStyle = paintColor;\n\tredrawGuideCanvas();\n\tscreenGfx.drawImage(guideCanvas, 0, 0);\n}", "function drawGuide(){\n drawColumns();\n drawConections();\n }", "static _u...
[ "0.6674839", "0.6537432", "0.5994899", "0.5923782", "0.5913295", "0.58705854", "0.58248806", "0.5812983", "0.57835233", "0.5736841", "0.57209533", "0.56806064", "0.5667025", "0.56615907", "0.5655212", "0.5643079", "0.56424254", "0.56215894", "0.55787605", "0.55392283", "0.545...
0.7878848
0
Clears the base canvas, redraws the guide canvas, and redraws the onscreen canvas.
function clearBaseCanvas() { baseGfx.fillStyle = backgroundColor; baseGfx.fillRect(0, 0, width, height); baseGfx.fillStyle = paintColor; redrawGuideCanvas(); screenGfx.drawImage(guideCanvas, 0, 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paintCanvas() {\n ctx.clearRect(0, 0, width, height);\n }", "function canvasUpdate() {\r\n dispCtx.drawImage(drawCanvas,0,0);\r\n clearCanvas(drawCtx);\r\n }", "clearCanvas() {\n this.canvas.width = this.canvas.width;\n // this.canvas.height = this.canvas.heigh...
[ "0.7253821", "0.7250611", "0.72456527", "0.7243216", "0.72183913", "0.7126349", "0.69693536", "0.69675386", "0.6967254", "0.6960527", "0.6952966", "0.6947134", "0.6940262", "0.6918763", "0.6907956", "0.69012636", "0.68951344", "0.68942744", "0.6887076", "0.6881379", "0.688044...
0.827666
0
Function to get the property image for a requested property based on the keyId
function getPropertyImage() { // firebaseInit(); //Get the project ID from the queryString passed into the page var keyId = queryString(); var projectRef = firebase.database().ref('projects').child(keyId) var fileName = projectRef.file.value var folderRef = firebase.storage().ref('propertyPi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPicture(id){\n let picture = imagens[id]\n return picture\n}", "function getImageById(id) {\n for (let i = 0; i < images.length; i++) {\n if (images[i].get('_id') === id) {\n return images[i];\n }\n }\n return null;\n }", "getProper...
[ "0.6439225", "0.576896", "0.5723277", "0.56916296", "0.5676838", "0.5634812", "0.5631758", "0.5629577", "0.56073797", "0.5602369", "0.5555155", "0.5546054", "0.5527785", "0.552615", "0.5488914", "0.54431546", "0.53887856", "0.53567344", "0.5347429", "0.53465", "0.53453594", ...
0.59191763
1
Function to get the query string from the search bar address.
function queryString() { var qs = window.location.search.substr(1) return qs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getQueryString() {\n return (/[?]([a-zA-Z =0-9]*)/g).exec(window.location.search)[0];\n }", "function getQueryString() {\n\tvar result = \"\";\n\tif ((window.location.href).indexOf(\"?\") > 0) {\n\t\tresult = (window.location.href).substring((window.location.href).indexOf(\"?\") + 1 );\n\t}\n\tretur...
[ "0.80745435", "0.7620613", "0.7531229", "0.7527056", "0.73997664", "0.7349751", "0.73351556", "0.7322569", "0.72792417", "0.724358", "0.7216983", "0.72151124", "0.7162131", "0.71567726", "0.7142526", "0.71197796", "0.7093137", "0.70921886", "0.70736957", "0.70592153", "0.7041...
0.7782672
1
Class representing an input parameter for a module
function InputParam(module, paramJSON) { this.id = Math.floor(Math.random() * 1000000000000); this.module = module; this.name = paramJSON.name; this.description = paramJSON.description; this.type = paramJSON.type; this.kinds = paramJSON.kinds; this.required = paramJSON.required; this.pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Input(module, param) {\n var pointer = null;\n var input = null;\n if (param instanceof InputParam) {\n pointer = param.name;\n input = param;\n }\n else {\n pointer = param;\n }\n\n\tvar port = new Port(module, pointer, input, input.id);\n\tport.type = \"input\";\n\...
[ "0.64322466", "0.6146424", "0.6037213", "0.6030191", "0.5976795", "0.59641165", "0.5920409", "0.59171116", "0.58274555", "0.5786662", "0.5766781", "0.57660645", "0.57660645", "0.57660645", "0.57660645", "0.57551426", "0.5701095", "0.5653232", "0.55863374", "0.5517012", "0.551...
0.6399501
1
Class an input port on a module
function Input(module, param) { var pointer = null; var input = null; if (param instanceof InputParam) { pointer = param.name; input = param; } else { pointer = param; } var port = new Port(module, pointer, input, input.id); port.type = "input"; port.init(); return p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InputPort(options, process) {\n BaseputPort.call(this, options);\n this.process = process;\n}", "function InputPort(read) {\n var _this8 = this;\n\n if (typeof this !== 'undefined' && !(this instanceof InputPort) || typeof this === 'undefined') {\n return new InputPort(read);\n }\n\n ...
[ "0.72717386", "0.65721107", "0.6407291", "0.6345676", "0.6333319", "0.62612814", "0.6105451", "0.61016256", "0.60751945", "0.6068672", "0.6021026", "0.5989375", "0.59641945", "0.59089905", "0.58647823", "0.5838768", "0.5745503", "0.57113725", "0.569571", "0.56287396", "0.5616...
0.69304127
1
Class an output port on a module
function Output(module, pointer) { var port = new Port(module, pointer, null, pointer); port.type = "output"; port.init(); return port; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Port(module, pointer, param, id) {\n\tthis.module = module;\n\tthis.id = id;\n this.pointer = pointer;\n this.param = param;\n\tthis.type = null;\n this.position = null;\n\tthis.endpoint = null;\n\tthis.tooltip = null;\n\tthis.pipes = [];\n this.master = false;\n\n\tthis.init = function() {\n ...
[ "0.67673665", "0.65366983", "0.634625", "0.6329238", "0.61252695", "0.59422094", "0.5894147", "0.5883796", "0.5878244", "0.5876896", "0.5875181", "0.5845012", "0.5828156", "0.5770487", "0.5734915", "0.56668955", "0.56524575", "0.56392044", "0.5621969", "0.56063026", "0.559977...
0.7540658
0
var input = new Value(datatype['DT_STRING'],'123'); var result = new Value(); CPVAL(result,input); console.log(result.stringV);
function MAKE_VALUE(result,datatype,value){ do{ //result = Buffer.alloc(Value.size); result.dt = datatype; switch(datatype){ case 0:{ result.intV = value; break; } case 1:{ result.stringV = value; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function StringValue(value) {\n this.value = value;\n this.type = 'string';\n}", "function StringValue(value) {\n this.value = value;\n this.type = 'string';\n}", "function StringValue(value) {\n this.value = value;\n this.type = 'string';\n}", "function string(val) {\n return {value: val, type: 'stri...
[ "0.61616266", "0.61616266", "0.61616266", "0.5941154", "0.5927663", "0.57828003", "0.5613736", "0.559757", "0.55751175", "0.5483985", "0.54267263", "0.5398173", "0.5397034", "0.53963846", "0.5389613", "0.5389613", "0.5320554", "0.5309542", "0.5256054", "0.52558655", "0.525535...
0.6260479
0
BUILD THE EMPLOYEES GRID
function buildGrid() { // REMOVE THE EXISTING SET OF ROWS BY REMOVING THE ENTIRE TBODY SECTION tbody; let tableEle = tbody[0].parentNode; tableEle.removeChild(tbody[0]); // REBUILD THE TBODY FROM SCRATCH let newTbody = document.createElement('tbody'); // LOOP THROUGH THE ARRAY OF EMPL...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createEmpGrid() {\n\tlet tempno = 0;\n\tcurEmpArray.map(function (author) {\n\n\t\tlet creatediv = createDiv('div', 'item', tempno),\n\t\t\timg = createNode('img'),\n\t\t\tcreatedivitem = createItemDiv('div', 'itemtext', ),\n\t\t\tspanName = createNode('p');\n\t\tspanEmail = createNode('p');\n\t\tspanStat...
[ "0.7534904", "0.6405575", "0.62880296", "0.62578344", "0.619508", "0.6143446", "0.61078775", "0.6051058", "0.6048043", "0.6030974", "0.60004836", "0.5996191", "0.5993496", "0.59905374", "0.5988138", "0.5984962", "0.59810364", "0.5966391", "0.5955046", "0.5954672", "0.5936577"...
0.6709034
1
Sort algorithm for Alarms 1. Unacknowleged red ones on top 2. Unacknowleged orange ones 3. Acknowledged reds 4. Acknowleged oranges. 5. Sort by timestamp for each category
function alarmsComparator (a,b) { if(a.ack && !b.ack) { return 1; } else if (!a.ack && b.ack){ return -1; } else { if(a.severity < b.severity) { return -1; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AlarmSort() {\n var small;\n var compare;\n var ind = -1;\n var temp;\n for (let i = 0; i < alarms.length -1; i++) { \n small = alarms[i].time; \n for (let j = i+1; j < alarms.length; j++) { \n compare = CompareAlarms(small, alarms[j].time);\n if (small !== compare) ...
[ "0.74638504", "0.62129843", "0.5988934", "0.59793097", "0.5968728", "0.5892737", "0.58927155", "0.5848845", "0.581716", "0.5746131", "0.57340485", "0.57306284", "0.5712807", "0.5682392", "0.5676112", "0.56572884", "0.56562936", "0.5653145", "0.5637744", "0.5624325", "0.562061...
0.6875822
1
CONSTRUCTOR / constructor sets up the default board anchor: optional anchor point
constructor ( anchor = undefined ) { /* create the board */ this.create_board (); /* anchor the board */ if ( anchor != undefined ) this.anchor_board ( anchor ); /* reset the board */ this.reset_board (); /* render the board */ this.render (); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Board () {\n this.grid = _makeGrid(8);\n}", "function Board(width,height){\n this.rows = height;\n this.columns = width;\n this.firstStart = true;\n}", "anchor_board ( anchor )\n {\n /* append the main board element */\n anchor.appendChild ( this.board_element ); \n }", ...
[ "0.64494133", "0.6446571", "0.6437903", "0.64376116", "0.64376116", "0.6431378", "0.64203495", "0.6352253", "0.6295741", "0.6268084", "0.62448776", "0.61997503", "0.6144061", "0.61147785", "0.6111193", "0.609923", "0.6075715", "0.6058386", "0.6028429", "0.5960996", "0.5935072...
0.8432291
0
anchor_board appends the board to an element
anchor_board ( anchor ) { /* append the main board element */ anchor.appendChild ( this.board_element ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor ( anchor = undefined )\n {\n /* create the board */\n this.create_board ();\n\n /* anchor the board */\n if ( anchor != undefined ) this.anchor_board ( anchor );\n\n /* reset the board */\n this.reset_board ();\n\n /* render the board */\n this...
[ "0.6690284", "0.6577222", "0.63658726", "0.628307", "0.62277883", "0.6174907", "0.61356044", "0.61124843", "0.6060783", "0.6060718", "0.60598683", "0.60108924", "0.60006917", "0.5932945", "0.5916045", "0.59129316", "0.5872438", "0.5871973", "0.58652526", "0.58521086", "0.5847...
0.8776853
0
RESET_BOARD METHOD / reset_board resets the pieces on the board to their starting positions the board is not rerendered
reset_board () { /* set the arrays */ this.board_layout = new Array ( 32 ); /* loop over to set pieces */ for ( let pos = 0; pos < 32; ++pos ) { /* if less than 12 then set to white */ if ( pos < 12 ) this.board_layout [ pos ] = checkers_board.piece_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetBoard(){\n setTemp(1)\n setGame(true)\n setWinner(0)\n Xmoves.splice(0, Xmoves.length)\n Omoves.splice(0, Omoves.length)\n setBoard(board.map(element=>{\n element.value=0\n return element\n })\n )\n }", "function resetBoard() {\n\t\t\tboard[0] = [1,0,1];\t\t\n\t\t...
[ "0.8187196", "0.8027688", "0.7991709", "0.7870992", "0.7824061", "0.78002584", "0.7782497", "0.777686", "0.7768195", "0.7745947", "0.7715403", "0.7714057", "0.7703365", "0.77015173", "0.76742166", "0.7617693", "0.7554142", "0.75254196", "0.75030524", "0.7490709", "0.74866295"...
0.8211623
0
function to create and append a queeny button to given location
function addQueenyButton(location, displayText){ $(location).append($('<button>').text(displayText).addClass("btn queen-button rounded")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertButton() {\n if (debug === true) {\n console.log('poll | insertButton()');\n }\n\n $element.buttonWrapper.html(state.currentQuestion.generateButton());\n }", "function createToggleButton(target, id) {\n var div = document.getElementById(tar...
[ "0.6539971", "0.6436806", "0.6398542", "0.635137", "0.62807745", "0.62683904", "0.6244707", "0.62361586", "0.6212045", "0.6200632", "0.6166112", "0.61637026", "0.61591065", "0.6156393", "0.6144459", "0.61423135", "0.611228", "0.61059296", "0.61034065", "0.60976845", "0.609714...
0.8045233
0
Takes a list of name of games and tries to find a match on steam. Adds an appid or false to each name.
function getSteamID(nameOfGames) { const inputs = { query: { assetType: 'games', filterType: 'on_twitch', filterValue: nameOfGames } }; const promises = []; nameOfGames.data.forEach(function (element) { promises.push(new Promise(function (res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gamesIsOnSale(twitchGames) {\n return new Promise((resolve, reject) => {\n const games = twitchGames;\n let IDs = []; // list to save appid's in\n let names = { data: [] }; // list to save the game names in\n games.data.forEach(function (element) {\n names.data.pu...
[ "0.6318389", "0.59385574", "0.5858809", "0.58436227", "0.56057805", "0.55960536", "0.55646896", "0.5441506", "0.53814983", "0.5198174", "0.5188253", "0.51861", "0.5185278", "0.5180153", "0.5172153", "0.51438606", "0.5128979", "0.51183045", "0.5098002", "0.5058537", "0.5057773...
0.6425429
0
Takes a list of of games on twitch and checks if they are on sale on steam and adds that to the json
function gamesIsOnSale(twitchGames) { return new Promise((resolve, reject) => { const games = twitchGames; let IDs = []; // list to save appid's in let names = { data: [] }; // list to save the game names in games.data.forEach(function (element) { names.data.push({ 'name'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWinners(data) {\n const winnersArray = []\n data.forEach(function(game) {\n if (game[\"Home Team Goals\"] > game[\"Away Team Goals\"]) {\n winnersArray.push(game[\"Home Team Name\"]);\n } else if (game[\"Home Team Goals\"] < game[\"Away Team Goals\"]) {\n winne...
[ "0.60989726", "0.60804117", "0.592071", "0.5885763", "0.579153", "0.5777435", "0.5717833", "0.56868696", "0.5686794", "0.56349087", "0.56003326", "0.55905885", "0.557901", "0.5541399", "0.55363685", "0.5488445", "0.5478844", "0.5453933", "0.54429024", "0.5417809", "0.53962016...
0.7449636
0
sample how to send events
function sendData () { // add your test events here /* myMsbClient.publish( 'EVENT_ID', // event id "Hello World!", // event vlaue 0, // event priority true // should the event be cached if the client is disconnected ) */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "test() {\n\t\tthis.emit('event1', 200)\n\t}", "function sendEvent (event) {\r\n\t\tconsole.log(\"Sending: \", event)\r\n\t\treceiveEvent(event); // Feed it back in\r\n\t}", "function sendMessage(event) {\n console.log('hello, ' + event.name)\n}", "sendEventAll (event, msg) {\n\t\tthis.io.emit(event, msg);\n...
[ "0.7244089", "0.70562685", "0.6817334", "0.67901397", "0.67714286", "0.6740238", "0.6708265", "0.6666675", "0.66644114", "0.66549945", "0.66170377", "0.6550291", "0.6540305", "0.6529022", "0.6529022", "0.6433678", "0.642039", "0.6402729", "0.6375866", "0.6364953", "0.63607967...
0.73361856
0
Se creo esta funcion para solo declarar 1 vez un objeto tipo izimodal ya que de no ser asi tendria que crearse varias instancias de este objeto por cada modal con esto se tiene un estandar de modal, osea todos los modales seran iguales Retorna los datos del modal al objeto izimodal
function modal_data(titulo, subtitulo,color_encabezado = '#2196F3',tamano = 600) { var modal_data = { title: titulo, subtitle: subtitulo, headerColor: color_encabezado, background: null, theme: '', // light icon: null, iconText: null, iconColor: '', ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initModalCuentasAuxiliar(){\n\t\tmodalCuentasAuxiliar = new modalesTelcel($('#modal-cuentas-auxiliar'),{\n\t\t\tonInit : function(){\n\t\t\t\tinitActionsModalAuxiliar();\n\t\t\t},\n\t\t\tonReset : function(){\n\t\t\t},\n\t\t\tonOpen : function(){\n\t\t\t\tupdateModalData();\n\t\t\t}\n\t\t});\n\n\n\t\tfunc...
[ "0.72365344", "0.69164276", "0.6686597", "0.6662646", "0.66062325", "0.6552758", "0.653909", "0.6498233", "0.64955777", "0.64468354", "0.6445985", "0.63974786", "0.63753986", "0.6338801", "0.633269", "0.63254213", "0.630976", "0.62930024", "0.6275374", "0.6262649", "0.6254717...
0.703113
1
Puts the scheduler in a `suspended` state and executes a task immediately.
function immediately(task) { try { suspend(); return task(); } finally { flush(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n this.scheduler.resume();\n }", "function exec(task) {\n try {\n suspend();\n task();\n } finally {\n release();\n }\n}", "function exec(task) {\n try {\n suspend();\n task();\n } finally {\n release();\n }\n}", "function exec(task) {\n try {\n suspend();\n ...
[ "0.60337275", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.57883084", "0.5502629", "0.54433006", "0.5415826", ...
0.6135947
1
Before use the Options class, you must link wordpress.js in head tag of html page with this:
function Options(wp, blog_id){ this.wp = wp; this.blog_id = blog_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lazyCustomJs(){\n /* lazy category post */ if(getid('HTML2')!=null){ctgryPst(ctgryLb1, '#HTML2 .ctgry', 6, 600, 200, true);if(getid('HTML3')!=null){ctgryPst(ctgryLb2, '#HTML3 .ctgry', 6, 600, 200, true)}};\n /* YOUR CUSTOM JS */\n}", "function BootstrapOptions() { }", "function BootstrapOptions() { ...
[ "0.59762377", "0.59490246", "0.59490246", "0.59490246", "0.59490246", "0.5890286", "0.5890286", "0.58568734", "0.5746345", "0.57455605", "0.5692153", "0.5692153", "0.5653768", "0.56338745", "0.56166977", "0.5610565", "0.5601072", "0.5593411", "0.5556412", "0.55525786", "0.553...
0.6016442
0
toggle slides to hidden and call
function hideSlides(){ a = plusOneOrReset(a); b = plusOneOrReset(b); $('#port'+ String(a) ).toggleClass('hidden'); $('#port'+ String(b)).toggleClass('hidden'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleSlideShow() {\n if (ss.slideShowActive) {\n endSlideShow();\n } else {\n startSlideShow();\n }\n}", "toggleSlideShow() {\n if (this.playing == true) {\n this.pauseSlideshow();\n } else if (this.playing == false) {\n this.playSlideshow();\n...
[ "0.74052984", "0.7397414", "0.7287846", "0.6894459", "0.6845064", "0.67525643", "0.67092925", "0.6709151", "0.6643254", "0.6600379", "0.65993005", "0.6546963", "0.6519347", "0.6505043", "0.6505043", "0.6505043", "0.6505043", "0.650399", "0.6497648", "0.6473556", "0.6450555", ...
0.75824887
0
Clear the default text when user clicks an input field, and, if nothing was entered, replace with initial text.
function init_clear_input_text() { $('.name, .password').focus(function() { if ($(this).val() == this.defaultValue) { $(this).val(''); } }); $('.name, .password').blur(function() { if ($(this).val() == '') { $...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearText(field) {\n\tif (field.defaultValue == field.value) field.value = '';\n\telse if (field.value == '') field.value = field.defaultValue;\n}", "function doClear(theText) { \n\tif (theText.value == theText.defaultValue) { theText.value = \"\" } \n}", "function clearText() {\n document.getE...
[ "0.76506025", "0.7347965", "0.7345537", "0.7324455", "0.72110605", "0.7150003", "0.71108073", "0.7092348", "0.70910853", "0.7059917", "0.6987737", "0.69821966", "0.6957839", "0.6948382", "0.6929611", "0.6929611", "0.69192046", "0.68401456", "0.6831353", "0.68264073", "0.68157...
0.73762476
1
Event method for when user clears scoreboard
function handleClearHighscores() { highscores = []; resetList(document.getElementById("highscore-list")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ClearScore()\n {\n console.log('this is ClearScore and it does nothing please help');\n //this.scoreOverTime = this.scoreOverTime.map(x=> 0);\n }", "function scoreCounterReset() {\n\n}", "function clearScore() {\n initialAndScore.value = \"\";\n}", "function clearScore(){\n ctx.clea...
[ "0.70052093", "0.6961008", "0.695356", "0.68291354", "0.6811344", "0.6800662", "0.6788749", "0.67355114", "0.6715874", "0.6668483", "0.66584224", "0.663705", "0.6623834", "0.6586544", "0.6585154", "0.65610164", "0.6554694", "0.6551049", "0.6550987", "0.65467435", "0.6520249",...
0.7042114
0
updating and creating all the scoreboard li elements
function updateScoreBoard() { var list = document.getElementById("highscore-list"); resetList(list); for(var i = 0; i < highscores.length; i++) { var newLi = document.createElement("li"); newLi.textContent = highscores[i].player + " - " + highscores[i].score; list.appendChild(newLi)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateScoreboard()\n{\n $(\"#scoreboard\").html(\"\")\n for (var i=0; i<users.length && i<11; i++)\n {\n var wrapped = wrapUser(users[i], i)\n $(\"#scoreboard\").append(wrapped)\n }\n}", "function renderscores() {\n // scores: Describe the functionality of the following two ...
[ "0.7458269", "0.74562585", "0.7215219", "0.71624225", "0.716033", "0.7140791", "0.7108751", "0.70792377", "0.70754415", "0.7005343", "0.6999449", "0.6982445", "0.69518787", "0.6936492", "0.69328135", "0.6927538", "0.6882085", "0.6854383", "0.681455", "0.6800964", "0.6775867",...
0.77276874
0
Method to insert at the proper spot when adding to scoreboard
function insertAtCorrectSpot(player, score) { var index = 0; for(var i = 0; i < highscores.length; i++) { var currScore = highscores[i].score; if(score >= currScore) { index = i; break; } } highscores.splice(index, 0, { "player": player, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addScore() {\n scoreBoard.css('font-size', '20px');\n scoreBoard.html(score);\n\n }", "function addScore(pos,schoolname) {\n var punkte = store.get('points');\n var name = schoolname;\n\n //Fuege Ergebnis an ermittelte Position und verschiebe\n highscores.splice(pos+5, 0, name);\n ...
[ "0.66802204", "0.6617284", "0.65657926", "0.6327069", "0.6225972", "0.6205894", "0.6197074", "0.6176197", "0.61686546", "0.616794", "0.6143583", "0.614197", "0.613718", "0.61210465", "0.60676", "0.60528713", "0.6037668", "0.6029086", "0.6002867", "0.59915435", "0.5989587", ...
0.6853728
0
Get All content in word document and save as word document
function saveAllDocument() { var i = 0; var slices = 0; var myFile; // Office.FileType.Compressed returns the entire document as a byte array(word or powerpoint) Office.context.document.getFileAsync(Office.FileType.Compressed, function (result) { if (result.status == "succeeded") { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AllContentToWord(id) {\r\n id.style.border = 0;\r\n ExcelSheet = new ActiveXObject(\"Word.Application\");\r\n ExcelSheet.Application.Visible = true;\r\n var mydoc = ExcelSheet.Documents.Add(\"\", 0, 1);\r\n myRange = mydoc.Range(0, 1);\r\n var sel = id.document.body.createTextRange();\r\...
[ "0.7127629", "0.6672646", "0.66491836", "0.6581085", "0.64836913", "0.6241179", "0.59988415", "0.58974683", "0.5754475", "0.5688877", "0.5676911", "0.56702155", "0.5667889", "0.5572005", "0.5523194", "0.5471848", "0.5442689", "0.5436431", "0.54298306", "0.53853095", "0.538231...
0.7345683
0
Call WCF Service to save All Content of Word document
function saveAllContent(content) { $.ajax({ type: 'post', url: '/SaveWordService.svc/SaveAllContent', contentType: 'text/json', data: '{"bytestring":"' + content + '"}', success: function (result) { if (result.d.toString() == "0") { writeToPage("Fa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveAllDocument() {\n var i = 0;\n var slices = 0;\n var myFile;\n\n // Office.FileType.Compressed returns the entire document as a byte array(word or powerpoint)\n Office.context.document.getFileAsync(Office.FileType.Compressed, function (result) {\n if (result.status == \"succeeded...
[ "0.6486724", "0.5920715", "0.5715668", "0.5708272", "0.56397265", "0.5567328", "0.54795235", "0.5447987", "0.54093593", "0.5201164", "0.51564443", "0.515159", "0.51425993", "0.5096306", "0.5081253", "0.50014466", "0.4972344", "0.49690762", "0.49486157", "0.4942041", "0.494039...
0.7555749
0
popup for 'how to get'
function howToGet(){ $(".howtoget-feedback").click(function(){ $(".layout-wrapper-about").css("position", "relative"); $(".howtoget-popup").css("display", "block"); $(".howtoget-popup-cancel").click(function(){ $(".howtoget-popup").css("display", "none");...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewHelp() {\n window.open('http://nuxy.github.io/SQLinJS/#syntax');\n }", "function openHelp(url) {\n\twindow.open(url, 'Help', 'width=700,height=600,screenX=100,screenY=100,toolbar=0,scrollbars=1');\n}", "function displayHelp() {\n ICEUtils.displayHelp(helpID);\n}", "function displayHelpWindo...
[ "0.6859187", "0.6711684", "0.6700808", "0.6570858", "0.65267885", "0.6448888", "0.6433132", "0.6387235", "0.6354275", "0.6315643", "0.6293821", "0.62825257", "0.62516266", "0.6194521", "0.61854184", "0.61781794", "0.6159665", "0.6154307", "0.6141684", "0.6115298", "0.6095985"...
0.67691565
1
Function to handle the doubleTap gesture
function doubleTapGestureHandler(widget, gestureInfo, context) { kony.print(" ########## doubleTapGestureHandler() -----> START"); // Displaying an alert that the user has performed double tap gesture //kony.ui.Alert({message: "Double Tap Gesture Recongnized!", alertType: constants.ALERT_TYPE_INFO, alertTit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _doubleClickHandler() {\n\t if (_alternateDoubleClickHandler) {\n\t _alternateDoubleClickHandler();\n\t return;\n\t }\n\n\t _this.trigger('doubleClick');\n\t }", "function inDoubleTap() {\r\n\t\t return validateDoubleTap();\r\n\t\t...
[ "0.81059355", "0.7739596", "0.7651491", "0.7646029", "0.7646029", "0.7646029", "0.7646029", "0.7644003", "0.7628695", "0.7623165", "0.7623165", "0.7623165", "0.7623165", "0.7542517", "0.7518434", "0.75072855", "0.74808836", "0.7423486", "0.73219156", "0.7207733", "0.7114037",...
0.80317104
1
Function to handle the longPress gesture
function longPressGestureHandler(widget, gestureInfo, context) { kony.print(" ########## longPressGestureHandler() -----> START"); // Displaying an alert that the user has performed long press gesture //kony.ui.Alert({message: "Long press Gesture Recongnized!", alertType: constants.ALERT_TYPE_INFO, alertTit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onLongPressButton() {\n Alert.alert('You long-pressed the button!')\n }", "_setupMouseLongPressEvent() {\n this.addEvent({\n type: 'mouse-long-press-left',\n onUpdate: this._onTouch.bind(this, false)\n });\n }", "function LongPress( map, length ) {\n this.lengt...
[ "0.722633", "0.6778258", "0.6726077", "0.6659535", "0.65934664", "0.6495541", "0.6448661", "0.64250207", "0.64250207", "0.64250207", "0.64250207", "0.6366747", "0.6289294", "0.6231265", "0.6177788", "0.61675763", "0.6158389", "0.6107621", "0.6107621", "0.6107621", "0.6107621"...
0.8013529
0
Makes the getgame request Creates the ranking within the game relative to the server response Checks if we are turnplayer Checks if we are admin Checks if we have to switch to another period relative to the server response and the goToEvolve variable Makes the user go back to the main menu if he/she happens to be unaut...
async getGameInfo() { try { console.log("getGameInfo called"); const response2 = await api.get('/games/' + this.props.match.params.pokeCode.toString(), {headers: {'Token': localStorage.getItem('token')}}); const resp2 = response2.data; let usersList = resp2.playe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playerTurnRequest() {\r\n\t\tvar allTanksPlacedWarningShown = false;\r\n\t\tvar source = new EventSource('../game/turnStatus');\r\n\t\tsource.onmessage = function(event) {\r\n\t\t\tif(!JSON.parse(event.data).hasOwnProperty('currentPlayerColor')) {\r\n\t\t\t\tif (!allTanksPlacedWarningShown) {\r\n\t\t\t\t\...
[ "0.64856833", "0.648468", "0.6437904", "0.63306564", "0.6305298", "0.629646", "0.629544", "0.628484", "0.6256911", "0.62089854", "0.6194854", "0.61721367", "0.613436", "0.6096298", "0.60734695", "0.6069073", "0.60610765", "0.60411596", "0.60374457", "0.602715", "0.6022192", ...
0.6605678
0
Update the current Node
function updateCurrentNode() { var current = Node.childString(superRoot).trim().replace(/(\s)\s+/g, '$1'); var stored = decodeURIComponent(currentNode.attr('document-parse')).trim().replace(/(\s)\s+/g, '$1'); var isChanged = current !== stored; if (isChanged) { currentNode.attr('document-parse'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n this.lifecycleListeners.beforeUpdate.call(this, this.context);\n if (!this.lifecycleListeners.shouldUpdate.call(this, this.context)) {\n return;\n }\n const vtree = this.render();\n patch(this.node, this.tree, vtree);\n this.lifecycleListeners.afterUpdate.call(this, this.context...
[ "0.6978612", "0.6839523", "0.6685239", "0.66529524", "0.65509874", "0.65175146", "0.64861953", "0.646996", "0.64284515", "0.6364205", "0.63531077", "0.6350481", "0.6328781", "0.6300417", "0.6300417", "0.6300417", "0.62901604", "0.6284637", "0.628235", "0.62640554", "0.6254784...
0.75264
0
runs all TestCase.test_ functions. These functions must be manualy assigned to TestCase object.
function run() { var func_name; for (tst in TestCase) { func_name = tst.toString(); if (func_name.indexOf('test_') > -1) { unit_test(func_name, TestCase[func_name]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "runAll() {\n const testName = this.__proto__.constructor.name;\n console.log(`--> Running test: ${testName}`);\n \n let testCount = 0;\n let reflection = Reflect.getPrototypeOf(this);\n let functionNames = Reflect.ownKeys(reflection);\n for (let testIndex = 0; testIndex < functionNam...
[ "0.7556287", "0.7282714", "0.7085507", "0.7066947", "0.70034856", "0.6907812", "0.68726945", "0.68530154", "0.6796007", "0.67535734", "0.66798866", "0.6625235", "0.65660465", "0.6494144", "0.6476097", "0.64667845", "0.6442932", "0.6405843", "0.64053303", "0.6395599", "0.63873...
0.8621369
0
Return bounding box of specified svg node.
function d3c_bbox(node, refresh) { if (!refresh && node._bbox) { return node._bbox; } var b = (node.nodeName === 'g' || node.nodeName === 'text') ? node.getBBox() : {'x': 0, 'y': 0, 'width': 0, 'height': 0}; node._bbox = {'x': b.x, 'y': b.y, 'width': b.width, 'height': b.height}; return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "bbox() {\n parser().path.setAttribute(\"d\", this.toString());\n return new Box(parser.nodes.path.getBBox());\n }", "get boundingBox() {\n const bb = this.element.getBoundingClientRect()\n bb.x = this.element.x.baseVal.getItem(0).value\n bb.y = this.element.y.baseVal.getItem(0).value\n return ...
[ "0.7225604", "0.71762353", "0.712942", "0.68362916", "0.6821633", "0.6628046", "0.65965605", "0.6418795", "0.6415883", "0.6323464", "0.6313598", "0.6280532", "0.62643087", "0.6225246", "0.6190972", "0.6184344", "0.6175128", "0.6175128", "0.6175128", "0.6175128", "0.6175128", ...
0.7263268
0
Rotate a svg node. The _mode values include start, end, middle. Middle means the x and y coordinates of rotation point is at center of text. Start means the x coordinate of rotation point is at start of text, y coordinate is center of text. End is similar to Start.
function d3c_rotateNode(svgNode, degree, mode) { var box, cx, cy, tran, tranA, cxy; if (degree) { box = svgNode.getBBox(); if (mode === 'auto') { cxy = ''; } else { cx = (mode === 'start') ? box.x : (mode === 'end') ? box.x + box.width : (box....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function d3c_rotate(selection, degree, mode) {\n return selection.attr('transform', function (_d) {\n var box, cx, cy, tran = null, tranA, cxy;\n\n if (degree) {\n box = this.getBBox();\n if (mode === 'auto') {\n cxy = '';\n } else {\n ...
[ "0.68892026", "0.6223061", "0.6105526", "0.5840806", "0.5755919", "0.56817", "0.5631716", "0.56222916", "0.55907404", "0.55719596", "0.55567825", "0.5548335", "0.55440205", "0.548101", "0.5462334", "0.5448196", "0.54465777", "0.54261756", "0.5420541", "0.5419612", "0.5396135"...
0.7369929
0
Rotate elements of selection.
function d3c_rotate(selection, degree, mode) { return selection.attr('transform', function (_d) { var box, cx, cy, tran = null, tranA, cxy; if (degree) { box = this.getBBox(); if (mode === 'auto') { cxy = ''; } else { cx = (mode ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotateItems() {\r\n\r\n for ( let i = 2; i < items.children.length; i++ ) {\r\n\r\n if ( items.children[ i ].children[ 0 ] !== selection ) {\r\n\r\n items.children[ i ].rotation.y += .01; \r\n } \r\n }\r\n}", "function rotation(d) {\r\n var elem = $('.option');\r\n\...
[ "0.69054896", "0.62715507", "0.6195519", "0.6190996", "0.61643803", "0.60956585", "0.604675", "0.6029301", "0.5994038", "0.59733313", "0.59053254", "0.5901559", "0.5817223", "0.5780104", "0.57764566", "0.5758905", "0.574766", "0.5742815", "0.57299936", "0.5653572", "0.5593203...
0.6445058
1
Translate elements of selection.
function d3c_translate(selection, x, y) { if (arguments.length === 1) { // Return x and y of current translate. var transXY = []; selection.each(function(){ var tran = this.getAttribute('transform'); if (tran && tran.indexOf('translate') >= 0) { tran =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "translate(el) {\n if (!el) el = document\n\n this.els = el.querySelectorAll(`[data-translation-id]`)\n // convert NodeList to Array so we can use forEach\n const els = Array.prototype.slice.call(this.els)\n\n // replace with translation wherever possible\n els.forEach(el => {\n const id = el...
[ "0.6558363", "0.63801414", "0.6362143", "0.63075805", "0.59338105", "0.58972025", "0.58947164", "0.58944356", "0.5842471", "0.58224285", "0.5749067", "0.56690043", "0.56109005", "0.5605789", "0.5588497", "0.55781394", "0.5577897", "0.55675244", "0.5513664", "0.55047786", "0.5...
0.64896023
1
Convert d3chart styles to CSS styles.
function d3c_toCssStyle(d3c_style) { if (typeof d3c_style === 'object') { for (var key in d3c_style) { if (d3c_style.hasOwnProperty(key)) { var newKey = d3c_toCssStyle(key); if (newKey !== key) { d3c_style[newKey] = d3c_style[key]; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processStyles() {\n if (globalVar.project.styles.length <= 0) return;\n\n for (var i = globalVar.project.styles.length - 1; i >= 0; i--) {\n if (globalVar.project.styles[i].match(/https?:\\/\\//)) {\n d3.select(\"head\")\n .append(\"link\")\n ...
[ "0.6070701", "0.5923794", "0.5801242", "0.57483476", "0.5697461", "0.5595678", "0.54750025", "0.54391086", "0.54337066", "0.5430762", "0.5421893", "0.5421893", "0.5420578", "0.5397487", "0.5397487", "0.5397487", "0.5393188", "0.5358795", "0.5353097", "0.5351877", "0.53487563"...
0.72088444
0
Convert gradient color options to svg gradient color paramters.
function d3c_adaptColorGradient(gradientOpts) { var params = gradientOpts.parameters, parts = null; if (gradientOpts.type === 'linearGradient') { params = params || ['0%', '0%', '100%', '100%']; if (typeof params === 'string') { /** * It uses short name. The sho...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attr_gradient_color(t){\n if(map_attribute == 'Gini'){\n return gini_gradient_color(t);\n } else if(map_attribute =='GDP'){\n return pib_gradient_color(t);\n } else if (map_attribute =='PP'){\n return pp_gradient_color(t);\n }\n }", "functi...
[ "0.6430456", "0.6018381", "0.589151", "0.5889682", "0.5886414", "0.583696", "0.58336216", "0.5770743", "0.5719669", "0.571501", "0.56663597", "0.5624063", "0.54952854", "0.54708195", "0.5459535", "0.54550135", "0.544287", "0.5438689", "0.541605", "0.54038906", "0.53950465", ...
0.66002303
0
Convert d3charts dashstyle option to HTML/CSS style.
function d3c_adaptDashstyle(name, v, width, chartContext) { var i, value = v; if (typeof value === 'function') { return (function (_this) { var args = chartContext ? d3.merge(arguments, [chartContext]) : arguments; return { 'name' : name, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function d3c_toCssStyle(d3c_style) {\n if (typeof d3c_style === 'object') {\n for (var key in d3c_style) {\n if (d3c_style.hasOwnProperty(key)) {\n var newKey = d3c_toCssStyle(key);\n if (newKey !== key) {\n d3c_style[newKey] = d3c_style[key];\n...
[ "0.6376188", "0.6231248", "0.59693503", "0.59496164", "0.5839141", "0.5829996", "0.5751869", "0.5724668", "0.5689986", "0.5671998", "0.5493222", "0.54517674", "0.542148", "0.540059", "0.5335793", "0.5326428", "0.526784", "0.52642596", "0.5253532", "0.5246263", "0.5226634", ...
0.6315406
1