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 |
|---|---|---|---|---|---|---|
Returns contentURI in Aragon's protocol:location format as hex | function toContentUri(protocol, location) {
if (!protocol)
throw Error('contentURI protocol must be defined');
if (!location)
throw Error('contentURI location must be defined');
return utf8ToHex([protocol, location].join(':'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getUri() {\n return super.getAsString(\"uri\");\n }",
"function toDataURI(content) {\n return DATA_URL_PREFIX + content;\n}",
"get base64UriString() {\n return exports.base64.encodeUri(this.refString);\n }",
"function getURI() {\n var uri = document.location.href;\n\t\t\t\t\n ... | [
"0.6087958",
"0.60679656",
"0.6016214",
"0.5895861",
"0.58497614",
"0.5824251",
"0.57037944",
"0.5683949",
"0.56166667",
"0.5612745",
"0.5595447",
"0.5573135",
"0.5535985",
"0.553534",
"0.55308026",
"0.5530385",
"0.5484975",
"0.54818773",
"0.5479923",
"0.5453132",
"0.5433351"... | 0.74371505 | 0 |
Return hex format of data with 0x prefix | function utf8ToHex(data) {
return '0x' + Buffer.from(data, 'utf8').toString('hex');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hexString() {\n let uintArr = new Uint8Array(this.buf);\n let out = \"\";\n for (let byte of uintArr) {\n out += ('0' + byte.toString(16)).slice(-2) + \" \";\n }\n return out;\n }",
"function h$_hs_bytestring_uint_hex(x, buf_d, buf_o) {\n var c, ptr = buf_o, ne... | [
"0.68755597",
"0.6634722",
"0.6623589",
"0.6623589",
"0.6623589",
"0.6617805",
"0.660787",
"0.660787",
"0.65904117",
"0.65901154",
"0.65434295",
"0.6519755",
"0.6447518",
"0.63833827",
"0.6313391",
"0.6304801",
"0.63041294",
"0.6267326",
"0.62596405",
"0.6243166",
"0.6243166"... | 0.68144906 | 1 |
Document Ready / populates the Dawg Pizza Menu dynamically using a js object. | function renderMenu() {
var menu = com.dawgpizza.menu;
// grab templates for duplication
var pizzaTemplate = $('.pizza-template');
var drinkDessertTemplate = $('.drink-dessert-template');
$.each(com.dawgpizza.menu.pizzas, function() {
var pizzaTemplateClone = pizzaTemplate.clone();
// populate the clone's fiel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function injectMenu(htmlDoc, autoOrder){\n let element = document.querySelector('.products-list')\n let newElement = htmlDoc.querySelector('.lufa-scraper-wrapper')\n\n newElement.querySelector('#auto-order').style.display = autoOrder ? 'block': 'none'\n newElement.querySelector('#auto-order').innerHTML = statusMap... | [
"0.62598246",
"0.6228109",
"0.61968064",
"0.6107869",
"0.60794437",
"0.6077929",
"0.6024597",
"0.59581566",
"0.59503037",
"0.5940482",
"0.5933772",
"0.5926629",
"0.59110767",
"0.5906368",
"0.588096",
"0.5864386",
"0.5850945",
"0.5767621",
"0.57602125",
"0.57585144",
"0.570915... | 0.6347257 | 0 |
populates and animates aside | function asideinator() {
// hide all children of aside elements
$('#hoursChild').hide();
$('#addressChild').hide();
$('#contactChild').hide();
$('#socialChild').hide();
// set all parts of aside to toggle upon clicking
var toggleTime = 400;
$('#hours').click(function() {
$('#hoursChild').toggle(toggleTime);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populate() {\n\n $('#mast').append('<div id=\"animation\"></div>');\n\n for (i=0; i<5; i++) {\n $('#mast #animation').append('<div></div>');\n }\n\n }",
"function fadeAside() {\r\n\t$aside.fadeOut('5000');\r\n}",
"function test_animate() {\n //Do the preview (IS THI... | [
"0.5944867",
"0.58361375",
"0.57839745",
"0.5764875",
"0.5667851",
"0.56659544",
"0.56144285",
"0.5604326",
"0.5597669",
"0.558088",
"0.5535769",
"0.55191505",
"0.548847",
"0.5486981",
"0.5483156",
"0.54608077",
"0.54549205",
"0.5445512",
"0.543945",
"0.54348505",
"0.5431947"... | 0.6566974 | 0 |
player's cell color (green) AI's cell color | function setAIColor() {
switch (difficulty) {
case "easy": base_color1 = [34, 142, 250]; break; // (blue)
case "medium": base_color1 = [230, 54, 230]; break; // (fuscia)
case "hard": base_color1 = [255, 60, 0]; break; // (red)
default: base_color1 = [255, 255, 0]; // (yel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playerColorizer(player) {\n var intensity = 55 + player.resource * 2;\n if (player.team === 0) {\n return 'rgb(' + intensity + ',0,' + intensity + ')';\n }\n if (player.team === 1) {\n return 'rgb(' + intensity + ',' + intensity + ',0)';\n }\n return 'rgb(0,' + intensity + ',' + intensity + ')... | [
"0.71948075",
"0.69896775",
"0.6811598",
"0.6790973",
"0.6766932",
"0.67268264",
"0.6708674",
"0.6707518",
"0.667519",
"0.6635518",
"0.6513943",
"0.65128183",
"0.64644027",
"0.6452016",
"0.64456",
"0.6440606",
"0.6431471",
"0.6413182",
"0.64097005",
"0.63981783",
"0.63842326"... | 0.7385811 | 0 |
Takes certain attributes of the vizcard that was clicked, stores them in an object, and posts it. | function displayViz(obj) {
var vizCreator = $(obj).attr("viz-creator");
var vizName = $(obj).attr("viz-name");
var vizType = $(obj).attr("viz-type");
var vizData = $(obj).attr("viz-data");
var vizDisplay = {
creator: vizCreator,
name: vizName,
type: vizType,
data: v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateCard(obj) {\n name.innerHTML = obj.name || 'Nombre Apellido';\n job.innerHTML = obj.job || 'Puesto de trabajo';\n email.setAttribute('href', 'mailto:' + obj.email);\n linkedin.setAttribute('href', obj.linkedin);\n github.setAttribute('href', 'https://github.com/', obj.github);\n}",
"function ... | [
"0.5412141",
"0.5411738",
"0.53796464",
"0.53237903",
"0.53024644",
"0.5278362",
"0.52708215",
"0.52489316",
"0.52457064",
"0.5243433",
"0.524109",
"0.5224907",
"0.5207568",
"0.5186796",
"0.51867443",
"0.5186041",
"0.51777744",
"0.5151298",
"0.5148203",
"0.5145789",
"0.514324... | 0.5532963 | 0 |
merges behavior with preexisting behavior with the same name. | mergeBehavior(newBehavior) {
const isBehaviorImpl = (b) => {
// filter out BehaviorImpl
return b.name.indexOf(newBehavior.className) === -1;
};
for (const behavior of this.behaviors) {
if (newBehavior.className !== behavior.className) {
continu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"merge() {\r\n }",
"withBehaviors(...behaviors) {\n this.behaviors = this.behaviors === null ? behaviors : this.behaviors.concat(behaviors);\n return this;\n }",
"function systemExtend(dest={}, src={}) {\n\n if(!isObject(dest)) {\n return {}\n }\n if(!isObject(src)) {\n return dest\n }\n... | [
"0.53971356",
"0.5394385",
"0.5315761",
"0.5304984",
"0.5179501",
"0.5168153",
"0.51012856",
"0.4942108",
"0.49206164",
"0.491667",
"0.4914153",
"0.4909466",
"0.48921952",
"0.48921663",
"0.4877999",
"0.48724377",
"0.4857504",
"0.48494473",
"0.4836896",
"0.482994",
"0.48203665... | 0.73721665 | 0 |
gets the expression representing a behavior from a node. | function behaviorExpression(node) {
switch (node.type) {
case 'ExpressionStatement':
// need to cast to `any` here because ExpressionStatement is super
// super general. this code is suspicious.
return node.expression.right;
case 'VariableDeclaration':
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function expresionValue(node)\n{\n let value;\n if(node.type=='Literal') {\n value= node.value;\n }\n else if(node.type=='Identifier') {\n value= node.name;\n }\n else if(node.type=='UnaryExpression') {\n value=node.operator + node.argument.value;\n }\n else if(node.typ... | [
"0.5596541",
"0.5525157",
"0.54931223",
"0.54791754",
"0.54271764",
"0.5421246",
"0.5421246",
"0.5417972",
"0.5383844",
"0.53767747",
"0.5373565",
"0.53623724",
"0.5354006",
"0.5312324",
"0.5312324",
"0.5275692",
"0.52745295",
"0.52745295",
"0.52745295",
"0.5244924",
"0.52449... | 0.7697177 | 0 |
checks whether an expression is a simple array containing only member expressions or identifiers. | function isSimpleBehaviorArray(expression) {
if (!expression || expression.type !== 'ArrayExpression') {
return false;
}
for (const element of expression.elements) {
if (element.type !== 'MemberExpression' && element.type !== 'Identifier') {
return false;
}
}
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function array_test(x) {\n if (Array.isArray === undefined) {\n return x instanceof Array;\n } else {\n return Array.isArray(x);\n }\n}",
"function array_test(x) {\n if (Array.isArray === undefined) {\n return x instanceof Array;\n } else {\n return Array.isArray(x);\n ... | [
"0.6290462",
"0.6290462",
"0.6226396",
"0.6195245",
"0.61554366",
"0.6065389",
"0.60360664",
"0.60102886",
"0.6009927",
"0.5976391",
"0.5942528",
"0.59376997",
"0.59376997",
"0.59376997",
"0.59329224",
"0.58559823",
"0.58305067",
"0.58305067",
"0.5813945",
"0.5813945",
"0.581... | 0.7667009 | 0 |
process line with column headers | function processHeader(line) {
headers = line.split(';');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHeaderInfo(line) {\n const headerNames = [];\n const headerLookupIdx = [];\n const info = [];\n const groups = {};\n\n // populate the header arrays\n for (let i = 1; i < line.length; i++) {\n let name = line[i];\n // default values\n let inGroup = false;\n let type = undefined;\n ... | [
"0.6763522",
"0.59934425",
"0.5939193",
"0.58914",
"0.5876146",
"0.5781144",
"0.5781144",
"0.5781144",
"0.5781144",
"0.5781144",
"0.57693654",
"0.57279223",
"0.5723791",
"0.56864715",
"0.56552505",
"0.56263995",
"0.5615151",
"0.55748314",
"0.5563527",
"0.55620086",
"0.5505413... | 0.696636 | 0 |
process line with fund type | function processFundType(line) {
currTyp = line; //next few funds will be of this fund type, so set it as current value
if (!typesHash[currTyp]) { //making sure types are not duplicated
types.push(currTyp);
typesHash[currTyp] = currTyp;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processFund(line) {\n\tfundVals = line.split(';');\n\tvar fund = {};\n\tfor (i=0; i < fundVals.length; i++)\n\t\tfund[headers[i]] = fundVals[i];\n\tfund.Type = currTyp; //add type to fund information\n\tfund.Manager = currMgr; //add manager to fund information\n\tfunds.push(fund);\n}",
"function getLi... | [
"0.73583233",
"0.61893475",
"0.56670284",
"0.5518171",
"0.5496385",
"0.5453256",
"0.53619075",
"0.53512526",
"0.53430754",
"0.532529",
"0.5309373",
"0.5252466",
"0.52431273",
"0.5232857",
"0.5231993",
"0.5205722",
"0.51637584",
"0.5130502",
"0.5106453",
"0.5103158",
"0.505654... | 0.7593806 | 0 |
process line with fund manager name | function processMgr(line) {
currMgr = line; //next few funds will be of this fund manager, so set it as current value
if (!managerHash[currMgr]) { //making sure fund managers are not duplicated
managers.push(currMgr);
managerHash[currMgr] = currMgr;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processFund(line) {\n\tfundVals = line.split(';');\n\tvar fund = {};\n\tfor (i=0; i < fundVals.length; i++)\n\t\tfund[headers[i]] = fundVals[i];\n\tfund.Type = currTyp; //add type to fund information\n\tfund.Manager = currMgr; //add manager to fund information\n\tfunds.push(fund);\n}",
"function proce... | [
"0.62344974",
"0.5033402",
"0.4991966",
"0.49589667",
"0.48371863",
"0.4724233",
"0.470429",
"0.46919203",
"0.46794498",
"0.46718076",
"0.46501258",
"0.46474662",
"0.4643912",
"0.46279973",
"0.46251455",
"0.4614132",
"0.46123445",
"0.45981702",
"0.45916083",
"0.45848122",
"0.... | 0.73150533 | 0 |
process line with fund information | function processFund(line) {
fundVals = line.split(';');
var fund = {};
for (i=0; i < fundVals.length; i++)
fund[headers[i]] = fundVals[i];
fund.Type = currTyp; //add type to fund information
fund.Manager = currMgr; //add manager to fund information
funds.push(fund);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processFundType(line) {\n\tcurrTyp = line; //next few funds will be of this fund type, so set it as current value\n\tif (!typesHash[currTyp]) { //making sure types are not duplicated\n\t\ttypes.push(currTyp);\n\t\ttypesHash[currTyp] = currTyp;\t\t\n\t}\n}",
"function analyzeLine(line) {\n\tvar arr = ... | [
"0.6614693",
"0.58158946",
"0.5749563",
"0.5729617",
"0.56280005",
"0.52930474",
"0.52915245",
"0.52915245",
"0.5279283",
"0.5224266",
"0.5224266",
"0.5206477",
"0.5187502",
"0.5167842",
"0.5123857",
"0.51162",
"0.50943077",
"0.5085972",
"0.5085972",
"0.50855035",
"0.50687844... | 0.78666055 | 0 |
Determine if we're appending the image to an artboard, group, or the page. | function getElToAppendTo () {
var app = NSApplication.sharedApplication();
var el = null;
if (selection.count() == 0) {
el = doc.currentPage();
}
else {
var type = selection[0].className();
if (type == 'MSArtboardGroup' || type == 'MSLayerGroup') {
el = selection[0];
}
else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isImageField() {\n if (this.start.paragraph.isEmpty() || this.end.paragraph.isEmpty()) {\n return false;\n }\n let startPosition = this.start;\n let endPosition = this.end;\n if (!this.isForward) {\n startPosition = this.end;\n endPosition = this.... | [
"0.5595828",
"0.54576886",
"0.5388854",
"0.5371927",
"0.53122896",
"0.52815574",
"0.52611214",
"0.52611214",
"0.52500004",
"0.52467114",
"0.5218804",
"0.5215241",
"0.51485354",
"0.51359576",
"0.5127923",
"0.5123294",
"0.50988036",
"0.5084441",
"0.5059676",
"0.5051223",
"0.504... | 0.5828389 | 0 |
Creates a new bitmap image and adds it to the Layer group | function addImgToCanvas (el, img, layerName) {
var imageCollection = el.documentData().images();
var imageData = imageCollection.addImage_name_convertColourspace(img, layerName, false);
var newImage = MSBitmapLayer.alloc().initWithImage_parentFrame_name(imageData, el.frame(), layerName);
el.addLayer(newImage);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newImage(imageName, imageSource, xPos, yPos, xScale, yScale) {\n\n var img = new Image();\n img.onload = onImageLoaded;\n img.src = 'images/' + imageSource;\n\n function onImageLoaded(e) {\n var imageName = new createjs.Bitmap(img);\n imageName.scaleX = xScale;\n imageName... | [
"0.6273246",
"0.6264037",
"0.6222772",
"0.62199664",
"0.6211953",
"0.60930544",
"0.6004329",
"0.5896289",
"0.58829087",
"0.58245033",
"0.5809726",
"0.57670516",
"0.5762366",
"0.5749427",
"0.5666334",
"0.5655009",
"0.56475645",
"0.5645192",
"0.56319827",
"0.56048423",
"0.55931... | 0.67071897 | 0 |
Essentially the same function as randomHTTPRequest, but it returns it as a promise with the reject & resolve handled in its callback. | function randomHTTPRequestWithPromise (input1, input2) {
const URL = API_URL + '?' + FIRST_PARAM + input1.toString() + '&' + SECOND_PARAM + input2.toString();
return new Promise(function (resolve, reject) {
request(URL, function (error, response, body) {
if (error) {
reject('Something went wrong...');
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generatorRequest(url) {\n\n return new Promise(function(resolve, reject) {\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.send();\n xhr.onreadystatechange = function() {\n if (this.readyState != 4) return;\n\n if (xhr.status != ... | [
"0.6201464",
"0.6167352",
"0.60892147",
"0.60698634",
"0.60141844",
"0.5978163",
"0.5938816",
"0.591231",
"0.5853219",
"0.57922804",
"0.57599455",
"0.56960034",
"0.56941575",
"0.56848127",
"0.5679632",
"0.5640664",
"0.5638249",
"0.56237525",
"0.5620479",
"0.5620479",
"0.56204... | 0.681774 | 0 |
Question properties: currentState: SOLVE_STATE windowDiv: element correct: int positionPercentX: float positionPercentY: float revealThreshold: int imageLink: string feedbacks: string[] connectionElements: element[] connections: int[] questionType: SOLVE_STATE justification: string wrongAnswer: string correctAnswer: st... | function Question(xml, resources, windowDiv, num){
// Set the current state to default at hidden and store the window div
this.currentState = SOLVE_STATE.HIDDEN;
this.windowDiv = windowDiv;
this.num = num;
// Get and save the given index, correct answer, position, reveal threshold, image link, feedb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"openQuestion(points){\n let question\n\n // plays thinking music\n thinking.volume = 0.2\n thinking.currentTime = 0\n thinking.play()\n\n if (this.category==1) {\n if (points==100) {\n question = 1;\n questionEl.innerHTML = q1.quest... | [
"0.6882561",
"0.6608329",
"0.65202016",
"0.64833623",
"0.6392896",
"0.6373011",
"0.6373011",
"0.6358482",
"0.63506913",
"0.63417953",
"0.6306404",
"0.62893456",
"0.6278278",
"0.62512064",
"0.6198302",
"0.61940384",
"0.6185189",
"0.6161903",
"0.61535287",
"0.61245406",
"0.6121... | 0.7079074 | 0 |
display image based on the id. if there is image src, set the width and height, if there is no image src, set width and height to 0 to save space | function displayImage(id)
{
var imageSection;
var myImage = document.getElementById(id);
if (myImage) {
//console.log('image existed');
var myWidth = myImage.style.width;
if (myWidth == "0px") {
imageSection = {
text: ""
};
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayImage(id) {\n //log('display ' + key);\n return initDB('thr').then(function(db) {\n return readRecord(db, 'books', id).then(function(book) {\n var key = uriToKey(book.pages[0].url);\n return readRecord(db, 'images', key).then(function(result) {... | [
"0.6758422",
"0.66708857",
"0.6641661",
"0.6627331",
"0.65989876",
"0.6584934",
"0.6531171",
"0.652307",
"0.64846444",
"0.64459974",
"0.64459974",
"0.6421322",
"0.63884634",
"0.6388254",
"0.63833034",
"0.6366749",
"0.63584054",
"0.63471097",
"0.6323356",
"0.6289103",
"0.62872... | 0.6700985 | 1 |
description: serializes form elements into name=value&name1=value1 etc... | function serialize(form){
if(form.nodeName!=="FORM")throw Error('not a form element');
var res = [];
Array.prototype.forEach.call(form.elements, function(item,idx,list){
switch (item.type){
case 'radio':
case 'checkbox':
if (item.checked){
res.push(item.name+"="+encodeURIComponent(item.val... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"serialize() {\n let ret = []\n this.serializeArray().forEach(element => {\n ret.push(encodeURIComponent(element.name) + '=' + encodeURIComponent(element.value))\n })\n return ret.join('&')\n }",
"formEncode(obj) {\n var str = []\n for (var p in obj) {\n str.push(encodeURIComponent(p)... | [
"0.73974717",
"0.67211664",
"0.656656",
"0.6564147",
"0.65593934",
"0.6552359",
"0.6517989",
"0.65047866",
"0.65047866",
"0.6493412",
"0.64800125",
"0.64767635",
"0.6470437",
"0.64648837",
"0.6443356",
"0.6409965",
"0.6409965",
"0.6346831",
"0.63426703",
"0.6333605",
"0.62718... | 0.7129359 | 1 |
Select the right qbo object | function selectQbo(id) {
switch(id) {
case config.THAI.REALM_ID:
return qbo_thai;
case config.TURKISH.REALM_ID:
return qbo_turkish;
case config.MEXICAN.REALM_ID:
return qbo_mexican;
case config.BURGERS.REALM_ID:
return qbo_burgers;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"subscribeBoq(boqId, isEdit) {\n //fill boq Item Drop\n dataservice.GetDataList('getContractsBoqItemsForDrop?boqId=' + boqId, 'details', 'id').then(result => {\n if (isEdit) {\n let id = this.state.itemEdit.boqItemId;\n let selectedValue = {};\n ... | [
"0.58496827",
"0.56989044",
"0.5679893",
"0.54986775",
"0.531853",
"0.52343076",
"0.5217905",
"0.52050763",
"0.51600987",
"0.5148779",
"0.5088995",
"0.5083452",
"0.50590837",
"0.5052842",
"0.50286233",
"0.5021717",
"0.5018433",
"0.5009846",
"0.4992428",
"0.4986757",
"0.496929... | 0.6334029 | 0 |
Show the zipcode modal | function askForZipcode() {
$('#zip-modal').show();
$.colorbox({
html: $('#zip-modal'),
innerWidth: 400,
fixed: true,
onOpen: function () {
// Binding events
$('#enter_zip_form label').inFieldLabels();
$('#enter_zip_form .signin').click(function (event) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleEnterZip() {\n if (this.htmlNodes.active.zipEntry === false) {\n document\n .querySelector(\"#zipCodeForm\")\n .classList.add(\"sidebar-btn-select\");\n this.htmlNodes.zipEntry.style.display = \"flex\";\n this.htmlNodes.active.zipEntry = true;\n } else {\n document\n ... | [
"0.6854715",
"0.66902643",
"0.6637596",
"0.6605719",
"0.608232",
"0.59603477",
"0.5869077",
"0.5865659",
"0.5854989",
"0.58465874",
"0.58366054",
"0.58293825",
"0.5809421",
"0.580135",
"0.5799765",
"0.5795944",
"0.5768108",
"0.5740202",
"0.5709835",
"0.56845164",
"0.5654678",... | 0.804934 | 0 |
emit status changed value | statusChanged() {
this.emit('statusChanged', this.status);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"emitChange () {\n this.emit(Constants.CHANGE_EVENT);\n }",
"updateStatus(){\n getStatus();\n }",
"emitChange() {\n\t\tthis.emit(CHANGE_EVENT)\n\t}",
"emitChange() {\n this.emit(CHANGE_EVENT);\n }",
"emitChange() {\n this.emit(CHANGE_EVENT);\n }",
"@action.bound\n update... | [
"0.7063827",
"0.69752157",
"0.6933681",
"0.6865478",
"0.6865478",
"0.68424934",
"0.6621718",
"0.65120125",
"0.6506198",
"0.64784545",
"0.6411403",
"0.6407469",
"0.63940185",
"0.6359028",
"0.6287096",
"0.62571806",
"0.6252852",
"0.62482953",
"0.6199977",
"0.6178399",
"0.617839... | 0.84677523 | 0 |
Track the position of mouse cursor | function trackPosition(e) {
mouse.x = e.pageX;
mouse.y = e.pageY;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function trackPosition(e) {\n mouse.x = e.pageX;\n mouse.y = e.pageY;\n}",
"function CursorTrack() {}",
"function cursor(info){\n cursorTracker.forEach(cursor => { // detect and assign the correct position (X, Y) of cursor\n cursor.style.top = info.pageY + 'px';\n cursor.style.left = info.page... | [
"0.79315656",
"0.7887991",
"0.74854743",
"0.7458935",
"0.7402847",
"0.73559433",
"0.7303878",
"0.7275011",
"0.7247901",
"0.71264166",
"0.70658916",
"0.70572907",
"0.705034",
"0.7024761",
"0.7024529",
"0.70077884",
"0.70052886",
"0.6985371",
"0.69753957",
"0.69466406",
"0.6937... | 0.7938625 | 0 |
Function to check collision between ball and one of the paddles | function collides(b, p) {
if(b.x + ball.r >= p.x && b.x - ball.r <=p.x + p.w) {
if(b.y >= (p.y - p.h) && p.y > 0){
paddleHit = 1;
return true;
}
else if(b.y <= p.h && p.y == 0) {
paddleHit = 2;
return true;
}
else return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function collides(b, p) {\n\n if (b.y + ball.r >= p.y && b.y - ball.r <= p.y + p.h) {\n if (b.x >= (p.x - p.w) && p.x > 0) {\n paddleHit = RIGHT;\n return true;\n }\n\n else if (b.x <= p.w && p.x == 0) {\n paddleHit = LEFT;\n return true;\n ... | [
"0.84494865",
"0.8381386",
"0.8308227",
"0.8266996",
"0.82357323",
"0.8192004",
"0.81908274",
"0.8130571",
"0.80846643",
"0.80753064",
"0.8012934",
"0.7967696",
"0.7957846",
"0.78691685",
"0.7819235",
"0.77914166",
"0.77765566",
"0.7773221",
"0.7736764",
"0.7682696",
"0.76118... | 0.8526578 | 0 |
Function for emitting particles | function emitParticles() {
for(var j = 0; j < particles.length; j++) {
par = particles[j];
ctx.beginPath();
ctx.fillStyle = "white";
if (par.radius > 0) {
ctx.arc(par.x, par.y, par.radius, 0, Math.PI*2, false);
}
ctx.fill();
par.x += par.vx;
par.y += par.vy;
// Reduce radius so that... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function emitParticles() {\n for (var j = 0; j < particles.length; j++) {\n par = particles[j];\n\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n if (par.radius > 0) {\n ctx.arc(par.x, par.y, par.radius, 0, Math.PI * 2, false);\n }\n ctx.fill();\n\n ... | [
"0.7947039",
"0.7651631",
"0.7389698",
"0.7385478",
"0.71706307",
"0.70429325",
"0.6908076",
"0.6894577",
"0.6869305",
"0.6863846",
"0.6853778",
"0.685278",
"0.6849579",
"0.6798332",
"0.6784324",
"0.67742586",
"0.676911",
"0.6766161",
"0.6712981",
"0.6712543",
"0.6705296",
... | 0.7990504 | 1 |
Hide loading animation and show page | function showPageLoading() {
$("div.loading-page").css("display", "block");
$(".main-page-core").css("opacity", "1");
$(".loading-icon").css("display", " none");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showLoader(){\n $(\".page-loader-wrapper\").show();\n}",
"function loading() {\n\tloader.hidden = false;\n\tmain.hidden = true;\n}",
"function showPageLoader(){\n $('.loader').show();\n}",
"function showLoadingView() {\n $loader.css(\"display\", \"block\");\n }",
"function hideLoadingView(... | [
"0.79127985",
"0.78300285",
"0.7786668",
"0.7736335",
"0.7711233",
"0.7695402",
"0.7681469",
"0.7681469",
"0.76355827",
"0.7608165",
"0.7569152",
"0.7548613",
"0.7510008",
"0.7471362",
"0.7402717",
"0.7385381",
"0.7358898",
"0.7355962",
"0.73526067",
"0.73477995",
"0.7332801"... | 0.79160994 | 0 |
Create multiplayer name from username and config multiplayer name if they different. | function multiplayerName(username)
{
let multiplayerName = Engine.ConfigDB_GetValue("user", "playername.multiplayer") || Engine.GetSystemUsername();
return !username ? multiplayerName : multiplayerName != username ? multiplayerName + " (" + username + ")" : username;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatPlayerName(player_name) {\n\t\tvar space = player_name.indexOf(' ');\n\t\tvar first_letter = player_name.slice(0,1).toUpperCase();\n\t\tvar last_name = player_name.slice(space+1);\n\t\tlast_name = last_name.charAt(0).toUpperCase() + last_name.slice(1);\n\t\treturn first_letter + '.' + last_name;\n\t... | [
"0.59828407",
"0.5906247",
"0.5832581",
"0.5743544",
"0.57184666",
"0.57184666",
"0.55754495",
"0.55385584",
"0.5419316",
"0.5407435",
"0.5372262",
"0.5358366",
"0.53530097",
"0.52896494",
"0.52878785",
"0.52728194",
"0.52632177",
"0.5233262",
"0.5192705",
"0.51917636",
"0.51... | 0.83238745 | 0 |
Returns map description and preview image or placeholder. | function getMapDescriptionAndPreview(mapType, mapName, gameAttributes = undefined)
{
let mapData;
if (mapType == "random" && mapName == "random")
mapData = { "settings": { "Description": translate("A randomly selected map.") } };
else if (mapType == "random" && Engine.FileExists(mapName + ".json"))
mapData = Eng... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getDescription(descriptionObj) {\n // Uncomment to view inconsistencies\n // const descStart = descriptionObj.lastIndexOf('<p>');\n // const description = descriptionObj.slice(descStart + 3, descriptionObj.length - 4);\n\n const description = 'A dummy description of the Flickr image, please view Flickr... | [
"0.606905",
"0.6041051",
"0.60296357",
"0.597684",
"0.59215194",
"0.58818644",
"0.58212966",
"0.57269144",
"0.570982",
"0.5675376",
"0.5637152",
"0.5613527",
"0.5603474",
"0.5590485",
"0.5554939",
"0.5545116",
"0.54919094",
"0.54876673",
"0.54836977",
"0.54777825",
"0.5476801... | 0.7545453 | 0 |
reuseable helper function applies given operation to a text frame, whether the cursor is inside of the text frame or not | function main(operation) {
var hasErrors = false,
selections = app.selection;
for (var i = 0; i < selections.length; i++) {
try {
var textFrame = selections[i] instanceof InsertionPoint ?
selections[i].parentTextFrames[0] :
selections[i];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"doTextOperation(){let root=this,selection=root.selection;if(root.toggled&&null!==root.toggledCommand){document.execCommand(root.toggledCommand,!1,root.toggledCommand||\"\")}else if(null!==root.command){root.dispatchEvent(new CustomEvent(root.command+\"-button\",{bubbles:!0,cancelable:!0,composed:!0,detail:root}));... | [
"0.6741092",
"0.6030203",
"0.5850201",
"0.5818624",
"0.5786038",
"0.56442523",
"0.55973804",
"0.5553062",
"0.54573655",
"0.5452117",
"0.5414267",
"0.5414",
"0.5383953",
"0.5379009",
"0.53779256",
"0.5374717",
"0.5357933",
"0.53571033",
"0.53570217",
"0.5352284",
"0.5350906",
... | 0.64306474 | 1 |
This function calculates the value of the Intellectual measurament taking into consideration the priority order. | function calculateValuesIntellectual(intellectual,childAge){
var realValuePrioritiesApplied;
var mathematical = intellectual.mathematical;
var language = intellectual.language;
var attention = intellectual.attention;
var recognition = intellectual.recognition;
if(0<=childAge<2){
real... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getDamageAmount() {\n return 0.1 + this.operators.reduce((acc, o) => (acc + o.experience), 0);\n }",
"calculateEV(){\n let EV = 0;\n this.props.data.forEach(event =>{\n let removeSymbol = event.eventValue.replace(\"$\", \"\");\n EV = EV + (event.eventProb/100) * (parseFloat(removeSymbol... | [
"0.61937016",
"0.578899",
"0.56979144",
"0.5637937",
"0.5635416",
"0.5635224",
"0.5586254",
"0.55389833",
"0.55114925",
"0.54992676",
"0.5494626",
"0.54821867",
"0.54658276",
"0.54593027",
"0.5435989",
"0.54287726",
"0.54282314",
"0.54235375",
"0.5416453",
"0.5407631",
"0.539... | 0.6319378 | 0 |
This function calculates the value of the Social measurament taking into consideration the priority order. | function calculateValuesSocial(social,childAge){
var realValuePrioritiesApplied;
var respect = social.respect;
var teamworking = social.teamworking;
var independence = social.independence;
var feelingsexpression = social.feelingsexpression;
if(0<=childAge<2){
realValuePrioritiesApplied=... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function minorityPercent(tractData) {\n var fieldName = $('#category-selector option:selected').val();\n if (fieldName.substring(0, 4) === 'inv_') {\n return 1 - tractData[fieldName.substr(4)];\n } else {\n return tractData[fieldName];\n }\n }",
"function calc... | [
"0.6088036",
"0.59891057",
"0.5751642",
"0.5735529",
"0.57174826",
"0.570457",
"0.57017016",
"0.5678918",
"0.5655148",
"0.56411546",
"0.5639149",
"0.56203496",
"0.5616075",
"0.5614394",
"0.56120694",
"0.5596909",
"0.5560426",
"0.55399513",
"0.55341846",
"0.5530125",
"0.552476... | 0.6717188 | 0 |
This function calculates the value of the Physical measurament taking into consideration the priority order. | function calculateValuesPhysical(physical,childAge){
var realValuePrioritiesApplied;
var motor = physical.motor;
var manipulative = physical.manipulative;
var hygiene = physical.hygiene;
var diet = physical.diet;
if(0<=childAge<2){
realValuePrioritiesApplied= (motor * 4) + (manipulat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcular_promedio(type_calification, pr1, pr2, pr3, pa1, pa2, pe){\n if (type_calification === 'A') {\n\n pro_pr = 3*((pr1+pr2+pr3)/3)\n pro_pa = 2*((pa1 + pa2)/2)\n pro_gen = (pro_pr + pro_pa + pe)/6\n return Math.round(pro_gen)\n\n } else if (typ... | [
"0.59412634",
"0.5863439",
"0.58316875",
"0.5827598",
"0.5778974",
"0.57555753",
"0.5671663",
"0.5669334",
"0.5580807",
"0.5549552",
"0.5549048",
"0.5508107",
"0.5490391",
"0.5486257",
"0.54859287",
"0.54732984",
"0.5466591",
"0.5463716",
"0.54628026",
"0.54593045",
"0.542720... | 0.6330083 | 0 |
creates the keypad button events, adds jquery ui for draggable and accordion | function makeKeypad(){
// jquery.ui.draggable to drag the keypad window boundaries
// should be draggable 50% on both sides and up to the header at the bottom of the window
x2 = ($dragBounds.width() - ($keypad.width()/2));
y2 = ($dragBounds.height() - $keypad_handle.height());
/**
* add jquery ui... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }",
"initButtonEvents() {\n let allButtons = document.querySelectorAll('#buttons > g, #parts > g');\n Array.from(allButtons).forEach((btn, index) => {\n this.addEventListenerAll(btn, 'click drag', e => {\n ... | [
"0.61379075",
"0.6099118",
"0.6087974",
"0.5989614",
"0.5930023",
"0.59190804",
"0.5764372",
"0.573447",
"0.5730969",
"0.5668427",
"0.5663974",
"0.56364655",
"0.56236964",
"0.5623076",
"0.56153077",
"0.5594555",
"0.559277",
"0.5571477",
"0.5570689",
"0.5560048",
"0.5547388",
... | 0.7032683 | 0 |
this function will tell sandbox to send back message with iframe size | requestAdjustIframe() {
if (this.props.isPlaying) this.postMessage({ mgbCommand: 'requestSizeUpdate' })
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sendFormHeightMessage() {\n const formHeight = document.getElementById('root').clientHeight;\n window.parent.postMessage('{\"iframe_height\":\"' + formHeight + '\"}','*');\n }",
"function reportSize() {\n var height = document.body.clientHeight;\n window.parent.postMessage(JSON.stringify({\n ty... | [
"0.69698244",
"0.688807",
"0.6864336",
"0.6841648",
"0.6668518",
"0.6646176",
"0.65467554",
"0.6450672",
"0.64120185",
"0.6316628",
"0.6298384",
"0.62856174",
"0.6278611",
"0.6260196",
"0.6154761",
"0.61061364",
"0.5977273",
"0.5929568",
"0.5922704",
"0.5919501",
"0.5913967",... | 0.765636 | 0 |
adjust iFrame size. This is initiated by an event | adjustIframe(size) {
if (this.state.fullScreen) {
return
}
this.iFrameWindow.setAttribute('width', size.width + '')
this.iFrameWindow.setAttribute('height', size.height + '')
// const bounds = this.wrapper.getBoundingClientRect()
const w = Math.min(window.innerWidth * SpecialGlobals.editC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sizeiframe(size, animate) {\n var theSize;\n\n if (size > config.maxViewportWidth) { //If the entered size is larger than the max allowed viewport size, cap value at max vp size\n theSize = config.maxViewportWidth;\n } else if (size < config.minViewportWidth) { //If the entered size is les... | [
"0.7342526",
"0.71938276",
"0.7136238",
"0.7101137",
"0.70168144",
"0.6966558",
"0.6929989",
"0.6886963",
"0.6850852",
"0.6843356",
"0.68363726",
"0.6796298",
"0.6677135",
"0.66457015",
"0.6583799",
"0.65753835",
"0.6575123",
"0.6557136",
"0.65182734",
"0.65159863",
"0.647844... | 0.74411047 | 0 |
Handle incoming AttachToCase events from other components | function handleAttachToCaseEvent(endpoint, args, onChange) {
if (endpoint && endpoint.caseId == args.dataToAttach.caseId) {
var data = endpoint.data;
var hasModification = false;
if (data.succeeded) {
// Add the document ID to our list of attached results since it was attached el... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"inputEventReceived(inputEvent) {\n switch (inputEvent.eventType) {\n case 'focusClassAdded':\n // Handle as desired\n break;\n case 'focusClassRemoved':\n // Handle as desired\n break;\n case 'errorClassAdded':\n ... | [
"0.57309115",
"0.5682359",
"0.5601698",
"0.5590841",
"0.5486934",
"0.54838866",
"0.5473208",
"0.5473208",
"0.5438012",
"0.5378559",
"0.53376895",
"0.5332479",
"0.5329923",
"0.53050774",
"0.52822447",
"0.5242998",
"0.5240619",
"0.5236974",
"0.5235898",
"0.51798594",
"0.5179335... | 0.6610489 | 0 |
Handle incoming DetachFromCase events from other components | function handleDetachFromCase(endpoint, args, onChange) {
if (endpoint && endpoint.caseId == args.caseId) {
var data = endpoint.data;
var hasModification = false;
if (data.succeeded) {
// Remove the document ID to our list of attached results since it was detached elsewhere.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onAfterDetach(msg) {\n const node = this.node;\n node.removeEventListener('keydown', this, true);\n node.removeEventListener('click', this, true);\n document.removeEventListener('focus', this, true);\n this._original.focus();\n }",
"onAfterDetach(msg) {\n this.node.re... | [
"0.6485962",
"0.64423114",
"0.64423114",
"0.6432348",
"0.6394243",
"0.6391553",
"0.6370147",
"0.62050956",
"0.61117685",
"0.6034533",
"0.60094523",
"0.59819686",
"0.5906469",
"0.5819904",
"0.58055806",
"0.5768986",
"0.57520205",
"0.5728104",
"0.5716438",
"0.570576",
"0.563830... | 0.646675 | 1 |
Apply a filter to the current search interface to only show AttachedResults | function AttachedResultsFilter(element, options, bindings) {
var _this = _super.call(this, element, AttachedResultsFilter.ID, bindings) || this;
_this.element = element;
_this.options = options;
_this.options = coveo_search_ui_1.ComponentOptions.initComponentOptions(element, AttachedResu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doFilter() {\n for (var i = 0; i < items.length; i++) {\n // show all\n items[i].classList.remove('thumb--inactive');\n\n // combine filters\n // - only those items will be displayed who satisfy all filter criterias\n var visible = true;\n\n for (var j = 0; j < visibleItem... | [
"0.60689986",
"0.5818395",
"0.580564",
"0.58045095",
"0.57153827",
"0.56780434",
"0.5643122",
"0.56428176",
"0.5591922",
"0.55819255",
"0.5581342",
"0.55511177",
"0.5492895",
"0.54703635",
"0.54236823",
"0.5422102",
"0.5417626",
"0.54138476",
"0.54055846",
"0.5398564",
"0.536... | 0.6504778 | 0 |
The SalesforceDefaultQuickviewTemplate class constructor. | function SalesforceDefaultQuickviewTemplate() {
return _super.call(this) || this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() {\n super(template);\n }",
"function TView() { }",
"function TView() { }",
"function TView(){}",
"function TView() {}",
"function TView() {}",
"function TView() {}",
"constructor() {\n super();\n this.type = 'BodyTemplate7';\n }",
"function ViewParent(templa... | [
"0.6453293",
"0.64099824",
"0.64099824",
"0.6359424",
"0.62803227",
"0.62803227",
"0.62803227",
"0.60150665",
"0.59667987",
"0.5889396",
"0.58882976",
"0.5836717",
"0.58043593",
"0.5786483",
"0.5786483",
"0.5748276",
"0.57327956",
"0.57327956",
"0.57327956",
"0.5556115",
"0.5... | 0.851171 | 0 |
SalesforceQuickviewDocument constructor. Build an iframe with an html view of the document. | function SalesforceQuickviewDocument(element, options, bindings, result) {
var _this = _super.call(this, element, SalesforceQuickviewDocument.ID, bindings) || this;
_this.result = result || _this.resolveResult();
_this.buildIFrame();
return _this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createNewHTMLDocument()\r\n{\r\n\r\n \r\n let frame = document.getElementById(\"iframe\"); \r\n let docu = document.implementation.createHTMLDocument(\"frameDoc\");\r\n \r\n // Fill our document fields\r\n\r\n let script = docu.createElement(\"script\");\r\n let css... | [
"0.5905017",
"0.56143075",
"0.56143075",
"0.56143075",
"0.545122",
"0.5346234",
"0.5323182",
"0.5293637",
"0.5293184",
"0.5271686",
"0.5271686",
"0.5271686",
"0.52621245",
"0.52621245",
"0.52621245",
"0.52621245",
"0.52621245",
"0.52373457",
"0.5236424",
"0.52081853",
"0.5198... | 0.7429092 | 0 |
Find the element's parent with the given tag name: $parent(qs('a'), 'div'); | function $parent (element, tagName) {
if (!element.parentNode) {
return;
}
if (element.parentNode.tagName.toLowerCase() === tagName.toLowerCase()) {
return element.parentNode;
}
return $parent(element.parentNode, tagName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findParent(tagname, el) {\n while (el) {\n if ((el.nodeName || el.tagName).toLowerCase() === tagname.toLowerCase()) {\n return el;\n }\n el = el.parentNode;\n }\n return null;\n }",
"function findParent(tagname,el){\n if ((el.nodeName || el.tagName).toLowerCase()===tagna... | [
"0.7485519",
"0.7412068",
"0.73418367",
"0.7225967",
"0.7105217",
"0.7086161",
"0.7040089",
"0.7040089",
"0.7040089",
"0.7040089",
"0.7040089",
"0.7040089",
"0.70343643",
"0.70140284",
"0.6989814",
"0.69680345",
"0.6940927",
"0.68906814",
"0.6878517",
"0.6870462",
"0.6870462"... | 0.76375026 | 0 |
Runs Array of Frames([time, frame]) | function scene(frames) { for (const [t, fn] of frames) fn(t); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printFrame(arr)\n{\n // Code goes here\n console.log(arr);\n}",
"function logAverageFrame(times) { // times is the array of User Timing measurements from updatePositions()\n var numberOfEntries = times.length;\n var sum = 0;\n for (var i = numberOfEntries - 1; i > numberOfEntries - 11; i--) {\n ... | [
"0.62778884",
"0.61066383",
"0.6100987",
"0.5943227",
"0.5877417",
"0.582697",
"0.5807213",
"0.5783637",
"0.57693154",
"0.57540977",
"0.5740776",
"0.5734342",
"0.5731583",
"0.5731574",
"0.57150507",
"0.57128364",
"0.5711735",
"0.56738883",
"0.5650441",
"0.5588841",
"0.5587072... | 0.6112614 | 1 |
Creates the FastList and caches the rendered content. Layerizing is the process of turning each listitem into its own layer. It's expensive so we defer it till after the firstpaint. | createList() {
debug('create list');
this.fastList = new this.el.FastList(this);
this.fastList.rendered.then(() => {
setTimeout(() => this.layerize(), 360);
this.updateCachedHtml();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RenderList() {\n\t\tvar renderItems = [];\n\t\tvar renderItemsIndex = 0;\n\t\t/**\n\t\t\t\t* Opaque list.\n\t\t\t\t* @memberof zen3d.RenderList#\n\t\t\t\t*/\n\n\t\tvar opaque = [];\n\t\tvar opaqueCount = 0;\n\t\t/**\n\t\t\t\t* Transparent list.\n\t\t\t\t* @memberof zen3d.RenderList#\n\t\t\t\t*/\n\n\t\tvar... | [
"0.65848434",
"0.58686584",
"0.583893",
"0.57542735",
"0.5730981",
"0.5714487",
"0.5711819",
"0.5657472",
"0.56496626",
"0.5621896",
"0.5609856",
"0.5608892",
"0.5596673",
"0.548176",
"0.54222846",
"0.54113334",
"0.53828114",
"0.53635263",
"0.5356323",
"0.535203",
"0.53492",
... | 0.7981671 | 0 |
Defines the templates to be used for the sections and items. Users can provide templates by placing in the root of their | configureTemplates() {
var templateHeader = this.el.querySelector('template[header]');
var templateItem = this.el.querySelector('template[item]');
var noTemplates = !templateItem && !templateHeader;
// If no exact templates found, use unlabeled <template> for item
if (noTemplates) templateItem = th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createTemplates() {\n\n \t/** Template de las opciones principales del header **/\n\n \tthis.templates.container_filter_options =\n\t \t`<div class=\"`+this.getClassOrIdName(this.containers.filter_options) +` pull-right\">\n\t \t\t<a href=\"#\" class=\"`+this.getClassOrIdName(this.styles.save_filters_b... | [
"0.66013634",
"0.64229715",
"0.64051735",
"0.626923",
"0.61745065",
"0.61597884",
"0.61594164",
"0.6127776",
"0.61245525",
"0.6045607",
"0.59126925",
"0.5903942",
"0.5790166",
"0.57646996",
"0.57611066",
"0.5752474",
"0.57311165",
"0.569248",
"0.5669511",
"0.5659317",
"0.5605... | 0.67258465 | 0 |
Check if an observer is already attached | alreadyAttached(newObserver){
var result = false;
this.observers.forEach(function(observer){
if(observer.equals(newObserver)){
result = true;
}
})
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isSubscribed(observer) {\n if (!this._observers)\n return false;\n return this._observers.has(observer);\n }",
"attach(observer){\n if(!this.alreadyAttached(observer)){\n this.observers.push(observer);\n }\n }",
"function client_is_observer()\n{\n return client.conn['ob... | [
"0.7050522",
"0.67340213",
"0.6548768",
"0.6503",
"0.59743786",
"0.59626305",
"0.59207475",
"0.5915714",
"0.5915714",
"0.5915714",
"0.5911038",
"0.5882358",
"0.5798743",
"0.57825077",
"0.57724917",
"0.575067",
"0.575067",
"0.575067",
"0.57425684",
"0.57425684",
"0.57425684",
... | 0.83381337 | 0 |
return an asset by property keyvalue, starting to search from a parent asset | function getAssetRecursive(parentAsset, key, value) {
if (parentAsset[key] === value){
return (parentAsset);
}
else {
for (let i = 0; i < parentAsset.children.length; i++) {
if (parentAsset.children[i].asset[key] === value) {
return (parentAsset.children[i].asset)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"FindPropertyRelative() {}",
"function find(key) {\n let parent = unioned[key];\n if (parent == null) return key;\n parent = find(parent);\n unioned[key] = parent; // Path compression\n return parent;\n }",
"getNodeByProp(prop, value, tree){\n ... | [
"0.566727",
"0.5608461",
"0.5531626",
"0.5507435",
"0.54924655",
"0.53147",
"0.52978414",
"0.5264036",
"0.5222736",
"0.51977247",
"0.51892334",
"0.51641494",
"0.5133539",
"0.51214296",
"0.5115152",
"0.5100756",
"0.5098468",
"0.5095192",
"0.5090042",
"0.50841403",
"0.50782436"... | 0.7198786 | 0 |
RANDOM EVENT: Find Drugs | function r_randomEventFindDrugs()
{
// baustelle - lets give Chilli P Meth away - insteed of acid
log.info("Random Event: Finding Drugs on street");
luckEvents = luckEvents + 1;
foundDrugs = h_getRandomInt(1,50); // get random number
if(foundDrugs <= freePockets)
{
var n = noty({text: '<p><i class="fa fa-se... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function r_randomEventCheapDrugs()\n{\n\tlog.info(\"Random Event: Cheap Drugs\");\n\n\tluckEvents = luckEvents + 1;\n\n\tvar n = noty({text: '<p><i class=\"fa fa-shopping-cart\"></i> Cheap Drugs</p>Drug sale - buy now as much as possible'});\n\n\t// new cost of drugs\n\tdrugs.acid = h_getRandomInt(200,500);\n\tdr... | [
"0.71083504",
"0.6387877",
"0.63333935",
"0.62373114",
"0.62008053",
"0.61246437",
"0.6076851",
"0.59863245",
"0.5920455",
"0.5912649",
"0.57793164",
"0.5761597",
"0.5760082",
"0.57588696",
"0.5757427",
"0.57205725",
"0.5715957",
"0.57054406",
"0.567721",
"0.5654263",
"0.5652... | 0.7656763 | 0 |
RANDOM EVENT: Sale / cheap Drugs | function r_randomEventCheapDrugs()
{
log.info("Random Event: Cheap Drugs");
luckEvents = luckEvents + 1;
var n = noty({text: '<p><i class="fa fa-shopping-cart"></i> Cheap Drugs</p>Drug sale - buy now as much as possible'});
// new cost of drugs
drugs.acid = h_getRandomInt(200,500);
drugs.coke = h_getRandomInt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function r_randomEventFindDrugs()\n{\n\t// baustelle - lets give Chilli P Meth away - insteed of acid\n\t\n\tlog.info(\"Random Event: Finding Drugs on street\");\n\n\tluckEvents = luckEvents + 1;\n\n\tfoundDrugs = h_getRandomInt(1,50); // get random number\n\tif(foundDrugs <= freePockets)\n\t{\n\t\tvar n = noty({t... | [
"0.7078706",
"0.67714417",
"0.6690595",
"0.6449149",
"0.6369461",
"0.63324577",
"0.6330816",
"0.6259439",
"0.6201653",
"0.6134621",
"0.61254334",
"0.60933006",
"0.60859185",
"0.60819465",
"0.60661703",
"0.6060163",
"0.6058824",
"0.60548633",
"0.6054536",
"0.6048136",
"0.60430... | 0.85298383 | 0 |
RANDOM EVENT: Buy Weapon | function r_randomEventBuyWeapon()
{
log.info("Random Event: Buying weapons");
luckEvents = luckEvents + 1;
weaponName = "Magnum";
weaponPrice = '400';
if(cash > weaponPrice)
{
var answer = confirm("Do you want to buy a "+weaponName+" for "+weaponPrice+" $ ?")
if (answer)
{
var n = noty({text: '<p><i ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"TakeWeapon() {\n this._on_cooldown = true\n this._PaintSpawn()\n this._last_use = Date.now()\n }",
"function bsmRandomWeapon(){\n\tif(GC >= bsmRandomWeaponCost){\n\t\tspendCurrency(bsmRandomWeaponCost);\n\t\tvar weaponHold = randomWeapon();\n\t\taddLogText(\"The Blacksmith forged: <label class='rarity\... | [
"0.7470386",
"0.70180696",
"0.69998515",
"0.69694096",
"0.68724114",
"0.6824402",
"0.67857164",
"0.6662824",
"0.6653501",
"0.6651342",
"0.6620712",
"0.6555602",
"0.64982337",
"0.64130664",
"0.6403856",
"0.63925356",
"0.6386694",
"0.63830256",
"0.6366893",
"0.63535357",
"0.635... | 0.8190481 | 0 |
RANDOM EVENT: Cancer Returns SPECIAL RANDOM EVENT happens really rare | function r_randomEventCancerReturns()
{
log.info("Random Event: Cancer returns");
var shouldRandomHappen = h_getRandomInt(1,100); // calculate chance for a random event
if(shouldRandomHappen >= 95) // random event happens
{
// cancer really happens
var n = noty({text: '<p><i class="fa fa-user-md"></i> Cancer</... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function C012_AfterClass_Jennifer_RandomJenniferDommeEvent() {\n\t\n\t// Makes sure the next random event can be triggered\n\tif (!GameLogQuery(CurrentChapter, CurrentActor, \"EventGeneric\")) {\n\n\t\t// 1 event per 15 minutes maximum, the event is random and drawn from the Mistress pool\n\t\tEventSetGenericTimer... | [
"0.6900574",
"0.68573225",
"0.6844983",
"0.67708224",
"0.6739569",
"0.67124087",
"0.6634774",
"0.65107584",
"0.6449001",
"0.64420414",
"0.6299973",
"0.62581325",
"0.61638445",
"0.61539996",
"0.61302155",
"0.6086888",
"0.6074972",
"0.60185426",
"0.6000976",
"0.59993696",
"0.59... | 0.7477782 | 0 |
Returns a promise which will be resolved within an idle timeframe of event loop or if a timeout will be fired. | function resolveOnIdleCallback(timeoutMs) {
if (timeoutMs === void 0) { timeoutMs = browser_idle_callback_utils_const_1.THROTTLING_UTILS_IDLE_CALLBACK_TIMEOUT_DEFAULT_MS; }
return new Promise(function (res) {
var requestIdleCallback = getRequestIdleCallback();
var idleCallback = requestIdleCallb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function timeout() {\n return new Promise(function (resolve) {\n setTimeout(resolve, 1);\n });\n }",
"function timeout(t = 0){\n return new Promise((resolve, reject) =>{\n setTimeout(resolve, duration); \n })\n}",
"async onIdle() {\n // Instantly resolve if none pend... | [
"0.67880195",
"0.6329196",
"0.6316195",
"0.6277932",
"0.61671895",
"0.61671895",
"0.59663844",
"0.5931142",
"0.5871381",
"0.58099824",
"0.5782799",
"0.5778359",
"0.5778359",
"0.57294977",
"0.5713025",
"0.5696702",
"0.56887776",
"0.56849295",
"0.5684582",
"0.56518006",
"0.5628... | 0.675276 | 1 |
convert Wei to Eth | function convertWeiToEth( stringValue ) {
if ( typeof stringValue != 'string' ) {
stringValue = String( stringValue );
}
return web3.utils.fromWei( stringValue, 'ether' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toWei(...args) {\n return ethers_1.utils.parseEther(...args);\n}",
"function tokens(n){\n return web3.utils.toWei(n, 'ether'); \n}",
"function ether (n) {\n return web3.utils.toWei(n.toString(), 'ether');\n }",
"function tokens(n) {\n return web3.utils.toWei(n, 'ether');\n}",
"functi... | [
"0.6472846",
"0.6440872",
"0.6315285",
"0.62931406",
"0.6089904",
"0.6063412",
"0.5534851",
"0.54950863",
"0.5394119",
"0.5201859",
"0.5129276",
"0.5129276",
"0.5070384",
"0.50320256",
"0.50309527",
"0.50200564",
"0.5016244",
"0.500223",
"0.4991308",
"0.49859",
"0.49604368",
... | 0.7310397 | 0 |
Takes data and writes text in cells on the 1st column of new 'bookmark_output' as well as col 5 of 'bookmark_input' for easy comparison (to check for errors). Uncomment line_ if you want to automatically go to exporting. | function dataToText() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('bookmark_input'); // I know it's bad to hardcode but hey, it works
var values = sheet.getDataRange().getValues();
var startRow = 2; // Start at second row because the first row contains the data labe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function export2Text() {\n var ss = SpreadsheetApp.getActiveSpreadsheet();\n var sheet = ss.getSheetByName(\"bookmark_output\");\n var values = sheet.getDataRange().getValues();\n\n // get and join text from all cells\n var text = values.map(function(a) {\n return a.join('\\t');\n }).join(... | [
"0.60542244",
"0.56596327",
"0.54745513",
"0.51474047",
"0.50995886",
"0.50447303",
"0.49723244",
"0.49650455",
"0.49540514",
"0.4935581",
"0.4920921",
"0.49113607",
"0.4908729",
"0.49069902",
"0.49014583",
"0.4900495",
"0.48877862",
"0.48788926",
"0.48722827",
"0.4871533",
"... | 0.74533594 | 0 |
Export bookmark_output to textfile. Save to Drive and Download link | function export2Text() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("bookmark_output");
var values = sheet.getDataRange().getValues();
// get and join text from all cells
var text = values.map(function(a) {
return a.join('\t');
}).join('\r\n');
/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeTextFile(filepath, output, type) {\n\t\tif (type == 'java'){\n\t\t\tvar link = document.getElementById('downloadlinkjava');\n\t\t}else{\n\t\t\tvar link = document.getElementById('downloadlinkros');\n\t\t}\n\t\tlink.href = makeTextFile(output);\n\t\tlink.download = filepath;\n\t\tvar event = new Mouse... | [
"0.64960396",
"0.6486619",
"0.62862647",
"0.62493294",
"0.61894315",
"0.6180496",
"0.61256397",
"0.61250883",
"0.6124943",
"0.61110073",
"0.6080096",
"0.60503006",
"0.60145617",
"0.59958",
"0.5968066",
"0.59257317",
"0.59030783",
"0.58956444",
"0.5878396",
"0.5877913",
"0.587... | 0.71071124 | 0 |
var EW_REPORT_TABLE_ROW_CLASSNAME = "ewTableRow"; var EW_REPORT_TABLE_ALT_ROW_CLASSNAME = "ewTableAltRow"; Get Ctrl key for multiple column sort | function ewrpt_Sort(e, url) {
var newUrl = url
if (e.ctrlKey)
newUrl += "&ctrl=1";
location = newUrl;
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setHeader(table,keys){\n var header = table.createTHead();\n var row = header.insertRow(0);\n scope.selectedMax = keys.length-1;\n if(typeof scope.actions === 'function'){\n var thCheck = document.createElement('th');\n thCheck.innerHTML = createCheckbox(-1,i,... | [
"0.576419",
"0.576419",
"0.5605758",
"0.5563278",
"0.5563084",
"0.5549168",
"0.55101466",
"0.55080914",
"0.549816",
"0.54951185",
"0.54713523",
"0.5444839",
"0.544172",
"0.5428417",
"0.5402429",
"0.53987926",
"0.53872675",
"0.53747874",
"0.536267",
"0.53350765",
"0.53350765",... | 0.615494 | 0 |
hollow button (mean justborder style) | hollowButton(content, type, templ) {
return this.button(
h.class(type, !!type)
.classes('button hollow'),
content, templ
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_createCloseModalButtonBorder() {\n const x = this._getGameWidth() - this.padding - 20;\n const y = this._getGameHeight() - this.windowHeight - this.padding;\n this.graphics.strokeRect(x, y, 20, 20);\n }",
"function clearDisplay() {\r\n $(\".bitbtn\").css(\"background-color\", \"LightGray\");\t\t\r\... | [
"0.6206668",
"0.590753",
"0.58876425",
"0.58844215",
"0.584678",
"0.5837762",
"0.5826868",
"0.57978064",
"0.5729674",
"0.560937",
"0.5554192",
"0.55529624",
"0.5552633",
"0.55193245",
"0.5514209",
"0.55141926",
"0.54920006",
"0.54905623",
"0.5489413",
"0.54819417",
"0.5464826... | 0.73873484 | 0 |
close button : for closing action : templ = h.data('close') || h.click(...) | closeButton(templ) {
return this.button(
h.class('close-button')
.attr('aria-label', 'Close alert')
.attr('type', 'button')
.span(h.attr('aria-hidden', 'true'), '\u00D7'),
templ
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_handleCloseClick() {\n\t\tthis.close();\n\t}",
"function handleCloseClick(){\n handleClose()\n }",
"_onCloseButtonTap() {\n this.fireDataEvent(\"close\", this);\n }",
"function onCloseButtonClick(){\n\t\tt.hide();\n\t}",
"function close_btn() {\n\n\t//Close window on click\n\t$(\".close-... | [
"0.7284809",
"0.72217625",
"0.71455634",
"0.7010384",
"0.69626945",
"0.6913528",
"0.69020784",
"0.67920625",
"0.678967",
"0.67867696",
"0.6786551",
"0.67797595",
"0.67437035",
"0.6674454",
"0.66275865",
"0.6621406",
"0.6620618",
"0.6619934",
"0.661941",
"0.65784043",
"0.65532... | 0.79447645 | 0 |
setActiveQuestion takes one optional argument. If no argument is passed it will set the active question in the quiz to the next question that has yet to be answered. This allows the user to skip questions and come back to them later, even by clicking the "continue" button. It will still take them to the unanswered ques... | function setActiveQuestion(index){
if(index === undefined){
var breakOut = false;
/*
* quizLength is set to 1 less than the length of the quiz as it
* is always referenced against the variable activeQuestion
* which is 0 index. Therefore the le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setActiveQuestion(index){\n // no argument passed, data = undefined.\n if(index === undefined){\n var breakOut = false;\n\n /*\n * quizLength is set to 1 less than the length of the quiz as it\n * i... | [
"0.707897",
"0.6325515",
"0.62194365",
"0.6195387",
"0.61794484",
"0.6062364",
"0.60572237",
"0.59698385",
"0.5966698",
"0.5962038",
"0.5915391",
"0.59021795",
"0.5872312",
"0.58687246",
"0.58609897",
"0.5856072",
"0.5813663",
"0.5805852",
"0.5800659",
"0.57787204",
"0.577635... | 0.6939525 | 1 |
call the smart contract, create a post | async function createPost() {
if (!title && !content) return;
if (typeof window.ethereum !== 'undefined') {
await requestAccount();
const provider = new ethers.providers.Web3Provider(window.ethereum);
console.log({ provider });
const signer = provider.getSigner();
const contract = new ethers.Contract... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async createPost () {\n\t\tthis.user = this.fromUser;\n\t\tthis.postCreator = new PostCreator({\n\t\t\trequest: this,\n\t\t\tteam: this.team,\n\t\t\tforInboundEmail: true,\n\t\t\torigin: 'email'\n\t\t});\n\t\tconst postData = {\n\t\t\tteamId: this.team.id,\n\t\t\tstreamId: this.streamId,\n\t\t\ttext: this.request.... | [
"0.65877944",
"0.6567711",
"0.64282376",
"0.64114076",
"0.6394719",
"0.63176167",
"0.62987435",
"0.62202954",
"0.61981034",
"0.6183399",
"0.6172781",
"0.6067889",
"0.60537314",
"0.60490334",
"0.6028643",
"0.602264",
"0.5978077",
"0.5957426",
"0.5936529",
"0.59128475",
"0.5856... | 0.75470537 | 0 |
call the smart contract, read post title and content | async function readPost() {
if (!id) return;
if (typeof window.ethereum !== 'undefined') {
await requestAccount();
const provider = new ethers.providers.Web3Provider(window.ethereum);
console.log({ provider });
const signer = provider.getSigner();
const contract = new ethers.Contract(crudAddress, Cru... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function editPost() {\n\t\tif (!title && !content) return;\n\t\tif (typeof window.ethereum !== 'undefined') {\n\t\t\tawait requestAccount();\n\t\t\tconst provider = new ethers.providers.Web3Provider(window.ethereum);\n\t\t\tconsole.log({ provider });\n\t\t\tconst signer = provider.getSigner();\n\t\t\tconst c... | [
"0.60195655",
"0.58744174",
"0.5637264",
"0.5508984",
"0.5448757",
"0.53905493",
"0.53856397",
"0.5327744",
"0.5211335",
"0.5155702",
"0.5149173",
"0.5112331",
"0.5102703",
"0.5056838",
"0.50326097",
"0.5023814",
"0.4996266",
"0.49693853",
"0.4918179",
"0.4912367",
"0.4878413... | 0.67206 | 0 |
call the smart contract, edit post title and content | async function editPost() {
if (!title && !content) return;
if (typeof window.ethereum !== 'undefined') {
await requestAccount();
const provider = new ethers.providers.Web3Provider(window.ethereum);
console.log({ provider });
const signer = provider.getSigner();
const contract = new ethers.Contract(c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async editPost(page,title,content){\n await page.click(or.post.editPost)\n await page.click(or.post.title,{clickCount: 3})\n await page.keyboard.press('Backspace');\n await page.type(or.post.title,title)\n await page.click(or.post.content,{... | [
"0.6901653",
"0.6387783",
"0.6297326",
"0.6214203",
"0.607885",
"0.5973292",
"0.59627175",
"0.5910883",
"0.587702",
"0.5874162",
"0.58375144",
"0.58264285",
"0.5777693",
"0.5776127",
"0.57495207",
"0.57446367",
"0.57393235",
"0.5734841",
"0.57229376",
"0.5721256",
"0.5661064"... | 0.80181897 | 0 |
call the smart contract, delete post | async function deletePost() {
if (typeof window.ethereum !== 'undefined') {
await requestAccount();
const provider = new ethers.providers.Web3Provider(window.ethereum);
console.log({ provider });
const signer = provider.getSigner();
const contract = new ethers.Contract(crudAddress, Crud.abi, signer);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function contract_delete(request, response, next) {\n console.log('Contract delete');\n}",
"function deleteOrdercontract(req, res) {\n contract.findOneAndUpdate({_id: req.body.contarctId}, {deleted: true}, function(err, contractdetail) {\n if (err) {\n res.json({code: Constant.ERROR_CODE, m... | [
"0.7481186",
"0.61918867",
"0.6185577",
"0.61370575",
"0.60173434",
"0.59736514",
"0.5954343",
"0.59287053",
"0.5902604",
"0.58538496",
"0.58204275",
"0.58204275",
"0.58204275",
"0.58204275",
"0.58204275",
"0.58204275",
"0.58204275",
"0.58204275",
"0.57846314",
"0.5770468",
"... | 0.6986383 | 1 |
Local storage for recent food items | function recentFoodStorage(value) {
if (foodStorage.length === 5) {
foodStorage.pop();
}
foodStorage.unshift(value);
localStorage.setItem("food", JSON.stringify(foodStorage));
populateRecentFood(foodStorage);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static storeFood(item) {\n const items = Storage.getFoods();\n\n items.push(item);\n localStorage.setItem('foods', JSON.stringify(items));\n }",
"function saveLocally(date, mealType, calories, foodName) {\n\n\n //console.log('storing in ' + number)\n //window.localStorage.setItem(number + '', pos... | [
"0.78172123",
"0.7403938",
"0.7218324",
"0.7090078",
"0.70390904",
"0.70055753",
"0.69189155",
"0.68559575",
"0.68303293",
"0.68210334",
"0.67550546",
"0.67460805",
"0.6744067",
"0.66909105",
"0.6674653",
"0.66452485",
"0.66179365",
"0.66075957",
"0.6589174",
"0.6585308",
"0.... | 0.76066875 | 1 |
Local storage for recent drink items | function recentDrinkStorage(value) {
if (drinkStorage.length === 5) {
drinkStorage.pop();
}
drinkStorage.unshift(value);
localStorage.setItem("drinks", JSON.stringify(drinkStorage));
populateRecentDrink(drinkStorage);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storageBreweriesVisited () {\n localStorage.setItem(\"breweriesVisited\", JSON.stringify(breweriesVisited));\n}",
"function updateStorage() {\n localStorage.setItem(\"budgetItems\", JSON.stringify(budgetItems));\n localStorage.setItem(\"lastID\", lastID);\n}",
"function saveDateToLocalStorage... | [
"0.6849293",
"0.68446434",
"0.67653185",
"0.6727532",
"0.6613727",
"0.66086394",
"0.6565825",
"0.65654355",
"0.6549378",
"0.6492303",
"0.6470187",
"0.6467661",
"0.6448032",
"0.6425117",
"0.64180255",
"0.6382859",
"0.6355369",
"0.63459873",
"0.6330797",
"0.63173413",
"0.631701... | 0.74170697 | 0 |
Use the generator with the given data to draw to the canvas | function drawCanvas(upData, downData, generator, canvas) {
const ctx = canvas.getContext('2d');
generator.context(ctx);
// Clear canvas
canvas.width = canvas.width;
// We have to draw the up and down candlesticks in separate 'paths' so we can colour them separately (green for up, red for down).
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newDrawing(data){\n noFill();\n\n for (var i = 0; i < 200; i += 20) {\n stroke (250);\n bezier(data.x-(i/2.0), data.y, 410, 20, 440, 300, 240-(i/16.0), 300+(i/8.0));\n } \n}",
"function draw(data) {\n if (!data.sourceImageBitmap || !data.backgroundImageBitmap || !outputContext || !h... | [
"0.65732616",
"0.6565623",
"0.6435349",
"0.6379317",
"0.6352406",
"0.633021",
"0.6268804",
"0.6264419",
"0.62465864",
"0.62139326",
"0.6200174",
"0.61596245",
"0.6123906",
"0.59660023",
"0.59660023",
"0.59660023",
"0.5937674",
"0.5893759",
"0.58805406",
"0.58561987",
"0.58493... | 0.7078675 | 0 |
Use the generator with the given data to draw to the SVG element | function drawSvg(upData, downData, generator, svg) {
generator.context(null);
d3.select(svg).select("path.up")
.datum(upData)
.attr("d", generator);
d3.select(svg).select("path.down")
.datum(downData)
.attr("d", generator);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newDrawing(data){\n noFill();\n\n for (var i = 0; i < 200; i += 20) {\n stroke (250);\n bezier(data.x-(i/2.0), data.y, 410, 20, 440, 300, 240-(i/16.0), 300+(i/8.0));\n } \n}",
"function drawSvg() {\n\t\t// selector can be #residential, or #commercial which should be in graph.html\n\t\t... | [
"0.67600554",
"0.649227",
"0.64535964",
"0.6449214",
"0.6382594",
"0.61475015",
"0.61379427",
"0.60484874",
"0.6027659",
"0.59493774",
"0.5894757",
"0.5887743",
"0.5842438",
"0.58384347",
"0.58250916",
"0.57923543",
"0.57921666",
"0.57069993",
"0.56906176",
"0.56864446",
"0.5... | 0.71249044 | 0 |
TODO: Add responseReceivedHandler() here | function responseReceivedHandler() {
if ( !this.response[ "error" ] ) {
let html = "<ol>";
this.response.forEach( elm => {
html += `<li>${ elm.quote } - ${ elm.source }</li>`;
});
html += "</ol>";
document.querySelector("#quotes").innerHTML = html;
} else {
document.qu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function completeHandler(e) {\n console.log(\"received \" + e.responseCode + \" code\");\n var serverResponse = e.response;\n}",
"_onResponse(msg) {\n let _this = this;\n\n let event = {\n type: msg.type,\n url: msg.body.source,\n code: msg.body.code\n };\n\n if (_this._onRespon... | [
"0.7196604",
"0.7137128",
"0.7055605",
"0.689268",
"0.66554874",
"0.65960574",
"0.6579527",
"0.6471617",
"0.6444165",
"0.64201075",
"0.6379968",
"0.63573045",
"0.63245034",
"0.63077664",
"0.6307314",
"0.6304234",
"0.6304234",
"0.62832123",
"0.62513334",
"0.6223445",
"0.621477... | 0.7277016 | 0 |
Renders the games as images in a grid. if you click on one it will create a popup with information about the game and a few buttons which link elsewhere | function renderGames() {
let counter = 0; // number of games added
for (let i = 0; i < window.games.length / 3; ++i) {
// Creates a row for the grid
const row = document.createElement('div');
row.classList.add('row');
row.setAttribute('id', "row " + (i + 1));
for (let j =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function layoutGame() {\r\n\t\t\r\n\t\t// $(\"#fighterImages\").html('<img value=\"characters.fighter[0]\" id=\"fighterImg\" src=' + fighterImg1 + ' />');\r\n\t\t// $(\"#fighterImages\").append('<img value=\"characters.fighter[1]\" id=\"fighterImg\" src=' + fighterImg2 + ' />');\r\n\t\t// $(\"#fighterImages\").app... | [
"0.67162454",
"0.6616491",
"0.65444916",
"0.64461297",
"0.6437737",
"0.64188516",
"0.63414866",
"0.6269512",
"0.62414676",
"0.6210933",
"0.620244",
"0.6194237",
"0.61869574",
"0.6179161",
"0.61760914",
"0.6170917",
"0.6163224",
"0.6162912",
"0.615915",
"0.6152045",
"0.6148747... | 0.721998 | 0 |
Closes the RTCPeerConnection and all the underlying ORTC objects. | close() {
if (this._closed) {
return;
}
this._closed = true;
logger.debug('close()');
this._updateAndEmitSignalingStateChange(RTCSignalingState.closed);
// Close RTCIceGatherer.
// NOTE: Not yet implemented by Edge.
try {
this._... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function closeRTCPeerConnection() {\r\n try {\r\n if (localChannel != null) {\r\n if (localChannel.readyState != \"closed\") {\r\n localChannel.close();\r\n }\r\n }\r\n\r\n if (remoteChannel != null) {\r\n if (remoteChannel.readyState != \"clo... | [
"0.6758838",
"0.66342837",
"0.62562436",
"0.623928",
"0.58204913",
"0.5710186",
"0.56911445",
"0.56447446",
"0.55789673",
"0.55782825",
"0.55782825",
"0.55782825",
"0.5564708",
"0.5471739",
"0.537042",
"0.52685285",
"0.52561885",
"0.5245071",
"0.521057",
"0.5207316",
"0.51967... | 0.6666935 | 1 |
Add a m= section. | function addMediaSection(mid, kind) {
const mediaObject = {};
// m= line.
mediaObject.type = kind;
switch (kind) {
case 'audio':
case 'video':
mediaObject.protocol = 'RTP/SAVPF';
mediaObject.port = 9;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertSection(k,v) {\n $('#interface').prepend(\n\t$('<fieldset></fieldset>').attr('id',k).append(\n\t $('<legend></legend>').append(v),\n\t '<div class=\"btn-toolbar\"><div class=\"btn-group\"></div></div>'\n\t)\n );\n}",
"make(m) {\n\t\treturn [`%c[TCFS]:%c ${m}`, 'color: purple; font-weight: bold... | [
"0.47707924",
"0.45689517",
"0.45560127",
"0.4449223",
"0.4443984",
"0.44359782",
"0.44238284",
"0.440573",
"0.4383318",
"0.43567535",
"0.43464634",
"0.43322468",
"0.43095514",
"0.43024328",
"0.4286674",
"0.428513",
"0.4266793",
"0.4266793",
"0.4266793",
"0.42620263",
"0.4244... | 0.46214175 | 1 |
May emit buffered ICE candidates. | _emitBufferedIceCandidates() {
if (this._closed) {
return;
}
for (const sdpCandidate of this._bufferedIceCandidates) {
if (!sdpCandidate) {
continue; // eslint-disable-line no-continue
}
// Now we have set the MID values of the SD... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_emitIceCandidate(candidate) {\n if (this._closed) {\n return;\n }\n\n let sdpCandidate = null;\n\n if (candidate) {\n // NOTE: We assume BUNDLE so let's just emit candidates for the\n // first m= section.\n const sdpMIndex = this._mids.keys()... | [
"0.68623716",
"0.6615096",
"0.6420136",
"0.64158064",
"0.6148824",
"0.60870415",
"0.6058924",
"0.60233325",
"0.6009345",
"0.59921104",
"0.59487957",
"0.5922857",
"0.58735216",
"0.58657205",
"0.58074415",
"0.5765566",
"0.5754639",
"0.5740707",
"0.5691405",
"0.5688625",
"0.5645... | 0.7904476 | 0 |
May emit 'connectionstatechange' event. | _emitConnectionStateChange() {
if (this._closed && this.connectionState !== 'closed') {
return;
}
logger.debug(
'emitting "connectionstatechange", connectionState:',
this.connectionState);
const event = new yaeti.Event('connectionstatechange');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function connectionStateChanged(connectionState) {\n return {\n payload: connectionState,\n type: Constants_1.CONNECTION_STATE_CHANGE\n };\n}",
"processUpdateConn(event) {\n trace(`ICE state changed to: ${event.target.iceConnectionState}.`);\n\n if (event.target.iceConnectionSta... | [
"0.7439439",
"0.73781645",
"0.7260693",
"0.7207006",
"0.7194621",
"0.7194621",
"0.7160408",
"0.69773954",
"0.6881134",
"0.67858136",
"0.66790026",
"0.6582611",
"0.6559427",
"0.649845",
"0.645354",
"0.6419011",
"0.64082277",
"0.64082277",
"0.64052194",
"0.64028555",
"0.6377881... | 0.82405126 | 0 |
May emit 'iceconnectionstatechange' event. | _emitIceConnectionStateChange() {
if (this._closed && this.iceConnectionState !== 'closed') {
return;
}
logger.debug(
'emitting "iceconnectionstatechange", iceConnectionState:',
this.iceConnectionState);
const event = new yaeti.Event('iceconnectionst... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleICEConnectionStateChange(event){\n log(\"ICEConnectionStateChange: \"+pc.iceConnectionState)\n}",
"function handleConnectionChange(event) {\n const peerConnection = event.target;\n console.log('ICE state change event: ', event);\n trace(`${getPeerName(peerConnection)} ICE state: ` +\n `... | [
"0.85007346",
"0.8248173",
"0.8248173",
"0.82197255",
"0.8152864",
"0.7800429",
"0.76307553",
"0.7256486",
"0.71670395",
"0.7037966",
"0.66663",
"0.6564211",
"0.65227103",
"0.65047365",
"0.64429176",
"0.640365",
"0.64008445",
"0.64008445",
"0.63830143",
"0.6365075",
"0.633683... | 0.8264424 | 1 |
May emit 'negotiationneeded' event. | _emitNegotiationNeeded() {
// Ignore if signalingState is not 'stable'.
if (this.signalingState !== RTCSignalingState.stable) {
return;
}
logger.debug('emitting "negotiationneeded"');
const event = new yaeti.Event('negotiationneeded');
this.dispatchEvent(ev... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function handleNegotiationNeededEvent() {\n if (negotioned) {\n log(\"Already netioned dear!!!!!\");\n return;\n }\n log(\"*** Negotiation needed\");\n try {\n log(\"---> Creating offer\");\n const offer = await myPeerConnection.createOffer();\n\n // If the connection has... | [
"0.7737604",
"0.7117028",
"0.6083531",
"0.5911373",
"0.543773",
"0.5416733",
"0.5332603",
"0.52956307",
"0.5285473",
"0.52292114",
"0.5216428",
"0.5208048",
"0.52012414",
"0.5180874",
"0.51638496",
"0.51191086",
"0.5108689",
"0.50989425",
"0.5098317",
"0.5069723",
"0.506365",... | 0.8193719 | 0 |
Start sending our media to the remote. | _sendMedia() {
logger.debug('_sendMedia()');
for (const info of this._localTrackInfos.values()) {
// Ignore if already sending.
if (info.sending) {
continue; // eslint-disable-line no-continue
}
const rtpSender = info.rtpSender;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function startMedia() {\n if (localVideoStream && localAudioStream) {\n console.warn('WARN: local media ALREADY started');\n return;\n }\n await connectSocket().catch(err => {\n console.error(err);\n return;\n });\n localVideoStream = await getUserStream({ video: tr... | [
"0.66941506",
"0.6253241",
"0.60328037",
"0.60327",
"0.6009098",
"0.59892434",
"0.59791034",
"0.5976939",
"0.597039",
"0.59448266",
"0.58890027",
"0.5768615",
"0.57194924",
"0.56829417",
"0.567894",
"0.5671261",
"0.5664803",
"0.5645729",
"0.5641507",
"0.5634413",
"0.56293",
... | 0.6844914 | 0 |
May update iceGatheringState and emit 'icegatheringstatechange' event. | _updateAndEmitIceGatheringStateChange(state) {
if (this._closed || state === this.iceGatheringState) {
return;
}
this._iceGatheringState = state;
logger.debug(
'emitting "icegatheringstatechange", iceGatheringState:',
this.iceGatheringState);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleICEGatheringStateChangeEvent(event) {\n log(\n \"*** ICE gathering state changed to: \" +\n myPeerConnection.iceGatheringState\n );\n }",
"_emitIceConnectionStateChange() {\n if (this._closed && this.iceConnectionState !== 'closed') {\n return;\n }\n\n ... | [
"0.8453173",
"0.6258389",
"0.6197565",
"0.6095492",
"0.6039615",
"0.60288227",
"0.60288227",
"0.58388114",
"0.5755967",
"0.56856936",
"0.55335784",
"0.55335784",
"0.549205",
"0.54877347",
"0.54840165",
"0.5439432",
"0.5434465",
"0.5430681",
"0.534967",
"0.534967",
"0.534967",... | 0.84782016 | 0 |
May update signalingState and emit 'signalingstatechange' event. | _updateAndEmitSignalingStateChange(state) {
if (state === this.signalingState) {
return;
}
this._signalingState = state;
logger.debug(
'emitting "signalingstatechange", signalingState:',
this.signalingState);
const event = new yaeti.Event('s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleSignalingStateChangeEvent(event) {\n log(\n \"*** WebRTC signaling state changed to: \" +\n myPeerConnection.signalingState\n );\n switch (myPeerConnection.signalingState) {\n case \"closed\":\n closeVideoCall();\n break;\n }\n }",
"emitBackendState(stat... | [
"0.67574316",
"0.66062754",
"0.65239555",
"0.64185745",
"0.63948315",
"0.63948315",
"0.63878924",
"0.63583726",
"0.63583726",
"0.6309529",
"0.6305242",
"0.62112504",
"0.620536",
"0.61706686",
"0.6165152",
"0.6142978",
"0.6060283",
"0.60516196",
"0.6008609",
"0.59805685",
"0.5... | 0.84882104 | 0 |
funcion para subir GIF a pagina | function subir_GIF_function() {
let form = new FormData();
form.append('file', GIF_video, 'myGif.gif');
let GIF_preview = URL.createObjectURL(GIF_video);
summary_panel_function(GIF_preview);
POST_GIF_function(form);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function subirNewGif(){\n repeat.style.display = \"none\";\n // hago que el boton de step1 ya no tenga funcionalidad\n stepper1.style.pointerEvents = \"none\";\n // defino un formData para crear el fichero que poteriormente subire a giphy\n let form = new FormData();\n\n subir.style.display... | [
"0.7131365",
"0.7075075",
"0.6782476",
"0.67643565",
"0.6667317",
"0.66617155",
"0.6651332",
"0.6651332",
"0.6567637",
"0.6566676",
"0.6534706",
"0.64761335",
"0.63925827",
"0.6377274",
"0.6373558",
"0.6370856",
"0.63364565",
"0.6317396",
"0.6294701",
"0.62921274",
"0.6280832... | 0.7558399 | 0 |
Pass in the ones you have and this will return only the hash combinations you have enough data for | getMatchingHashCombinations(fieldsWithData, hashCombinations) {
const dummyFormattedRow = this.getEmptyFormattedRow("EMPTY");
Object.entries(fieldsWithData).forEach(([field, data]) => {
if (data !== null) {
dummyFormattedRow[field] = "FILLED";
}
});
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DoHash(lengths){\r\n\tvar listSize = 256;\r\n\tvar list = Array(listSize).fill(0).map((e, i) => i);\r\n\tvar curr = 0;\r\n\tvar skip = 0;\r\n\t\r\n\tif(typeof lengths == \"string\") lengths = lengths.split(\"\").map(e => e.charCodeAt(0));\r\n\tlengths = lengths.concat([17, 31, 73, 47, 23]);\r\n\t\r\n\tfun... | [
"0.5909092",
"0.58519965",
"0.5830428",
"0.5711534",
"0.56508857",
"0.56368965",
"0.5501606",
"0.55000746",
"0.548942",
"0.5437715",
"0.54371846",
"0.543689",
"0.5418184",
"0.5403496",
"0.53983873",
"0.5392647",
"0.5390828",
"0.53761035",
"0.53314763",
"0.5324878",
"0.5310201... | 0.6363704 | 0 |
Transforms a row of Looker data into a row of data formatted for the Facebook marketing API. Missing data is filled in with empty strings. | transformRow(row) {
row = this.normalizeRow(row);
const formattedRow = this.getFormattedRow(row, this.schema); // get a uniform object
// turn our uniform object into X strings like doe_john_30008_1974. One per transform we have enough data for
const transformedRow = this.matchedHashComb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rowToFields (row) {\n return {\n name: { 'en-US': row['Name'].substr(0, 255) },\n productLink: { 'en-US': row['Product Link'] },\n description: { 'en-US': row['Description'] },\n category: { 'en-US': row['Category'] },\n imageLink: { 'en-US': row['Image'] },\n };\n}",
"function cleanDat... | [
"0.5752445",
"0.564079",
"0.5593393",
"0.5527835",
"0.5518496",
"0.54980314",
"0.5484132",
"0.5476965",
"0.54595023",
"0.54112536",
"0.5393598",
"0.5381074",
"0.52874804",
"0.5278194",
"0.5268262",
"0.52269906",
"0.5200454",
"0.5200454",
"0.5190903",
"0.51654655",
"0.51396126... | 0.5968361 | 0 |
initialize index array which to draw nodes | initializeNodeIndex() {
for (let i = 0; i < this.n * this.m; ++i)
this.node_index[i] = i;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function refreshXYIndexes()\r\n{\r\n // redraw text nodes on the X axis\r\n for (var i = 0; i <= xDivisions; i++)\r\n if (typeof xIndexes[i].getBBox != \"undefined\")\r\n try \r\n {\r\n textWidth = xIndexes[i].getBBox().width;\r\n textHeight = xIndexes[i].getBBox().height;\r\n x... | [
"0.6320229",
"0.62293434",
"0.61750215",
"0.61238503",
"0.6094703",
"0.6063391",
"0.60549164",
"0.6035655",
"0.60073674",
"0.59788036",
"0.5975467",
"0.59677136",
"0.5923392",
"0.5910816",
"0.5899632",
"0.58986855",
"0.5893935",
"0.58810836",
"0.58663666",
"0.58593804",
"0.58... | 0.79950696 | 0 |
initialize index array which to draw edges | initializeEdgeIndex() {
let counter = 0;
for (let i = 0; i < this.n; ++i) // iterate over nodes
{
for (let j = 0; j < this.m; ++j) {
if (i != this.n - 1 && j != this.m - 1) { // if the node is not from the last row
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initializeEdges() {\n edges = [\n [5, 0, 1],\n [2, 0, 2],\n [10, 0, 3],\n [7, 1, 4],\n [4, 2, 5],\n [1, 1, 3],\n [5, 2, 3],\n [6, 3, 4],\n [3, 3, 6],\n [11, 3, 5],\n [13, 4, 6],\n [9, 5, 6]\n ]\n}",
"generateCoordi... | [
"0.68469507",
"0.66026884",
"0.65263784",
"0.6293996",
"0.6288402",
"0.6205903",
"0.61587167",
"0.6072591",
"0.6015139",
"0.5994949",
"0.59947485",
"0.5984029",
"0.598298",
"0.5967459",
"0.5934776",
"0.5887115",
"0.5875667",
"0.5871985",
"0.5789428",
"0.57867223",
"0.5779981"... | 0.71054566 | 0 |
initialize positions of the nodes | initializeCoords() {
// deltas between nodes
let row_delta = 2 * this.m;
let column_delta = 2;
// top-left node has coordinates x=-0.45*(m-1)*distance_between_nodes,
// y=0. Positions of the other nodes are based on this node
for (let i = 0; i < this.n; ++i) { ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setPositions(nodes) {\n // determine positions\n for (i in nodes) {\n if (nodes[i].category === \"Math\") {\n nodes[i].x = mathX\n nodes[i].y = firstY + i * smallVerticalGap\n } else if (nodes[i].category === \"Lower\") {\n nodes[i].x = mathX*2\n nod... | [
"0.75227857",
"0.7045477",
"0.68329656",
"0.6796382",
"0.6694371",
"0.65421677",
"0.653996",
"0.64505243",
"0.64443815",
"0.6425895",
"0.6381732",
"0.6327758",
"0.6317021",
"0.6307152",
"0.6276129",
"0.6268021",
"0.6223506",
"0.6222202",
"0.6221222",
"0.62204605",
"0.6201017"... | 0.72723496 | 1 |
initialize how many edges are connected to the each node | initializeEdgesPerNode() {
let row_delta = this.m;
for (let i = 0; i < this.m; ++i) {
if (i == 0 || i == this.m - 1) {
this.edges_per_node[i] = 2;
this.edges_per_node[(this.n - 1) * row_delta + i] = 2;
}
else {
this.edg... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getNumOfEdges() {\n let numOfRelations = 0;\n for (let node of this.nodes) {\n numOfRelations += node.adjacent.size;\n }\n return numOfRelations / 2;\n }",
"get edgeCount() {\n return this.next.length;\n }",
"function initializeEdges() {\n edges = [\n [5, 0, 1],\n [2, 0, ... | [
"0.7712128",
"0.71784145",
"0.7109807",
"0.66919476",
"0.65191066",
"0.64422315",
"0.6398195",
"0.6356279",
"0.6319574",
"0.6127142",
"0.6063094",
"0.6029985",
"0.60230666",
"0.60135823",
"0.6003825",
"0.59989786",
"0.59647685",
"0.59630746",
"0.59567213",
"0.59101814",
"0.59... | 0.75516504 | 1 |
initialize data about nodes that are locked by the default | initializeLockedNodes() {
this.selected_node = -1; // we store data about locked nodes in this.locked_nodes array.
this.current_mouse_x = 0; // The way we store data is:
this.current_mouse_y = 0; ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"init(data) {\n data.threads = []\n }",
"constructor () {\n\t\tthis.nodes = {};\n\t}",
"function initialize_local_node (filename, init_admin) {\n var db = new sqlite3.Database(filename, sqlite3.OPEN_READWRITE);\n var key = null;\n return {\n db : db,\n id : null, // ... | [
"0.6308586",
"0.58210015",
"0.5754479",
"0.5752186",
"0.5747989",
"0.572936",
"0.5711752",
"0.57089674",
"0.5586091",
"0.55409706",
"0.5514249",
"0.5476145",
"0.54500633",
"0.5440027",
"0.5437153",
"0.5430281",
"0.5425563",
"0.53786117",
"0.53685987",
"0.53634584",
"0.5341856... | 0.7337009 | 0 |
calculate stress in all nodes | calculateStress(i, j, diff1, diff2) {
diff1 = Math.abs(diff1);
diff2 = Math.abs(diff2);
let row_delta = this.m;
// if node is not in the last row and is not in the last column we should
// update stress in this node and in it's neighbours down and right
if (i != this.n ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"calculateColors() {\n // find node with the maximum stress\n let max_stress = 0;\n for (let i = 0; i < this.n * this.m; ++i) {\n if (this.stress[i] > max_stress) max_stress = this.stress[i];\n }\n\n // normilize coefficient\n let coeff = 1 / max_stress;\n\n ... | [
"0.5790114",
"0.559949",
"0.55639964",
"0.5532049",
"0.5268553",
"0.5245338",
"0.51290447",
"0.5114855",
"0.5079577",
"0.50570494",
"0.49151692",
"0.4904607",
"0.4853863",
"0.48508665",
"0.4846754",
"0.48017892",
"0.47809324",
"0.47804043",
"0.47550124",
"0.4745611",
"0.47358... | 0.72908324 | 0 |
calculate colours of the nodes | calculateColors() {
// find node with the maximum stress
let max_stress = 0;
for (let i = 0; i < this.n * this.m; ++i) {
if (this.stress[i] > max_stress) max_stress = this.stress[i];
}
// normilize coefficient
let coeff = 1 / max_stress;
let color_ro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getColor(node) {\n if (node.x === 0) {\n var r = node.node * 22 % 255 - 30;\n var g = node.node * 24% 255 - 20;\n var b = node.node * 39 % 255 - 10;\n return d3.rgb(r, g, b);\n } else {\n return d3.rgb(0, 0, 0);\n }\n}",
"function getNodeColor(nodeName) {\n ... | [
"0.7114681",
"0.70140254",
"0.69179684",
"0.68126076",
"0.68078965",
"0.6762339",
"0.6759129",
"0.66925377",
"0.6661304",
"0.66481495",
"0.6621482",
"0.6585492",
"0.6581591",
"0.6574327",
"0.65620774",
"0.65583163",
"0.650224",
"0.64598906",
"0.64048237",
"0.6373222",
"0.6361... | 0.73605466 | 0 |
partition viewport into higher zoom tiles | function partitionViewport(projection) {
const z = geoScaleToZoom(projection.scale());
const z2 = (Math.ceil(z * 2) / 2) + 2.5; // round to next 0.5 and add 2.5
const proj = new Projection().transform(projection.transform()).dimensions(projection.clipExtent());
const tiles = tiler.zoomRange([z2, z2]).... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function partitionViewport(projection) {\n var z = geoScaleToZoom(projection.scale());\n var z2 = (Math.ceil(z * 2) / 2) + 2.5; // round to next 0.5 and add 2.5\n var tiler = utilTiler().zoomExtent([z2, z2]);\n\n return tiler.getTiles(projection)\n .map(function(tile) { return tile.extent; });... | [
"0.7575097",
"0.70942533",
"0.6618797",
"0.6431484",
"0.633158",
"0.6285147",
"0.6260185",
"0.59917724",
"0.58985895",
"0.5897281",
"0.5887427",
"0.58504754",
"0.58155185",
"0.5814382",
"0.5795145",
"0.5755447",
"0.57245684",
"0.5718103",
"0.57101053",
"0.56698817",
"0.562853... | 0.74470514 | 1 |
nodeChanged: called after the viewer has changed images and is ready. There is some logic here to batch up clicks into a _mlyClicks array because the user might click on a lot of markers quickly and nodechanged may be called out of order asynchronously. Clicks are added to the array in `selectedImage` and removed here. | function nodeChanged(node) {
that.resetTags();
const clicks = _mlyClicks;
const index = clicks.indexOf(node.key);
that.setActiveImage(node);
that.setStyles(context, null, true);
if (index > -1) { // `nodechanged` initiated from clicki... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onToggleNode() {\n // Need to repopulate grid cache\n this.dependencyGridCache = null;\n // node toggled in tree, can affect resources both above and below, need to redraw all.\n this.scheduleDraw(true);\n }",
"_changedNode(){\n\n if (this.root.autoMerklify)\n this._refreshHash(tru... | [
"0.5870634",
"0.57903486",
"0.5719464",
"0.571399",
"0.571399",
"0.5694717",
"0.56226444",
"0.5607688",
"0.55950475",
"0.55893916",
"0.5519129",
"0.5444138",
"0.5363962",
"0.5316668",
"0.5287786",
"0.5283932",
"0.5265587",
"0.5265587",
"0.52312344",
"0.52214",
"0.5196122",
... | 0.8202259 | 0 |
Verifies that an object has every property expected by a string to interpolate | static validateInterpolationProps(str, props) {
if (typeof str === 'function') {
return true;
}
const keys = str.match(/\$([\w\.]+)/g);
return keys.every((key) => {
return props.hasOwnProperty(key.substr(1));
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkProperty() {\n if(\"lottery\" in str || \"prize\" in str ) {\n return true;\n }else {\n return false;\n }\n}",
"function isPropMetadataString(str) {\n return str.indexOf(INTERPOLATION_DELIMITER) >= 0;\n}",
"_isValidPropertyName(str) {\n return /^(?![0-9])[a-zA-Z0-... | [
"0.6201874",
"0.6031389",
"0.6004658",
"0.5961843",
"0.56698155",
"0.56698155",
"0.56359047",
"0.56297946",
"0.56297946",
"0.5592623",
"0.55789536",
"0.5575464",
"0.55620307",
"0.55226946",
"0.55226946",
"0.55226946",
"0.55214435",
"0.55139905",
"0.5510785",
"0.54889494",
"0.... | 0.73855436 | 0 |
fix a part by dragging a part onto another that is already slotted into the ship. Sets durability back to full | function fix(part1, part2){
parts_buffer = items.splice(indexOf(part2), 1);
part1.durability = 100;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onDrop(e, ui, triggerEvent = true) {\n let item = ui.draggable, itemNativeEl = item.get(0);\n //if any piece has been dropped in the slot or the piece dropped is the current one) and (if the \"onlyDropOnValid\" is false or the piece dropped is the correct one\n //a piece could not be dropped i... | [
"0.62596625",
"0.58674276",
"0.58512634",
"0.57588917",
"0.5653715",
"0.559447",
"0.5551565",
"0.553288",
"0.5524488",
"0.55207735",
"0.5504607",
"0.5501803",
"0.54728276",
"0.5463518",
"0.54172593",
"0.53969175",
"0.5383339",
"0.5363375",
"0.53534275",
"0.53408915",
"0.53124... | 0.6145401 | 1 |
LM: 10021014 Function to completely wipe a canvas element by replacing it with a clone of the old canvas element. | function canvasWipe(_id) {
var $canvasOld = z('#'+_id),
$clone, $parent;
if (! $canvasOld.length) { return document.getElementById(_id); }
$parent = $canvasOld.parent();
$clone = $canvasOld.clone();
$canvasOld.remove();
$parent.append($clone);
return $clone[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function clearCanvas() {\n d3.select(\"#canvas\").selectAll(\"*\").remove();\n}",
"function clearCanvas() {\r\n\tcanvasBackground.clear();\r\n\tcurrentFile.drawObjects.length = 0;\r\n\tpencilObj.length = 0;\r\n\t$(\"#foreground\").html(\"\");\r\n\t$(\"#foreground\").css({ 'display': 'none' });\r\n}",
"funct... | [
"0.69719535",
"0.69414526",
"0.6914699",
"0.6824118",
"0.6817067",
"0.67834866",
"0.67792517",
"0.6754656",
"0.6729297",
"0.6702941",
"0.66876817",
"0.66554546",
"0.6653985",
"0.6639099",
"0.6631868",
"0.6626317",
"0.6599614",
"0.6553827",
"0.6532129",
"0.6530259",
"0.6523262... | 0.7421442 | 0 |
Gets all the mentors that match the newSearch selected fields | function getMentors(newSearch){
var newSearchString = JSON.stringify(newSearch);
return $http({
method: 'GET',
url: '/mentor-search/search',
headers: {
newSearchString: newSearchString
}
})
.then(function(response) {
mentors.info = response.data;
}),
functio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMatchedEndUsers(searchTerm,searchFieldId){\n\t\t\tif(searchTerm.length>=3){\n\t\t\t\tisSearchGoClicked=true;\n\t\t\t\tupdateSearchResults(searchTerm,searchFieldId);\n\t\t\t}\n\t\t}",
"function match(ment) {\n var mentee = ment; \n //filter by type of interaction they are looking for\n ... | [
"0.58563775",
"0.5513067",
"0.5390658",
"0.5351022",
"0.52685654",
"0.52613294",
"0.51705885",
"0.5169293",
"0.5157429",
"0.5157429",
"0.5157429",
"0.5157429",
"0.5157429",
"0.5157429",
"0.5157429",
"0.5157429",
"0.5157429",
"0.5157429",
"0.5157429",
"0.5157429",
"0.5157429",... | 0.668893 | 0 |
// Attach the chosen mentor object to the info property on mentorBio to be accessed by the profile controller | function setMentor(mentor){
mentorBio.info = mentor;
mentorId = mentorBio.info.id;
getProfiles();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadMentorProfile() {\n linkedinID = getParameterByName('linkedinID');\n mentor = fingMentorByLinkedinID(linkedinID);\n}",
"function setMentorId(id){\n mentorId = id;\n getProfiles();\n }",
"function saveLinkedinMember(member) {\n currentMentor.linkedinID = member.id;\n currentMento... | [
"0.61868614",
"0.61156386",
"0.5672628",
"0.55646235",
"0.54583275",
"0.5426781",
"0.54039025",
"0.54013324",
"0.5355007",
"0.5334068",
"0.5308842",
"0.53044504",
"0.52985406",
"0.529172",
"0.52855384",
"0.5271781",
"0.5266182",
"0.5229631",
"0.52142906",
"0.5171642",
"0.5150... | 0.7441757 | 0 |
Sets the mentor ID | function setMentorId(id){
mentorId = id;
getProfiles();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setMentor(mentor){\n mentorBio.info = mentor;\n mentorId = mentorBio.info.id;\n getProfiles();\n }",
"set _id(value) {\n this.__id = value;\n }",
"static userToMentor(req, res) {\n const userId = parseInt(req.params.id, 10);\n const userIndex = Users.findIndex((usr) => usr.id === u... | [
"0.7325789",
"0.60419756",
"0.6028615",
"0.5886447",
"0.58642566",
"0.5836865",
"0.58113396",
"0.5749949",
"0.57023484",
"0.56621397",
"0.5566024",
"0.552448",
"0.552448",
"0.55230886",
"0.5491689",
"0.536801",
"0.5345068",
"0.53085554",
"0.52915215",
"0.5279422",
"0.52578694... | 0.821614 | 0 |
Edit user's FAQ entires | function editFaqs(faqArray) {
// Makes sure that currentUser is set
AuthFactory.auth.$onAuthStateChanged(function(currentUser) {
if(currentUser){
return currentUser.getToken().then(function(idToken) {
return $http({
method: 'PUT',
url: '/profile-edit/edit-faq/'+fa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function editAnswer(value) {\n setId(value.id); \n setEditQuestion(value.question); \n setFlag(true); //making flag as true to display input field\n }",
"function ciniki_web_faq() {\n \n this.activeToggles = {'no':'No', 'yes':'Yes'};\n this.faqFlags = {'1':{'name':'Hidden'}};\n \n this.i... | [
"0.65274334",
"0.628353",
"0.61211854",
"0.5950657",
"0.5925477",
"0.59221566",
"0.5888162",
"0.5879315",
"0.5858305",
"0.5725232",
"0.5695023",
"0.5683998",
"0.5670636",
"0.5634619",
"0.5602478",
"0.55746317",
"0.5557091",
"0.55510193",
"0.55217856",
"0.54656154",
"0.5457948... | 0.69868785 | 0 |
Delete user's FAQ entires | function deleteFaq(faqId) {
// Makes sure that currentUser is set before getting messages from the server
AuthFactory.auth.$onAuthStateChanged(function(currentUser) {
if(currentUser){
return currentUser.getToken().then(function(idToken) {
return $http({
method: 'DELETE',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteFare(query) {\n debug('DELETING FAQ');\n return new Promise((resolve, reject) => {\n FareModel.findOneAndRemove(query)\n .then((result) => {\n resolve(result)\n }, err => {\n reject(err);\n });\n })\n }",
"async deleteQuesti... | [
"0.69190025",
"0.6906627",
"0.6760763",
"0.6657932",
"0.64160854",
"0.61776114",
"0.6169346",
"0.61639553",
"0.6159245",
"0.6094932",
"0.6088494",
"0.6066658",
"0.6023543",
"0.6005521",
"0.59828514",
"0.59506154",
"0.59159887",
"0.58627623",
"0.58586097",
"0.58572197",
"0.584... | 0.73536384 | 0 |
Sends the client html file The file is cached after the first time it's been read | function sendClientHtml(response) {
if (sendClientHtml.cachedHtml) {
response.writeHead(200, {'Content-Type': 'text/html', 'Transfer-Encoding': 'chunked'});
response.write(sendClientHtml.cachedHtml);
response.end();
} else {
fs.readFile('client.html', function(err, data) {
sendClientHtml.cachedHtml = data;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openHTML(response, filename){\n\tcontent = fs.readFileSync(\"./PUBLIC/\" + filename );\n\tresponse.end(content);\n}",
"function landingscreen(res) {\n global.clog(\"[ss_reqHan][landingscreen][SENT]\");\n res.writeHead(200, { \"Content-Type\": \"text/html\" }); \n var sendingfile = fs.readFileSy... | [
"0.657809",
"0.64230376",
"0.63940483",
"0.63677704",
"0.632228",
"0.6304325",
"0.6286139",
"0.6262079",
"0.6244814",
"0.6186678",
"0.6119586",
"0.6087904",
"0.6057405",
"0.60508907",
"0.598392",
"0.59456605",
"0.58354473",
"0.5828589",
"0.5810955",
"0.5807779",
"0.5759025",
... | 0.79943013 | 0 |
Initializes eye dna as a square | setSquare() {
this.gene = makeSquare(this.size - 10);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function set_eye_position (x, y, z) {\r\n eye_x = x;\r\n eye_y = y;\r\n eye_z = z;\r\n}",
"function init(){\n for(var i = 0; i <SNAKE_INITIAL_LENGTH; ++i){\n snake.push({\n x:Math.floor(COLS/2) - i, // x is the column of the snake which starts at the middle of the canvas\n y:Math.floor(ROWS/2) ... | [
"0.5934771",
"0.5883362",
"0.5874852",
"0.58696723",
"0.58530587",
"0.5834863",
"0.5793829",
"0.5752061",
"0.57472086",
"0.5740579",
"0.5739155",
"0.5701835",
"0.5688601",
"0.56744426",
"0.56508565",
"0.5642314",
"0.56358135",
"0.5633766",
"0.5632839",
"0.56140107",
"0.560448... | 0.5972352 | 1 |
Filter out the categories that are already starred | async function filterOutCategories(selected_categories) {
const categories = await fetchCategoriesFromServer()
return categories.filter( cat => {
for (let c of selected_categories) {
if(c.id === cat.id || c.name === cat.name){
return false
}
}
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"categoryFilter(recipe) {\n return recipe.category === this.state.category;\n }",
"function filterCategory(cat) {\n //if all is selected, displays all products\n if (cat.toLowerCase() === \"all\") {\n Products(products);\n }\n //filters products depending on category selected\n else {\n let f... | [
"0.6138831",
"0.60141414",
"0.5951515",
"0.5919165",
"0.59032077",
"0.5882794",
"0.5865071",
"0.58600914",
"0.58251446",
"0.57868606",
"0.5755324",
"0.5721004",
"0.57094353",
"0.57070255",
"0.57025963",
"0.56763464",
"0.55961144",
"0.55871415",
"0.5566954",
"0.5526194",
"0.55... | 0.6575505 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.