query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Create a single boid | function Boid() {
//This defines what the boid will actually look like :-)
this.mesh = initCube(); //initCube();
//Sets the direction and position of the boid
this.direction = randomVector();
this.position = randomVector().multiplyScalar(400);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Boid(x,y,id) {\n this.acceleration = createVector(0,0);\n this.velocity = createVector(random(-1,1),random(-1,1));\n this.position = createVector(x,y);\n this.r = 4.0;\n this.maxspeed = 1; // Maximum speed\n this.maxforce = 0.05; // Maximum steering force\n\n this.id = id;\n this.birthTime = mi... | [
"0.682974",
"0.67414504",
"0.67242813",
"0.6274118",
"0.62372154",
"0.5791528",
"0.56568015",
"0.56462365",
"0.56451285",
"0.54676926",
"0.54336303",
"0.54336303",
"0.54067487",
"0.5406471",
"0.5406471",
"0.5373144",
"0.5294381",
"0.52829546",
"0.5278688",
"0.5267262",
"0.524... | 0.722759 | 0 |
Is another boid nearby | function isNearby(boid, otherBoid) {
if (otherBoid == boid)
return false;
distance = boid.position.distanceTo(otherBoid.position);
return (distance < LOCAL);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"contain(x2, y2) {\n let d = dist (x2, y2, this.x, this.y);\n if (d < this.r * 2) {\n return true;\n }\n else {\n return false;\n }\n }",
"function onTopOf(obj) {\n\t\treturn (!(this.x + this.boundingBox.left >= obj.x + obj.boundingBox.right ||\n\t\t\tthis.x + this.boundingBox.right <= ... | [
"0.6589865",
"0.62558657",
"0.6187203",
"0.618347",
"0.61502504",
"0.61384284",
"0.6103216",
"0.60907876",
"0.60883397",
"0.60855705",
"0.6055404",
"0.6031699",
"0.60274297",
"0.59968865",
"0.59753805",
"0.59684956",
"0.59684956",
"0.5959778",
"0.5958104",
"0.5950107",
"0.594... | 0.77356815 | 0 |
Force that makes Boids want to group together | function group(boid) {
boidCenter = new THREE.Vector3();
numBoids = 0;
for(k=0;k<boids.length;k++) {
if(isNearby(boid, boids[k])) {
boidCenter.add(boids[k].position);
numBoids += 1;
}
}
if (numBoids > 0) {
//Get the centoid of the group
boidCenter.divideScalar(numBoids);
to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function group_comms() {\n // Create an array of all committees\n // These are the names associated with the \n // nodes on the chart.\n // We'll pull out the top 'ntop' comms after the first generation\n comm_group={}; // reset\n comm_type={}; //reset\n for (i=0; i < nc; i++) {\n mycan... | [
"0.57775646",
"0.55936384",
"0.55249846",
"0.54913163",
"0.54895365",
"0.54299146",
"0.53672844",
"0.5287636",
"0.52619797",
"0.52573967",
"0.524528",
"0.5226775",
"0.52166307",
"0.5167542",
"0.51585096",
"0.513705",
"0.5122773",
"0.51187396",
"0.5108772",
"0.50822073",
"0.50... | 0.64638406 | 0 |
Force that makes Boids want to avoid each other | function avoid(boid) {
avoidBoids = new THREE.Vector3();
numBoids = 0;
for(k=0;k<boids.length;k++) {
if(isNearby(boid, boids[k])) {
//Direction away from this boid
awayFromBoid = boid.position.clone().sub(boids[k].position);
//Scale inverse of distance to boid
distance = boid.positi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function kindle(ob1, ob2){\r\n if(!ob1.weldJoint){\r\n var dis=b2Vec2.distance(ob1.body.GetPosition(), ob2.body.GetPosition());\r\n if(dis<1){\r\n ob1.flame=true;\r\n // console.info(ob1.flame);\r\n }\r\n }\r\n}",
"flock(boids){\n\t\tlet alignment = this.align(boids);\n\t\tlet cohesion = thi... | [
"0.5946217",
"0.59245205",
"0.57624435",
"0.575814",
"0.5663914",
"0.5663914",
"0.5634894",
"0.5601049",
"0.5573313",
"0.5523005",
"0.5487347",
"0.5413303",
"0.54075974",
"0.5370421",
"0.5369551",
"0.53632456",
"0.5344496",
"0.53363013",
"0.53336847",
"0.5284399",
"0.5283949"... | 0.6848357 | 0 |
Update boid's position and move mesh to new position | function move(boid) {
boid.position.add(boid.direction.multiplyScalar(SPEED));
boid.mesh.position = boid.position.clone();
boid.mesh.lookAt(boid.direction.clone().multiplyScalar(10000));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update_boid_mesh(boid, mesh) {\n boid.run();\n mesh.rotation.y = Math.atan2( - boid.velocity.z, boid.velocity.x );\n mesh.rotation.z = Math.asin( boid.velocity.y / boid.velocity.length() );\n mesh.position.copy(boid.position);\n color = mesh.material.color;\n color.r = color.g = color.b ... | [
"0.731187",
"0.71543074",
"0.68222904",
"0.6768272",
"0.6597356",
"0.65066624",
"0.6505606",
"0.6488562",
"0.64812636",
"0.639578",
"0.6393762",
"0.635465",
"0.63452137",
"0.6309442",
"0.6279105",
"0.62764794",
"0.6240524",
"0.6229379",
"0.6226147",
"0.6209113",
"0.6198988",
... | 0.8032003 | 0 |
Check if all viruses are gone. | function hasViruses() {
for (var yy = 0; yy < board.h; yy++) {
for (var xx = 0; xx < board.w; xx++) {
if (board.get(xx, yy).type === TileType.virus)
return true
}
}
return false
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clearedAllViruses () {\n return this.numVirusesRemaining == 0\n }",
"function resetVirusValues(){\n \n bayern_virus_value = 0;\n baden_virus_value = 0;\n nrw_virus_value = 0;\n hessen_virus_value = 0;\n niedersachsen_virus_value = 0;\n schleswigholst_virus_value = 0;\n mecklvorp_virus_v... | [
"0.7917828",
"0.56182384",
"0.55759823",
"0.5366432",
"0.5127008",
"0.5111981",
"0.5072512",
"0.5040018",
"0.50343436",
"0.50231254",
"0.4989432",
"0.49855053",
"0.497453",
"0.49686795",
"0.49570674",
"0.49570674",
"0.49419725",
"0.49344864",
"0.49212146",
"0.49209294",
"0.49... | 0.6228209 | 1 |
Define a "box" object | function box(x,y,width,height){
this.x = x;
this.y = y;
this.width = width;
this.height = height;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createBox()\n\t{\n\t\tbox = that.add('rect', {\n\t\t\tcolor: style.boxColor,\n\t\t\tborderWidth: style.borderWidth,\n\t\t\tborderColor: style.borderColor,\n\t\t\tdepth: that.depth\n\t\t}, fw.dockTo(that));\n\t}",
"function Box(id, name, color, x, y) {\n\tthis.id = id;\n\tthis.name = name;\n\tthis.color ... | [
"0.80620694",
"0.7712325",
"0.76599264",
"0.76302356",
"0.7548707",
"0.7536324",
"0.75330484",
"0.74673235",
"0.7350338",
"0.7340799",
"0.73253393",
"0.73121583",
"0.72711825",
"0.72391164",
"0.71957433",
"0.7195541",
"0.71928567",
"0.7067139",
"0.7018459",
"0.70087576",
"0.6... | 0.7824781 | 1 |
Define a "instructions_obj" object | function instructions_obj(x,y,width,height,text,open,name){
this.x = x;
this.y = y;
this.width = width;
this.height = height;
//this.color = color;
this.text = text;
this.open = open;
this.name = name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ExpandoInstructions(){}",
"function ExpandoInstructions() {}",
"function ExpandoInstructions() {}",
"function ExpandoInstructions() {}",
"function ExpandoInstructions() { }",
"function ExpandoInstructions() { }",
"loadInstructions () {\n this.instructionParameters = {\n clearRect: ['ct... | [
"0.6768008",
"0.6499088",
"0.6499088",
"0.6499088",
"0.6480209",
"0.6480209",
"0.61256236",
"0.59851086",
"0.583094",
"0.57252806",
"0.5702452",
"0.56388307",
"0.55982673",
"0.5582396",
"0.5541034",
"0.55329406",
"0.55280286",
"0.55220896",
"0.5516685",
"0.54599935",
"0.54442... | 0.75695837 | 0 |
Define a "conversations_obj" object | function conversations_obj(speaker,text,open,name){
this.speaker = speaker;
this.text = text;
this.open = open;
this.name = name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ConversationList()\n{\n this.conversations = [];\n this.sender = undefined;\n this.recipient = undefined;\n}",
"function Conversation() {}",
"get conversations() {\r\n return new Conversations(this);\r\n }",
"function createConversation(paras){\n let conversations = {};\n pa... | [
"0.68711233",
"0.6704978",
"0.6563865",
"0.63557917",
"0.62241715",
"0.6007521",
"0.600397",
"0.5893604",
"0.5857086",
"0.58087206",
"0.56599957",
"0.55981624",
"0.5577866",
"0.556383",
"0.5531764",
"0.54869455",
"0.5481569",
"0.547633",
"0.5450839",
"0.54462755",
"0.5430126"... | 0.780375 | 0 |
Base event: If the robot is more than the event, it is over. If the robot is less than the event, no more robot. | function click_base_event(event, robot) {
if (robot.level > event.difficulty) {
event.diffuse = true;
event.duration = 10; // Duration of a diffused event is how long it takes to fix.
} else {
robot.dead = true; // Might be too harsh!
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"triggerPulled() {\n if (this.state.traitorInGame && !this.state.showCountdown) {\n Vibration.vibrate();\n this.state.triggersRemaining = this.state.triggersRemaining - 1;\n if (this.state.triggersRemaining <= 0) {\n //Traitor won as tracer ran out of triggers\n this.state.triggersRe... | [
"0.57434636",
"0.5693314",
"0.56670725",
"0.55904704",
"0.55779797",
"0.55627996",
"0.55623305",
"0.55505043",
"0.5536576",
"0.5526331",
"0.5506567",
"0.55052257",
"0.5485635",
"0.54697025",
"0.54329324",
"0.54180163",
"0.5411985",
"0.54016703",
"0.53739035",
"0.5353843",
"0.... | 0.648736 | 0 |
Progress base event by whittling down timer. | function progress_base_event(event) {
event.duration--;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onprogress() {}",
"function updateProgress(oEvent){}",
"updateProgress() {\n var state = this.state;\n\n state.runningTime += state.deltaT;\n\n if (this.duration) {\n state.progress = Math.max(0, Math.min(1, state.runningTime / this.duration));\n }\n }",
"function Ht... | [
"0.6636294",
"0.6629642",
"0.6492538",
"0.6401356",
"0.6401356",
"0.63779235",
"0.63779235",
"0.63779235",
"0.6367927",
"0.6367927",
"0.6346342",
"0.6346342",
"0.6346342",
"0.6233816",
"0.61533284",
"0.61082906",
"0.6048335",
"0.6034027",
"0.6025627",
"0.6024337",
"0.60153836... | 0.797468 | 0 |
Incremental Event: Gets worse. Returns an 'incremental' event. | function create_incremental_event(counter) {
var event = create_base_event(counter);
event.type = "inc";
return event;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nextEventId() {\n\n\t\t\tfunction max(array) {\n\t\t\t\t// keep picking the larger value until it is the largest\n\t\t\t\treturn array.reduce(function (lhs, rhs) {\n\t\t\t\t\treturn rhs > lhs ? rhs : lhs;\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// find the next integer after the largest ID in our store\n\t\t\tretu... | [
"0.5424252",
"0.540007",
"0.53960663",
"0.51646405",
"0.5141293",
"0.5131725",
"0.47961628",
"0.4741921",
"0.4741921",
"0.47295284",
"0.46833876",
"0.462513",
"0.46133313",
"0.45695478",
"0.45614034",
"0.45532662",
"0.45285785",
"0.4527377",
"0.4500814",
"0.44946203",
"0.4492... | 0.63203084 | 0 |
CALCULATE BILL The function takes a bill, a VAT percent and a tip percent and returns the total bill, formatted as a currency string. | function calculateBill (bill, VATrate, TipRate) {
var tip = (TipRate / 100) * bill;
var vat = (VATrate / 100) * bill;
return '£' + (bill + tip + vat).toFixed(2);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tipCalculator(bill) {\n var percentage;\n if (bill < 50) {\n percentage = 0.2;\n } else if (bill >= 50 && bill < 200) {\n percentage = 0.15;\n } else {\n percentage = 0.1;\n }\n return percentage * bill;\n}",
"function calculateTip(totalBill,totalPercentage){\n\n var amountTip = (totalBi... | [
"0.7215663",
"0.7215105",
"0.71756536",
"0.7083627",
"0.70673615",
"0.70673615",
"0.70624954",
"0.70018446",
"0.69782317",
"0.69089675",
"0.69087166",
"0.69012886",
"0.68818146",
"0.68739194",
"0.68141174",
"0.67598915",
"0.67388475",
"0.6732563",
"0.67226124",
"0.6668544",
"... | 0.744194 | 0 |
fetch admins, ensure twilio sid and return admins | function prepareAdmins() {
return store.getAdmins().then(admins => !admins
? Promise.resolve([]) : Promise.all(
admins.map(admin => chatService.ensureUser(admin).then(sid => ({ ...admin, twilio: { sid } }) ))
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getAllAdmins(){\r\n\r\n try{\r\n const admins = await Admin.find();\r\n return [200, admins];\r\n }catch{\r\n return [500, 'SERVER ERROR: couldn\\'t get all admins'];\r\n }\r\n \r\n }",
"function _admins(req,res,next){\n\tCommon.ensureUserInSessio... | [
"0.7052196",
"0.67852324",
"0.6671282",
"0.6506486",
"0.6467453",
"0.642057",
"0.6160306",
"0.61391723",
"0.61391634",
"0.60862017",
"0.5961569",
"0.5944214",
"0.5942714",
"0.59351116",
"0.5932602",
"0.59160465",
"0.5877731",
"0.5777016",
"0.5773031",
"0.5746965",
"0.57281417... | 0.7691397 | 0 |
Function to carry out steps if the response in the previous trial was correct | function responseWasCorrect(){
//Set the incorrect streak counter to zero
incorrectStreakCounter = 0;
//Increment the streak counter for correct responses
correctStreakCounter++;
//If it reaches the down threshold, then determine the step size and reset streak counter to zero.
if(correctStreakCount... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function continueReponse() {\n // Check if the answer text says 'CORRECT' to determine the next step.\n if (dataContainers.answer.innerText == \"CORRECT\") {\n getStat(); \n }\n else {\n saveScore();\n window.location.href = \"/gameover.html\";\n }\n}",
"function correctResponse() {\n score += 1... | [
"0.67104",
"0.6670894",
"0.66586643",
"0.6413526",
"0.6339781",
"0.63003004",
"0.6296899",
"0.62817776",
"0.6278599",
"0.62780696",
"0.6234481",
"0.6224693",
"0.61912394",
"0.61823004",
"0.61505675",
"0.6150248",
"0.614417",
"0.61376196",
"0.61311674",
"0.6111213",
"0.610868"... | 0.699223 | 0 |
Function to change the stimuli step size according to PEST | function changeStepSizePEST(){
//Variable to store if this step is a reversal of the previous step
var reversal;
//For the first step, just set the reversal to false
if (firstStep){
reversal = false;
//Change firstStep to be false because subsequent steps will have a previousStepDirection to compare... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setStepSize(value){\n stepSize = parseInt(value);\n }",
"setStepSize(stepSize) {\n this.stepSize = stepSize;\n }",
"setStepSize(stepSize) {\n this.stepSize = stepSize;\n }",
"function halveStepSize(){\n\t\t//Check to make sure that it is above the minimum\n\t\tif(currentStepSiz... | [
"0.69620055",
"0.65466315",
"0.65466315",
"0.65130633",
"0.6146011",
"0.6106665",
"0.60093665",
"0.59627855",
"0.5935942",
"0.5896658",
"0.58568776",
"0.576003",
"0.57140964",
"0.56146306",
"0.55241084",
"0.55235016",
"0.54582226",
"0.54503596",
"0.54503596",
"0.54503596",
"0... | 0.70455986 | 0 |
Function to make sure that the intensity is still in range | function intensityInRange(theintensity){
return ((theintensity <= upperIntensityLimit) && (theintensity >= lowerIntensityLimit));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decreaseIntensity(){\n\t\t//Check that it will still be in the range after decrease\n\t\tif(intensityInRange(currentIntensity - currentStepSize)){\n\t\t\tcurrentIntensity -= currentStepSize;\n\t\t\t\n\t\t\t//Set the variable to keep track that we have not hit the limit such that we update the step size\n\... | [
"0.7051953",
"0.6323403",
"0.59737724",
"0.5924244",
"0.58168066",
"0.5770467",
"0.5751859",
"0.5737592",
"0.5716461",
"0.5707792",
"0.568952",
"0.5676103",
"0.5592587",
"0.5564241",
"0.55334616",
"0.5530053",
"0.5501379",
"0.54552555",
"0.5447931",
"0.5418589",
"0.5397762",
... | 0.68017024 | 1 |
Function that halves the step size | function halveStepSize(){
//Check to make sure that it is above the minimum
if(currentStepSize * 0.5 > minimumStepSize){
currentStepSize *= 0.5;
console.log("Step size halved.");
}
//If not, then set it to the minimum
else{
console.log("Minimum step size reached. Setting currentStepSize to minimumSte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doubleStepSize(){\n\t\t//Check to make sure that it is above the minimum\n\t\tif(currentStepSize*2 < maximumStepSize){\n\t\t\tcurrentStepSize *= 2;\n\t\t}\n\t\t//If not, then set it to the maximum\n\t\telse{\n\t\t\tconsole.log(\"Maximum step size reached. Setting currentStepSize to maximumStepSize.\");\n\... | [
"0.6898381",
"0.6256347",
"0.62443507",
"0.61660695",
"0.6117342",
"0.60404557",
"0.5916762",
"0.5904339",
"0.588242",
"0.58655894",
"0.5863567",
"0.5834121",
"0.5834121",
"0.576892",
"0.5726501",
"0.5695732",
"0.56595194",
"0.5514404",
"0.54800355",
"0.5469506",
"0.5432783",... | 0.8231319 | 0 |
Function that doubles the step size | function doubleStepSize(){
//Check to make sure that it is above the minimum
if(currentStepSize*2 < maximumStepSize){
currentStepSize *= 2;
}
//If not, then set it to the maximum
else{
console.log("Maximum step size reached. Setting currentStepSize to maximumStepSize.");
currentStepSize = maximumStep... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function halveStepSize(){\n\t\t//Check to make sure that it is above the minimum\n\t\tif(currentStepSize * 0.5 > minimumStepSize){\n\t\t\tcurrentStepSize *= 0.5;\n\t\t\tconsole.log(\"Step size halved.\");\n\t\t}\n\t\t//If not, then set it to the minimum\n\t\telse{\n\t\t\tconsole.log(\"Minimum step size reached. Se... | [
"0.7059604",
"0.693609",
"0.67386323",
"0.6658378",
"0.6540016",
"0.65221715",
"0.62129647",
"0.62129647",
"0.616714",
"0.6157472",
"0.60689586",
"0.6022916",
"0.5950899",
"0.59060156",
"0.5871832",
"0.5871832",
"0.5871832",
"0.5870815",
"0.58455825",
"0.58348376",
"0.5830894... | 0.73197633 | 0 |
Function to decrease the intensity by the step size | function decreaseIntensity(){
//Check that it will still be in the range after decrease
if(intensityInRange(currentIntensity - currentStepSize)){
currentIntensity -= currentStepSize;
//Set the variable to keep track that we have not hit the limit such that we update the step size
limitHit = false;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function increaseIntensity(){\n\t\t//Check that it will still be in the range after increase\n\t\tif(intensityInRange(currentIntensity + currentStepSize)){\n\t\t\tcurrentIntensity += currentStepSize;\n\t\t\t\n\t\t\t//Set the variable to keep track that we have not hit the limit such that we update the step size\n\... | [
"0.64626026",
"0.60982037",
"0.5887268",
"0.5860973",
"0.5858506",
"0.5849268",
"0.57816255",
"0.5757084",
"0.5732431",
"0.57271403",
"0.56660503",
"0.56550026",
"0.5644192",
"0.56247044",
"0.55609363",
"0.5559491",
"0.5548809",
"0.55363035",
"0.55122465",
"0.55122465",
"0.54... | 0.7594841 | 0 |
Function to decrease the intensity by the step size | function increaseIntensity(){
//Check that it will still be in the range after increase
if(intensityInRange(currentIntensity + currentStepSize)){
currentIntensity += currentStepSize;
//Set the variable to keep track that we have not hit the limit such that we update the step size
limitHit = false;
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decreaseIntensity(){\n\t\t//Check that it will still be in the range after decrease\n\t\tif(intensityInRange(currentIntensity - currentStepSize)){\n\t\t\tcurrentIntensity -= currentStepSize;\n\t\t\t\n\t\t\t//Set the variable to keep track that we have not hit the limit such that we update the step size\n\... | [
"0.7594841",
"0.60982037",
"0.5887268",
"0.5860973",
"0.5858506",
"0.5849268",
"0.57816255",
"0.5757084",
"0.5732431",
"0.57271403",
"0.56660503",
"0.56550026",
"0.5644192",
"0.56247044",
"0.55609363",
"0.5559491",
"0.5548809",
"0.55363035",
"0.55122465",
"0.55122465",
"0.545... | 0.64626026 | 1 |
/This function is use to add one row dynamicly tabObj : Target table colNum: The number of columns that of a row in table sorPos: The source of the new row. targPos: The position where the new row will be added. | function addRow(tabObj,colNum,sorPos,targPos,Hidden){
var nTR = tabObj.insertRow(tabObj.rows.length-targPos); // Insert a new row into appointed table on the
//appointed position.
var TRs = tabObj.getElementsByTagName('TR'); // Get TRs collection from the appointed table
var sorTR = TRs[sorPos]; // ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addRow () {\r\n var td; var tr = thisTable.document.createElement('tr');\r\n var t = thisTable.document.getElementById('tabulated_data');\r\n // create the td nodes for the new row\r\n // for each td node add the object variable like ?v0\r\n for (var i=0; i<numCols; i++)... | [
"0.64906114",
"0.6306228",
"0.6264159",
"0.62229556",
"0.6188443",
"0.61557794",
"0.61399317",
"0.61024374",
"0.60998845",
"0.5961625",
"0.5960126",
"0.5933104",
"0.5925778",
"0.5915996",
"0.5904421",
"0.58883834",
"0.5877997",
"0.58762836",
"0.58525956",
"0.58372045",
"0.583... | 0.72373194 | 0 |
/ This function is use to remove appointed row in appointed table tabObj: the appointed table targPos: target row position btnObj: currently clicked delete image button | function deleteRow(tabObj,targPos,btnObj){ //Remove table row
for(var i =0; i<tabObj.rows.length;i++){
if(tabObj.getElementsByTagName('img')[i]==btnObj){
tabObj.deleteRow(i+targPos);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeRow2(oButton) {\n let empTab = document.getElementById('empTable2');\n empTab.deleteRow(oButton.parentNode.parentNode.rowIndex); // buttton -> td -> tr\n}",
"function removeRow3(oButton) {\n let empTab = document.getElementById('empTable3');\n empTab.deleteRow(oButton.parentNode.parent... | [
"0.7247651",
"0.7184191",
"0.6968181",
"0.67016757",
"0.664868",
"0.6627023",
"0.65440553",
"0.6508466",
"0.6478544",
"0.6468823",
"0.64633733",
"0.6444715",
"0.64393955",
"0.6419731",
"0.6415047",
"0.64100295",
"0.6406747",
"0.6365413",
"0.632103",
"0.63187146",
"0.631439",
... | 0.825348 | 0 |
Determine which function to use for sorting currencies | function sortByFunc() {
switch (sortBy.field) {
case 'name':
case 'ticker':
if (sortBy.desc === 0) {
return (a, b) => a[sortBy.field].localeCompare(b[sortBy.field])
}
return (a, b) => b[sortBy.field].localeCompare(a[sort... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSortMethod(aimArray){\n // to got sort option\n var sortMethod=$(\"#sortByPrice\").find(\"option:selected\").text();\n\n if(sortMethod==\"Price: low-high\"){\n orderLowtoHigh(aimArray);\n }else if(sortMethod==\"Price: high-low\"){\n orderHightoLow(aimArray);\n }\n}",
"get... | [
"0.6560918",
"0.633157",
"0.6048271",
"0.6020573",
"0.5953495",
"0.5867616",
"0.58359903",
"0.5825984",
"0.58065337",
"0.5777741",
"0.5749721",
"0.5741204",
"0.5732458",
"0.5701989",
"0.56840444",
"0.56782365",
"0.56498206",
"0.5624713",
"0.5616655",
"0.5610081",
"0.5576029",... | 0.68411136 | 0 |
Like `isNaN` but returns `true` for symbols. | function betterIsNaN(s) {
if (typeof s === "symbol") {
return true;
}
return isNaN(s);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isNaN(value) {\n return Number(value) !== value;\n}",
"function isNum(a)\n{ return !(isNaN(a)); }",
"function isNaN(value) {\n\treturn typeof value == 'number' && value != +value;\n}",
"function isNaN$1(obj) {\n return isNumber(obj) && _isNaN(obj);\n }",
"function isNaN$1(obj) {\n return... | [
"0.7087407",
"0.70641285",
"0.69881874",
"0.69445014",
"0.69445014",
"0.69445014",
"0.69445014",
"0.69445014",
"0.69445014",
"0.69445014",
"0.69445014",
"0.69445014",
"0.68661916",
"0.6786409",
"0.67276263",
"0.67132205",
"0.6710277",
"0.66975576",
"0.6674051",
"0.6673399",
"... | 0.80030775 | 0 |
function to return a movie object | function makeMovie(title, release){
var obj = {
title: title,
release: release
};
return obj;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Movie(name,year,genre,cast,description){\n this.name = name\n this.year = year\n this.genre = genre\n this.cast = cast\n this.description = description\n}",
"function Movie(name, year, genre, cast, description){\n this.name = name;\n this.year = year;\n this.genre = genre;\n this.cast = cast;\n... | [
"0.6910575",
"0.6771822",
"0.6762661",
"0.675695",
"0.6736139",
"0.6736139",
"0.67024094",
"0.6669594",
"0.663906",
"0.66252303",
"0.66131437",
"0.6606557",
"0.6547628",
"0.653917",
"0.65387815",
"0.65099084",
"0.6475628",
"0.6399518",
"0.6397357",
"0.63483614",
"0.63413364",... | 0.7671801 | 0 |
Compare function that orders bodies by distance from parent | function compareBodies(a, b){
if (a.distanceFromParent < b.distanceFromParent){
return -1;
}
else if (a.distanceFromParent > b.distanceFromParent){
return 1;
}
else{
return 0;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static compare(left, right) {\n if (left instanceof Position) {\n left = left.pos\n }\n if (right instanceof Position) {\n right = right.pos\n }\n return left - right\n for (let i = 0; i < Math.min(left.atoms.length, right.atoms.length); i++) {\n const diff = compareAtoms(left.atom... | [
"0.63100886",
"0.6066657",
"0.60544705",
"0.604351",
"0.604351",
"0.604351",
"0.604351",
"0.604351",
"0.58818954",
"0.5808588",
"0.5676085",
"0.565462",
"0.56329423",
"0.5627641",
"0.5608565",
"0.55965513",
"0.55965513",
"0.55965513",
"0.55944353",
"0.55944353",
"0.5575359",
... | 0.8224889 | 0 |
Handles speed modification and toast message | function modifySpeed(multiplier){
speedMultiplier = multiplier;
speedMessage = "";
switch (speedMultiplier){
case 1440:
speedMessage = "Speed: 1 day per minute";
break;
case 1440 * 60:
speedMessage = "Speed: 1 day per second";
break;
c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateSpeed()\n {\n // WPM and CPM does not need to be calculated on error\n if (my.current.state == my.STATE.ERROR) {\n return\n }\n\n var goodChars = my.current.correctInputLength\n\n // Determine the time elapsed since the user began typing\n var ... | [
"0.7047163",
"0.69834054",
"0.6975987",
"0.6915403",
"0.68047816",
"0.67818314",
"0.67329323",
"0.66961545",
"0.66770744",
"0.65249896",
"0.6466126",
"0.6437526",
"0.64199203",
"0.63607025",
"0.6301186",
"0.6275094",
"0.62712234",
"0.6218755",
"0.6201699",
"0.6177312",
"0.617... | 0.74319154 | 0 |
Searches the system tree passed for the mesh provided | function findDetails(mesh, sys){
if (sys.mesh == mesh){
return sys;
}
else{
var result = null;
for (var i = 0; result == null && i < sys.children.length; i++){
result = findDetails(mesh, sys.children[i]);
}
return result;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateObjects(system){\n objects.push(system.mesh); \n for (var i = 0; i < system.children.length; i++){\n populateObjects(system.children[i]);\n }\n}",
"function findFirstChildMesh(parent)\r\n{\r\n // find the mesh child\r\n for (var i = 0; i < parent.childCount; i++) {\r\n\r... | [
"0.569346",
"0.55889446",
"0.5413039",
"0.53202456",
"0.5313291",
"0.5082386",
"0.50612533",
"0.5026519",
"0.50223625",
"0.49921837",
"0.49132946",
"0.48872337",
"0.48652977",
"0.48463926",
"0.482438",
"0.47769707",
"0.47678757",
"0.47624996",
"0.4761295",
"0.4757914",
"0.474... | 0.660675 | 0 |
Handles planet selection and toast message | function selectPlanet(mesh){
if (mesh != null){
var details = findDetails(mesh, system);
htmlString = "Name: " + details.name + "<br>" + "Type: " + details.type + "<br>" + "Satellites: " + details.children.length + "<br>" + "Rotation Duration (Days): " + (1 / details.rotationPeriod).toFixed(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function planetClicked(planetId) {\n if(turnData.planetSelection.launchingFleet) {\n //launching a fleet\n if(konquestData.planets[planetId].selected) {\n //Already selected. Do nothing.\n } else {\n selectPlanet(planetId, true);\n prepareFleet(planetId);\n }\n } else {\n //just c... | [
"0.66760176",
"0.6035909",
"0.60217696",
"0.6009301",
"0.5950644",
"0.59124595",
"0.5907109",
"0.5879102",
"0.5869656",
"0.5779968",
"0.5773277",
"0.5769894",
"0.5710625",
"0.56705606",
"0.5663611",
"0.56630886",
"0.56607616",
"0.5653481",
"0.56385493",
"0.5620383",
"0.561328... | 0.6822948 | 0 |
Revolve a given body around its parent | function revolve(body){
if (body.pivot == null){
return;
}
else{
var x = Math.cos(TAU * getDayCompletion() * body.yearLength * speedMultiplier) * body.distanceFromParent;
var z = Math.sin(TAU * getDayCompletion() * body.yearLength * speedMultiplier) * body.distanceFromParent;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function warp(body){\n var p = body.position;\n if(p[0] > spaceWidth /2) p[0] = -spaceWidth/2;\n if(p[1] > spaceHeight/2) p[1] = -spaceHeight/2;\n if(p[0] < -spaceWidth /2) p[0] = spaceWidth/2;\n if(p[1] < -spaceHeight/2) p[1] = spaceHeight/2;\n\n // Set the previous p... | [
"0.5762943",
"0.5378064",
"0.5228965",
"0.51789063",
"0.5157586",
"0.5157321",
"0.5123439",
"0.5122214",
"0.51114047",
"0.5106604",
"0.5104979",
"0.5010788",
"0.49775672",
"0.49751103",
"0.49551517",
"0.49360356",
"0.490945",
"0.4870998",
"0.4867374",
"0.48650464",
"0.4864461... | 0.74248546 | 0 |
Rotate a body on its own y axis | function rotate(body){
if (body.mesh == null){
return;
}
else{
body.mesh.rotation.y = getDayCompletion() * TAU * speedMultiplier * body.rotationPeriod;
for (var i = 0; i < body.children.length; i++){
rotate(body.children[i]);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rotate_y() {\n curr_sin = Math.sin(map.degree);\n curr_cos = Math.cos(map.degree);\n var x = (this.x * curr_cos) + (this.z * curr_sin);\n this.z = (this.x * (-curr_sin)) + (this.z * (curr_cos));\n this.x = x;\n }",
"function rotateY() {\n console.log('rotate about... | [
"0.71734196",
"0.694933",
"0.658459",
"0.64730394",
"0.6466663",
"0.64308906",
"0.64250964",
"0.63959014",
"0.61816025",
"0.61454004",
"0.6145262",
"0.6106052",
"0.6090806",
"0.6086857",
"0.60506415",
"0.6034596",
"0.60252506",
"0.60195994",
"0.5979993",
"0.5971929",
"0.59547... | 0.7208121 | 0 |
fixes a typo, prints and saves a log | function fixTypo(input, output) {
if (ignores && minimatch(input, ignores)) {
return;
}
const match = output.suggestions.join(chalk.grey(", "));
// output.suggestions[0] may have troubles with RegExp, so we try
try {
if (input != output.suggestions[0]) {
hist.write(input + ' -> ' + output.sugg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logCorrection(tweet, correction) {\n console.log(tweet.user.screen_name, \"-\\n\");\n console.log(tweet.text, \"\\n\\n\");\n console.log(\"*\" + correction);\n console.log(\"\\n\\n\\n\\n\");\n}",
"function mistake8() {\n\ttoss();//not even a name\n}",
"function fixProperNoun(noun) {\n\t// ... | [
"0.5687986",
"0.5593083",
"0.5510952",
"0.54734993",
"0.54354197",
"0.5312113",
"0.5307664",
"0.5259131",
"0.5214109",
"0.52099204",
"0.51311785",
"0.51311785",
"0.50343686",
"0.50102043",
"0.4955808",
"0.49301898",
"0.4926659",
"0.4918263",
"0.49140015",
"0.4907077",
"0.4867... | 0.5778649 | 0 |
loops to check typo map and to call `fixTypo` | function fixTypos(data) {
for (var i = 0; i < data.length; ++i) {
if (typoMap.get(data[i].token) == null) {
fixTypo(data[i].token, data[i]);
typoMap.set(data[i].token, true);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processEntriesToTyposDef(entries) {\n const def = isIterable(entries) ? reduceToTyposDef(entries) : entries;\n const result = sanitizeIntoTypoDef(def);\n (0, assert_1.default)(result);\n return result;\n}",
"function checkAll() {\n const input = sentence;\n hanspell.spellCheckByDAUM(input,... | [
"0.6443701",
"0.56163",
"0.5422254",
"0.53480333",
"0.5207492",
"0.50752306",
"0.50225514",
"0.50198984",
"0.50127065",
"0.49838147",
"0.4954866",
"0.492705",
"0.48912913",
"0.48738787",
"0.48496294",
"0.4822442",
"0.48203492",
"0.4820133",
"0.47800142",
"0.47794124",
"0.4779... | 0.7470677 | 0 |
writes fixed sentence to console | function writeFixedSentence() {
process.stdout.write(sentence);
if (sentence[sentence.length - 1] != '\n') {
process.stdout.write('\n');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function print(sentence) {\n \n function fill (str, length, char) {\n return (str.length < length) ? fill(str + char, length, char) : str;\n }\n\n let size = sentence.map((str) => {\n return str.length;\n })\n .reduce((a, b) => {\n return Math.max(a, b);\n });\... | [
"0.6722433",
"0.66894555",
"0.6599912",
"0.6437337",
"0.6399844",
"0.6387174",
"0.6386389",
"0.63368165",
"0.62744796",
"0.621866",
"0.6058673",
"0.6046171",
"0.6044335",
"0.6038106",
"0.60315126",
"0.5992905",
"0.5983559",
"0.59496474",
"0.5946538",
"0.5874107",
"0.584848",
... | 0.809621 | 0 |
reads `.hanspellignores` and sentence from stdin, and calls one of four functions above | function readAndCheck(check) {
try {
var contents = fs.readFileSync(homedir + '/.hanspell-ignore',
'utf8');
contents = contents.replace(/[,{}]/g, '');
contents = "{" + contents.replace(/[\n ][\n ]*/g, ',') + "}";
if (contents.length > 3) {
ignores = contents;
}
} catch (err) {
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function BOT_inputStringProcessing(s) {\r\n\tvar lemstring = (s == \"\") ? \"ping\" : s; // empty output + CR means ping\r\n\tlemstring = BOT_rawStringExtraction(lemstring);\r\n\tBOT_traceString += \"RAW EXTRACT \\\"\" + lemstring + \"\\\"\\n\";\r\n\tlemstring = BOT_englishStringLemmatization(lemstri... | [
"0.60074115",
"0.59390754",
"0.58037615",
"0.56289244",
"0.5628299",
"0.5602468",
"0.55836815",
"0.5563168",
"0.5544418",
"0.55358016",
"0.5527951",
"0.5453283",
"0.5445293",
"0.54419184",
"0.54374784",
"0.54213804",
"0.54186225",
"0.5417275",
"0.5408025",
"0.5405057",
"0.539... | 0.6481786 | 0 |
Hide regions that are not selected | function selectRegions() {
map.data.setStyle(function(feature) {
if(feature.f.regionData &&
((left && feature.f.regionData.scaled < 0.45) ||
(right && feature.f.regionData.scaled > 0.55) ||
(center && feature.f.regionData.scaled >= 0.45 && feature.f.regionData.scaled <= 0.55)
)) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideFilter() {\n svg.selectAll('.coursesoverview_split').remove();\n }",
"function hideSelectedObjects() {\r\n var layers = webMap._layers;\r\n var objectIds;\r\n for (var i = 0; i < layers.length; i++) {\r\n if (layers[i].active) {\r\n objectIds = Object.keys(layers[i].hi... | [
"0.67526555",
"0.6695264",
"0.6675344",
"0.65893114",
"0.6561874",
"0.654699",
"0.65280575",
"0.65280575",
"0.64897233",
"0.64031297",
"0.6382942",
"0.63791925",
"0.6360926",
"0.6271109",
"0.62451154",
"0.6227757",
"0.6168411",
"0.6134245",
"0.61320364",
"0.61032766",
"0.6083... | 0.70813376 | 0 |
Get data from our local json | function getDataFromLocalJson(url, callback) {
fetch(url)
.then(res => res.json())
.then(data => movies = data)
.then(() => callback(movies))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getData(ID){\r\n var filename = \"./src/\"+ID+\".json\";\r\n var data = JSON.parse(fs.readFileSync(filename));\r\n return data;\r\n}",
"function loadData() {\n $.getJSON(\"../Mini-project-2-data.json\", function(json) {\n console.log(json); // this will show the info it in firebug con... | [
"0.6963209",
"0.6957248",
"0.69361347",
"0.69320375",
"0.6930406",
"0.68928003",
"0.68779075",
"0.6847697",
"0.6840134",
"0.6815009",
"0.6789454",
"0.67576957",
"0.67530197",
"0.67343074",
"0.6732451",
"0.67158663",
"0.66944873",
"0.66797805",
"0.66759866",
"0.6674691",
"0.66... | 0.71282095 | 0 |
Returns the number of the slot with the specified name. Returns 1 if there is no such slot. name: string // Slot name Returns number // Slot number or 1 | function number(name) {
var slots = fs.readFileSync(SLOTS_PATH, FS_OPTIONS).split('\n'),
i;
name = ',' + name;
// Search backwards. Added slots are more likely to be at end of slots file.
for (i = slots.length - 1; i >= 0; i -= 1) {
if (slots[i].indexOf(name, slots[i].length - name.length) !== -1) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get(name) {\n if (typeof name === 'string') name = this.store.lookup(name);\n if (this.slots) {\n for (let n = 0; n < this.slots.length; n += 2) {\n if (this.slots[n] === name) return this.slots[n + 1];\n }\n }\n return undefined;\n }",
"name(n) {\n return this.slots[n * 2];\n }... | [
"0.64299065",
"0.6415706",
"0.63062894",
"0.6266712",
"0.6148176",
"0.6055103",
"0.5991294",
"0.5991294",
"0.59803635",
"0.5952763",
"0.5952763",
"0.5813764",
"0.58041847",
"0.5714242",
"0.5657306",
"0.5645297",
"0.56143993",
"0.5591425",
"0.55685425",
"0.5555928",
"0.5509661... | 0.77938104 | 0 |
Builds a request logger, logs req and assigns logger to req.logger | requestLogger(options = defaultLoggerOptions) {
let logger = null;
try {
// make logger avail in requests;
logger = buildLogger(options, this.loggingConf);
} catch (e) {
// so using console as last resort
console.error('Error when creating logger', e); // eslint-disable-line no-conso... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function httpRequestLoggingMiddleware(ctx, next) {\n const { req, res } = ctx;\n\n // skip logs for favicon, which the browser sometimes hits automatically\n if (req.url === '/favicon.ico') return next();\n\n ctx.$.requestStart = +new Date();\n ctx.$.requestId = uuidv4();\n\n const requestInfo = {\n ... | [
"0.64928675",
"0.6204902",
"0.5934991",
"0.5904063",
"0.5874312",
"0.5821932",
"0.5769005",
"0.56658006",
"0.5654333",
"0.5649747",
"0.5609055",
"0.5605044",
"0.558653",
"0.55814266",
"0.55678576",
"0.55559057",
"0.55135095",
"0.54754233",
"0.54679674",
"0.5456167",
"0.541249... | 0.77798086 | 0 |
request approval from MetaMask user | function requestApproval() {
tokenInst.approve(
addrHOLD,
truePlanCost,
{ gasPrice: web3.toWei('50', 'gwei') },
function (error, result) {
if (!error && result) {
var data;
console.log('approval sent to network.');
var url ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"approve(result) { }",
"requestApproval() {\n this.grrAclDialogService_.openRequestClientApprovalDialog(\n this.clientId, undefined, this.suggestedReason);\n }",
"sendOneTouchRequest(user, callback) {\n let url = `/onetouch/json/users/${user.authyID}/approval_requests`;\n\n authy._reque... | [
"0.6705895",
"0.66346943",
"0.64271647",
"0.62516034",
"0.60319626",
"0.6019363",
"0.60114026",
"0.59963644",
"0.5988283",
"0.5942964",
"0.59269357",
"0.5903106",
"0.58653545",
"0.5818719",
"0.5748625",
"0.5715428",
"0.5686358",
"0.5667684",
"0.5652037",
"0.56041",
"0.5572909... | 0.6892808 | 0 |
======================= Frustum Math ====================== RUN MATH FUNCTION | function runMath() {
console.log(
input_diameter1.value, input_diameter1.flag + "\n",
input_diameter2.value, input_diameter2.flag + "\n",
input_lateral.value, input_lateral.flag
)
if(input_diameter1.flag && input_diameter2.flag && input_lateral.flag) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function extractFrustum()\n{\n var mat = mvpMatrix;\n var a = 0, b = 0, c = 0, d = 0;\n var frustum = [null, null, null, null, null, null];\n var mat1 = mat[0];\n var mat2 = mat[1];\n var mat3 = mat[2];\n var mat4 = mat[3];\n var mat5 = mat[4];\n var mat6 = mat[5];\n var mat7 ... | [
"0.6543193",
"0.6118531",
"0.59372926",
"0.57779396",
"0.57758033",
"0.5731468",
"0.5718256",
"0.57076764",
"0.56655633",
"0.5616424",
"0.5605211",
"0.55126077",
"0.55112195",
"0.54974437",
"0.5494001",
"0.5456511",
"0.54262644",
"0.5419688",
"0.53909874",
"0.53883755",
"0.53... | 0.62535423 | 1 |
called everytime a user leaves this is usually where you remove the user's line | function onUserOut(id) {
for(var i=0; i<users.length; i++) {
if (users[i].bodyId == id) {
users[i].line.remove();
users.splice(i, 1);
break;
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onDeleteLine() {\n changeCurrMeme('delete-row');\n initCanvasAndEditor();\n}",
"function onUndo() {\n hideNotification();\n var lastBlacklistedRID = lastBlacklistedTile.rid;\n if (typeof lastBlacklistedRID != 'undefined') {\n isUndoing = true;\n apiHandle.undoMostVisitedDeletion(lastBlack... | [
"0.62668073",
"0.6237556",
"0.618166",
"0.61053544",
"0.6092985",
"0.59288013",
"0.5859422",
"0.5810964",
"0.5805655",
"0.5805655",
"0.57860726",
"0.5771931",
"0.5761297",
"0.57422847",
"0.57422847",
"0.57422847",
"0.5742018",
"0.574095",
"0.5722537",
"0.5713859",
"0.5705919"... | 0.6669872 | 0 |
dispNs displays ns nanoseconds in a humanreadable string. | function dispNs(ns) {
const timeTable = [
[60, 's'],
[60, 'm'],
[60, 'h'],
];
const parts = [];
let v = ns / 1e9;
timeTable.forEach(([div, disp], idx) => {
const part = Math.floor(v % div);
if (part >= 1 || idx === 0) {
parts.unshift(`${part}${disp}`);
}
v = Math.floor(v / di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printNs(n) {\n return +`${n}` + +`${n}${n}` + +`${n}${n}${n}`;\n}",
"function value_label(n) {\n if (n > 1000000) {\n return format1dp(n / 1000000) + 'Bn'\n //return Number(Math.round(n / 100000) / 10) + 'Bn';\n } else if (n > 1000) {\n return format1dp(n / 1000) + 'M'\n return Number(Mat... | [
"0.602143",
"0.55340385",
"0.53995967",
"0.53075004",
"0.52805763",
"0.5236662",
"0.5222837",
"0.5132507",
"0.5123137",
"0.5104255",
"0.5046546",
"0.50461185",
"0.5046089",
"0.5036244",
"0.49809268",
"0.49809268",
"0.49784604",
"0.4957445",
"0.4950067",
"0.49467105",
"0.49440... | 0.82113945 | 0 |
code to populate voice list (mozilla docs) removed the 'voice not available option from the list' does not work in Chrome | function populateVoiceList() {
if (typeof speechSynthesis === 'undefined') {
return;
}
voices = speechSynthesis.getVoices();
for (let i = 0; i < voices.length; i++) {
var option = document.createElement('option');
option.textContent = voices[i].name + ' (' + voices[i].lang + ')';
if (voices[i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateVoiceList() { // Populate the list with the Invoke SpeechSynthesis.getVoices()\n voices = synth.getVoices();\n \n for(i = 0; i < voices.length ; i++) { // Create an option element for each available voice\n ... | [
"0.8263045",
"0.81632817",
"0.8161531",
"0.7955974",
"0.78925896",
"0.7879194",
"0.7820394",
"0.7787091",
"0.76598644",
"0.7343569",
"0.71940434",
"0.7175937",
"0.70735556",
"0.6956653",
"0.68818444",
"0.6864367",
"0.6861554",
"0.6859424",
"0.683419",
"0.68052346",
"0.6775594... | 0.84577364 | 0 |
Updates the stored delay in the database using LIST_OF_STATIONS. | function updateDatabase() {
for (i = 0; i < 100; i++) {
delaycalculator.platsuppslag(LIST_OF_STATIONS[i], database.updateDelay);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateSeconds(site, list){\n if (site in list) {\n count = list[site].intervalSeconds; // getting count\n list[site].intervalSeconds = count + 1; //updates\n totalCount = list[site].totalSeconds;\n list[site].totalSeconds = totalCount +1;\n chrome.storage.local.set({\... | [
"0.5565762",
"0.5522691",
"0.536458",
"0.53584146",
"0.5314525",
"0.52692807",
"0.5261206",
"0.52035123",
"0.5200821",
"0.51917034",
"0.5159309",
"0.5115244",
"0.51040006",
"0.5067799",
"0.50537324",
"0.50473905",
"0.5008702",
"0.4988901",
"0.49740747",
"0.49720562",
"0.49676... | 0.7526025 | 0 |
Generates LIST_OF_STATIONS with the help of callback function extractionCallbackStations. Callback is necessary to catch data when extracted as a snapshot from the database. | function generateStationList() {
database.readCurrentStations(extractionCallbackStations);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function extractionCallbackStations(data) {\n for (var key in data) {\n LIST_OF_STATIONS.push(data[key].station);\n }\n }",
"function getStations() {\n // can choose one of two notification methods, \n // a callback function or an event\n if(stations_event === true) tessel.ne... | [
"0.79324245",
"0.6581918",
"0.64091915",
"0.63099796",
"0.62403053",
"0.61220026",
"0.6044722",
"0.5920925",
"0.5845798",
"0.5833017",
"0.58189905",
"0.57524383",
"0.56390846",
"0.5623279",
"0.5564293",
"0.5545079",
"0.55063885",
"0.5494733",
"0.5452323",
"0.5378301",
"0.5336... | 0.8211368 | 0 |
if strike already in object, add teh new call or put object | function addToStrike(line, strikeHolder){
sortCallsAndPuts(line)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeNewStrike(line, strikeHorder){\n strikeHolder[line.strike] = {};\n strikeHolder[line.strike].numberStrike = line.numberStrike;\n sortCallsAndPuts(line, [strikeHolder[line.strike]]);\n\n }",
"function sortCallsAndPuts(line){\n if(line.option_type == \"put\"){\n strikeHol... | [
"0.70082235",
"0.6361521",
"0.56204534",
"0.5131883",
"0.51318336",
"0.50415415",
"0.5037915",
"0.50359875",
"0.50291806",
"0.5025745",
"0.5025541",
"0.5022709",
"0.50220907",
"0.5020241",
"0.499878",
"0.49785224",
"0.4965571",
"0.49575377",
"0.49327362",
"0.4919801",
"0.4913... | 0.7360283 | 0 |
if strike not already in object, make a new object for the strike THEN add the call or put | function makeNewStrike(line, strikeHorder){
strikeHolder[line.strike] = {};
strikeHolder[line.strike].numberStrike = line.numberStrike;
sortCallsAndPuts(line, [strikeHolder[line.strike]]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addToStrike(line, strikeHolder){\n sortCallsAndPuts(line)\n }",
"function sortCallsAndPuts(line){\n if(line.option_type == \"put\"){\n strikeHolder[line.strike].put = line;\n } else{\n strikeHolder[line.strike].call = line;\n };\n }",
"strike(strikeId) {\n ... | [
"0.7597635",
"0.6462554",
"0.5614626",
"0.5551718",
"0.5502361",
"0.5449711",
"0.5431578",
"0.5430638",
"0.5345088",
"0.529085",
"0.5225819",
"0.51710653",
"0.51278704",
"0.5003618",
"0.493519",
"0.492086",
"0.4913048",
"0.48951784",
"0.4884708",
"0.48826677",
"0.4868087",
... | 0.7702353 | 0 |
mouseenter and mouseleave events required to add css styling to the entire row regardless of whether the main row component or moreInfo row component are hovered, the same styling is applied to both components. CSS does not support a previous sibling selector, therefore, must apply this logic through javascript | mouseenter(e) {
e.preventDefault();
const $listItem = this.$el.prev('tr.list-item');
$listItem.addClass('hover');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function comparePageRowHoverOver() {\n var $pageRow = $(this);\n $pageRow.children(\".leftCompareDetails\").children(\".detailText\").children(\".unchangedDetails\").addClass(\"unchangedDetailsVisible\");\n $pageRow.children(\".rightCompareDetails\").children(\".detailText\").children(\".uncha... | [
"0.70494473",
"0.6600535",
"0.64235246",
"0.63851476",
"0.6367098",
"0.63514704",
"0.6345408",
"0.63128465",
"0.6228667",
"0.62055314",
"0.6183431",
"0.6159499",
"0.6117516",
"0.6114069",
"0.60878897",
"0.6030429",
"0.6025775",
"0.5999521",
"0.59875613",
"0.5949881",
"0.59485... | 0.7038983 | 1 |
Downgrade fatal errors to warning if 'fatalaswarning' is enabled in the settings | function mayFatalAsWarning(message, onlyWarnConfig) {
if (
message.fatal &&
typeof onlyWarnConfig['fatal-as-warning'] === 'boolean'
) {
if (onlyWarnConfig['fatal-as-warning']) {
message.fatal = false
}
}
return
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function useWarnings(options) {\n \n }",
"function onwarn(warning) {\n if (warning.code === 'THIS_IS_UNDEFINED') return;\n console.error(warning.message);\n}",
"onwarn(warning, rollupWarn) {\n if (warning.code !== \"CIRCULAR_DEPENDENCY\") rollupWarn(warning);\n }",
"function restoreWarnings (... | [
"0.646512",
"0.6308257",
"0.6234774",
"0.6110254",
"0.607359",
"0.607359",
"0.607359",
"0.607359",
"0.607359",
"0.607359",
"0.607359",
"0.607359",
"0.607359",
"0.6016248",
"0.59923804",
"0.5983808",
"0.5911159",
"0.5855767",
"0.5755064",
"0.56946045",
"0.56946045",
"0.56946... | 0.6627838 | 0 |
helper function to parse out the X and Y values from backgroundPosition | function parseBgPos(bgPos) {
var parts = bgPos.split(/\s/),
values = {
"X": parts[0],
"Y": parts[1]
};
return values;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseBgPos(bgPos) {\r\n var parts = bgPos.split(/\\s/),\r\n values = {\r\n \"X\": parts[0],\r\n \"Y\": parts[1]\r\n };\r\n return values;\r\n }",
"function parseBgPos(bgPos) {\n var parts = bgPos.split(/\\s/),\n valu... | [
"0.8071138",
"0.8034543",
"0.79366446",
"0.7163916",
"0.65074986",
"0.65057075",
"0.6427997",
"0.6238813",
"0.62128633",
"0.6078337",
"0.6064854",
"0.6063204",
"0.6045297",
"0.60205954",
"0.599827",
"0.5934905",
"0.5874449",
"0.587227",
"0.5872076",
"0.5867523",
"0.58663774",... | 0.8054176 | 1 |
chunk, value to be written commonly a buffer converted from the string passed to stream.write | _write(chunk, encoding, callback) {
if (!chunk) {
callback(Error("give me something"))
}
const string = chunk.toString();
console.log(`writing: ${string}`)
callback()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async _write(chunk, enc, next) {\n\t\tvar query;\n\t\tchunk = chunk.toString(this.encoding);\n\t\tvar error = null;\n\t\tfor (let i = 0; i < chunk.length; i++) {\n\t\t\tlet char = chunk[i];\n\t\t\tquery = this.parseChar(char);\n\t\t\ttry{\n\t\t\t\tif(query) await this.executeQuery(query);\n\t\t\t}catch(e){\n\t\t\t... | [
"0.6881005",
"0.6764598",
"0.6744542",
"0.67318463",
"0.6726646",
"0.66764855",
"0.660785",
"0.6566805",
"0.65144455",
"0.6446854",
"0.631912",
"0.62880117",
"0.6260502",
"0.6260502",
"0.6260502",
"0.61679775",
"0.6163509",
"0.6163509",
"0.6163509",
"0.6163509",
"0.6163509",
... | 0.7023939 | 0 |
delete stored pipeline removes selected stored pipeline from store pipelineName String pipeline name to get from the store returns defaultResponse | async deletePipeline(options) {
validator.validateDeletePipeline(options);
const pipeline = await stateManager.getPipeline(options);
if (!pipeline) {
throw new ResourceNotFoundError('pipeline', options.name);
}
return await stateManager.deletePipeline(options);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleDelete() {\n if (currentPipeline && currentPipeline.id) {\n showClearFormDialog(function() {\n deletePipeline(currentPipeline.id, function(err) {\n if (err) {\n showGlobalErrorMessage('Failed to delete pipeline', err);\n } else {\... | [
"0.65771335",
"0.58933747",
"0.583396",
"0.5685631",
"0.567948",
"0.5670296",
"0.56694555",
"0.56340116",
"0.557565",
"0.5541301",
"0.55322534",
"0.5529818",
"0.54717267",
"0.5456595",
"0.5439453",
"0.5396398",
"0.53847617",
"0.534925",
"0.5336658",
"0.53250015",
"0.53138494"... | 0.7255164 | 0 |
get pipeline data from store returns stored pipeline pipelineName String pipeline name to get from the store returns piplineNamesList | async getPipeline(options) {
validator.validateGetPipeline(options);
const pipeline = await stateManager.getPipeline(options);
if (!pipeline) {
throw new ResourceNotFoundError('pipeline', options.name);
}
return pipeline;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pipelineData(pipeline) {\n if (pipeline._embedded.instances[0]) {\n pipeline.is_building = pipeline._embedded.instances[0]._embedded.stages.some(stageIsBuilding);// ? true : false\n pipeline._embedded.instances[0].latest_stage_state_text_class = BUILD_STATE_TEXT_CLASSES[pipeline._embedded.instances... | [
"0.6028574",
"0.5281392",
"0.5266958",
"0.52540535",
"0.51864374",
"0.5004646",
"0.49742183",
"0.48213673",
"0.4774851",
"0.47625747",
"0.47385943",
"0.47258922",
"0.4721805",
"0.4719172",
"0.47144768",
"0.47057095",
"0.4700997",
"0.4695384",
"0.46915287",
"0.46468014",
"0.46... | 0.5652058 | 1 |
add a pipeline adds the given pipeline to the store. pipeline Pipeline pipeline descriptor to be added to the store returns defaultResponse | async insertPipeline(options) {
validator.validateInsertPipeline(options);
const pipe = await stateManager.getPipeline(options);
if (pipe) {
throw new ResourceExistsError('pipeline', options.name);
}
const pipeline = new Pipeline(options);
return await stateMa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pipelineData(pipeline) {\n if (pipeline._embedded.instances[0]) {\n pipeline.is_building = pipeline._embedded.instances[0]._embedded.stages.some(stageIsBuilding);// ? true : false\n pipeline._embedded.instances[0].latest_stage_state_text_class = BUILD_STATE_TEXT_CLASSES[pipeline._embedded.instances... | [
"0.56823903",
"0.5365666",
"0.5296641",
"0.5250272",
"0.51827216",
"0.51731205",
"0.51676893",
"0.51284915",
"0.51284915",
"0.51128274",
"0.51052105",
"0.50747067",
"0.5009395",
"0.49929762",
"0.49824622",
"0.4956087",
"0.4920637",
"0.48971468",
"0.48955905",
"0.48852128",
"0... | 0.59182054 | 0 |
Adds default gitignore options for a Python project based on | addDefaultGitIgnore() {
this.gitignore.exclude('# Byte-compiled / optimized / DLL files', '__pycache__/', '*.py[cod]', '*$py.class', '', '# C extensions', '*.so', '', '# Distribution / packaging', '.Python', 'build/', 'develop-eggs/', 'dist/', 'downloads/', 'eggs/', '.eggs/', 'lib/', 'lib64/', 'parts/', 'sdist/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function repo () {\n opts.git = true\n opts.meta.repo = 'init'\n opts.files.gitignore = true\n }",
"git() {\r\n this.fs.copyTpl(\r\n this.templatePath('_gitignore'),\r\n this.destinationPath('.gitignore'),\r\n this.opts\r\n );\r\n this.fs.copyTpl(\r\n ... | [
"0.62838537",
"0.5949864",
"0.5632885",
"0.55747396",
"0.54895043",
"0.54529077",
"0.54139626",
"0.538229",
"0.53474325",
"0.51633215",
"0.5155316",
"0.5149013",
"0.50948733",
"0.5062412",
"0.5041499",
"0.5013192",
"0.49846923",
"0.49173746",
"0.48812687",
"0.4872865",
"0.486... | 0.7684159 | 0 |
(experimental) Adds a dev dependency. | addDevDependency(spec) {
return this.depsManager.addDevDependency(spec);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function devDeps (argv, next) {\n const opts = { saveDev: true, cache: true }\n install(argv.devDeps, opts, function (err) {\n if (err) return next(err)\n next()\n })\n}",
"addDevDeps(...deps) {\n for (const dep of deps) {\n this.project.deps.addDependency(dep, deps_1.DependencyType.BU... | [
"0.70015275",
"0.6801987",
"0.63963413",
"0.63735235",
"0.6288682",
"0.61021084",
"0.6011322",
"0.5940381",
"0.5858354",
"0.58416367",
"0.58081794",
"0.5759763",
"0.5713994",
"0.5655936",
"0.5584312",
"0.5564566",
"0.5564566",
"0.5521793",
"0.5521793",
"0.5521793",
"0.5521793... | 0.7487414 | 0 |
Nombre edad (validar) sexo (masculino femenino no binario) puesto (programador analista Qa) sueldo (entre 15000 y 70000) La empresa desea saber: se debe informar de existir, o informar que no existe , en el caso que corresponda. a) promedio de sueldos para cada puesto b) el sexo del que percibe el mayor sueldo c) el no... | function mostrar()
{
let nombre;
let edad;
let sexo;
let puesto;
let sueldo;
let seguir;
let contP=0;
let acumP=0;
let contA=0;
let acumA=0;
let contQ=0;
let acumQ=0;
let promedioP=0;
let promedioA=0;
let promedioQ=0;
let sexoMaxSueldo;
let maxSueldo;
let FlagMaxSueldo=1;
let nombreMujerMasSueldo;
let maxSueldoMujer;
l... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function adivinarSexoEstudiante(estudiantes) {\n //valor que se utilizará para comparar\n var resultado = 100000;\n //tupla que almacenará la posición más cercana \n var numeroTupla = 0;\n //for que recorre todos los datos como parámetro de la consulta \n //de la tabla de estudiantes\n for (va... | [
"0.6420408",
"0.61990887",
"0.6172343",
"0.61172813",
"0.610862",
"0.6078236",
"0.60512334",
"0.6037086",
"0.6035547",
"0.6014663",
"0.5956408",
"0.5943006",
"0.5927218",
"0.58938783",
"0.5878432",
"0.5864997",
"0.5861955",
"0.5853693",
"0.583364",
"0.5831707",
"0.582366",
... | 0.66561675 | 0 |
metodos del server config configura prop app | config() {
this.app.set('port', process.env.PORT || 3000); // si hay port set toma ese, si no va al 3000
this.app.use(morgan_1.default('dev'));
this.app.use(cors_1.default());
this.app.use(express_1.default.json()); // met para poder aceptar json de apps clientes (antes body parser)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"config() {\n this.app.set(\"PORT\", process.env.PORT || 3000);\n this.app.use(morgan_1.default(\"dev\")); //Miraremos las peticiones en modo desarrollador.\n this.app.use(cors_1.default()); //Permitira que clientes haga peticiones\n this.app.use(express_1.default.json()); //La app enten... | [
"0.77489656",
"0.7392248",
"0.7343689",
"0.70406127",
"0.69754905",
"0.6951753",
"0.6871087",
"0.6613582",
"0.6564311",
"0.64812785",
"0.64623034",
"0.6329151",
"0.6289683",
"0.62890065",
"0.6288889",
"0.6273628",
"0.6247057",
"0.6242851",
"0.61639065",
"0.6151252",
"0.613009... | 0.76747334 | 1 |
Clear value from managed page. | _clearManagedPageValue() {
this._managedPage = {
controller: null,
controllerInstance: null,
decoratedController: null,
view: null,
viewInstance: null,
route: null,
options: null,
params: null,
state: {
activated: false
}
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clear() {\n _value = null;\n }",
"clear () {\n this.setValue('');\n }",
"clear() {\n this.value = undefined;\n }",
"_clear() {\n this.selectedItem = null;\n\n if (this.allowCustomValue) {\n this.value = '';\n }\n\n this._detect... | [
"0.69206643",
"0.6808538",
"0.6790346",
"0.6698743",
"0.6597206",
"0.6503174",
"0.6464789",
"0.6425993",
"0.6425993",
"0.64188325",
"0.63064164",
"0.6296539",
"0.62679464",
"0.6235502",
"0.62091047",
"0.61767733",
"0.6140351",
"0.6132159",
"0.6124025",
"0.61053413",
"0.608709... | 0.7917823 | 0 |
Iterates over extensions of current controller and switches each one to pageStateManager and clears their partial state. | _switchToPageStateManager() {
const controller = this._managedPage.controllerInstance;
for (let extension of controller.getExtensions()) {
extension.switchToStateManager();
extension.clearPartialState();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_clearManagedPageValue() {\n this._managedPage = {\n controller: null,\n controllerInstance: null,\n decoratedController: null,\n view: null,\n viewInstance: null,\n route: null,\n options: null,\n params: null,\n state: {\n activated: false\n }\n };\n... | [
"0.54151416",
"0.5271221",
"0.5234829",
"0.5078472",
"0.5040174",
"0.50262564",
"0.50219923",
"0.49327216",
"0.49049696",
"0.4895614",
"0.48865208",
"0.48604184",
"0.4848122",
"0.48051614",
"0.4803369",
"0.47954756",
"0.47721282",
"0.475639",
"0.47340524",
"0.46622646",
"0.46... | 0.84060717 | 0 |
This function is used to retrieve history from database | function getHistory() {
var db = getDatabase();
var respath="";
db.transaction(function(tx) {
var rs = tx.executeSql('SELECT history.url FROM history ORDER BY history.uid;');
for (var i = 0; i < rs.rows.length; i++) {
openUrlPage.addHistory(rs.rows.item(i).url)
//cons... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHistory() {\n var pastQueriesJSON;\n pastQueries = localStorage.getItem(storageItem);\n try {\n pastQueriesJSON = JSON.parse(pastQueries);\n if (pastQueriesJSON && typeof pastQueriesJSON === \"object\") {\n return pastQueriesJSON;\n }\n }\n catch (e) {}\n pastQue... | [
"0.7107711",
"0.6960636",
"0.69396937",
"0.6896077",
"0.6877132",
"0.68724674",
"0.6845734",
"0.6840439",
"0.672634",
"0.66896826",
"0.6688091",
"0.66552067",
"0.6631104",
"0.6627706",
"0.6594861",
"0.65791553",
"0.6550802",
"0.6442551",
"0.64400566",
"0.6422639",
"0.6407407"... | 0.82248574 | 0 |
Update the known topics. | function updateTopics(topics) {
topics.forEach(function(d, i) { d.r = Math.max(12, r(d.count)); }); // min. collision
force.nodes(data.topics = topics).start();
updateNodes();
updateLabels();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateTopics(topics) {\n topics.forEach(function(d, i) { d.r = Math.max(12, r(d.count)); }); // min. collision\n force.nodes(data.topics = topics).start();\n updateNodes();\n updateLabels();\n }",
"function updateTopics(topics) {\n topics.forEach(function(d) {\n d.r = ... | [
"0.72805154",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
"0.7189533",
... | 0.72191924 | 1 |
Update the active topic. | function updateActiveTopic(topic) {
if (activeTopic = topic) {
node.classed("g-selected", function(d) { return d === topic; });
updateMentions(findMentions(topic));
d3.select("#g-topic").text((topic.count > maxMentions ? "A sampling of " : topic.count || "No") + " mentions of " + topic.name + ".");
} el... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\... | [
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"0.6853935",
"... | 0.7263247 | 0 |
Return a random sample of mentions, one per topic. Mentions are returned in chronological order. | function sampleMentions() {
return data.topics
.filter(function(d) { return d.mentions.length; })
.map(function(d) { return d.mentions[Math.floor(Math.random() * d.mentions.length)]; })
.sort(orderMentions);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sampleMentions() {\n return data.parties.map(function(party, i) {\n return data.topics\n .map(function(d) { return d.parties[i].mentions; })\n .filter(function(d) { return d.length; })\n .map(function(d) { return d[Math.floor(Math.random() * d.length)]; })\n .sort(orderMent... | [
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"0.8013811",
"... | 0.8793878 | 0 |
Return displayable mentions for the specified topic. If too many, a random sample of matching mentions is returned. Mentions are returned in chronological order. | function findMentions(topic) {
var mentions = topic.mentions;
if (mentions.length > maxMentions) {
shuffle(mentions).length = maxMentions;
mentions.sort(orderMentions);
}
return mentions;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findMentions(topic) {\n return data.parties.map(function(party, i) {\n var mentions = topic.parties[i].mentions;\n if (mentions.length > maxMentions) {\n shuffle(mentions).length = maxMentions;\n mentions.sort(orderMentions);\n mentions.truncated = true;\n }\n return mentions;\... | [
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"0.7857687",
"... | 0.82210845 | 0 |
Adjacent faces of the vertex with a sharpen face first | function getShiftedAdjacentFaces(vertex, facesTosharpen) {
const adjFaces = vertex.adjacentFaces();
const [first, ...last] = adjFaces;
if (first.inSet(facesTosharpen)) {
return adjFaces;
}
return [...last, first];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"vertexAdjacentFaces() {\n return flatMapUniq(\n this.vertices,\n vertex => vertex.adjacentFaces(),\n 'index',\n );\n }",
"_addAdjoiningFace( vertex, horizonEdge ) {\n\n\t\t// all the half edges are created in ccw order thus the face is always pointing outside the hull\n\n\t\tconst face = ne... | [
"0.69919765",
"0.6268562",
"0.62129873",
"0.62096876",
"0.618195",
"0.61671567",
"0.61417925",
"0.6139427",
"0.6087605",
"0.60444975",
"0.60140646",
"0.6011505",
"0.5987519",
"0.5879113",
"0.58633596",
"0.5861024",
"0.58418363",
"0.58289075",
"0.5807714",
"0.5747828",
"0.5715... | 0.6802808 | 1 |
Set the number of empty bars on the left | setLeftEmptyBarCount (barCount) {
if (!isNumber(barCount) || barCount < 0) {
logWarn('setLeftEmptyBarCount', 'barCount', 'barCount must be a number and greater than zero!!!')
return
}
this._chartPane.chartData().setLeftEmptyBarCount(Math.ceil(barCount))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setRightEmptyBarCount (barCount) {\n if (!isNumber(barCount) || barCount < 0) {\n logWarn('setRightEmptyBarCount', 'barCount', 'barCount must be a number and greater than zero!!!')\n return\n }\n this._chartPane.chartData().setRightEmptyBarCount(Math.ceil(barCount))\n }",
"function initialise... | [
"0.70569396",
"0.6657526",
"0.6434934",
"0.6380675",
"0.63716054",
"0.6251793",
"0.62474847",
"0.62471294",
"0.6197241",
"0.61591244",
"0.6139554",
"0.61063355",
"0.6063584",
"0.5992592",
"0.5961156",
"0.59515285",
"0.5916575",
"0.58731014",
"0.58544713",
"0.58190465",
"0.580... | 0.77570605 | 0 |
Set the number of empty bars on the right | setRightEmptyBarCount (barCount) {
if (!isNumber(barCount) || barCount < 0) {
logWarn('setRightEmptyBarCount', 'barCount', 'barCount must be a number and greater than zero!!!')
return
}
this._chartPane.chartData().setRightEmptyBarCount(Math.ceil(barCount))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setLeftEmptyBarCount (barCount) {\n if (!isNumber(barCount) || barCount < 0) {\n logWarn('setLeftEmptyBarCount', 'barCount', 'barCount must be a number and greater than zero!!!')\n return\n }\n this._chartPane.chartData().setLeftEmptyBarCount(Math.ceil(barCount))\n }",
"checkIfNeedsLastBar() ... | [
"0.69940346",
"0.68479073",
"0.64549094",
"0.63758004",
"0.6367454",
"0.6367219",
"0.6299198",
"0.6229018",
"0.6209207",
"0.6164746",
"0.6096594",
"0.60726315",
"0.6026035",
"0.60162866",
"0.60159045",
"0.59684104",
"0.59324026",
"0.5897673",
"0.5890709",
"0.58590496",
"0.584... | 0.7282062 | 0 |
When the scene changes or tracks are added to the track set, update which track is visible and physically interactive. | updateActiveTrack( scene ) {
for ( let i = 0; i < this.tracks.length; i++ ) {
const track = this.tracks.get( i );
track.physicalProperty.value = ( i === scene );
// Reset the skater when the track is changed, see #179
this.skater.returnToInitialPosition();
// make sure th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"changeTracks() {\n // keeps track of the new Tracks to be rendered\n let newTrackList = [];\n // keeps track of the indexes of the Tracks to update our global currentTracks rendered\n let newTrackIndexes = [];\n\n for (let i = 1; i < this.totalTracks; i++) {\n // Check... | [
"0.6391417",
"0.61653703",
"0.5920684",
"0.5837904",
"0.57104486",
"0.56138664",
"0.5592995",
"0.5583281",
"0.5570591",
"0.5568939",
"0.5531648",
"0.5492937",
"0.54832494",
"0.5480909",
"0.54275686",
"0.5403895",
"0.5398702",
"0.53964996",
"0.539597",
"0.5378474",
"0.53698754... | 0.70839185 | 0 |
Reset all of the tracks in this model's track set, if they are configurable. Otherwise, identical to super function. | reset() {
super.reset();
this.tracks.forEach( track => {
if ( track.configurable ) {
track.reset();
}
} );
this.sceneProperty.reset();
this.updateActiveTrack( this.sceneProperty.get() );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resetPlays(){\n this.playsValues = [];\n this.playsCoords = [];\n }",
"function reset_player() {\r\n\r\n //reset of the local track object.\r\n local_track = {\r\n \"id\": \"\",\r\n \"name\": \"...\",\r\n \"artists\": [{ \"name\": \"...\" }],\r\n \"paused\": true,\r\n ... | [
"0.6230159",
"0.6106161",
"0.5980407",
"0.5913192",
"0.58646095",
"0.57813764",
"0.5764321",
"0.57186615",
"0.5716995",
"0.5713944",
"0.56873614",
"0.56767726",
"0.56748",
"0.5612007",
"0.55929255",
"0.55702764",
"0.5541524",
"0.5527304",
"0.55263066",
"0.550897",
"0.54807645... | 0.7958167 | 0 |
Recursively traverse the document body looking for headings | function findHeadings(root, sects)
{
for (var c = root.firstChild; c != null; c = c.nextSibling)
{
if (c.nodeType !== 1)
continue;
//if (c.tagName.length == 2 && c.tagName.charAt(0) == "H")
// ================= 判断tagName是否在设置的标签里面
if (i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getHeadings(htmlBody) {\n const $ = cheerio.load(htmlBody);\n const headings = $('h2');\n return _.map(headings, heading => {\n const $el = $(heading);\n\n return {\n title: $el.text(),\n anchor: $el.attr('id'),\n };\n });\n }",
"function hasInnerHeadings(elm) {\n ... | [
"0.6469749",
"0.6202174",
"0.59186435",
"0.5883328",
"0.5823692",
"0.5803814",
"0.57300204",
"0.5701929",
"0.5567324",
"0.55546564",
"0.55502975",
"0.554723",
"0.5533672",
"0.5489293",
"0.5389786",
"0.5386563",
"0.5381303",
"0.53808373",
"0.5379767",
"0.53551877",
"0.5341542"... | 0.6325588 | 1 |
load the arrays of peopleSelectionRanges and enemySelectionRanges | function insertCharactersRanges() {
let newObj;
let max_people = 0;
let max_enemy = 0;
for(let i=0; i < characters.length; i++){
let min_people = max_people + 1;
let min_enemy = max_enemy + 1;
// Enemy
max_enemy = max_enemy + characters[i].enemyChance;
newObj =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Selection (ranges) {\n this.ranges = ranges || [];\n }",
"_dumpRanges() {\n var text = \"Ranges:\";\n\n for (var i = 0; i < this.__selectedRangeArr.length; i++) {\n var range = this.__selectedRangeArr[i];\n text += \" [\" + range.minIndex + \"..\" + range.maxIndex + \"]\";\n ... | [
"0.56259614",
"0.55233115",
"0.5451343",
"0.5402773",
"0.53271335",
"0.5267635",
"0.5266829",
"0.5255291",
"0.5242079",
"0.5188168",
"0.5110109",
"0.51096207",
"0.50638974",
"0.5003409",
"0.49961174",
"0.49836352",
"0.4974219",
"0.49668252",
"0.49651608",
"0.49625188",
"0.494... | 0.6189206 | 0 |
check the number of greeting people, and increase the satisfaction rate accoringly | function increaseSatisfactionByGreeting() {
if(this.game.time.now > nextCheckGreetingStatus)
{
peopleCountGreeting = 0;
// first get the new count of greeting people by selecting the standing people
let standingPeople = people.filter(x => x.currentAnimation == "stand" && x.isInsidethe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gryffindor() {\n gryffindorScore += 1;\n questionCount += 1;\n if (questionCount >= 3) {\n updateResult();\n }\n}",
"function tellFortune () {\n var number = Math.floor(Math.random() * 3) + 1;\n \n if (number === 1) {\n alert(\"You will befriend a stranger at lunch today.\")\n // documen... | [
"0.68759775",
"0.6250829",
"0.6071384",
"0.6008783",
"0.59887296",
"0.59398544",
"0.5904109",
"0.5878498",
"0.5875809",
"0.5835518",
"0.5831627",
"0.5805638",
"0.58050305",
"0.5802774",
"0.5802389",
"0.5783455",
"0.57758325",
"0.5759769",
"0.57268125",
"0.57266605",
"0.571373... | 0.7971639 | 0 |
Update the vaues of Health bar, Satisfaction bar, and Boss' Messages | function updateTopMenuValues(playerHealth, bossHealth){
// Update the Healthbar values
setHealthbarValues(playerHealth, bossHealth);
// Update the value of the satisfaction bar based on its current value
setSatisfactionBarValue();
// Set the text message
generateMessage();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateStats() {\n $(\"#fighterhealth\").text(\"HP:\\xa0\" + fighterHP);\n $(\"#defenderhealth\").text(\"HP:\\xa0\" + defenderHP);\n }",
"function updateStats()\n{\n updateGoalAttempts();\n updateShotsOnGoal();\n updateShotsOffGoal();\n updateBlockedShots();\n updateCorners();\n ... | [
"0.6747639",
"0.67270905",
"0.65839744",
"0.64660513",
"0.6369053",
"0.63575417",
"0.6345802",
"0.63338155",
"0.6283382",
"0.62581587",
"0.62533957",
"0.6211385",
"0.6152702",
"0.6136758",
"0.60938007",
"0.607897",
"0.6064254",
"0.6051211",
"0.6046316",
"0.6043782",
"0.603638... | 0.75797576 | 0 |
change the satisfaction bar value | function setSatisfactionBarValue(){
// only animate the bar if the satifaction value has changed
if(satisfactionLastRate != satisfactionRate){
satisfactionBar.animate(satisfactionRate);
satisfactionLastRate = satisfactionRate;
}
if(satisfactionRate == 0)
gameOver("fired");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setBar(val){\n\t\tthis.status = val;\n\t\tthis.clampScale();\n\t\tthis.blueBar.scale.setTo(this.status, .617);\n\t}",
"function editBar() {\n if (inputValue == 0 || inputValue > 10) {\n barValueWarning = \"Value must be between 1 and 10\"\n } else { \n numbers[parseInt(selectedBar) - 1] = par... | [
"0.63042647",
"0.61693114",
"0.6140217",
"0.60750455",
"0.60672843",
"0.60021853",
"0.59367675",
"0.5849513",
"0.5822417",
"0.5786092",
"0.57363105",
"0.5698906",
"0.56959146",
"0.5695515",
"0.5691901",
"0.56271225",
"0.5625714",
"0.5602392",
"0.5602163",
"0.55766743",
"0.556... | 0.76374006 | 0 |
Removes credit card by it's number in the pointed account. | removeCreditCard(accountId, creditCardNumber) {
return this.remotePaymentAPI.remove({accountId: accountId, creditCardNumber: creditCardNumber}).$promise;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteCard() {\n var customerMgr = require('dw/customer/CustomerMgr');\n var registeredUsers = customerMgr.queryProfiles(\"\", \"customerNo ASC\");\n for each(var user in registeredUsers) {\n var wallet = user.getWallet();\n var creditCardsSaved = wallet.getPaymentInstruments('CREDI... | [
"0.70430213",
"0.6524581",
"0.6227947",
"0.6141101",
"0.6070452",
"0.60368973",
"0.6029524",
"0.59893954",
"0.5976442",
"0.59592164",
"0.5947903",
"0.5919",
"0.5856545",
"0.57507765",
"0.5747002",
"0.5723526",
"0.5714144",
"0.56812704",
"0.5663675",
"0.56628376",
"0.56612325"... | 0.73355573 | 0 |
GENERIC FUNCTIONS END/////////////////// / / / / / ///////////////PERSONAL INFORMATION STARTS/////////////////////// function to insert top part. It accepts data as a JSON object and inserts the object in to the web page | function insertTopPart(data,locateProPic)
{
var topPart="";
topPart+='<div class="col-md-2" id="personPicture">';
var num=Math.random();
if(data.profilePicExists==1)
{
topPart+='<a href="'+commonURLAbout+userIdFromURL+'" title="'+data.name+'" class=""><img src="/4pi/img/proPics/'+data.userIdHash+'.jpg?v='+num... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CreateOtherData(ppl_object)\n{\n//name and title\n\tvar string=\"\";\n\tfor ( key in ppl_object)\n\t{\n\t\tstring+=\"<br> <b>\"+ ppl_object[key][\"title\"] + \": </b>\" +ppl_object[ key][\"name\"];\n\t}\n\treturn string;\n}",
"function addJSONToPage(jsonData){\n\t//Console log my data\n\tconsole.log(jso... | [
"0.6052228",
"0.58112186",
"0.57358754",
"0.5709799",
"0.5675369",
"0.5668858",
"0.56021726",
"0.5514332",
"0.55041546",
"0.5488092",
"0.5484067",
"0.54663396",
"0.5430896",
"0.5430749",
"0.5423253",
"0.54037404",
"0.5391089",
"0.53899425",
"0.5375543",
"0.53707004",
"0.53619... | 0.6556364 | 0 |
disable label clicks when dragging | function onLabelClickDragging( event ) {
event.preventDefault();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"disable() {\n this.annotation.onMousedown = {};\n this.annotation.borderColor = 'rgba(150, 150, 150, 0.7)';\n this.annotation.label['backgroundColor'] = 'rgba(150, 150, 150, 0.7)';\n }",
"__preventDuplicateLabelClick() {\n const inputClickHandler = (e) => {\n e.stopImmediatePropagation();\n... | [
"0.681121",
"0.6682119",
"0.65400404",
"0.6480055",
"0.64524245",
"0.64457834",
"0.6445587",
"0.64450055",
"0.64121",
"0.63786364",
"0.6369926",
"0.6369926",
"0.6369926",
"0.63324726",
"0.63011754",
"0.6291876",
"0.6288369",
"0.62834835",
"0.62623554",
"0.6253152",
"0.6251395... | 0.8332244 | 0 |
Called when the "submit" event is triggered on the "uploadimageform" | function onSubmitUploadImageForm () {
// Get the form element
var form = document.getElementById("upload-image-form")
// Get the file input field (which we know is the first)
var input = form.elements[0]
// Loop from 0 to the number of files uploaded
for (var i = 0; i < input.files.length; i++) {
// Get the "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formSubmit(event) {\n event.preventDefault(); // the page won't reload\n refreshImages();\n }",
"function handleSubmit(e) {\n e.preventDefault();\n if (image) {\n imageUpload();\n } else {\n collectFields();\n }\n }",
"function onAddNewImageFormSubmit() {\n l... | [
"0.75594765",
"0.74544007",
"0.7437714",
"0.7339168",
"0.7197635",
"0.7177256",
"0.71076405",
"0.70883304",
"0.6924514",
"0.68951774",
"0.68951774",
"0.6813146",
"0.67494535",
"0.67493165",
"0.6710561",
"0.667814",
"0.66373295",
"0.6621283",
"0.66205806",
"0.6602934",
"0.6574... | 0.8043264 | 0 |
Method to save the given file input | function saveFileInput(fileInput) {
// Create a JavaScript FileReader
var reader = new FileReader()
// Listen for the "loadend" event (when the file reader is done loading)
reader.addEventListener("loadend", function onLoadEnd () {
// Get the binary representation of the loaded file
var binary = reader.result... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_save() {\n let content = this.input.getContent().split(\"</div>\").join(\"\")\n .split(\"<div>\").join(\"\\n\");\n this.file.setContent(content);\n\n // create new file\n if (this.createFile)\n this.parentDirectory.addChild(this.fi... | [
"0.67639",
"0.6688678",
"0.65984964",
"0.6576133",
"0.6380518",
"0.6360375",
"0.6345235",
"0.6261959",
"0.62591964",
"0.61437416",
"0.60423625",
"0.6020523",
"0.60083973",
"0.59999114",
"0.5959079",
"0.5951845",
"0.5931926",
"0.5923403",
"0.5912462",
"0.58966994",
"0.5884623"... | 0.74116594 | 0 |
Returns a JavaScript object representing the stored files through a '.files' property | function getStoredFilesObject () {
// Get the pure JSON from the local storage
var storedFilesJSON = window.localStorage.getItem('joe_storedFiles')
// Return the JSON parsed to a JavaScript object
// If there is no stored JSON we create an empty object, with an empty files array
return JSON.parse(storedFilesJSON)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function valueOf() {\n return this.files\n}",
"function files() {\n _throwIfNotInitialized();\n return props.files;\n}",
"get files() {\n return this._files;\n }",
"getFiles() {\n const {\n files\n } = this.getState();\n return Object.values(files);\n }",
"get files() {\r\n ... | [
"0.6904411",
"0.67631006",
"0.6698167",
"0.6601912",
"0.65523213",
"0.6398317",
"0.63854206",
"0.63716906",
"0.63105226",
"0.6260591",
"0.6188062",
"0.6161202",
"0.60600895",
"0.60301006",
"0.6020048",
"0.60071886",
"0.6003117",
"0.6000817",
"0.59634095",
"0.5893673",
"0.5880... | 0.7797295 | 0 |
This graph rewrite rule tries to identify the PRelu structure generated by tf.keras, and convert it to tfjs core prelu op. The formula of PReLU is: f(x) = alpha x for x = 0. `x` is the input, and `alpha` is a trainable tensor which can be broadcasted to the shape of `x`. There's no native PRelu op in TensorFlow, so tf.... | function rewritePrelu(graph, weightMap) {
var _loop_1 = function (key) {
var addNode = graph.nodes[key];
if (addNode == null || addNode.op !== 'Add' && addNode.op !== 'AddV2' ||
addNode.inputNames.length !== 2) {
return "continue";
}
var reluNode = addNode.inp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"relu(n=0) { return Math.max(n, 0); }",
"function backpropagateGradients(tensorAccumulatedGradientMap, filteredTape, tidy, add) {\n // Walk the tape backward and keep a map of Tensor to its gradient.\n for (let i = filteredTape.length - 1; i >= 0; i--) {\n const node = filteredTape[i];\n const... | [
"0.5381967",
"0.5113865",
"0.5073751",
"0.5040232",
"0.49959633",
"0.49409026",
"0.47513056",
"0.47220865",
"0.47002265",
"0.46831718",
"0.46255136",
"0.4587174",
"0.45775917",
"0.44946966",
"0.4492747",
"0.44893807",
"0.4476529",
"0.44578093",
"0.43995616",
"0.43818516",
"0.... | 0.77270466 | 0 |
Will store attendeeName and invoke error action in case of failed edge case. | storeAttendeeName(e) {
if (e.target.value.length >= '40') {
this.props.dispatch(storeAttendeeNameErrorLabel('Only 40 characters permitted!!!'))
} else {
this.props.dispatch(storeAttendeeNameErrorLabel(''))
this.props.dispatch(storeAttendeeName(e.target.value));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function recordError(dataModelName, entityName, id) {\n errorStore[dataModelName] = errorStore[dataModelName] || {};\n errorStore[dataModelName][entityName] = errorStore[dataModelName][entityName] || {};\n errorStore[dataModelName][entityName][id] = true;\n }",
"_setIntern... | [
"0.52087045",
"0.5070649",
"0.49868375",
"0.49501166",
"0.49463782",
"0.48834893",
"0.48561296",
"0.485137",
"0.48368394",
"0.47852382",
"0.47045943",
"0.4698418",
"0.46909937",
"0.46702904",
"0.4656083",
"0.45910713",
"0.45894945",
"0.45879897",
"0.4576191",
"0.4564499",
"0.... | 0.5828634 | 0 |
This method is responsible for calculating the count of free, maybe and busy for a given date. | fillFreeStatus() {
let dateStatusArray = this.props.eventObj.dateArray;
dateStatus = {};
dateStatus['free'] = {};
dateStatus['maybe'] = {};
dateStatus['busy'] = {};
for (let i=0; i<dateStatusArray.length; i++) {
dateStatus['free'][dateStatusArray[i]] = 0;
dateStatus['maybe'][dateStat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"daysBookedAndAutorized(){\n let num = 0;\n this._booking.filter(function(obj){\n if(obj.authorized == true){\n num+=obj.numberOfDays();\n }\n })\n return num;\n }",
"getTournamentOverdueCnt() {\n var cnt = 0, i; \n var d = Date.now... | [
"0.59532523",
"0.5948391",
"0.5750599",
"0.5743777",
"0.57365763",
"0.56705743",
"0.56672645",
"0.5635836",
"0.5624641",
"0.5485802",
"0.548027",
"0.54402834",
"0.5381603",
"0.5380788",
"0.53288084",
"0.53120214",
"0.53082407",
"0.52835876",
"0.5261738",
"0.5249882",
"0.52487... | 0.64751625 | 0 |
Creates a new `NamedNodeMap`. | static _create(element) {
return new NamedNodeMapImpl(element);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function NamedNodeMap() {}",
"function NamedNodeMap() {}",
"function NamedNodeMap() {}",
"function NamedNodeMap() {\n}",
"function NamedNodeMap() {\n}",
"function NamedNodeMap() {\n}",
"function NamedNodeMap() {\n}",
"function NamedNodeMap() {\n}",
"function NamedNodeMap() {\n}",
"function NamedN... | [
"0.7583401",
"0.7583401",
"0.7583401",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.7409665",
"0.6201768",
"0.59640485",
... | 0.7634367 | 0 |
Encargada de convertir una cadena desde diversos formatos a tipo Date. Siempre retorna una fecha, en caso de ser invalida la cadena de entrada regresa la fecha minima | function FECHA(fecha) {
if (IsNullOrEmptyWhite(fecha)) {
return FBUtils.getDateMin();
}
var date;
try {
var formatISO = "yyyy-MM-ddTHH:mm:ssZ";
var formatISOWithouTimeZone = "yyyy-MM-ddTHH:mm:ss";
var formatDateOnly = "d/M/yyyy";
date = Date.parseExact(fecha, [for... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convierteAFecha(valor){\r\n\tvar dConvertida = null;\r\n\tvar sAnio = \"\";\r\n\tvar sMes = \"\";\r\n\tvar sDia = \"\";\r\n\tvar nAnio=0, nMes=0, nDia = 0;\r\n\t\r\n\tif (valor.match(/^\\d{2}\\/\\d{2}\\/\\d{4}$/)){\r\n\t\tnDia = parseInt(valor.substring(0,2), 10);\r\n\t\tnMes = parseInt(valor.substring(3,... | [
"0.7662308",
"0.6846125",
"0.66318524",
"0.65014964",
"0.64014876",
"0.6271312",
"0.6270873",
"0.6242474",
"0.6232118",
"0.6162769",
"0.6156451",
"0.6091719",
"0.6055306",
"0.60084134",
"0.59954584",
"0.5988331",
"0.5949814",
"0.5949814",
"0.5949814",
"0.5949814",
"0.59269035... | 0.6983971 | 1 |
add block challenge modal to player's controls | promptPlayerForChallenge() {
if (this.currentPlayer.isComputer) {
let blockWasChallenged = this.currentPlayer.decideBlockChallenge(this.action);
if (blockWasChallenged) {
let announcement = computerPlayerMessage(`Challenge Block`);
this.currentPlayer.renderControls(announcement);
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"promptTargetForChallenge() {\n if (this.currentPlayer.isComputer) {\n let blockChallenge = blockChallengeForm(this.action, this.blockable, this.challengeable);\n this.currentTarget.renderControls(blockChallenge);\n blockChallenge.addEventListener('submit', (e) => {\n e.preventDefault();\n ... | [
"0.6206132",
"0.592322",
"0.5887803",
"0.58655196",
"0.5827154",
"0.58199847",
"0.57392836",
"0.57341605",
"0.5713407",
"0.5710009",
"0.5674024",
"0.5673805",
"0.5658087",
"0.5649063",
"0.56352574",
"0.562208",
"0.56178063",
"0.56115824",
"0.55981535",
"0.55938745",
"0.558928... | 0.6200011 | 1 |
ask target to choose card after lost challenge | promptTargetForLostChallengeChoice() {
if (this.currentPlayer.isComputer) {
let announcement = computerPlayerMessage(`Won Challenge`);
this.currentPlayer.renderControls(announcement);
this.targetLostChallenge = true;
let lostChallengeForm = loseCardSelector('challenge', this.currentTarget);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"promptTargetForChallenge() {\n if (this.currentPlayer.isComputer) {\n let blockChallenge = blockChallengeForm(this.action, this.blockable, this.challengeable);\n this.currentTarget.renderControls(blockChallenge);\n blockChallenge.addEventListener('submit', (e) => {\n e.preventDefault();\n ... | [
"0.68236583",
"0.6803697",
"0.67991966",
"0.66644144",
"0.6656219",
"0.66548586",
"0.66547734",
"0.63745457",
"0.6352871",
"0.6340907",
"0.6278876",
"0.6148246",
"0.6143331",
"0.609062",
"0.6086665",
"0.6083367",
"0.60303324",
"0.60297143",
"0.5996559",
"0.59956163",
"0.59839... | 0.72457916 | 0 |
ask player to choose return cards after Exchange | promptPlayerForExchangeChoice() {
if (this.currentPlayer.isComputer) {
let announcement = computerPlayerMessage(`Choosing influences to return`);
this.currentPlayer.renderControls(announcement);
const [idx1, idx2] = this.currentPlayer.randExchangeIdx();
setTimeout(() => {
this.curren... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }",
"function acceptAnswer() {\n // if this was the last card, don't replace it (must be done on client side, to avoid Async DB inconsistencies.)\n lookupCardsRemainingInCurrentLevel()... | [
"0.7352892",
"0.683102",
"0.6600765",
"0.6344884",
"0.63408977",
"0.62735224",
"0.62727517",
"0.6252486",
"0.62404937",
"0.6195779",
"0.6183847",
"0.6177887",
"0.61523485",
"0.6146819",
"0.6146679",
"0.61444134",
"0.6141557",
"0.61353064",
"0.6135002",
"0.6125304",
"0.6121051... | 0.69108146 | 1 |
image removal function fired at load and after AJAX | function imageRemoval() {
jQuery('span.be-image-remove').on('click', function(event) {
var image = jQuery(this).attr('rel');
var parent = jQuery('form#post input#post_ID').prop('value');
var data = {
action: 'gallery_remove',
image: image,
parent: parent
};
jQuery.pos... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function remover_img() {\n\tvar src = assets + \"/admin/img/no-image.png\";\n\t$(\"#image\").val('');\n\t$(\"#prevImg\").attr('src', src);\n}",
"function fCleanUp() // CLEANS: This function cleans up the data after the previously loaded image\r\n{\r\n expandedImg.innerHTML = \"\";\r\n}",
"function stopsl... | [
"0.7143341",
"0.7132332",
"0.7100107",
"0.7086556",
"0.7065077",
"0.7031323",
"0.6910687",
"0.69033897",
"0.6860075",
"0.68188614",
"0.6712015",
"0.6708872",
"0.6705646",
"0.6705108",
"0.668913",
"0.6644808",
"0.6627549",
"0.6622347",
"0.6594285",
"0.6565344",
"0.65504503",
... | 0.7671648 | 0 |
gives gui to score | function OnGUI ()
{
GUI.skin = theSkin;
GUI.Label (new Rect (Screen.width/2-150-30, 20, 150, 150), "P1: " + playerScore01);
GUI.Label (new Rect (Screen.width/2+150-30, 20, 150, 150), "P2: " + playerScore02);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function OnGUI () {\n\n //GUI.Box (Rect (0,0,200,200), zAcc.ToString());\n \n //GUI.Box (Rect (0,200,200,50), statusString);\n \n// GUI.Box (Rect (0,250,200,50), score.ToString());\n \n scoreText.guiText.text = \"Score:\" + score.ToString();\n \t\n }",
"_updateScoreBox() {\n\t\tthis.score... | [
"0.7425067",
"0.73546505",
"0.7308198",
"0.7273329",
"0.72707826",
"0.71672827",
"0.7165068",
"0.71385384",
"0.7126477",
"0.7000577",
"0.69736904",
"0.693702",
"0.6927743",
"0.6907908",
"0.6906499",
"0.6901725",
"0.6869313",
"0.6868029",
"0.6851832",
"0.6848162",
"0.68394226"... | 0.7428226 | 0 |
the AniLetters object defines the simple geometry font | function AniLetters(_lwidth, _lheight){
var that = this;
that.textTyped = [];
that.textTyped = [];
that.paths = [];
that.letterWidth = _lwidth;
that.letterHeight = _lheight;
that.lineCount = 0;
that.aniSteps = 20;
that.drawMode = 3;
that.cursorLocation = {x: 50, y: 50};
that.letterPadding = 60;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Letter(let) { \n\tthis.charac = let; //storing the letter in a variable\n\tthis.appear = false;\n\tthis.letterRender = function(){\n\t\tif(this.appear === false){\n\t\t\treturn \"_\"; // the line\n\t\t}else{\n\t\t\treturn this.charc; // the letter\n\t\t}\n\t};\n}",
"set Alpha(value) {\n this._fon... | [
"0.6382604",
"0.6188893",
"0.6145872",
"0.614576",
"0.60829496",
"0.60720855",
"0.60234296",
"0.6018363",
"0.6007599",
"0.600079",
"0.5989442",
"0.5981313",
"0.59628433",
"0.5945718",
"0.5938278",
"0.5937112",
"0.5902811",
"0.5901993",
"0.58681947",
"0.5858557",
"0.5858169",
... | 0.66366464 | 0 |
This will increment the current index value. This stores the last index used to insert data. | _incrementIndex() {
this._index++;
if (this._index >= this._capacity) {
this._index = 0;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function incrementIndex()\r\n {\r\n //increment index\r\n counter += 1;\r\n // at end of array start over\r\n if (counter >= currentObjects.length)\r\n {\r\n counter = 0;\r\n }\r\n }",
"next() {\n this.index++;\n }",
"addOnIndex(ind... | [
"0.7903482",
"0.7043069",
"0.701557",
"0.6997041",
"0.6917821",
"0.6886739",
"0.6593213",
"0.655098",
"0.65465724",
"0.6510199",
"0.64830005",
"0.6420684",
"0.6417178",
"0.6386535",
"0.6349942",
"0.6349942",
"0.6349942",
"0.6339689",
"0.6285092",
"0.62809604",
"0.62173486",
... | 0.79765713 | 0 |
This will increment the max index value. The max index represents how much of the _data array is currently being used, allowing the selection of random minibatches. | _incrementMaxIndex() {
if (this._maxIndex < this._capacity) {
this._maxIndex++;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set maxIndex(_val) {\n (typeof _val === \"number\") && this.setAttribute(\"max\", _val);\n }",
"get maxIndex() {\n return Number(this.getAttribute(\"max\"));\n }",
"getLastIndex() {\n return (this.maxIndex - Math.floor(this.index) - 1) % this.maxIndex;\n }",
"function index (max... | [
"0.6664371",
"0.64603317",
"0.64464206",
"0.6409339",
"0.62593514",
"0.62398463",
"0.6104873",
"0.60743225",
"0.6045243",
"0.60156375",
"0.5992332",
"0.597526",
"0.5894699",
"0.57783675",
"0.57625335",
"0.573853",
"0.573853",
"0.573853",
"0.57197803",
"0.57197803",
"0.5719780... | 0.8027592 | 0 |
17 Liste des sites des hotspots Paris WiFi | function D17_SiteWifi() {
return Utils
.newDataSet({
"path" : "liste_des_sites_des_hotspots_paris_wifi.csv",
"url" : "http://public.opendatasoft.com/explore/dataset/liste_des_sites_des_hotspots_paris_wifi/download?format=csv",
transform : function(obj) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onEachStation(feature, layer) {\n if (feature.properties && feature.properties[\"SITE NAME\"]) {\n var baseURL = \"http://www.co.thurston.wa.us/monitoring/\";\n var link = \"\";\n switch (feature.properties[\"SITE CODE\"]) {\n case '13u': link = '<a href=\"' + baseURL + ... | [
"0.6125944",
"0.54919755",
"0.54838383",
"0.547618",
"0.54756457",
"0.5436427",
"0.5415971",
"0.53751415",
"0.53688294",
"0.53635824",
"0.5357525",
"0.532003",
"0.53065735",
"0.5305327",
"0.52857083",
"0.5276317",
"0.5271922",
"0.5242915",
"0.52357775",
"0.5233804",
"0.521129... | 0.6563488 | 0 |
Restores an archived mapping. If there is an active mapping, then archives that mapping and updates it. Otherwise, creates new mapping, always with appropriate version. A new version is created with the contents of the restored one. | static restoreFromHistory(username,template,lang,version,callback){
//1. Get document corresponding to rev
MappingHistory.findOne({ _id: { template,lang,version } }, (err, archivedMapping) => {
if (err){
return callback(err);
}
const Mapping = requ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"unarchive () {\n this.cached = this.archived\n }",
"archiveAndDearchive(){\n this.archived = !this.archived;\n }",
"appendMappingInverted(mapping) {\n for (let i = mapping.maps.length - 1, totalSize = this.maps.length + mapping.maps.length; i >= 0; i--) {\n let mirr = mapping.getMirror(i);\n ... | [
"0.579351",
"0.5153023",
"0.5074303",
"0.49986294",
"0.49852222",
"0.48317736",
"0.47259206",
"0.46503496",
"0.45874494",
"0.4585571",
"0.4582144",
"0.45653474",
"0.45457995",
"0.45232928",
"0.4521731",
"0.4521668",
"0.4512595",
"0.45019454",
"0.44619083",
"0.44370148",
"0.44... | 0.56657195 | 1 |
Subscribed list functions Returns an object representing the subscribed list from storage | function getSubscribedList() {
return JSON.parse(localStorage.getItem(subscribedStorage));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSubscribedList() {\n\treturn JSON.parse(localStorage.getItem(subscribedStorage));\n}",
"function setSubscribedList(newList) {\n localStorage.setItem(subscribedStorage, JSON.stringify(newList));\n }",
"function setSubscribedList(newList) {\n\tlocalStorage.setItem(subscribedStorage, JSON.st... | [
"0.845282",
"0.7389126",
"0.73583806",
"0.6442242",
"0.636359",
"0.62141156",
"0.606905",
"0.6042991",
"0.6022828",
"0.6008995",
"0.59015936",
"0.5889888",
"0.5857372",
"0.5807372",
"0.5806555",
"0.57840836",
"0.5715157",
"0.5670562",
"0.5665158",
"0.56634444",
"0.56629384",
... | 0.8458253 | 0 |
Sets an object representing the subscribed list to storage | function setSubscribedList(newList) {
localStorage.setItem(subscribedStorage, JSON.stringify(newList));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setSubscribedList(newList) {\n\tlocalStorage.setItem(subscribedStorage, JSON.stringify(newList));\n}",
"function saveList() {\n storage.put(ListName, masterList);\n}",
"set(value){\r\n\r\n this.list.push(value)\r\n localStorage.setItem(this.name, JSON.stringify(this.list))\r\n\r\n }"... | [
"0.7940563",
"0.65472215",
"0.6493739",
"0.6341095",
"0.62884706",
"0.6279201",
"0.6199663",
"0.61198795",
"0.61182207",
"0.6091166",
"0.6010488",
"0.58614385",
"0.5848258",
"0.5847729",
"0.5829044",
"0.57906294",
"0.5790581",
"0.57718414",
"0.57435215",
"0.5720938",
"0.57120... | 0.7978553 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.