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 |
|---|---|---|---|---|---|---|
function for clean sweep achieve | function cleanSweepAction(){
cleanSweep = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sweep_left(){\n\n}",
"decc() {\n\t\tlet maxvx = 0.0;\n\t\tlet maxvy = 0.0;\n\n\t\tif( this.vx < maxvx ){\n\t\t\tthis.vx += this.dc;\n\t\t} else if( this.vx > maxvx ){\n\t\t\tthis.vx -= this.dc;\n\t\t}\n\n\t\tif( this.vy < maxvy ){\n\t\t\tthis.vy += this.dc;\n\t\t} else if( this.vy > maxvy ){\n\t\t\tthis... | [
"0.62392485",
"0.5793806",
"0.5611966",
"0.55242026",
"0.54214656",
"0.54056567",
"0.5388583",
"0.53774863",
"0.52729017",
"0.5259759",
"0.52443683",
"0.5243778",
"0.5223316",
"0.5202506",
"0.51801395",
"0.51788235",
"0.5178285",
"0.5150443",
"0.5142613",
"0.5142246",
"0.5129... | 0.6340083 | 0 |
function for ironman achieve | function ironManAction(){
ironMan = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Man() {\r\n}",
"function Alerter() {}",
"function Macex() {\r\n}",
"man() {\n console.log('Grammaire de la machine de Peano :');\n this.expression.man();\n this.definition.man();\n }",
"think() {\n let targ = {\n x: this.player.target.x,\n y: th... | [
"0.5846424",
"0.581076",
"0.57965726",
"0.577611",
"0.57126784",
"0.5690131",
"0.5654435",
"0.5633954",
"0.5629716",
"0.5621049",
"0.56146",
"0.5610141",
"0.5605384",
"0.55915666",
"0.5556686",
"0.55469877",
"0.55434185",
"0.55423445",
"0.5514193",
"0.55136096",
"0.55129254",... | 0.5846334 | 1 |
Sort the queue to have the least expensive node on first position | sort () {
this.queue.sort((a, b) => a.priority - b.priority)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sortShortest() {\n this.waitingQueue = this.waitingQueue.sort(function(jobA, jobB) {\n if(jobA.getBurstsRemaining() < jobB.getBurstsRemaining)\n return -1;\n if(jobA.getBurstsRemaining() > jobB.getBurstsRemaining())\n return 1;\n return 0;\n ... | [
"0.6898954",
"0.6417913",
"0.6320275",
"0.6310877",
"0.6305943",
"0.6253141",
"0.6160829",
"0.615003",
"0.61360013",
"0.61088884",
"0.6099662",
"0.6081532",
"0.60461396",
"0.60461396",
"0.60140514",
"0.60011005",
"0.59917414",
"0.59652925",
"0.5927616",
"0.5925465",
"0.591939... | 0.6763277 | 1 |
Set a priority for a key in the queue | set (key, value) {
const priority = Number(value)
if (isNaN(priority)) {
throw new TypeError('"priority" should be a number')
}
if (!this.keys.has(key)) {
this.keys.add(key)
this.queue.push({ key, priority })
} else {
this.queue.map((element) => {
if (element.key ===... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"enqueue(element, priority){\n var newElement = new QueueEntry(element, priority);\n var valueExists = false; \n\n for(var i = 0; i < this.items.length; i++){\n if(this.items[i].priority > newElement.priority) {\n this.items.splice(i, 0, newElement);\n v... | [
"0.655333",
"0.6285119",
"0.6285119",
"0.62807524",
"0.626477",
"0.62212795",
"0.6210925",
"0.6159073",
"0.61063695",
"0.6055655",
"0.60478735",
"0.60005826",
"0.5926534",
"0.59164274",
"0.5915978",
"0.5915978",
"0.5915978",
"0.5915978",
"0.5915978",
"0.5915978",
"0.5915978",... | 0.8073283 | 0 |
Get key form queue | get (key) {
return this.queue.find(element => element.key === key)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"retrieve(key) {\n const index = getIndexBelowMax(key.toString(), this.limit);\n const bucket = this.storage.get(index);\n if (bucket !== undefined) {\n let current = bucket.head;\n while (current) {\n if (current.value[0] === key) {\n return current.value[1];\n }\n ... | [
"0.6509284",
"0.6453",
"0.63253486",
"0.62820643",
"0.62592465",
"0.62396705",
"0.6201971",
"0.6152436",
"0.61086255",
"0.60878015",
"0.6062417",
"0.6034144",
"0.6029308",
"0.6019743",
"0.6010912",
"0.60090774",
"0.5998947",
"0.5985082",
"0.5975016",
"0.5966269",
"0.596534",
... | 0.76678455 | 0 |
function definition to make any two objects bounce off each other | function bounceOff(obj1Input,obj2Input){
//bounce off
if (obj1Input.x - obj2Input.x < obj1Input.width / 2 + obj2Input.width / 2 &&
obj2Input.x - obj1Input.x < obj1Input.width / 2 + obj2Input.width / 2 &&
obj1Input.y - obj2Input.y < obj1Input.height / 2 + obj2Input.height / 2 &&
obj2Input.y - obj1In... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"attract(ball_1, ball_2) {\n ball_1.state.spe.add(this.gravity_pull(ball_1, ball_2));\n ball_2.state.spe.add(this.gravity_pull(ball_2, ball_1));\n }",
"function doCollide(obj1, obj2) {\n \n obj1.leftX = obj1.X;\n obj1.topY = obj1.Y;\n obj1.rightX = obj1.X + 50;\n obj1.bottomY = obj1.Y + 200;\... | [
"0.747909",
"0.7304703",
"0.70109946",
"0.6953706",
"0.68746877",
"0.68039536",
"0.67900467",
"0.67101073",
"0.6687732",
"0.6641753",
"0.6604936",
"0.65928274",
"0.6543976",
"0.654238",
"0.65312946",
"0.65089285",
"0.65089285",
"0.6505662",
"0.6505662",
"0.64962083",
"0.64893... | 0.7720991 | 0 |
draw the indicator of fish count | function drawFishCount(fishNumber) {
push()
fill(255)
textSize(20)
if (fishNumber != null) {
text("Fish Count " + fishNumber, width/2+120, height-25)
} else {
text("Fish Count "+`${params.fishCount}`, width/2+120, height-25)
}
pop()
// bg
push()
noStroke()
fill(color... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"drawFish(){\n \tstroke(245, 114, 0);\n strokeWeight(1);\n \tfill(245, 114, 0);\n\t\t ellipse(this.x,this.y,30,30);\n triangle(this.x+5, this.y, this.x+30, this.y+15, this.x+30, this.y-15);\n // triangle(30, 75, 58, 20, 86, 75);\n\t}",
"function draw() {\n\t//Redraw Background Color (Necessa... | [
"0.64650697",
"0.6229137",
"0.62141836",
"0.6188712",
"0.5953027",
"0.59529907",
"0.5941618",
"0.5925848",
"0.5865941",
"0.58395004",
"0.58304834",
"0.5825461",
"0.5820481",
"0.57722276",
"0.5760605",
"0.57591844",
"0.5747464",
"0.5699969",
"0.56656617",
"0.5654565",
"0.56490... | 0.7962066 | 0 |
In this implementation, there is a builtin staleness feature, but it is "lazy" in the sense that it removes a stale item only when it is accessed. Add a proactive staleness cleaner that checks the cache every seconds, where "" is a new value for your options. | function proactiveStalenessCleaner() {
console.log("Sweeping the cache for old entries");
cache.prune();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkCacheTimer() {\n var oldCacheTime = this.cacheTime;\n super.checkCacheTimer(); // First call service level cache clearning\n // Then do implementation specific cache clean-up\n if (this.now - oldCacheTime > this.CACHE_TIMEOUT) {\n // Clear the cache\n this.cac... | [
"0.60169387",
"0.5867104",
"0.5867104",
"0.577125",
"0.5738229",
"0.5725193",
"0.5687386",
"0.56156486",
"0.5606201",
"0.5586802",
"0.5562622",
"0.5543537",
"0.55381316",
"0.55335736",
"0.55246687",
"0.55242",
"0.5499183",
"0.54971886",
"0.5490508",
"0.549029",
"0.5486301",
... | 0.6920508 | 0 |
Moves the primative so that it is centered around the given position. 1. Gets the geometric midpoint. 2. Moves the primative by setting the in values. | move() {
this.geometricMidpoint = this.setGeometricMidpoint();
this.in.X = this.position.X - this.geometricMidpoint.X;
this.in.Y = this.position.Y - this.geometricMidpoint.Y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_updatePosFromCenter() {\n let half = this._size.$multiply(0.5);\n this._topLeft = this._center.$subtract(half);\n this._bottomRight = this._center.$add(half);\n }",
"stepExactCenter_() {\n this.mutateElement(() => {\n this.updatePositions_(0.5);\n });\n }",
"executeMidpoint... | [
"0.6092017",
"0.5998361",
"0.5933497",
"0.5924389",
"0.58491963",
"0.5816981",
"0.56228733",
"0.5606469",
"0.5546298",
"0.5545262",
"0.55258065",
"0.55064785",
"0.54953593",
"0.54902846",
"0.5478043",
"0.5471169",
"0.5456348",
"0.5445238",
"0.54275364",
"0.5414263",
"0.541355... | 0.6404769 | 0 |
Sets the size of the plane by multiplying unit and shape. Unit is a square. | setSize() {
this.size.D1 = this.shape.D1*this.unit.X;
this.size.D2 = this.shape.D2*this.unit.Y;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function configure_plane_size(){\n\tplane_width = global.stage.width;\n\tconfigure_plane_height();\n\tconfigure_plane_offset();\n}",
"_setWorldSizes() {\n const ratios = this.camera.getScreenRatiosFromFov();\n\n // our plane world informations\n // since our vertices values range from -1 to ... | [
"0.65942764",
"0.619893",
"0.6149462",
"0.60991424",
"0.60862046",
"0.6066668",
"0.5998041",
"0.59830886",
"0.57997674",
"0.57771164",
"0.57662827",
"0.57465005",
"0.5738377",
"0.5727867",
"0.57248497",
"0.5687156",
"0.5674783",
"0.56506294",
"0.5646691",
"0.5646365",
"0.5619... | 0.7490348 | 0 |
Sets the bounds of size along X and Y just actual drawn width and height. | setSizeBounds() {
const cosAngle = Math.cos(this.angle * Math.PI / 180);
const sinAngle = Math.sin(this.angle * Math.PI / 180);
this.sizeBounds.alongX = this.size.D1*cosAngle;
this.sizeBounds.alongY = this.size.D1*sinAngle + this.size.D2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setBounds() {\n let el = angular.element(canvas);\n\n //set initial style\n if ( scope.options.layout.height === \"inherit\" ) {\n let viewHeight = view.getHeight();\n el.css(\"height\", `${viewHeight}px`);\n ... | [
"0.67604786",
"0.6546441",
"0.6462593",
"0.6391442",
"0.6378866",
"0.63525665",
"0.63124233",
"0.6253805",
"0.621114",
"0.62022275",
"0.61907667",
"0.6145199",
"0.613934",
"0.6127046",
"0.6069497",
"0.60676074",
"0.6031727",
"0.5984932",
"0.59571403",
"0.5943436",
"0.59208864... | 0.74052083 | 0 |
Sets the out points for the plane primative. 1. Pushes geometric midpoint. 2. Pushes specific coords. | setOut() {
this.geometricMidpoint = this.setGeometricMidpoint();
this.out.push(this.geometricMidpoint);
const idxs = [0, 1, 2];
idxs.forEach((idx) => {
this.out.push({
X: this.coordinates[0][idx * 2],
Y: this.coordinates[0][idx * 2 + 1],
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setOut() {\n this.geometricMidpoint = getGeometricMidpoint(this.bounds);\n this.out.push({\n X: this.geometricMidpoint.X,\n Y: this.geometricMidpoint.Y,\n });\n this.setPlaneOut(0);\n this.setPlaneOut(this.coordinates.length - 1);\n }",
"executeMidpoint()\n {\n let vertices = thi... | [
"0.7904023",
"0.5834651",
"0.5795251",
"0.57014316",
"0.5664885",
"0.562432",
"0.55775577",
"0.55111754",
"0.5489386",
"0.54867023",
"0.54803747",
"0.54720294",
"0.54609865",
"0.5459113",
"0.54497695",
"0.5440638",
"0.54313487",
"0.5380218",
"0.5371244",
"0.5363802",
"0.53514... | 0.6891846 | 1 |
Draws the plane by using the following steps: 0. Set size using unitshape 1. Sets the actual width and height. 2. Moves to center around position and calculate new in coords. 3. Draws is by setting this.coordinates. 4. Sets out coords. | draw() {
this.setSize();
this.setSizeBounds();
this.move();
this.coordinates = getPlaneCoordinates(this);
this.setOut();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"draw() {\n this.setSize();\n this.setSizeBounds();\n this.move();\n this.coordinates = getPlaneCoordinates(this);\n this.gridCoordinates = getGridCoordinates(this);\n }",
"function drawPlane() {\n if (plane.getContext) {\n // Set line style and draw grid lines\n let ctx = plane.getContext(... | [
"0.7890915",
"0.7107557",
"0.7047702",
"0.6749565",
"0.67122257",
"0.6440661",
"0.63139343",
"0.62977046",
"0.62819606",
"0.6203639",
"0.6149281",
"0.6106054",
"0.6091039",
"0.608182",
"0.60757494",
"0.6067427",
"0.6048106",
"0.6045924",
"0.6045924",
"0.6026443",
"0.60208434"... | 0.8295807 | 0 |
Sets the out points for the planeStack primative. Overwrites the plane setOut(). 1. Sets geometric midpoint of entire PlaneStack. 2. Sets out point of first Plane. 3. Sets out points of last Plane. | setOut() {
this.geometricMidpoint = getGeometricMidpoint(this.bounds);
this.out.push({
X: this.geometricMidpoint.X,
Y: this.geometricMidpoint.Y,
});
this.setPlaneOut(0);
this.setPlaneOut(this.coordinates.length - 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setOut() {\n this.geometricMidpoint = this.setGeometricMidpoint();\n this.out.push(this.geometricMidpoint);\n const idxs = [0, 1, 2];\n idxs.forEach((idx) => {\n this.out.push({\n X: this.coordinates[0][idx * 2],\n Y: this.coordinates[0][idx * 2 + 1],\n });\n });\n }",
"re... | [
"0.5853711",
"0.56717384",
"0.5532901",
"0.55068296",
"0.54707694",
"0.53676444",
"0.5345974",
"0.51648957",
"0.5040186",
"0.5009326",
"0.50063777",
"0.49369332",
"0.48712385",
"0.48593467",
"0.48572803",
"0.48314026",
"0.47883478",
"0.47685274",
"0.47432098",
"0.47327182",
"... | 0.76296896 | 0 |
maps canonical routes to their subway user equivalents this takes care of strange canonical routes like 'GS', 'FS' and 'H' which all map to the S train. | function getUserRouteMap(canonicalRoutes) {
return canonicalRoutes.reduce((mapping, route) => {
switch (route) {
case 'GS':
case 'FS':
case 'H': {
const newMap = { [route]: 'S' }
return Object.assign({}, mapping, newMap)
}
default: {
const newMap = { [route]: ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makePathRoute(input) {\n\t// input needs to be an array produced by findPath -> [Array of ints, distance]\n\tif (!Array.isArray(input) || (input.length != 2)) {\n\t\tthrow new Error(\"Failed to create new route because input was not a suitable array.\");\n\t}\n\n\tif ((parseInt(input[1]) < 0) || (isNaN(pa... | [
"0.51233405",
"0.5120353",
"0.5105839",
"0.50302213",
"0.50135624",
"0.5005583",
"0.49483693",
"0.49314392",
"0.48990887",
"0.4898485",
"0.48884663",
"0.48854214",
"0.48403516",
"0.48352525",
"0.48094255",
"0.48070812",
"0.47878802",
"0.47698233",
"0.47676277",
"0.47610876",
... | 0.69318634 | 0 |
Add one or more words to the dictionary with a specified class | function defwords(words, class) {
for (var i = 0; i < words.length; i++) {
var w = words[i].replace(/^=/, "");
patterns.push(new RegExp("([^a-zA-Z])(" + w + ")([^a-zA-Z])",
words[i].match(/^=/) ? "g" : "gi"));
classes.push(class);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addWords(words) {}",
"@action updateIncludeKeywords(classification, words) {\n this.includeKeywordsRef.set({...this.includeKeywords, [classification]: words})\n }",
"function Dictionary(words) {\n this.words = words;\n}",
"wordClass(word) {\r\n return {\r\n der: word.artikel == \"der\... | [
"0.6347689",
"0.6340151",
"0.6071362",
"0.59632677",
"0.59625727",
"0.5953857",
"0.58563954",
"0.57036346",
"0.5651516",
"0.55261576",
"0.54858226",
"0.5470696",
"0.54513586",
"0.54413146",
"0.5431127",
"0.5409236",
"0.53953445",
"0.5378875",
"0.5364351",
"0.53413063",
"0.533... | 0.6609547 | 0 |
INITIALIZATION Sets up the canvas, stage, and preloads all the assets. | function init() {
// Initialize all base variables and preload assets. Once assets are loaded it will call init.
// Canvas info
canvas = document.getElementById("canvas");
fullScreenCanvas(canvas); // Sets width and height to fill screen
// Stage info
stage = new cre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setup() {\n\t\tthis.stage.removeAllChildren();\n\t\tthis.initBackground();\n\t\tthis.initReceptors();\n\t\tthis.initNotetrack();\n\t\tthis.initStats();\n\t\tthis.initTimeline();\n\t\tthis.initBackButton();\n\t}",
"function preload() {\n managers.Assets.init();\n managers.Assets.loader.addEventListener(\"co... | [
"0.74566597",
"0.733201",
"0.733201",
"0.72874635",
"0.72744",
"0.72581625",
"0.714794",
"0.7079624",
"0.70414644",
"0.6883634",
"0.6879281",
"0.68555784",
"0.68377054",
"0.68338794",
"0.68241405",
"0.6808932",
"0.6797616",
"0.67954445",
"0.6788675",
"0.6754724",
"0.67531055"... | 0.7792305 | 0 |
GAME LOGIC Creates the next answer | function generateNextAnswer() {
var randInt;
// Loop until there is no overlap
outer:
while (true) {
// Get the new value
randInt = getRandomInt(1, 20);
// Check if it exists already
for (j = 0; j < answers.length; j++) {
if (answers[j... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nextQuestion() {\n newQuestion();\n}",
"function generateEasyQuestion(){\n //Rename the button from \"Next Question\" to \"Submit\"\n var submitButton = document.getElementById(\"submit\");\n submitButton.innerHTML = \"Submit\";\n submitButton.onclick = checkAnswerForEasyLevel;\n\n //display a que... | [
"0.7254008",
"0.71878177",
"0.7111793",
"0.7059056",
"0.7002033",
"0.6961583",
"0.69576764",
"0.6955205",
"0.6947268",
"0.6925654",
"0.6906163",
"0.68902194",
"0.6882509",
"0.68766",
"0.68620443",
"0.6847399",
"0.68327266",
"0.68144226",
"0.6809328",
"0.6793349",
"0.67765456"... | 0.73243606 | 0 |
Sets the currentAnswer to the answer object for the bottom most question. | function updateCurrentAnswer() {
for (a = 0; a < answers.length; a++) {
if (checkAnswer(answers[a].answer)) {
currentAnswer = answers[a];
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function answerLogic(currentAnswer) {\n\tuserAnswers[questionCounter] = currentAnswer;\n\tnextVideo();\n}",
"function setQuestionAnswer(answerId){\n questions[questionIndex].userAnswerId = answerId;\n }",
"setAnswer(id, answer) {\n console.log('setAnswer : ', answer)\n if (!this.players.has(id)) {\n ... | [
"0.62037796",
"0.6031375",
"0.5965387",
"0.57276815",
"0.5691248",
"0.564382",
"0.55669373",
"0.5505416",
"0.5468221",
"0.546302",
"0.54567456",
"0.54544175",
"0.54406995",
"0.5423525",
"0.5407171",
"0.5401612",
"0.53864086",
"0.5383859",
"0.5378208",
"0.5364659",
"0.53542906... | 0.60441977 | 1 |
Checks if achievement is unlocked, and creates it if it can | function checkAchievement(key, imageSource) {
// Not unlocked yet, unlock now!
if (localStorage.getItem(key) != "true") {
// Prep the image
var imageFile = new Image();
imageFile.src = imageSource
// Wait until done loading
imageFile.onload = function() {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function NewAchievement( appid, achievement )\n{\n\tvar parentDiv = document.getElementById( \"appAchievementDisplay\" );\n\tvar sourceDiv = document.getElementById( \"achievementTableSource\" );\n\ttheTable = parentDiv.firstChild;\n\n\tvar newRow = theTable.tBodies[ 0 ].insertRow( -1 );\n\tnewRow.vAlign = \"top\"... | [
"0.6076367",
"0.5977495",
"0.59309894",
"0.5881968",
"0.5797167",
"0.5551286",
"0.5289092",
"0.523866",
"0.5230265",
"0.51835746",
"0.5105132",
"0.50616026",
"0.4969314",
"0.49344537",
"0.492215",
"0.49083385",
"0.4890767",
"0.48441976",
"0.48366925",
"0.4804568",
"0.4799089"... | 0.6447787 | 0 |
Send entries and zeroout the list. | function flush() {
sendEntries();
events.length = 0;
totalLogScore = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onWrite (entry) {\n this._updateEntries([entry])\n this._decrementSendingMessageCounter()\n }",
"_flush() {\n\t\tthis.finished = true;\n\t\tthis._definitelyPush();\n\t}",
"_flush() {\n this.push(this.contents);\n this.emit('end')\n }",
"@action\n flush() {\n if (this.buffer.lengt... | [
"0.64770013",
"0.6346636",
"0.62763494",
"0.6101768",
"0.6002765",
"0.5977791",
"0.5915051",
"0.58873725",
"0.57659703",
"0.5725871",
"0.57042426",
"0.56510115",
"0.56180644",
"0.5586384",
"0.55543506",
"0.5552767",
"0.55424446",
"0.55401117",
"0.55295813",
"0.55203277",
"0.5... | 0.7011401 | 0 |
Use bound ref callback to prevent heading from being set to null | refHandler(domElement) {
this.heading = domElement;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setupTargetData(newTarget) {\n if (this.target) {\n this.remoteHeadingobserver.disconnect();\n }\n this.target = newTarget;\n // add a backdoor for hax to have a hook into this\n this._haxSibling = this;\n // @todo need to add some kind of \"if this gets deleted let me know\"\n // or a ho... | [
"0.54015064",
"0.5395707",
"0.5215135",
"0.5189645",
"0.51734704",
"0.51101893",
"0.5093658",
"0.5093658",
"0.5084261",
"0.50720155",
"0.5000195",
"0.49961916",
"0.4965688",
"0.49525887",
"0.4905363",
"0.48574024",
"0.48543358",
"0.48542705",
"0.48410714",
"0.48302972",
"0.47... | 0.69443125 | 0 |
function to hide and show guess number game on html | function guessTheNumber() {
var guessGameB = document.getElementById('guessGameBlock');
if (guessGameB.style.display === 'none') {
guessGameB.style.display = 'block';
} else {
guessGameB.style.display = 'none';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newGame() {\n\tnum = Math.round(Math.random() * 50);\n\tguess.placeholder=\"Make your first guess\";\n\tdocument.getElementById(\"output\").innerHTML=\"You have five attempts to guess my number between 1 and 50\";\n\treset.style.display=\"none\";\n}",
"function displayMessageToPromptUserToGuessWithAnima... | [
"0.77699137",
"0.72568583",
"0.7246122",
"0.72176874",
"0.719659",
"0.7148359",
"0.714033",
"0.7089029",
"0.70733696",
"0.7069929",
"0.7054879",
"0.70530885",
"0.7017994",
"0.6989336",
"0.69606775",
"0.69602895",
"0.69544536",
"0.694977",
"0.6898632",
"0.6886512",
"0.6878481"... | 0.7477668 | 1 |
USEUNIT InitializationEnviornment USEUNIT Listbox USEUNIT POSObjectMapping USEUNIT SelectSubPackagesFromWindow USEUNIT WrapperFunction USEUNIT SelectPaymentType USEUNIT CommonCalender | function _0001485874497586_117_DateTime_settlementScreen()
{
Log.AppendFolder("_0001485874497586_117_DateTime_settlementScreen");
try
{ InitializationEnviornment.initiliaze();
AppLoginLogout.login();
WrapperFunction.selectKeyword("Daily Admission");
selectPackage("3 site Combi","Children ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _0001485874456152_33_PromoCodes_Cash()\n{\nLog.AppendFolder(\"_0001485874456152_33_PromoCodes_Cash\");\ntry{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n var keyWordNm =\"Promo Codes\";\n var packageNm = \"1:1 Comp Ratio\";\n var subPakNm =\"Indi... | [
"0.60245174",
"0.5946947",
"0.5682135",
"0.5652536",
"0.5636585",
"0.5573537",
"0.546583",
"0.5442458",
"0.5434304",
"0.5412831",
"0.5367333",
"0.53506726",
"0.5300925",
"0.5277718",
"0.5276134",
"0.52729666",
"0.5231467",
"0.52268994",
"0.5224156",
"0.5204909",
"0.52043086",... | 0.6245345 | 0 |
Complete the method which accepts an array of integers, and returns one of the following: "yes, ascending" if the numbers in the array are sorted in an ascending order "yes, descending" if the numbers in the array are sorted in a descending order "no" otherwise You can assume the array will always be valid, and there w... | function isSortedAndHow(array) {
console.log(array)
let boolMap = array.map((e, i) => {
return i > 0 ? e > array[i - 1] : true;
})
let ascending = boolMap.slice(1).every(e => e === true);
let descending = boolMap.slice(1).every(e => e !== true);
console.log(descending)
return ascending && 'yes, ascen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function order (array) {\n for (var i = 0; i < array.length - 1; i++) {\n if (array[i] > array[i + 1]) {\n return false; \n }\n }\n return true;\n}",
"function isSorted(array) {\n if (array.length <= 1) {\n return true;\n }\n for (let i = 0; i < array.length-1; i++){\n if (array[i]... | [
"0.6418797",
"0.6318764",
"0.6257935",
"0.6239074",
"0.61886585",
"0.6179637",
"0.6129565",
"0.6083027",
"0.6058078",
"0.604188",
"0.6011458",
"0.596643",
"0.5863718",
"0.58061856",
"0.57599306",
"0.57562953",
"0.5743387",
"0.57300746",
"0.57300746",
"0.57300746",
"0.5727326"... | 0.70258933 | 0 |
functions: 1.Function to search meal using Api | function searchMeal(e) {
// prevent form submition and redirect
e.preventDefault();
// get the value from search input fields
const searchText = search.value;
console.log(searchText);
// check if search field is empty
if(searchText.trim()){
//fetch data from Api
fetch(`https://... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchMealDetailsById(mealId) {\n let url = `https://www.themealdb.com/api/json/v1/1/lookup.php?i=${mealId}`;\n $.getJSON(url, function(data) {\n let mealDetails = data.meals[0];\n renderMealResults(mealDetails);\n });\n}",
"function fecthMeals(meal) {\n result.innerHTML = `<p>Searching...</p>... | [
"0.7058631",
"0.68198824",
"0.67531425",
"0.67354214",
"0.67243767",
"0.66104573",
"0.6564576",
"0.6547705",
"0.6506756",
"0.64250743",
"0.6297149",
"0.62828076",
"0.6276607",
"0.6245831",
"0.62374103",
"0.62210035",
"0.6195686",
"0.6183182",
"0.61722887",
"0.61395836",
"0.60... | 0.68818325 | 1 |
Either. Run either leftFunc or rightFunc depending on whether or not e is an instance of Left or Right. CSV Parsing Code Split a row string into an array of fields. Note: Don't do this. Use a CSV parsing library like Neat CSV instead. | function splitFields(row) {
return row.replace(/"(.*)"/, "$1").split('","');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CSVToArray( strData, strDelimiter ){\n // Check to see if the delimiter is defined. If not,\n // then default to comma.\n sys.debug(\"Hitting CSVToArray with Data: \"+strData.substring(0,200)+\"...\")\n strDelimiter = (strDelimiter || \",\");\n\n // Create a regular expression to parse the ... | [
"0.55442137",
"0.54477316",
"0.5436046",
"0.5436046",
"0.5420196",
"0.54154736",
"0.54056907",
"0.5350254",
"0.53450006",
"0.53388137",
"0.53319776",
"0.5325884",
"0.52988684",
"0.52536213",
"0.5251054",
"0.52424836",
"0.51890826",
"0.5174309",
"0.5172792",
"0.5159341",
"0.51... | 0.5966806 | 0 |
Zip Row data with header fields to create an object. | function zipRow(headerFields) {
return function zipRowWithHeaderFields(fieldData) {
const lengthMatch = headerFields.length == fieldData.length;
return !lengthMatch
? left(new Error("Row has an unexpected number of fields"))
: right(zipObj(headerFields, fieldData));
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeObject(row, headers) {\n var ret = {};\n headers = headers || [];\n if (typeof headers === 'undefined') {\n for (var j = 0; j < row.length; j++) {\n headers[j.toString()] = j;\n }\n }\n for (var i = 0; i < ... | [
"0.6363957",
"0.6222601",
"0.6209588",
"0.6071507",
"0.6052529",
"0.59320474",
"0.58693546",
"0.5813672",
"0.58042717",
"0.57750505",
"0.5711839",
"0.5711501",
"0.5711501",
"0.5704403",
"0.5696394",
"0.5668554",
"0.565604",
"0.5646846",
"0.5614768",
"0.55635005",
"0.5531373",... | 0.68280685 | 0 |
Add a humanreadable date string to a message object. | function addDateStr(messageObj) {
const errMsg = "Unable to parse date stamp in message object";
const months = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
];
const d = new Date(message... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addMessage(author, message, dt) {\n ui.content.prepend('<p><span>' + author + '</span> @ ' +\n + (dt.getHours() < 10 ? '0' + dt.getHours() : dt.getHours()) + ':'\n + (dt.getMinutes() < 10 ? '0' + dt.getMinutes() : dt.getMinutes())\n + ... | [
"0.62929153",
"0.6246126",
"0.6230531",
"0.5825585",
"0.58045006",
"0.5690249",
"0.56437767",
"0.5633367",
"0.5631332",
"0.5623449",
"0.5623327",
"0.55572146",
"0.54485154",
"0.54386675",
"0.54018354",
"0.5401726",
"0.5384793",
"0.5366291",
"0.53391886",
"0.53190786",
"0.5296... | 0.7709036 | 0 |
Split a CSV string into rows. Note: Don't do this. Use a CSV parsing library like Neat CSV instead. | function splitCSVToRows(csvData) {
// There should always be a header row... so if there's no
// newline character, something is wrong.
return csvData.indexOf("\n") < 0
? left(new Error("No header row found in CSV data"))
: right(csvData.split("\n"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parse_csv(csv_str, drop=3) {\n\tconst rows = csv_str.split(\"\\r\\n\").slice(drop)\n\treturn rows.map((row) => row.split(\",\"))\n}",
"function parse_csv_line(s, field_separator) {\n if (typeof(s) === 'undefined' || s.length === 0 ) {\n return [];\n }\n\n if (typeof(field_separator) === 'undefined... | [
"0.7292737",
"0.725261",
"0.70471406",
"0.6994499",
"0.69863683",
"0.696266",
"0.69599134",
"0.69599134",
"0.6957146",
"0.695513",
"0.69325465",
"0.6916428",
"0.69118804",
"0.689962",
"0.68369955",
"0.6819954",
"0.68170065",
"0.6768505",
"0.6767515",
"0.6746729",
"0.6733248",... | 0.73870915 | 0 |
1. Prompt user for their name 2. Personalize the greeting with name entered by user. 'hungry person' as default 3. Get time of day, and give greeting dependant on the current 4. Return greeting to be used in html as an h3 tag | function giveGreeting(){
var today = new Date();
var userName = prompt("Who is hungry?", "Hungry Person");
var hourNow = today.getHours();
var greeting;
while (userName === null || userName === ''){
userName = prompt("Please enter a valid name");
}
if (hourNow > 18) {
g... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function askName() {\n var name = prompt('What is your name?');\n var today = new Date();\n var hourNow = today.getHours();\n var greeting;\n\n if (hourNow > 18) {\n greeting = 'Good evening,';\n } else if (hourNow > 12) {\n greeting = 'Good afternoon,';\n } else if (hourNow > 0)... | [
"0.82609797",
"0.75501555",
"0.7295708",
"0.72415715",
"0.71842134",
"0.7083933",
"0.7073134",
"0.706026",
"0.7058298",
"0.7036979",
"0.69875544",
"0.6972348",
"0.6965922",
"0.6945343",
"0.6930512",
"0.6877915",
"0.6875549",
"0.68514127",
"0.6843997",
"0.683321",
"0.6819358",... | 0.8182228 | 1 |
getSpecial function will 1. Tell users what the days special is 2. Special will be stored in an array and change each day 3. | function getSpecial(){
var today = new Date();
var day = today.getDay();
var specialmeallist = ['Pizza', 'Wings', 'Tacos', 'Margaritas', 'Reuben', 'Pancakes', 'Ice Cream Sunday'];
var specialmeal = specialmeallist[day];
switch (day){
case 0:
day = 'Sunday';
break... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dailySpecials(special){\n switch (special){\n case 'Monday':\n menu = 'Margarita';\n break;\n\n case 'Tuesday':\n menu = 'Tequila';\n break;\n\n case 'Wednesday':\n menu = 'Wine';\n break;\n\n case 'Thursday':\n menu = 'Whisky';\n break;\n\n case 'Friday':\n menu... | [
"0.696253",
"0.6758346",
"0.55489206",
"0.55294216",
"0.5501579",
"0.5363178",
"0.5353953",
"0.53106135",
"0.52953017",
"0.52943635",
"0.52798516",
"0.5248039",
"0.5242422",
"0.51851654",
"0.5176134",
"0.5152283",
"0.51097536",
"0.5103838",
"0.5065554",
"0.5049975",
"0.504944... | 0.69194055 | 1 |
Make sure that the sidebar is streched full height We are gonna assign a minheight value every time the wrapper gets resized and upon page load. We will use Ben Alman's method for detecting the resize event. alert($(window).height()); | function _fix() {
//Get window height and the wrapper height
var height = $(window).height() - $("body > .header").height();
$(".wrapper").css("min-height", height + "px");
var content = $(".wrapper").height();
//If the wrapper height is greater than the window
if (conten... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _fix() {\n //Get window height and the wrapper height\n var height = $(window).height() - $(\"body > .header\").height() - ($(\"body > .footer\").outerHeight() || 0);\n $(\".wrapper\").css(\"min-height\", height + \"px\");\n var content = $(\".wrapper\").height();\n //If... | [
"0.790436",
"0.790436",
"0.77939343",
"0.76519877",
"0.7619844",
"0.7491731",
"0.745618",
"0.74216527",
"0.7417751",
"0.7383808",
"0.7298957",
"0.72666",
"0.7263465",
"0.72502786",
"0.7238393",
"0.7238393",
"0.72377414",
"0.71330357",
"0.7100661",
"0.70332944",
"0.6998653",
... | 0.7963161 | 1 |
Speed of movement of the bloc Move the bloc on your left | function moveBloc() {
//Conversion in number of the left position of the bloc
var xBloc = parseFloat (getComputedStyle(bloc).left);
//
var xMax = parseFloat (getComputedStyle(cadre).width);
if (xBloc + blocWidth <= xMax){
//Move the bloc
bloc.style.left = (xBloc + speed) + "px... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"movement_left() {\n if (this.distance != 0) {\n let delay = 1000 / 60;\n this.scene.time.delayedCall(delay, () => {\n this.x -= this.movespeed;\n this.distance -= this.movespeed;\n this.movement_left();\n });\n }\n ... | [
"0.7150604",
"0.6942486",
"0.67732215",
"0.675641",
"0.67285836",
"0.6692176",
"0.66374147",
"0.6636011",
"0.66248965",
"0.66028297",
"0.6580888",
"0.65549594",
"0.6547949",
"0.6545538",
"0.653014",
"0.6517494",
"0.6506111",
"0.6505532",
"0.6454878",
"0.6418833",
"0.6418579",... | 0.72905284 | 0 |
You realise that in order to make significant steps quickly, it would help to go to a coding bootcamp in London. Problem is, many of them cost a fortune, and those that don't still involve a significant amount of time off work who will pay your mortgage?! To offset this risk, you decide that rather than leaving work to... | function sabb(x, val, happ) {
let sabObj = {}
let letterTotal = 0;
let finalTotal;
x = x.replace(/ /g, '');
for (let char of "sabbatical") {
sabObj[char] = (sabObj[char] || 0) + 1;
}
for (let char of x) {
if (char in sabObj) {
letterTotal += 1;
}
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sabb(x, val, happ) {\n\treturn (x.match(/[sabbatical]/gi) || []).length + val + happ > 22 ? 'Sabbatical! Boom!' : 'Back to your desk, boy.';\n}",
"function oldScrabbleScorer(word) {\n\tword = word.toUpperCase();\n\tlet letterPoints = \"\";\n\tlet totalPoints = 0;\n \n\tfor (let i = 0; i < word.length; i... | [
"0.7326087",
"0.64079905",
"0.63952786",
"0.63587576",
"0.6265763",
"0.6231567",
"0.62089306",
"0.62088346",
"0.61997926",
"0.61739004",
"0.61707765",
"0.61534786",
"0.61469996",
"0.6145106",
"0.6135016",
"0.61069953",
"0.6079173",
"0.6024329",
"0.6023184",
"0.5930254",
"0.59... | 0.7349385 | 0 |
Event Listenner Uncheck All checkboxes | function UncheckAll() {
const el = document.querySelectorAll("input.checkboxFilter");
console.log(el);
for (var i = 0; i < el.length; i++) {
var check = el[i];
if (!check.disabled) {
check.checked = false;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"unCheckAll() {\n this.$selectAllCheckbox.prop('checked', false);\n this.$checkboxes.prop('checked', false);\n }",
"uncheckAll() {\n this.toggleCheckedAll(false);\n }",
"function uncheck(e) {\n // console.log(e);\n e.forEach((x) => x.checked = false)\n}",
"unCheck() {\n let check... | [
"0.8162136",
"0.7805137",
"0.7727944",
"0.76016545",
"0.75843936",
"0.755217",
"0.75392365",
"0.75303286",
"0.75215673",
"0.7417287",
"0.7417287",
"0.7417287",
"0.7417287",
"0.7417287",
"0.7417287",
"0.7417287",
"0.7417287",
"0.7417287",
"0.74107283",
"0.74107283",
"0.7410728... | 0.78671813 | 1 |
seting numbers of mines near cell | function setNumbers() {
for (var x = 0; x < size; x++) {
for (var y = 0; y < size; y++) {
visitLocation(x, y, minesNear);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setMinesNegsCount(rowIdx, colIdx) {\n var minesCount = 0;\n\n for (var i = rowIdx - 1; i <= rowIdx + 1; i++) {\n if (i < 0 || i > gLevel.SIZE - 1) //if the is on the range\n continue;\n for (var j = colIdx - 1; j <= colIdx + 1; j++) {\n if ((j < 0 || j > gLevel.SI... | [
"0.7283144",
"0.7278226",
"0.68606114",
"0.6799486",
"0.6735099",
"0.67258877",
"0.663983",
"0.66320235",
"0.6619752",
"0.66163486",
"0.65956426",
"0.6577428",
"0.65574086",
"0.6504732",
"0.6481879",
"0.64697343",
"0.64161795",
"0.6408688",
"0.63766026",
"0.63763195",
"0.6357... | 0.733402 | 0 |
Diberikan function hitungHuruf(kalimat) yang akan menerima satu parameter berupa string. Function akan mereturn kata dari kalimat yang memiliki jumlah perulangan huruf yang paling besar. Contoh: "Today, is the greatest day ever!" akan mereturn "greatest" karena kata "greatest" memiliki 2 huruf e dan 2 huruf t, dan munc... | function hitungHuruf(kata) {
var max_word = ["",0];
var theWordOccurence = 0;;
kata = kata.match(/[^\s]+[a-zA-z]/gm);
for (var word of kata){
if(word.split("").sort().join("").match(/(.)\1+/g)){
theWordOccurence = word.split("").sort().join("").match(/(.)\1+/g).length;
if(theWordOccurence>max_word[1]){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hitung(harga,tujuan){\n\t\t\tvar berat = $(\"#berat\").val();\n\t\t\tvar volume = $(\"#volume\").val();\n\t\t\tif(berat!='' && volume!=''){\n\t\t\t\tif(parseInt(berat) > parseInt(volume)){\n\t\t\t\t\tvar jumlah = harga*berat;\t\t\n\t\t\t\t}else{\n\t\t\t\t\tvar jumlah = harga*volume;\n\t\t\t\t}\n\t\t\t\n\t... | [
"0.6693317",
"0.6125845",
"0.6086365",
"0.6072131",
"0.60427034",
"0.5891465",
"0.5770261",
"0.5766747",
"0.57237023",
"0.57225186",
"0.5715547",
"0.5696492",
"0.5672985",
"0.5667151",
"0.5601973",
"0.5597379",
"0.5581096",
"0.55654395",
"0.55304533",
"0.5519468",
"0.5505439"... | 0.63747936 | 1 |
Recursively get all video and audio for the document and its subdocuments. | function getMedia(document) {
let allMedia = Array.from(document.querySelectorAll('video, audio'));
/* Find video and audio inside the shadow DOM of custom elements (Web Components). */
const notRegularHtmlElementsSelector = 'a,abbr,address,area,article,aside,audio,b,base,bdi,bdo,blockquote,body,br,button,canvas... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logAllNestedVideos(){\n logAncestorsOfType(\"your-folder-here\", \"your-type-here\");\n}",
"function getAllVideos(){\n var contents = Contents_Live.find({ \"code\": Session.get(\"UserLogged\").code });\n var videosArray = [];\n contents.forEach(function(doc){\n var res = doc.contentType.split(\"/... | [
"0.5816079",
"0.56368744",
"0.53358775",
"0.5112157",
"0.5075896",
"0.5061428",
"0.50457954",
"0.49123332",
"0.49090534",
"0.48965847",
"0.48697186",
"0.48550427",
"0.48511505",
"0.48477584",
"0.484243",
"0.48088482",
"0.4806769",
"0.47953773",
"0.47425294",
"0.47160786",
"0.... | 0.5988308 | 1 |
Retrieves peeps from the API and asigns them to Peep objects | async function fetchPeeps() {
try {
const response = await fetch("https://chitter-backend-api-v2.herokuapp.com/peeps", {
method: 'GET',
headers: { 'Content-Type': 'application/json' },
});
const peeps = await response.json();
console.log(peeps)
peeps.forEach(peep => {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPups(){\n API.get(baseUrl).then(pupList => pupList.forEach(renderPups))\n}",
"async fetchPokemons(offset=0) {\n const response = await fetch(`https://pokeapi.co/api/v2/pokemon?limit=${LIMIT}&offset=${offset}`)\n const pkmJson = await response.json()\n let pkms = pkmJson.result... | [
"0.6120661",
"0.5716973",
"0.569697",
"0.5488803",
"0.5476095",
"0.53959256",
"0.53604686",
"0.5358627",
"0.53553474",
"0.53156734",
"0.5289416",
"0.52729255",
"0.5111067",
"0.5109003",
"0.5091419",
"0.5090922",
"0.5068546",
"0.504472",
"0.5038467",
"0.50134796",
"0.5006137",... | 0.7712953 | 0 |
function for the store the products array holds all the items in the store | function store() {
this.products = [
new product('AF1Mint', 'Nike Mint Air Force One', 'Size 12 Dead Stock Never Been Worn Only Taken Out The Box', 190,12,4),
new product('AJ1Lace', 'Air Jordan Lace Retro 1', 'Size 7 Extremely Rare With Lace Accents 8/10 Wore Them In The Rain But Nubuck Is Still Fal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getProductItems(data) {\n const items = [];\n for (let i = 0; i < data.products.length; i += 1) {\n const p = data.products[i];\n items.push({ id: p.aonr, price: p.priceData.total, quantity: p.quantity });\n }\n return items;\n }",
"static get_All_products(){\n return products;\n }"... | [
"0.7410434",
"0.73783493",
"0.7357135",
"0.733206",
"0.72640616",
"0.7242823",
"0.72392404",
"0.71846575",
"0.71810895",
"0.7180173",
"0.6993202",
"0.6962185",
"0.6961461",
"0.69573903",
"0.6952079",
"0.69444245",
"0.6922068",
"0.69108844",
"0.6853163",
"0.6849345",
"0.683831... | 0.74667525 | 0 |
checkout parameters (one per supported payment service) | function checkoutParameters(serviceName, merchantID, options) {
this.serviceName = serviceName;
this.merchantID = merchantID;
this.options = options;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkoutParameters(serviceName, merchantID, options) {\r\n this.serviceName = serviceName;\r\n this.merchantID = merchantID;\r\n this.options = options;\r\n}",
"constructor(payment) {\n this.paymentType = payment.paymentType\n this.doneBy = payment.doneBy;\n this.descriptio... | [
"0.7536422",
"0.5838271",
"0.56659806",
"0.54838294",
"0.5437259",
"0.54120743",
"0.5391223",
"0.538158",
"0.53592765",
"0.5353265",
"0.5350088",
"0.53327924",
"0.5316017",
"0.53111345",
"0.5309115",
"0.5307268",
"0.53020406",
"0.52582556",
"0.5212929",
"0.52121276",
"0.52058... | 0.7542281 | 0 |
Fetch all Contact details | static async findAllContacts() {
const ContactList = await Contact.find({});
return ContactList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async _fetchContact() {\n const { id, emailaddress1, contactid } = await this.store.queryRecord('contact', { me: true });\n\n return { id, emailaddress1, contactid };\n }",
"async function fetchContacts() {\n const contactData = await API.get('formapi', '/contact');\n console.log({ contactData });\n}",
... | [
"0.76399",
"0.736829",
"0.7269663",
"0.7241483",
"0.72347575",
"0.7158551",
"0.7153754",
"0.7140737",
"0.7050981",
"0.7031303",
"0.70008117",
"0.68352264",
"0.6772169",
"0.6769913",
"0.6729184",
"0.66550714",
"0.6568359",
"0.6552716",
"0.65138924",
"0.6487019",
"0.6461156",
... | 0.7436261 | 1 |
Function to check for the height of the window and recompute the height of the current playlist section | function resizeContainer(){
var height = window.outerHeight
height = height - 360
currentPlaylistSection.style.height = height
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkHeightAndReturn() {\n const iframe = d3Select(this.root).selectAll('iframe');\n lastHeight = height;\n height = parseInt(iframe.node().style.height.replace(\"px\", \"\"));\n if(height > 0 && heightStableSince > 3) {\n this.props.onLoadSuccess(height, this.props.item);\n ... | [
"0.70114243",
"0.6798393",
"0.6611308",
"0.6573722",
"0.65619165",
"0.6555072",
"0.6549575",
"0.65337914",
"0.65115786",
"0.6511037",
"0.64853793",
"0.6484548",
"0.6482313",
"0.64688694",
"0.6438308",
"0.64240956",
"0.64231867",
"0.6417678",
"0.6396745",
"0.6394719",
"0.63747... | 0.7088245 | 0 |
Function to start the seek | function startSeek(){
seek.max = songDuration
timeLeft = songDuration
intervalTime = 1000
setInterval(function(){
if(!seeking){
// Updating seek value
seek.value = audio.currentTime
}
// Playing next file if the current song has ended
if(audio.ended && songIndex < songQueue.length){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set seek(seek) {\n this.api.seek(seek)\n }",
"seek(options) {\n return Native.seek(options);\n }",
"seek(_index) {\n if (_index <= this._index) {\n this._index = _index; // just jump; don't update stream state (line,\n // ...)\n return;\n }\n // see... | [
"0.6613118",
"0.66086113",
"0.6252755",
"0.62425315",
"0.5931682",
"0.58960235",
"0.58803654",
"0.5840019",
"0.57853234",
"0.5767111",
"0.57654303",
"0.5739317",
"0.5704037",
"0.5696355",
"0.5665184",
"0.5649508",
"0.5615435",
"0.56130874",
"0.55861676",
"0.5566684",
"0.55644... | 0.7263957 | 0 |
Function to populate the playlist table | function populatePlaylists(){
for(i = 0; i < savedPlaylists.length; i++){
tableRow = document.createElement("tr")
rowElement = document.createElement("td")
textElement = document.createTextNode(savedPlaylists[i].name)
rowElement.appendChild(textElement)
tableRow.appendChild(rowElement)
rowElem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addToPlaylist(songsList){\n for(var i=0; i<songsList.length; i++){\n // Getting metadata for the audio file\n id3({ file: songsList[i].toString(), type: id3.OPEN_LOCAL }, function(err, tags) {\n if(tags){\n tableRow = document.createElement(\"tr\")\n rowElement = document.createE... | [
"0.6954878",
"0.6767235",
"0.6761853",
"0.67455",
"0.6737084",
"0.66948646",
"0.66567236",
"0.6655314",
"0.65942657",
"0.6530005",
"0.64737904",
"0.6410087",
"0.6200767",
"0.6164055",
"0.6118442",
"0.61125267",
"0.60877407",
"0.6060947",
"0.6029867",
"0.60145575",
"0.600933",... | 0.71552855 | 0 |
Listens to window scroll and resize events. We cache scroll values so that application code can access them without triggering reflows. NOTE: Scroll events do not bubble. | function registerScrollValueMonitoring() {
var refresh = ViewportMetrics.refreshScrollValues;
EventListener.listen(window, 'scroll', refresh);
EventListener.listen(window, 'resize', refresh);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_addListeners() {\n window.addEventListener('scroll', () => {\n this._handleEvent(window.scrollY + window.outerHeight);\n }, false);\n }",
"registerWindowScroll() {\n window.addEventListener('scroll', () => {\n // style handle when scroll\n this.styleHandleWhenScroll();\n... | [
"0.7576374",
"0.72669554",
"0.7226343",
"0.718157",
"0.7159887",
"0.70941806",
"0.70800126",
"0.70166296",
"0.7008036",
"0.6899481",
"0.68964636",
"0.686139",
"0.6832695",
"0.67970806",
"0.67531735",
"0.67531735",
"0.6738342",
"0.6700635",
"0.6689168",
"0.66565317",
"0.661558... | 0.732406 | 1 |
Return the ID value for a given node. This allows us to avoid issues with forms that contain inputs with name="id". | function _getNodeID(node) {
// #document and #document-fragment do not have getAttributeNode.
var id = node.getAttributeNode && node.getAttributeNode('id');
return id ? id.value : null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function id(node) {\n return NODE_ID_PREFIX + node.selfLink.replace(/:/g, '__').replace(/\\//g, '--');\n }",
"function getPostId(tempNode) {\n\treturn tempNode.id.match(/\\d\\d?/)[0];\n}",
"function getId(ele){\t// store the id value\r\n id_value = ele.id; \r\n}",
"function getId... | [
"0.6711456",
"0.6526716",
"0.63657755",
"0.62973964",
"0.62950206",
"0.6294311",
"0.6260952",
"0.6260952",
"0.62427723",
"0.6206646",
"0.6206646",
"0.6186393",
"0.6131731",
"0.6098591",
"0.60670507",
"0.6062354",
"0.60521835",
"0.59481597",
"0.5862367",
"0.5856418",
"0.585571... | 0.74081886 | 0 |
Utility Function to create LocationBlogs | function locationBlogCreator(info, author, longitude, latitude) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function locationBlogCreator(info, author, longitude, latitude) {\n let blogDetails = {\n info,\n author,\n pos: {\n longitude,\n latitude\n }\n };\n\n let newBlog = new LocationBlog(blogDetails);\n return newBlog.save();\n\n}",
"function addBlogsToPa... | [
"0.7206734",
"0.62417144",
"0.5758932",
"0.5710767",
"0.5611312",
"0.5393228",
"0.53806823",
"0.5357074",
"0.53106636",
"0.52631456",
"0.52475566",
"0.52278054",
"0.52094615",
"0.5177605",
"0.51538825",
"0.5149523",
"0.5126659",
"0.5073917",
"0.50716007",
"0.5064943",
"0.5050... | 0.7593448 | 0 |
Hide the input area | function hideInput(){
jQuery("#input").hide();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dontShowInput1M(){\n document.getElementById(\"medium-block\").style.display = \"none\";\n }",
"function dontShowInput1H(){\n document.getElementById(\"hard-block\").style.display = \"none\";\n }",
"function dontShowInput1E(){\n document.getElementById(\"easy-block\").style.display ... | [
"0.7682602",
"0.7647969",
"0.7624141",
"0.76128316",
"0.7365638",
"0.72987443",
"0.7274996",
"0.72375554",
"0.721998",
"0.7166475",
"0.7081132",
"0.6999404",
"0.69881666",
"0.68594664",
"0.68413",
"0.6832303",
"0.6746799",
"0.6715568",
"0.66712993",
"0.66422045",
"0.6626567",... | 0.7693799 | 0 |
Show the input area and focus on it | function showInput(){
jQuery("#input").show();
// Keep the scroll bar in the end
jQuery('body,html').animate({
scrollTop: jQuery(document).height()
}, 0);
jQuery(".input-text").focus();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showInput()\n {\n input.show();\n input.focus();\n }",
"focus() {\n this.$.input.focus();\n }",
"function focusInput() { \n input.focus()\n}",
"setFocus(){\n this.getInputEle().focus();\n }",
"function focusInputElement () {\n elements.input.focus();\n ... | [
"0.8515602",
"0.73489416",
"0.7336985",
"0.72855955",
"0.727144",
"0.727144",
"0.7189778",
"0.7174685",
"0.71428376",
"0.7135181",
"0.70775956",
"0.7076507",
"0.7073177",
"0.6946249",
"0.6928013",
"0.69251925",
"0.6909356",
"0.6909356",
"0.68976104",
"0.68943423",
"0.68675226... | 0.7780151 | 1 |
Show the choise input area and focus on it | function showChoise(){
jQuery("#output-choise").css("display", "inline");
// Keep the scroll bar in the end
jQuery('body,html').animate({
scrollTop: jQuery(document).height()
}, 0);
jQuery(".input-choise").css("display", "inline").focus();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showInput()\n {\n input.show();\n input.focus();\n }",
"function setFocus()\n\t{\n\t\tvar wid = fw.getWidget('answerInput', true);\n\t\twid && wid.focus();\n\t}",
"setFocus(){\n this.getInputEle().focus();\n }",
"function focus(){}",
"focus() {\n this.toggleMenuLis... | [
"0.7798478",
"0.7097422",
"0.6993462",
"0.69823056",
"0.69111437",
"0.68879676",
"0.68814516",
"0.6871783",
"0.68582356",
"0.68582356",
"0.68529207",
"0.68293613",
"0.68115467",
"0.6772166",
"0.6748624",
"0.67358637",
"0.67358637",
"0.6680336",
"0.6654039",
"0.66251004",
"0.6... | 0.73992914 | 1 |
A handler that implements reversible editing of the hit policy. | function EditHitPolicyHandler(elementRegistry, graphicsFactory) {
this._elementRegistry = elementRegistry;
this._graphicsFactory = graphicsFactory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handle(operation, key, data, src, dst) {}",
"goHandler(replacement) {\n const { toks } = this.props;\n const { focusedId } = this.state;\n const item = toks[focusedId];\n const replacementItem = Object.assign({}, item, { t: replacement });\n this.props.dispatch({\n type: 'GO',\n payload:... | [
"0.5286556",
"0.51054394",
"0.5075354",
"0.50439495",
"0.4998832",
"0.49833572",
"0.49765128",
"0.4950604",
"0.49176407",
"0.48833674",
"0.48815605",
"0.48742676",
"0.48439464",
"0.48314866",
"0.48311806",
"0.4824233",
"0.48158443",
"0.47532147",
"0.4752704",
"0.47489506",
"0... | 0.61439085 | 0 |
try to get reasonable message info from err | function getMessage(err)
{
if (err.data.err)
return err.data.err;
if (err.data.message)
return err.data.message;
if (typeof err == 'string')
return err;
if (err)
return "Error occurred - non standard error response."
return "Error occurred - no reason given";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function messageError(err, info) {\n if (err) {\n return console.log(err);\n }\n\n console.log(info);\n}",
"parseErr(err) {\n if (!err.errors) return err;\n const messages = Object.keys(err.errors).map(errorKey =>\n `${errorKey} error: ${err.errors[errorKey]}`);\n return messages;\n }",
"f... | [
"0.72814745",
"0.7246711",
"0.7231608",
"0.72198474",
"0.71753186",
"0.693408",
"0.6891296",
"0.6891296",
"0.6891296",
"0.6891296",
"0.68603486",
"0.6820776",
"0.6816541",
"0.6721814",
"0.6592604",
"0.6587426",
"0.6582516",
"0.65679264",
"0.65656114",
"0.656331",
"0.65494615"... | 0.7401575 | 0 |
Factory of DUPair object | function DUPairFactory() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function factory() {}",
"function factory() {}",
"function Factory(){}",
"static create () {}",
"create() {}",
"create() {}",
"create () {}",
"create () {}",
"static create(params) {\n return {type: `${this.prefix}${this.name}`, _instance: new this(params)}; //eslint-disable-line\n }",
"funct... | [
"0.69278646",
"0.69278646",
"0.69254875",
"0.68792886",
"0.67510563",
"0.67510563",
"0.6666748",
"0.6666748",
"0.6485693",
"0.6428248",
"0.6402839",
"0.62637824",
"0.6252139",
"0.6252139",
"0.6249819",
"0.62248355",
"0.6188684",
"0.6142576",
"0.6136258",
"0.6090616",
"0.60826... | 0.87667453 | 0 |
Async function Resizes image usgin config params And then calls action 'addTask' | async submitForm(e) {
e.preventDefault();
let formData = new FormData(e.target);
const resizedImage = await resizeImage(formData.get('file'), 320, 240);
formData.append("image", dataURItoBlob(resizedImage));
this.props.addTask(formData);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function resizeImage(img){\n const size = imgSize(img)\n const newSize = {}\n if (size.width < 500) newSize.width = 500\n if (size.height < 500) newSize.height = 500\n if (Object.keys(newSize).length){\n return resizeImg(img, newSize)\n }\n\n return img\n}",
"@action\n resize()... | [
"0.64306337",
"0.6340117",
"0.6195212",
"0.6183272",
"0.5885515",
"0.58677167",
"0.5840194",
"0.5785387",
"0.57774085",
"0.5668899",
"0.56610745",
"0.56390905",
"0.5637502",
"0.56269336",
"0.5624888",
"0.56060356",
"0.5603644",
"0.5543123",
"0.5516664",
"0.5492294",
"0.549047... | 0.6784141 | 0 |
this following function is responsible for watching if the checbox of full time job is checked and do the fetch. | function handleSearchFullTimeJob(e) {
setFullTimeJobIsChecked(!fullTimeJobIsChecked)
dispatch({type : ACTIONS.SEARCH_BY_FULL_TIME_JOB, fullTimeJobIsChecked })
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_doCheck()\n {\n let now = Date.now();\n for (let downloadable of this.dataSource())\n {\n if (downloadable.lastCheck &&\n now - downloadable.lastCheck > this.maxAbsenceInterval)\n {\n // No checks for a long time interval - user must have been offline,\n // e.g. during ... | [
"0.66598475",
"0.6647628",
"0.65329677",
"0.6192431",
"0.61849177",
"0.613582",
"0.61185575",
"0.6104451",
"0.6065712",
"0.60366136",
"0.6033031",
"0.6028181",
"0.60230565",
"0.5993914",
"0.59742564",
"0.59737533",
"0.59413075",
"0.592679",
"0.59046096",
"0.59046096",
"0.5883... | 0.6672128 | 0 |
Method to close the alert | close() {
this.dispatchCustomEvent('tk.alert.close');
this.addEventListener('transitionend', () => {
this.dispatchCustomEvent('tk.alert.closed');
this.parentNode.removeChild(this);
});
this.classList.remove('tk-alert--show');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function closeAlert() {\n $mdDialog.hide( alert, \"finished\" );\n alert = undefined;\n }",
"close() {\n console.log(' this is close function');\n this.showAlert = false;\n }",
"function closeAlert() {\n let alertDialogID = document.getElementById(\"alertCustomDialog\");\n a... | [
"0.79933465",
"0.7851442",
"0.7833492",
"0.7763218",
"0.762881",
"0.75260675",
"0.74883324",
"0.74053305",
"0.73132294",
"0.7255068",
"0.71754736",
"0.7149869",
"0.7128011",
"0.7115905",
"0.711241",
"0.71062446",
"0.70744866",
"0.703626",
"0.69911593",
"0.6967028",
"0.692305"... | 0.785601 | 1 |
Method to remove the close button. Internal | removeCloseButton() {
if (this.closeButton) {
this.closeButton.removeEventListener('click', this.buttonCloseFn);
this.closeButton.parentNode.removeChild(this.closeButton);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onRemove() {\n this.activateCallback('close');\n if (this._html) {\n const parent = this._html.floatWrapper.parentElement;\n if (parent) {\n parent.removeChild(this._html.floatWrapper);\n }\n this._html = null;\n }\n this._isOpen = false;\n this.activateCallback('afterClos... | [
"0.75033057",
"0.74888587",
"0.74772054",
"0.73074454",
"0.7221346",
"0.71956265",
"0.7150467",
"0.70947236",
"0.70850533",
"0.70794845",
"0.70298123",
"0.69994247",
"0.6956485",
"0.69552743",
"0.69510233",
"0.69251645",
"0.69128436",
"0.69087964",
"0.69063514",
"0.6895561",
... | 0.83678573 | 0 |
Add pagination info to the response of read operation | read(req) {
return this.connector.read(req)
.then((res) => {
return res.set('pagination', this.pagination(res))
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function paging(res){\n\t// Does the response include a 'next_cursor_string'\n\tif(\"next_cursor_str\" in res){\n\t\t// https://dev.twitter.com/docs/misc/cursoring\n\t\tres['paging'] = {\n\t\t\tnext : \"?cursor=\" + res.next_cursor_str\n\t\t};\n\t}\n}",
"getPage(offset,limit,tag)\n {\n \n return ... | [
"0.6488119",
"0.60558313",
"0.6040985",
"0.59986037",
"0.5969676",
"0.5943612",
"0.58974844",
"0.58737516",
"0.58267236",
"0.580473",
"0.5791321",
"0.5779511",
"0.57732147",
"0.5769569",
"0.57627994",
"0.57340825",
"0.5729995",
"0.57170516",
"0.5707975",
"0.56727105",
"0.5672... | 0.67280847 | 0 |
FIXME getStackTrace was initially in webglutils (as a global function) but only used in this file Obtain a stacktrace from the current stack | function getStackTrace( err ) {
if ( Notify.console && Notify.console.trace ) {
if ( Notify.console.groupCollapsed ) Notify.console.groupCollapsed();
Notify.console.trace();
if ( Notify.console.groupEnd ) Notify.console.groupEnd();
return '';
}
var... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stacktrace() {\r\n function st2(f) {\r\n return !f ? [] :\r\n st2(f.caller).concat([f.toString().split('(')[0].substring(9) + '(' + f.arguments.join(',') + ')']);\r\n }\r\n return st2(arguments.callee.caller);\r\n}",
"function getRenderStack$1() {\n var renderStack = '';\n\n try {\n re... | [
"0.7031154",
"0.65018237",
"0.64988565",
"0.6489603",
"0.6471751",
"0.63628477",
"0.63628477",
"0.6360633",
"0.6360633",
"0.6358524",
"0.6356707",
"0.63296324",
"0.630388",
"0.62723",
"0.62561876",
"0.6246852",
"0.6246852",
"0.6246852",
"0.6246852",
"0.6246852",
"0.6246852",
... | 0.65056205 | 1 |
I reject the current modal with the given reason. | function reject(reason) {
if (!modal.deferred) {
return;
}
modal.deferred.reject(reason);
modal.deferred = modal.params = null;
// Tell the modal directive to close the active modal window.
$rootScope.$emit("AlertServices.close");
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rejectWithReason(reason) {\n moc.error = false;\n ModerationService\n .reject(moc.offer, reason)\n .then(function() {\n moc.offer.workflowStatus = OfferWorkflowStatus.REJECTED;\n })\n .catch(showProblem);\n }",
"function rejectModal(err) {\n console.error('Modal reje... | [
"0.78746736",
"0.7373929",
"0.6866585",
"0.66970116",
"0.667433",
"0.65172505",
"0.63369364",
"0.6319641",
"0.62849176",
"0.6257386",
"0.6232134",
"0.6157967",
"0.6136577",
"0.6078328",
"0.60110486",
"0.600579",
"0.6000972",
"0.5984784",
"0.59573925",
"0.5936379",
"0.5928121"... | 0.7863213 | 1 |
I resolve the current modal with the given response. | function resolve(response) {
if (!modal.deferred) {
return;
}
modal.deferred.resolve(response);
modal.deferred = modal.params = null;
// Tell the modal directive to close the active modal window.
$rootScope.$emit("AlertServices.clos... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function response_in_modal(response) {\n $(\".modal-title\").html(response);\n $(\"#empModal\").modal(\"show\");\n}",
"function show_modal_response( data ){\n //debugger\n if(data){\n j('#response').html( S(data) );\n j('#fancybox_trigger').trigger('click');\n }\n }",
... | [
"0.61118555",
"0.60380656",
"0.5988268",
"0.59331024",
"0.58884704",
"0.577835",
"0.57299066",
"0.5677266",
"0.56696725",
"0.55607814",
"0.54980326",
"0.54867595",
"0.547882",
"0.5477932",
"0.5471923",
"0.54490244",
"0.5408887",
"0.5386861",
"0.5377622",
"0.53554773",
"0.5315... | 0.7701977 | 0 |
o: number that was repeated twice e: numbers repeated more than twice, numbers not there Write a function called findTwins, which accepts an array of integers and finds two of same numbers and returns the number that is repeated twice. The function should return null if there is not a number repeated twice. count occur... | function findTwins(arr) {
if (arr.length === 0) return null;
let count = {};
let ones = 0; //we want to return null if elements don't repeat
for (let i = 0; i < arr.length; i++) {
let num = arr[i];
if (count[num] === undefined) {
count[num] = 0;
}
count[num]++;
}
//if value of count is 2... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findOdd(A) {\n const counts = A.reduce((tracker, e) => {\n tracker[e] = tracker[e] ? tracker[e] + 1 : 1;\n //console.log(tracker[e])\n\n return tracker;\n }, {});\n\n for (key in counts) {\n if (counts[key] % 2)\n return parseInt(key);\n }\n\n return n... | [
"0.710358",
"0.68278384",
"0.67206657",
"0.6683609",
"0.665838",
"0.6642985",
"0.66357607",
"0.6586479",
"0.6554184",
"0.6534172",
"0.65155315",
"0.6464872",
"0.6445867",
"0.64301574",
"0.64124936",
"0.6408793",
"0.6382769",
"0.6318161",
"0.631258",
"0.63033044",
"0.6290974",... | 0.8726997 | 0 |
Handle refreshing the document list. | handleRefreshDocuments() {
this.refreshDocumentsAction();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleRefreshDocuments() {\n this.props.refreshDocuments();\n }",
"function _triggerRefresh() {\n lListManager$.trigger('apexrefresh');\n } // triggerRefresh",
"function refresh() {\n fetchNewestLists();\n}",
"function refresh() {\n }",
"function AjaxCallback(data){\n docsToGet = da... | [
"0.7283454",
"0.6690797",
"0.6519718",
"0.64646006",
"0.6367308",
"0.63560706",
"0.6334293",
"0.6281281",
"0.6281281",
"0.62669754",
"0.62291545",
"0.62052566",
"0.6204525",
"0.61924714",
"0.619175",
"0.61682314",
"0.613046",
"0.6120366",
"0.60874414",
"0.6056699",
"0.6001143... | 0.80588126 | 0 |
This methods is used to save the college fund payment that is being edited in the dialog | function save() {
$log.log('CollegeFundPaymentDialogController::save called');
if (vm.collegeFundPayment.id) {
//update the collegeFundPayment information
CollegeFundPayment.save(vm.collegeFundPayment, onSaveFinished);
} else {
// Creat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function MCH_Save() {\n console.log(\" ----- MCH_Save ----\")\n\n mod_MCH_dict.show_err_msg = true;\n const enable_save_btn = MCH_Hide_Inputboxes();\n\n if (enable_save_btn){\n const data_dict = mod_MCH_dict.data_dict;\n console.log(\" data_dict\", data_dict)\n ... | [
"0.63364315",
"0.62763864",
"0.6210954",
"0.62048376",
"0.6063523",
"0.60248035",
"0.5934354",
"0.5854585",
"0.5854183",
"0.58088166",
"0.5802246",
"0.57791084",
"0.57754284",
"0.575086",
"0.5742519",
"0.57380474",
"0.57305086",
"0.5721774",
"0.57148767",
"0.5697752",
"0.5689... | 0.8161231 | 0 |
_get performs get on the passed client, recording a request stat. If an error occurs that is not an abort error then a result will still be returned with an error property. | async _get (client, round, options) {
const startTime = Date.now()
try {
const rand = await client.get(round, options)
return { rand, stat: { client, rtt: Date.now() - startTime, startTime } }
} catch (err) {
// client failure, set a large RTT so it is sent to the back of the list
if... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async tryGet(errorType, client, path, cred) {\n try {\n return await client.get(path, undefined, cred);\n }\n catch (e) {\n throw new this.errClass(errorType, e);\n }\n }",
"get() {}",
"get(key, cb) {\n this.client.get(key, (err, data) => {\n if (!er... | [
"0.59852374",
"0.5505344",
"0.5502637",
"0.54829323",
"0.54716533",
"0.54628754",
"0.5427133",
"0.5378102",
"0.5377453",
"0.53710276",
"0.53625697",
"0.53490436",
"0.5346562",
"0.53306156",
"0.53043026",
"0.527914",
"0.52704406",
"0.52462685",
"0.52339596",
"0.5227012",
"0.52... | 0.55204463 | 1 |
Instructions: [1, n, m, r] = tape[n] + tape[m]. Store in tape position r. [2, m, m, r] = tape[n] tape[m]. Store in tape position r. [99] = halt execution Step 4 positions after processing each instruction | function compute(tape) {
let position = 0;
let instruction = tape[position];
while (instruction != 99) {
switch (instruction) {
case 1:
tape[tape[position + 3]] = tape[tape[position + 1]] + tape[tape[position + 2]];
break;
case 2:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function main(tape) {\n let position = 0;\n let instruction = tape[position];\n\n while (instruction != 99) {\n switch (instruction) {\n case 1:\n tape[tape[position + 3]] = tape[tape[position + 1]] + tape[tape[position + 2]];\n break;\n case 2:\n... | [
"0.74174607",
"0.609898",
"0.600805",
"0.5904106",
"0.5764787",
"0.54821366",
"0.5478927",
"0.53443825",
"0.5308699",
"0.5274114",
"0.52609766",
"0.52268213",
"0.5200743",
"0.51955426",
"0.51936114",
"0.5138309",
"0.51170623",
"0.51158684",
"0.51078904",
"0.50996387",
"0.5091... | 0.7125608 | 1 |
fonction permettant de changer le nombre de like d'une photo" | function likePicture(idPicture){
for(var i=0;i<mediaArray.length;i++){
if(mediaArray[i].id == idPicture){
mediaArray[i].likes += 1;
document.getElementById(idPicture).innerHTML = mediaArray[i].likes;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compteurLikes (photographerMediaList) {\n let totalCoeur = compteurTotal(photographerMediaList)\n // selectionne le nombre total de likes\n const totalLikes = document.querySelector('.numbers_likes')\n\n // selectionne tous les coeurs\n const allLikes = document.querySelectorAll('figure button')\n\n ... | [
"0.6566839",
"0.654466",
"0.6462703",
"0.6462444",
"0.6334422",
"0.63204676",
"0.62502974",
"0.6166436",
"0.61631536",
"0.6147022",
"0.611205",
"0.60753125",
"0.60742587",
"0.6044372",
"0.60430276",
"0.59954846",
"0.5990897",
"0.5976474",
"0.5972123",
"0.5970856",
"0.59302944... | 0.65755504 | 0 |
fonction appelant trois fonctions du cycle de validation | function validCycle(event) {
update(event);
validOrNot(event);
validForm(event);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validation() {\r\n\t\t\r\n\t}",
"function validate(){\n\n\t\t//TODO: make this work\n\n\n\t}",
"selfValidate(){\n\n }",
"validate() { }",
"validate() {}",
"afterValidChange() { }",
"validate() {\n // Als NIET (!) valide, dan error weergeven\n if (!this.isValid()) {\n ... | [
"0.71943665",
"0.6931001",
"0.68178433",
"0.66423315",
"0.6624813",
"0.6578506",
"0.6499621",
"0.6426914",
"0.64264625",
"0.63468665",
"0.6343384",
"0.6297208",
"0.6261599",
"0.6243498",
"0.62038267",
"0.62038267",
"0.6197088",
"0.6197088",
"0.6183405",
"0.61459494",
"0.61459... | 0.7543151 | 0 |
We need to generate the navbar menu title from the state.names | function generateNavTitle(string) {
var startIndex = string.indexOf(".") + 1;
var title = string.substring(startIndex);
return title.substr(0, 1).toUpperCase() + title.substr(1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"definePageName() {\n const pageName = this.state.navPages.filter(page => this.state.currentRoute === page.pageRoute)[0].pageName;\n this.setState({pageName: pageName});\n }",
"getTitles() {\n\t\tconst\n\t\t\tlinks = this.props.config.layout_config.nav.links,\n\t\t\troute = this.props.router.route,\n\t\t\t... | [
"0.6330066",
"0.6010143",
"0.59510773",
"0.5939037",
"0.59123933",
"0.5895908",
"0.58905613",
"0.58410424",
"0.5817533",
"0.58139956",
"0.58115137",
"0.5769064",
"0.5764746",
"0.576016",
"0.57574743",
"0.5709873",
"0.56910276",
"0.5680176",
"0.56768197",
"0.5667685",
"0.56674... | 0.65548414 | 0 |
gets the tile dimensions based on the type | function getTileDimensions(tile) {
var flags = tile.type;
var extraFlags = 0;
var dims = [];
//strip out the extra flags so we can render the tiles
if (flags & AUTOTILE_INNER_TOP_RIGHT) {
flags &= ~AUTOTILE_INNER_TOP_RIGHT;
extraFlags |= AUTOTIL... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"GetTileCount()\n\t{\n\t\tvar value = this.tileCountPerGrid * this.gridCount * this.tileCountPerGrid * this.gridCount ; \n\t\treturn value;\n\t}",
"getDimensions() {\n return { x: 1, y: 1, z: 1 };\n }",
"function CheckForTileType(x, y){\n return Tiles[x][y].TileType;\n}",
"function ImageDimension... | [
"0.6438047",
"0.62839544",
"0.62538826",
"0.6156971",
"0.6039183",
"0.60379726",
"0.60217935",
"0.6016206",
"0.5977402",
"0.5950577",
"0.5922378",
"0.5917722",
"0.59175086",
"0.591619",
"0.5909744",
"0.5880582",
"0.58732116",
"0.58654314",
"0.58513224",
"0.5836474",
"0.581433... | 0.7554893 | 0 |
Ensure that the popups element is present | function ensurePopupsElement () {
if (!popupsElement) {
popupsElement = createPopupsElement();
angular.element(document.body).append(popupsElement);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isAlreadyInDOM(){\n\t\t\tlet $alreadyExistent = $(\".sth-select-popup\");\n\t\t\treturn ( $alreadyExistent && $alreadyExistent.length > 0 );\n\t\t}",
"get popupIsOpen() {\n return this.popupHTMLCollection.length > 0;\n }",
"function checkPopupShown() {\n if ($(\".ui-popup-active\").length... | [
"0.69321525",
"0.67608505",
"0.65614706",
"0.65596384",
"0.6497377",
"0.64430785",
"0.6401888",
"0.6375144",
"0.6351373",
"0.6288028",
"0.62741864",
"0.6269096",
"0.6248779",
"0.62315273",
"0.6188259",
"0.6176293",
"0.6164571",
"0.6163853",
"0.614638",
"0.61454153",
"0.608576... | 0.8195022 | 0 |
Focus the first element with tabindex 0 | function focusFirstElement (instance) {
var element = instance.element[0].querySelectorAll('[tabindex="0"]')[0];
if (element) {
instance.focusElement = document.activeElement;
element.focus();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"focusFirstElement() {\n this.trapFocus();\n }",
"focus() {\n\t\tthis.children.first.focus();\n\t}",
"function focusFirstTabindexedDescendant(element)\n {\n const descendants = $(element).find('*');\n for (let i = 0; i < descendants.length; i++)\n {\n const toTest = ... | [
"0.8375296",
"0.77169454",
"0.75151503",
"0.7404898",
"0.7311502",
"0.7243622",
"0.72432697",
"0.7224165",
"0.71981984",
"0.717584",
"0.71536696",
"0.7151375",
"0.71093345",
"0.71093345",
"0.71093345",
"0.70984066",
"0.708315",
"0.70814365",
"0.70764303",
"0.7023847",
"0.7019... | 0.8180103 | 1 |
Update the popups visibility | function updatePopupsVisibility () {
popupsElement.toggleClass('ng-hide', popups.length === 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_wallpaper_option_panels_visibility()\n {\n const value = DOM.is_enabled.checked ? \"block\" : \"none\";\n DOM.panels.forEach(panel => { panel.style.display = value; });\n }",
"function subPopup1(mId) {\r\n\tjQuery('#'+mId).css(\"visibility\",\"visible\");\r\n}",
"function up... | [
"0.6711504",
"0.6608523",
"0.6522828",
"0.6522625",
"0.6477299",
"0.6455988",
"0.64544255",
"0.644414",
"0.6438",
"0.6400003",
"0.6397063",
"0.6395155",
"0.6385753",
"0.6364253",
"0.6339302",
"0.63268226",
"0.6323866",
"0.63131756",
"0.6300403",
"0.62973166",
"0.6274992",
"... | 0.8309015 | 0 |
Close the most top popup | function closeMostTopPopup () {
if (popups[0]) {
popups[0].close();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static popup_close() {\n const context = Utils.popup_context.pop();\n if (typeof AGGrid !== 'undefined')\n AGGrid.popGridContext();\n Utils.popEnterContext();\n $('#' + context.id).hide();\n Utils.globalEnterHandler(context.globalEnterHandler);\n Utils.popup_zin... | [
"0.79031485",
"0.7743563",
"0.7575638",
"0.7564961",
"0.7558552",
"0.7554635",
"0.749716",
"0.73752695",
"0.7280023",
"0.72597396",
"0.7249109",
"0.7224081",
"0.7214876",
"0.7210264",
"0.7168137",
"0.7158217",
"0.71551514",
"0.7144959",
"0.7127966",
"0.7127966",
"0.71278614",... | 0.877937 | 0 |
Get users for Discover | static getAllUsers() {
return fetch('https://dev-selfiegram.consumertrack.com/users').then(response => {
return response.json();
}).catch(error => {
return error;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fetchUsers() {\n\t\treturn fetch(\"http://127.0.0.1:4120/v0/notify/cf/users\", {\n\t\t\tmethod: \"GET\",\n\t\t})\n\t\t\t.then(response => {\n\t\t\t\treturn response.json();\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tconsole.error(err);\n\t\t\t});\n\t}",
"function getUsers() {\n\treturn fetch(userURL).then((resp) ... | [
"0.7314472",
"0.7261902",
"0.72526294",
"0.72377306",
"0.72339606",
"0.7225871",
"0.7171031",
"0.71555114",
"0.715428",
"0.7147023",
"0.7123069",
"0.71070385",
"0.70909506",
"0.70757294",
"0.7075712",
"0.70660937",
"0.7054837",
"0.700749",
"0.69805527",
"0.697483",
"0.6951927... | 0.74673074 | 0 |
Get user info and posts for Profile using userId url param | static getProfilePosts(userId) {
return fetch(`https://dev-selfiegram.consumertrack.com/users/${userId}`).then(response => {
return response.json();
}).catch(error => {
return error;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getProfilePosts (req, res, next) {\n await Post.getUserPosts(req.params.username, (err, posts) => {\n if (err) return next(err)\n\n res.send(posts)\n })\n }",
"async getUsersProfile (userId) {\n const response = await axiosConfig.get(`profile/${userId}`)\n return response\n ... | [
"0.7008362",
"0.67537147",
"0.6749983",
"0.667955",
"0.66544276",
"0.6634758",
"0.6621874",
"0.6615253",
"0.6546261",
"0.6524236",
"0.6521971",
"0.6471538",
"0.6455696",
"0.64446384",
"0.64378774",
"0.6402021",
"0.6372011",
"0.6357879",
"0.6345682",
"0.6335458",
"0.63348377",... | 0.76617146 | 0 |
Get artist names and artistpage urls from local files, one file at a time. Artist page should have all their albums listed out. | function readArtistUrls () {
// reset the albums list for a new file
all_albums_object = {};
var file_name = path.join(__dirname, '../collections/artistUrls/artistUrls'+file_number+'.js'),
artist_urls_object;
try {
// get the json object of artist page urls
artist_urls_object = jso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getArtists() {\r\n //In questa copia del progetto, mi sono salvato tutti gli artisti e le loro informazioni in un file json\r\n artistsList = await fetch('artists.json').then(r => r.json());\r\n}",
"function getFiles(urls) {\n\tconst responses = [];\n\t\n\treturn urls\n\t\t.map(getFile)\n\t\... | [
"0.59392595",
"0.5730636",
"0.5675361",
"0.5587915",
"0.5556513",
"0.5543214",
"0.5487354",
"0.5440803",
"0.5432884",
"0.5409201",
"0.53951794",
"0.53897226",
"0.53862137",
"0.5373576",
"0.53318626",
"0.5327415",
"0.5295388",
"0.52751654",
"0.5271344",
"0.5256754",
"0.5254151... | 0.7359168 | 0 |
Attempts to handle the given intent with the state's handlers and update the session, returning true if succesfull or null if no matching handler found. | handleIntent(intentName, intentObj, session, response) {
var handler = this.intentHandlers[intentName];
if (handler) {
handler.call(this, intentObj, session, response);
return true;
}
// no suitable handler found
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handle(intent, inputData) {\n const handlers = this.intentHandlers\n .filter(ih => ih.intent.getName() === intent.getName())\n .map(ih => ih.handler);\n\n if (handlers.length > 0) {\n return handlers[0](inputData);\n } else {\n return this.fallbackHa... | [
"0.61500406",
"0.60478497",
"0.6036625",
"0.6036625",
"0.6036625",
"0.6036625",
"0.6036625",
"0.6036625",
"0.5974158",
"0.5974158",
"0.5974158",
"0.59508574",
"0.59000444",
"0.57711244",
"0.5736118",
"0.57146764",
"0.5692262",
"0.5688337",
"0.56314325",
"0.5627563",
"0.559667... | 0.70567966 | 0 |
Looks for a hidden input in `responseText` that indicates whether there are more results available after those in `responseText`. Returns true or false depending on the value of that hidden input. | function moreResults(responseText) {
var more = $j(responseText)
.find('[name=moreResultsAvailable]').andSelf()
.filter('[name=moreResultsAvailable]');
return more.val() != 'false';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isMoreToProcess(info, data) {\n if (!info || !data || !data[0]) {\n return false;\n }\n let perPage = bpu.ebayInt(data[0], \"paginationOutput/entriesPerPage\");\n if (!perPage) {\n return false;\n }\n // adding additional search returns\n info.processed += perPage;\n if (info.proc... | [
"0.57299316",
"0.56397814",
"0.55821663",
"0.5555811",
"0.5526171",
"0.5522832",
"0.5490587",
"0.5384576",
"0.5373998",
"0.53502804",
"0.53404254",
"0.53043365",
"0.5240656",
"0.5218034",
"0.5202735",
"0.51774395",
"0.5171307",
"0.5157385",
"0.5146231",
"0.51432306",
"0.51429... | 0.83201796 | 0 |
Recursively expand config directives. | function expandConfig(value) {
var expandable = ['config', 'json'];
var parts;
if (value instanceof Array) {
// If value is an array, recurse.
return value.map(expandConfig);
} else if (typeof value === 'string') {
// If value is an expandable directive, expand it if possible.
parts = task.getDi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function expandConfiguration(setts, callback) {\n setts = _.extend({}, setts);\n var imports = setts.imports;\n delete setts.imports;\n expandedConfiguration = superExtend(expandedConfiguration, setts);\n\n if (imports) {\n async.forEach(imports, function(imp, next) {\... | [
"0.5826986",
"0.5084468",
"0.5078109",
"0.5074614",
"0.49565893",
"0.4875426",
"0.48329708",
"0.48109028",
"0.47922203",
"0.47080454",
"0.4702896",
"0.4670119",
"0.46550938",
"0.4639466",
"0.4633744",
"0.4631092",
"0.4599927",
"0.4596637",
"0.45955315",
"0.45665133",
"0.45631... | 0.6917836 | 0 |
If prop is an array, convert it to a props string. | function getPropString(prop) {
if (util.kindOf(prop) === 'array') {
return prop.map(exports.escape).join('.');
}
return prop;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function arrayify(prop) {\n // turns single args into single-item array\n if (prop && prop.constructor !== Array) {\n return [prop];\n } else {\n return prop || [];\n }\n }",
"function sdfg_property_to_string(prop, settings=null) {\n if (prop === null) return prop;\n if... | [
"0.6847961",
"0.6486568",
"0.6439035",
"0.6368707",
"0.6197322",
"0.61324745",
"0.6005797",
"0.5982907",
"0.57929814",
"0.57929814",
"0.5613402",
"0.5584231",
"0.55811626",
"0.5537221",
"0.5524593",
"0.5471115",
"0.5430302",
"0.5414893",
"0.5413301",
"0.5382439",
"0.5362915",... | 0.7731144 | 0 |
A function that sets the transparent state of the navbar. | function handleTransparentNavbar() {
setTransparentNavbar(dispatch, (fixedNavbar && window.scrollY === 0) || !fixedNavbar);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function whiteNavbar() {\n\tif (window.pageYOffset > navbar.offsetTop) {\n\t\t// after scrolling\n\t\tif (_WHITENAVBAR == true) {\n\t\t\tnavbar.classList.add(\"default\");\n\t\t\tnavbar.classList.remove(\"white\");\n\n\t\t\tlogoImg.src = \"assets/img/nav_logo.png\";\n\t\t} else if (_WHITENAVBAR == false) {\n\t\t\t... | [
"0.6871412",
"0.654339",
"0.64434093",
"0.6426975",
"0.63832635",
"0.63832635",
"0.63796085",
"0.61297274",
"0.6068367",
"0.60190684",
"0.60187805",
"0.5993325",
"0.5977935",
"0.5942612",
"0.59086275",
"0.59008896",
"0.5883008",
"0.5878598",
"0.587196",
"0.5866494",
"0.586643... | 0.7210417 | 0 |
works like Array.filter but applies the filter to this and returns this | filterAndUpdate( callback, thisArg)
//------------------------------------------------------------------------------------------------------
{
var itemsToRemove = [];
this.forEach( function( item) {
if ( ! callback.call(thisArg, item) ) {
itemsToRemove.push(item);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"afilter (callback) {\n return this.asArray().filter(callback)\n }",
"filter(predicate, thisArg = undefined) {\n const ret = new Arr();\n let i = 0;\n for (let p in this)\n if (predicate.call(thisArg, this[p], i++, this))\n ret.push(this[p]);\n return ret;... | [
"0.73207307",
"0.70081997",
"0.66563857",
"0.66217655",
"0.65310836",
"0.6451532",
"0.64422315",
"0.6411064",
"0.637239",
"0.6352655",
"0.6079679",
"0.60495055",
"0.6043072",
"0.60410786",
"0.60410786",
"0.6003106",
"0.59964097",
"0.5995614",
"0.5993085",
"0.5989926",
"0.5974... | 0.7045942 | 1 |
The window of the infobar that shows informations of the currently selected field. | function InfoBarWindow(){} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showInfoWindow() { \n currentmarker = this;\n infoWindow.open(map, currentmarker);\n buildIWContent();\n\n}",
"function information() {\n\t//alert(\"Created by Monica Michaud\\nIn the Institute for New Media Studies\\nAdviser: Gordon Carlson, PhD\\nDev Version: 0.2 (Apr 25)\");\n\n\tvar mapInfoBo... | [
"0.66546005",
"0.6365414",
"0.6363552",
"0.62891656",
"0.6180505",
"0.6149818",
"0.6119021",
"0.60807484",
"0.6062862",
"0.60509294",
"0.6038735",
"0.6032203",
"0.6020419",
"0.6015565",
"0.5991858",
"0.59775305",
"0.597072",
"0.5930817",
"0.5892009",
"0.58712286",
"0.5838879"... | 0.7086269 | 0 |
handleHealing() Checks if the player found the potion by taking the distance between the two objects and checks if it is drank. If yes, set the condition to true and it will not be displayed anymore because of the code in display() | handleHealing(player) {
let d = dist(this.x, this.y, player.x, player.y);
// Check if the distance is less than their two radii (an overlap)
//as long as the potion has not been drank
if (d < this.size + player.size && this.isDrank === false) {
// Increase player's health and constrain it to its p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function healCheck() {\n if (combatant[\"healing\"] === true && combatant[\"hitPoints\"] < 75 && combatant[\"healCounter\"] > 0 && combatant[\"hitPoints\"] > 0) {\n combatant[\"hitPoints\"] = combatant[\"hitPoints\"] + combatant[\"healPoints\"];\n document.getElementById(\"combatHitPoints\").inner... | [
"0.6393571",
"0.6325462",
"0.6163486",
"0.61205894",
"0.6098143",
"0.6078946",
"0.60127366",
"0.5999079",
"0.5986477",
"0.59595686",
"0.5931322",
"0.59246093",
"0.59003043",
"0.589955",
"0.58860576",
"0.58853835",
"0.58759844",
"0.58707756",
"0.5870223",
"0.58668846",
"0.5853... | 0.8250009 | 0 |
generates and places stars on "star_canvas" | function placeStars(){
var canvas = document.getElementById("star_canvas");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
max_x = window.innerWidth;
max_y = window.innerHeight;
ctx = canvas.getContext("2d");
ctx.scale(1.5, 1.5);
rand = Math.random;
//varyi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderStars() {\n var canv = document.getElementById('star-canvas');\n\n // check if the canvas exists\n if(!canv) {\n // Initialise the document background\n canv = initBackgroundCanvas(\"star-canvas\");\n createLocations();\n }\n\n var cont = canv.context;\n\n\n\n ... | [
"0.7823409",
"0.76411027",
"0.7510442",
"0.7459672",
"0.74546874",
"0.7357166",
"0.73494333",
"0.7294141",
"0.7270358",
"0.722787",
"0.71939963",
"0.7161951",
"0.712477",
"0.71182525",
"0.70951813",
"0.7050303",
"0.70363367",
"0.7015159",
"0.6970562",
"0.6948164",
"0.6913209"... | 0.7773525 | 1 |
function to pause transaction | async function pauseTransaction(data) {
const { sender, receiver } = data;
let base58publicKey = new PublicKey(
"9Ayh2hS3k5fTn6V9Ks7NishUp5Jz19iosK3tYPAcNhsp"
);
const senderaddress = new PublicKey(data.sender);
const recepientaddress = new PublicKey(data.receiver);
//sender and receiver address
let... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"pause () {}",
"pause () {}",
"pause () {}",
"function playPause() {\n\t\tDBR.act('pause');\n\t\tsyncState();\n\t}",
"suspendAutoCommit() {\n this.suspendCount++;\n }",
"suspend() {\n\t\tthis._context.suspend();\n\t}",
"function pause() {\n paused = true;\n clearTimeout(timeout);\n }",
... | [
"0.6558856",
"0.6558856",
"0.6558856",
"0.6397964",
"0.63530564",
"0.6125015",
"0.61162853",
"0.61075604",
"0.6103572",
"0.60972273",
"0.60972273",
"0.60716087",
"0.6058136",
"0.6054296",
"0.6044183",
"0.60204256",
"0.60117996",
"0.6003164",
"0.5998673",
"0.59820664",
"0.5974... | 0.6590305 | 0 |
Write a function that takes 4 arguments. A start value An end value A callback to call if the number is divisible by 3 A callback to use if the number is divisible by 5 The function should generate an array containing values from start value to end value Then the function should iterate over the array and call the seco... | function threeFive(startIndex, stopIndex, threeCallback, fiveCallback) {
// make array
let arrayContainer = [];
for(let i = startIndex; i<=stopIndex; i++){
arrayContainer.push(i);
}
// start at beginning of array and check if you should call threeCallback or
// fiveCallback or go on to ne... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function divisibleBy(lowerBound, upperBound) {\n for (var i = lowerBound; i <= upperBound; i++) {\n if (i % 5 == 0 && i % 3 == 0) console.log(i);\n }\n }",
"function divisibleFactory(z){\nreturn function() {\n return arr.filter((numberFromArray) =>{\nreturn numberFromArray % z ==0;\n });\n} \nretur... | [
"0.6582958",
"0.6287825",
"0.6246434",
"0.6212064",
"0.61976594",
"0.6108313",
"0.6091946",
"0.60807997",
"0.60227495",
"0.6005412",
"0.60021174",
"0.59824795",
"0.5952655",
"0.5952294",
"0.594331",
"0.5927591",
"0.5925262",
"0.5909277",
"0.5899602",
"0.58946604",
"0.5893851"... | 0.7794967 | 0 |
var navFixed = document.getElementById("navbarmobilefixed"); | function viewNavbar_mobile(){
if(showNavbar){
if(window.pageYOffset<75)
opacity.style.display = "none";
else
document.getElementById("navbar-mobile-fixed").style.display= "none";
nav.style.display = "flex";
}
else{
if(window.pageYOffset<75)
opacity.style.display = "block";
else
document.getEle... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function respNavbar() {\n var x = document.getElementById(\"navbar1\");\n \n document.body.scrollTop = 0;\n document.documentElement.scrollTop = 0;\n\n if (x.className === \"navbar\") {\n x.className += \" responsive\";\n } else {\n x.className = \"navbar\";\n }\n}",
"function ... | [
"0.7033856",
"0.70081466",
"0.6985026",
"0.68498707",
"0.68479",
"0.6814982",
"0.67956704",
"0.67870295",
"0.67407024",
"0.6739153",
"0.67317474",
"0.67219156",
"0.6656335",
"0.6645841",
"0.6637413",
"0.6618381",
"0.66173834",
"0.66139466",
"0.6604299",
"0.6602301",
"0.658695... | 0.71067995 | 0 |
Generate a state from a list of positions. | function generateState(list) {
const array = new Array(36);
for (let i = 0; i < 36; i++) {
array[i] = NOT_FILLED;
}
for (let i = 0; i < list.length; i++) {
array[list[i].row * 6 + list[i].col] =
list[i].player === "red" ? RED_PLAYER : BLACK_PLAYER;
}
return array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function StateMember(coordinates) {\n /** Array of coordinates*/\n this.coordinates = coordinates;\n}",
"fullPositionsUpdate(positions) {\n let openPositions = []\n\n for (const position of positions) {\n if (position['symbol'] in this.positions && !['buy', 'sell'].includes(position['s... | [
"0.53706336",
"0.53673446",
"0.5334424",
"0.53006864",
"0.5290699",
"0.5253381",
"0.51896733",
"0.5144064",
"0.5125925",
"0.51101446",
"0.50847423",
"0.50683904",
"0.50663036",
"0.5037615",
"0.5018086",
"0.4988816",
"0.49830407",
"0.49830407",
"0.49830407",
"0.49556252",
"0.4... | 0.6022154 | 0 |
Create simple Hello World Response based on request AcceptLanguage | async function hello_world_response(request) {
// Defaults to use if item not in EdgeKV
let default_greeting = "Hello World";
let language = "en";
let content_lang = "en-US";
let greeting = "";
let err_msg = ""
// Retrieve Accept-Language header & extract language key
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleRequest(request, response){\n var acceptLanguage = request.headers[\"accept-language\"];\n var foundLang = _.filter(locales, function(locale) {\n\t\treturn locale === acceptLanguage;\n\t});\n\t\n\tvar language = foundLang[0];\n\tvar languagePath = path.join(__dirname, \"./dist/prerender/i18n/\... | [
"0.6350727",
"0.62759525",
"0.61874735",
"0.60681564",
"0.60363525",
"0.60194093",
"0.59702647",
"0.59418434",
"0.570928",
"0.5685883",
"0.5649043",
"0.5630715",
"0.55934644",
"0.55927354",
"0.5589962",
"0.5576551",
"0.5565688",
"0.555735",
"0.546143",
"0.5459593",
"0.5451467... | 0.70910525 | 0 |
Change customer default wishlist | function WishlistChangeDefault(id, id_wishlist)
{
$.ajax({
type: 'GET',
url: baseDir + 'modules/blockwishlist/cart.php',
async: true,
data: 'id_wishlist=' + id_wishlist + '&token=' + static_token,
cache: false,
success: function(data)
{
// $('#' + id).slideUp('normal');
document.getElemen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wishlist_ui_restore_default(sidebarListID) {\n\t$(\"#\" + sidebarListID).empty();\n\tdefault_elt = create_ui_element(\"li\", sidebarListID + \"-default\", \"sidebar_wishlist_default\");\n\tif (sidebarListID === \"my-wishlists\") {\n\t\tdefault_elt.html(\"You don't have any wishlists yet! Use the plus butt... | [
"0.66302156",
"0.61482346",
"0.5862624",
"0.58620965",
"0.5703636",
"0.55582875",
"0.5460988",
"0.5381678",
"0.53480154",
"0.533761",
"0.5332068",
"0.5290135",
"0.5275822",
"0.52568644",
"0.5255005",
"0.5237639",
"0.5215349",
"0.51604503",
"0.5118331",
"0.5118331",
"0.5074404... | 0.63361776 | 1 |
Send wishlist by email | function WishlistSend(id, id_wishlist, id_email)
{
$.post(baseDir + 'modules/blockwishlist/sendwishlist.php',
{ token: static_token,
id_wishlist: id_wishlist,
email1: $('#' + id_email + '1').val(),
email2: $('#' + id_email + '2').val(),
email3: $('#' + id_email + '3').val(),
email4: $('#' + id_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async handle ({ email, username, bets, total }) {\r\n await Mail.send(\r\n ['emails.new_bets'],\r\n { username, bets, total },\r\n (message) => {\r\n message\r\n .to(email)\r\n .from('tgl_bets@lubysoftware.com', 'TGL | BETS')\r\n .subject('Novas apostas');\r\n ... | [
"0.6262956",
"0.6100294",
"0.602862",
"0.59350336",
"0.59318787",
"0.5911009",
"0.5897887",
"0.57900685",
"0.5705745",
"0.56967884",
"0.56583875",
"0.5657566",
"0.56416005",
"0.56399554",
"0.56376624",
"0.56259185",
"0.56142616",
"0.5601735",
"0.5597169",
"0.55947894",
"0.556... | 0.71441823 | 0 |
Detects and attempts to fix known buffer stalling issues. | _tryFixBufferStall (bufferInfo, stalledDurationMs) {
const { config, fragmentTracker, media } = this;
const currentTime = media.currentTime;
const partial = fragmentTracker.getPartialFragment(currentTime);
if (partial) {
// Try to skip over the buffer hole caused by a partial fragment
// Th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_checkBuffer() {\n const EPS = 1e-3;\n if (this.config.isLive) {\n // Live stream, try to maintain buffer between 3s and 8s\n // TODO make 3s and 8s configurable\n let currentBufferEnd = this.getCurrentBufferEnd();\n if (typeof currentBufferEnd === 'undefined') {\n // QUICKFIX:\n ... | [
"0.67014253",
"0.6316682",
"0.6109256",
"0.57507026",
"0.56906915",
"0.55470204",
"0.55317974",
"0.5452515",
"0.5444423",
"0.5419768",
"0.53671205",
"0.5276781",
"0.5245316",
"0.5243934",
"0.519452",
"0.51896805",
"0.5183204",
"0.51668185",
"0.5154369",
"0.51365507",
"0.51164... | 0.73890406 | 0 |
Triggers a BUFFER_STALLED_ERROR event, but only once per stall period. | _reportStall (bufferLen) {
const { hls, media, stallReported } = this;
if (!stallReported) {
// Report stalled error once
this.stallReported = true;
logger.warn(`Playback stalling at @${media.currentTime} due to low buffer (buffer=${bufferLen})`);
hls.trigger(Event.ERROR, {
type:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_tryNudgeBuffer () {\n const { config, hls, media } = this;\n const currentTime = media.currentTime;\n const nudgeRetry = (this.nudgeRetry || 0) + 1;\n this.nudgeRetry = nudgeRetry;\n\n if (nudgeRetry < config.nudgeMaxRetry) {\n const targetTime = currentTime + nudgeRetry * config.nudgeOffset;\... | [
"0.5527189",
"0.54950756",
"0.5429903",
"0.52078474",
"0.5173094",
"0.513013",
"0.5050894",
"0.50086117",
"0.500674",
"0.5006226",
"0.4964298",
"0.4935001",
"0.49318302",
"0.49119034",
"0.4910197",
"0.48992592",
"0.4896145",
"0.48844853",
"0.48844853",
"0.48844853",
"0.488448... | 0.71367466 | 0 |
Attempts to fix buffer stalls by jumping over known gaps caused by partial fragments | _trySkipBufferHole (partial) {
const { config, hls, media } = this;
const currentTime = media.currentTime;
let lastEndTime = 0;
// Check if currentTime is between unbuffered regions of partial fragments
const buffered = BufferHelper.getBuffered(media);
for (let i = 0; i < buffered.length; i++) {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_tryFixBufferStall (bufferInfo, stalledDurationMs) {\n const { config, fragmentTracker, media } = this;\n const currentTime = media.currentTime;\n\n const partial = fragmentTracker.getPartialFragment(currentTime);\n if (partial) {\n // Try to skip over the buffer hole caused by a partial fragment\... | [
"0.7913769",
"0.6589201",
"0.6447253",
"0.5952644",
"0.58081216",
"0.5780041",
"0.574674",
"0.56833684",
"0.5629199",
"0.5580207",
"0.5559493",
"0.5536453",
"0.5534844",
"0.5501438",
"0.54906195",
"0.5489215",
"0.5458998",
"0.5433323",
"0.5423867",
"0.5408424",
"0.5381634",
... | 0.6947169 | 1 |
Attempts to fix buffer stalls by advancing the mediaElement's current time by a small amount. | _tryNudgeBuffer () {
const { config, hls, media } = this;
const currentTime = media.currentTime;
const nudgeRetry = (this.nudgeRetry || 0) + 1;
this.nudgeRetry = nudgeRetry;
if (nudgeRetry < config.nudgeMaxRetry) {
const targetTime = currentTime + nudgeRetry * config.nudgeOffset;
// pla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_tryFixBufferStall (bufferInfo, stalledDurationMs) {\n const { config, fragmentTracker, media } = this;\n const currentTime = media.currentTime;\n\n const partial = fragmentTracker.getPartialFragment(currentTime);\n if (partial) {\n // Try to skip over the buffer hole caused by a partial fragment\... | [
"0.7300922",
"0.64601374",
"0.63787735",
"0.6170724",
"0.601653",
"0.5925789",
"0.5855742",
"0.5706098",
"0.5673302",
"0.5662795",
"0.5650537",
"0.5589789",
"0.5575089",
"0.55698705",
"0.5537811",
"0.5528408",
"0.55063885",
"0.5502327",
"0.5493641",
"0.54897743",
"0.548477",
... | 0.71664286 | 1 |
Generates an expirable project invitation token for provided email. | function generateProjectInvitationToken(email_address, project_id){
// expirates in 1 day
var now = new Date();
now.setDate(now.getDate() + 1);
return jwt.sign({
project_id: project_id,
email_address: email_address,
action: 'accept_project',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generatePasswordResetToken(email) {\n return new Promise(function(resolve, reject) {\n User\n .findOne({email: email})\n .exec()\n .then(function(user) {\n if (user) {\n var passwordResetToken = new PasswordResetToken({\n userId: user._id,\n email: user.email,\n ... | [
"0.619841",
"0.6085069",
"0.5903227",
"0.577752",
"0.5663364",
"0.55652404",
"0.54968727",
"0.5453028",
"0.53708446",
"0.5351058",
"0.52952266",
"0.52497137",
"0.5245938",
"0.5179545",
"0.51759195",
"0.5166657",
"0.51519656",
"0.51412493",
"0.51335174",
"0.5114786",
"0.509718... | 0.7787196 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.