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 |
|---|---|---|---|---|---|---|
Static validation of reports (metrics, dimensions, fields set) | isValid () {
const stdListCheck = (list) => list.length > 0 && list.every(i => !!i)
const dimCheck = ({ field }) => !!field
const mtrCheck = ({ field, aggregate }) => (!!field && (field === 'count' || !!aggregate))
return stdListCheck(this.config.reports.map(({ moduleID, dimensions, metrics }) => {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkFieldsMetric() \n{\n\tvar ageEntered = false;\n\tvar heightEntered = false;\n\tvar weightEntered = false;\n\tvar lvlEntered = false;\n\tgetUserInput();\n\n\t//checks for age field\n\tif (ageMet == 0) \n\t{\n\t\tdocument.getElementById(\"ageErrorMet\").innerHTML = \"<font size=\\\"2\\\" color=\\\"red\... | [
"0.6114272",
"0.6053749",
"0.5773058",
"0.57334167",
"0.5720657",
"0.56790227",
"0.5600307",
"0.55990493",
"0.55990493",
"0.55990493",
"0.55485725",
"0.55393094",
"0.5532716",
"0.5526958",
"0.5520245",
"0.5515921",
"0.5510744",
"0.55084914",
"0.55042005",
"0.5486491",
"0.5484... | 0.71321654 | 0 |
Given a product ID, returns the index to the product data in products. | function getProductIndex(id) {
for (var i = 0; i < products.length; i++) {
if (products[i].Id == id)
return i;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cmGetProductIndex(id){\n\tvar i =0;\n\tfor (i=0; i<cmShopCounter; i++)\n\t{\n\t\tif (id==cmShopIds[i])\n\t\t{\n\t\t\treturn i;\n\t\t}\n\t}\n\treturn -1;\n}",
"function get_index(product_name) {\n for (j = 0; j<4; j++) {\n if (idList[j] == product_name) {\n return j;\n }\n ... | [
"0.73866487",
"0.69187963",
"0.6333316",
"0.6298754",
"0.6212987",
"0.6199228",
"0.6152536",
"0.6146826",
"0.6121935",
"0.611363",
"0.6111524",
"0.6015553",
"0.5980504",
"0.5965141",
"0.59086174",
"0.59046024",
"0.5878217",
"0.5812192",
"0.5796331",
"0.5789128",
"0.57709295",... | 0.79153055 | 0 |
3. Create a function called greeting that returns "Hello, !", where is the name given as an argument to the function. | function greeting(name){
return ("Hello, "+ name + "!")
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createGreeting(name) {\n return \"Hello, \" + name;\n}",
"function greeting(name) {\n console.log('Hello ' + name);\n}",
"function greeting(g, name){\n return g + \" \" + name;\n}",
"function sayHello (greeting, name){\nreturn greeting + \" \" + name\n}",
"function greet(name) {\n return \"H... | [
"0.8984374",
"0.8935023",
"0.8929218",
"0.88260806",
"0.88259006",
"0.88141346",
"0.88117135",
"0.88075775",
"0.8794291",
"0.8758178",
"0.8724503",
"0.8710304",
"0.8685452",
"0.8678942",
"0.865595",
"0.86490124",
"0.8631188",
"0.86036867",
"0.86004895",
"0.85926944",
"0.85694... | 0.9163549 | 0 |
6. Create a function called fahrenheitToCelsius that takes a Fahrenheit temperature as an argument and returns the temperature in Celsius. | function fahrenheitToCelsius(tempF){
var celsius = (((tempF-32)*5)/9);
return celsius;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fahrenheitToCelsius(fahrenheit) {\n let celsius = (fahrenheit - 32) * (5 / 9)\n return celsius\n}",
"function getCelcius(fahrenheit){\n return helperCelcius(fahrenheit) * (5/9);\n}",
"function fToC(fahrenheit) {\n\tvar fTemp = fahrenheit,\n\t\t\tfToCel = (fTemp - 32) * 5 / 9; \n\n\treturn f... | [
"0.86141557",
"0.84301823",
"0.83861154",
"0.83673257",
"0.828537",
"0.8285218",
"0.82623905",
"0.8246359",
"0.8207705",
"0.8186704",
"0.81534404",
"0.8148792",
"0.81073564",
"0.80921775",
"0.8038562",
"0.8028363",
"0.8028363",
"0.8028363",
"0.80219346",
"0.8010674",
"0.79394... | 0.85068184 | 1 |
8. Create a function called lesser that takes two numbers as arguments and returns the lesser of them. This function should use an if/else statement. | function lesser(num1,num2){
if(num1<num2){
return num1;
}else if(num2<num1){
return num2;
}else{
return num1 && num2;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function min(number1, number2) {\n if (number1 < number2)\n return number1;\n else \n return number2;\n}",
"function smallestNumber (num1, num2) {\n if (num1 > num2) {\n return num2;\n } else {\n return num1\n }\n}",
"function smallestNumber(num1, num2) {\n if (num1 < num2) {\n return num1... | [
"0.80254436",
"0.79305387",
"0.78723246",
"0.787205",
"0.7776335",
"0.7646566",
"0.7631782",
"0.7615943",
"0.760009",
"0.7596874",
"0.75960684",
"0.75852257",
"0.75668734",
"0.7538713",
"0.75209814",
"0.7517105",
"0.749081",
"0.748534",
"0.74748117",
"0.74621534",
"0.7455648"... | 0.83953995 | 0 |
Get a joke from API | function getJoke() {
let url = URL;
fetch(url)
.then(checkStatus)
.then(resp => resp.json())
.then(fillJoke)
.catch(handleError);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findJoke () {\n fetch(`https://icanhazdadjoke.com/`, {\n method: \"GET\",\n headers: {\n \"Accept\": \"application/json\"\n }\n })\n .then(jokes => jokes.json())\n .then(parsedJokes => {\n addJokeToDom(parsedJokes.joke);\n console.l... | [
"0.7542095",
"0.73835677",
"0.7341794",
"0.71776426",
"0.7098708",
"0.7091539",
"0.69433665",
"0.6942618",
"0.69017947",
"0.6885596",
"0.6869879",
"0.68144786",
"0.679943",
"0.67956054",
"0.66979045",
"0.66894925",
"0.6650352",
"0.6646319",
"0.6645691",
"0.6598589",
"0.658890... | 0.7785089 | 0 |
get elements from html chat list | function getHtmlChatItems() {
let html = getHtmlElement('chatList')
let total = html.childNodes[0].childElementCount
let reactElements = {}
for (let index = 0; index < total; index++) {
let htmlElement = html.childNodes[0].childNodes[index];
let reactComponent = findReactComponent(htmlE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetchChat() {\n var li = document.createElement(\"li\");\n li.className = \"sender\";\n \n var msg = [\n \n 'Why did the web developer leave the restaurant? Because of the table layout.',\n \n 'How do you comfort a JavaScript bug? You console it.',\n\n ... | [
"0.67011815",
"0.6407555",
"0.638644",
"0.6215671",
"0.61860174",
"0.6179761",
"0.6179761",
"0.6179131",
"0.6154777",
"0.60070986",
"0.5941764",
"0.5878977",
"0.585685",
"0.58470577",
"0.5844623",
"0.5843683",
"0.5809155",
"0.5801956",
"0.58005613",
"0.5788626",
"0.57802486",... | 0.71745104 | 0 |
format the sender object we can memoize it on future | function formatSender(obj) {
if (!obj || obj.sender === undefined)
return undefined
return {
id: obj.sender ? obj.sender.user : undefined,
displayName: obj.senderObj ? obj.senderObj.displayName : undefined,
formattedName: obj.senderObj ? obj.senderObj.formattedName : undefined,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function format( sender, data ) {\n return {\n sender : sender,\n data : data\n };\n}",
"get sender(){ return this.m_sender; }",
"function senderAction(senderId){\n const messageData = {\n \"recipient\": {\n \"id\": senderId\n }\n }\n}",
"function transportH... | [
"0.7276189",
"0.5981097",
"0.5712369",
"0.56608593",
"0.56608593",
"0.5653215",
"0.56511784",
"0.56511784",
"0.5605957",
"0.55466044",
"0.54710084",
"0.53699106",
"0.53413093",
"0.5288793",
"0.52864856",
"0.52471423",
"0.5245545",
"0.52201563",
"0.5189663",
"0.5182598",
"0.51... | 0.6811485 | 1 |
Helper function to handle XMLHttpRequests. base_url: ie. ' api_key: log in and see your profile page for your API key action: see for possible actions payload: JSON string to send with the request callback: your own data handling function with one input parameter | function callAPI(base_url, api_key, action, payload, callback) {
var xmlhttp = new XMLHttpRequest();
var url = base_url + '/data/api/3/action/' + action;
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
response = JSON.parse(xmlhttp.responseText);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static individualApiCall(callbackFn, baseId) {\n $.ajax({\n type: 'GET',\n url: `http://localhost:3000//api/v1/base_urls/${baseId}`,\n contentType: 'application/json',\n dataType: 'json',\n success: function(response) {\n callbackFn(response)\n }\n })\n }",
"function g... | [
"0.6078074",
"0.5799291",
"0.577625",
"0.55638206",
"0.5533135",
"0.5481528",
"0.54563856",
"0.5397268",
"0.5396323",
"0.5373651",
"0.53429973",
"0.5334601",
"0.53189075",
"0.5235015",
"0.51976395",
"0.51916057",
"0.5179351",
"0.5177727",
"0.5176749",
"0.5171752",
"0.51435506... | 0.60267425 | 1 |
Example of an action without authorization or payload Loops over result set and prints organization names to console.log() | function organization_list(base_url) {
callAPI(base_url, null, 'organization_list', null, function(data) {
console.log('*** List all organizations ***');
for (var i = 0; i < data.length; i++) {
console.log(data[i]);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getOrganization() {\n this.props.dispatch({\n type: 'FETCH_ORGANIZATION'\n })\n }",
"function getAllOrganizations(req, res) {\n Organization.find({ isActive: true }, function (err, organizations) {\n if (err) {\n res.status(204).send(err);\n }\n else... | [
"0.62585485",
"0.57747877",
"0.5773862",
"0.5683246",
"0.55072516",
"0.5495098",
"0.54228276",
"0.53567994",
"0.5345367",
"0.5343601",
"0.53422236",
"0.5340111",
"0.5322585",
"0.530477",
"0.5271272",
"0.5251116",
"0.5231174",
"0.52157",
"0.5208929",
"0.5204774",
"0.5198538",
... | 0.6360044 | 0 |
Example of an action call using package_search action Prints all content types in use and the number of packages using them to console.log() | function get_content_types(base_url) {
var payload = JSON.stringify({
'facet.field': '["vocab_content_type"]',
'facet.limit': '-1', // Show all content types
'rows': 0 // Don't show any packages, just the content types
});
callAPI(base_url, null, 'package_search', payload, function(data) {
// Ord... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async count(ctx) {\n const { model } = ctx.params;\n const contentManagerService = strapi.plugins['content-manager'].services.contentmanager;\n\n let count;\n if (_.has(ctx.request.query, '_q')) {\n count = await contentManagerService.countSearch({ model }, ctx.request.query);\n } else {\n ... | [
"0.5518519",
"0.54451096",
"0.5396192",
"0.5174763",
"0.5138425",
"0.5093054",
"0.5061292",
"0.502643",
"0.5005607",
"0.4990204",
"0.4940225",
"0.4933096",
"0.49111062",
"0.48473695",
"0.48145393",
"0.48118326",
"0.48069853",
"0.4785857",
"0.47381687",
"0.4736907",
"0.4725419... | 0.61540115 | 0 |
Example of actions with authorization and payload Example of callback chaining Creates an organization with unique name and deletes it | function create_and_delete_test_organization(base_url, api_key) {
var organization_name = "z-org-apitest-" + Date.now() // API call fails if name is not unique
var payload = JSON.stringify({
'name': organization_name,
'title': 'Z CKAN API ' + organization_name
});
callAPI(base_url, api_key, 'organizatio... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteOrganization(req, res) {\n\n Organization.findOne({\n _id: req.params.id\n }, function (err, organization) {\n if (err || !organization) {\n return res.send(400).send(\"This organization not exist in db.\")\n } else {\n User.findOne({ OrganizationId: ... | [
"0.6382833",
"0.5527931",
"0.5452466",
"0.5384461",
"0.5359516",
"0.5325084",
"0.52752626",
"0.52648205",
"0.52497697",
"0.5204939",
"0.5200448",
"0.5115199",
"0.51129574",
"0.51080143",
"0.50388855",
"0.50027514",
"0.49808168",
"0.49793118",
"0.49703842",
"0.49382147",
"0.49... | 0.6714242 | 0 |
api: config[brush] :class:`style.Brush` The brush used to create this fill. This will typically be a :class:`Color` and can be given by the string hex value. api: property[brush] :class:`style.Brush` The brush used to create this fill. | set brush(brush) {
if (!(brush instanceof Brush)) {
brush = STYLE_UTIL.create(brush);
}
if (brush instanceof Color) {
this._fill.setColor(brush._expression);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function brush() {\n\n var actives = dimensions.filter(function (p) {\n return !y[p].brush.empty();\n }),\n extents = actives.map(function (p) {\n return y[p].brush.extent();\n });\n foreground.style(\"display\... | [
"0.6658618",
"0.64853895",
"0.64827937",
"0.6430695",
"0.64060634",
"0.63937426",
"0.63937426",
"0.63937426",
"0.6387843",
"0.6302161",
"0.62712055",
"0.6235379",
"0.6220637",
"0.62136567",
"0.61815304",
"0.6167203",
"0.61647713",
"0.6126718",
"0.60454243",
"0.5984683",
"0.59... | 0.7554096 | 0 |
OSS Stream Storage Parameters: OSS RAM AccessKey accessKeyId OSS RAM AccessSecret accessKeySecret OSS Bucket bucket | function OssStreamStorage (opts) {
this.getDestination = (opts.destination || getDestination);
client = new OSS({
region: opts.region,
accessKeyId: opts.accessKeyId,
accessKeySecret: opts.accessKeySecret,
bucket: opts.bucket
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_bucketSetup()\n {\n return {\n \"size\": 32,\n \"window\": 5\n };\n }",
"function s3Params(filename) {\n\t\t\tvar credential = amzCredential();\n\t\t\tvar policy = s3UploadPolicy(filename, credential);\n\t\t\tvar policyBase64 = new Buffer(JSON.stringify(policy)).toStrin... | [
"0.5586056",
"0.5468776",
"0.5388719",
"0.5217783",
"0.5165417",
"0.5132709",
"0.51205397",
"0.5081621",
"0.5073839",
"0.50713664",
"0.50569606",
"0.50566995",
"0.4995424",
"0.49945527",
"0.4986355",
"0.49852994",
"0.49847564",
"0.49618828",
"0.49563485",
"0.4946808",
"0.4941... | 0.67962986 | 0 |
Rendering the PDF document | function renderPDF(pdfFile) {
// svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
pdfjsLib.getDocument(pdfFile).then(function(pdf) {
// Get div#container and cache it for later use
var container = document.getElementById('container');
// Loop from 1 to total_number_of_pages in PDF d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderPdf(pdf) {\n // console.log(page);\n if (page < 1) {\n pdf.getPage(1).then(renderPage);\n } else if (page > totalPageNum) {\n pdf.getPage(totalPageNum).then(renderPage);\n } else {\n pdf.getPage(page).then(renderPage);\n }\n }",
... | [
"0.6936882",
"0.6932534",
"0.6803352",
"0.6693108",
"0.66909087",
"0.66207796",
"0.6620181",
"0.6613967",
"0.65786946",
"0.6541332",
"0.65398335",
"0.6527241",
"0.6446568",
"0.6442644",
"0.6430204",
"0.6406865",
"0.64044744",
"0.6394913",
"0.63848",
"0.63773733",
"0.63584554"... | 0.70056194 | 0 |
Comment & Contact Forms | function Forms() {
var $respond = $('#respond'), $respondWrap = $('#respond-wrap'), $cancelCommentReply = $respond.find('#cancel-comment-reply-link'),
$commentParent = $respond.find('input[name="comment_parent"]');
$('.comment-reply-link').each(function () {
var $this = $(th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupCommentForm() {\nvar form_container = $('#form_comment_container');\nform = $('form#form_comment');\nform.submit(function () {\nform_container.fadeTo(0, 0.5);\nBR.Reload.load({\nloaderConfig: {\nsize: BR.Statics.LOADER_SIZE_BIG\n},\nloaderContainer: $(this).parent().parent(),\ncontainer: form_contain... | [
"0.6777875",
"0.6764733",
"0.6529853",
"0.65143013",
"0.651272",
"0.6490982",
"0.6423509",
"0.6384721",
"0.63617414",
"0.6326489",
"0.6282651",
"0.6257524",
"0.6249006",
"0.62444085",
"0.6222228",
"0.6183302",
"0.6157675",
"0.6121437",
"0.610723",
"0.61067873",
"0.61049235",
... | 0.7683833 | 0 |
Renders the full territory as per map. | _renderTerritory(territory) {
territory.forEach(cell => {
var territoryObj = new NeutralTerritory(cell.x, cell.y);
territoryObj.render();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function render() {\r\n var avg = (map.getBounds()._ne.lng + map.getBounds()._sw.lng + 1.0) / 2.0;\r\n //Sample top left, top mid, top right and the 3 bottoms to get topographical tiles\r\n [map.getBounds()._ne.lat, map.getBounds()._sw.lat].forEach(function (lat, index1) {\r\n [map.getBounds()._ne.lng, avg, ... | [
"0.64002407",
"0.62231857",
"0.61818933",
"0.5957947",
"0.58687556",
"0.57781076",
"0.57614213",
"0.5739856",
"0.57382274",
"0.5724682",
"0.563421",
"0.5562129",
"0.55453205",
"0.55195683",
"0.55003405",
"0.549106",
"0.54755825",
"0.5471221",
"0.5449735",
"0.54351115",
"0.542... | 0.73605597 | 0 |
Renders trees in the territory. | _renderTrees(trees) {
if (!trees) {
return;
}
const treeCount = OBJECT_MAPPING[BASE_TREES].length;
trees.forEach(function(tree) {
const index = parseInt(Math.random() * 100000) % treeCount;
var treeObj = index
? new PalmTree(tree.x, t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderTreesGraphics () {\n var sceneWidth = SI.game.Renderer.getScene().getWidth();\n var treeWidth = treesSpriteSheet.width;\n var treeX;\n \n for (treeX = 0; treeX <= sceneWidth; treeX += treeWidth) {\n SI.game.Renderer.getScene().getContext().drawImage(treesSpriteSheet, treeX, trees... | [
"0.72735155",
"0.7064506",
"0.69843835",
"0.69544613",
"0.6751286",
"0.67353845",
"0.6717932",
"0.6710109",
"0.6679417",
"0.66673714",
"0.64698464",
"0.6396593",
"0.6372105",
"0.63178575",
"0.63149357",
"0.6274319",
"0.62332755",
"0.623057",
"0.61806476",
"0.6119709",
"0.6067... | 0.73073107 | 0 |
Renders anonymus towers not belonging to any players. | _renderAnonymousTowers(towers) {
if (!towers) {
return;
}
towers.forEach(function(tower) {
TowerFactory.create(tower.type, tower.x, tower.y, /* owner= */ undefined).render();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function HidePlayer()\n{\n\t//GameObject.Find(\"rootJoint\").GetComponent(SkinnedMeshRenderer).enabled = false; // stop rendering the player.\n\tisControllable = false;\t// disable player controls.\n}",
"function sanitizeForEvilTeam(yourSocketID, players) {\n for (const i in players) {\n if (players[i]... | [
"0.58979106",
"0.5736587",
"0.56248665",
"0.55980057",
"0.5536431",
"0.55120873",
"0.55097175",
"0.55082273",
"0.5383407",
"0.53314555",
"0.5308896",
"0.5285044",
"0.52656645",
"0.5236285",
"0.52358425",
"0.5193672",
"0.51527935",
"0.5146305",
"0.5145133",
"0.51114064",
"0.50... | 0.6440564 | 0 |
Sets the non reachable islands as not selectable | _setUnreachableTerritoryNonSelectable() {
const valid = {};
function spreadValidity(key) {
if (key in valid) {
return;
}
valid[key] = true;
const x = TERRITORYMAP[key].x;
const y = TERRITORYMAP[key].y;
const neighbo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set clrDgSelectable(value) {\n this.selection.lockItem(this.item, value === false);\n }",
"function unselectAll() {\n\tfor (var i = 0; i < ALL_POINTS.length; i ++) {\n\t\tALL_POINTS[i].isSelected = false;\n\t}\n\t\n\tfor (var i = 0; i < ALL_WALLS.length; i ++) {\n\t\tALL_WALLS[i].isSelected = false;\n\... | [
"0.6357817",
"0.59943235",
"0.59637064",
"0.58584774",
"0.5804998",
"0.5789133",
"0.57332647",
"0.5719134",
"0.56738853",
"0.5619217",
"0.5619073",
"0.55995387",
"0.5574886",
"0.5565735",
"0.55615926",
"0.55366963",
"0.5511605",
"0.5506939",
"0.55028653",
"0.5496368",
"0.5481... | 0.7538261 | 0 |
Reveals the achievement for a set duration before hiding it Duration controlled by: revealDuration showDuration hideDuration | show() {
this.visible = true;
this.alpha = 1.0;
// Play sound effect
GoodDogPrototype.soundManager.playSoundEffect(this.soundEffect);
// Start reveal animation
var revealTween = new Tween(this, TweenTransitions.quadout);
revealTween.animate(TweenableParams.Y, this.startY, this.targetY, this.revealDurati... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getFadeDuration() {\r\n return 1/2;\r\n }",
"_switchToDuration() { this._showFps = false; }",
"function displayAchievement(achievementCard) {\n achievementsList.appendChild(achievementCard);\n\n //Display achievement\n achievementCard.classList.add('popIn');\n\n wait(5000)\n .then(() => {\n ach... | [
"0.604635",
"0.6013313",
"0.59905046",
"0.5979032",
"0.5874778",
"0.5824217",
"0.5745503",
"0.566784",
"0.5662425",
"0.5654151",
"0.56514424",
"0.56345606",
"0.5625858",
"0.55951583",
"0.55486894",
"0.5538932",
"0.55385953",
"0.55299014",
"0.5498666",
"0.5494111",
"0.54741573... | 0.73264474 | 0 |
Comparing React `children` is a bit difficult. This is a good way to compare them. This will catch differences in keys, order, and length. | function childrenEqual(a, b) {
// $FlowIgnore: Appears to think map calls back w/array
return (0, _lodash2.default)(React.Children.map(a, function (c) {
return c.key;
}), React.Children.map(b, function (c) {
return c.key;
}));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function childrenEqual(a, b) {\n\t return (0, _lodash2.default)(_react2.default.Children.map(a, function (c) {\n\t return c.key;\n\t }), _react2.default.Children.map(b, function (c) {\n\t return c.key;\n\t }));\n\t}",
"function childrenEqual(a, b) {\n\t return (0, _lodash2.default)(_react2.default.Chil... | [
"0.7530132",
"0.7530132",
"0.7519384",
"0.64943737",
"0.6327357",
"0.6226317",
"0.6058406",
"0.5938266",
"0.58785206",
"0.58785206",
"0.5877461",
"0.5750505",
"0.57335365",
"0.57226986",
"0.5694345",
"0.5684989",
"0.56772065",
"0.56310046",
"0.5624396",
"0.5624355",
"0.562435... | 0.768126 | 0 |
Create a new atom. For debugging purposes it is recommended to give it a name. The onBecomeObserved and onBecomeUnobserved callbacks can be used for resource management. | function Atom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) {
if (name === void 0) { name = "Atom@" + getNextId(); }
if (onBecomeObservedHandler === void 0) { onBecomeObservedHandler = noop; }
if (onBecomeUnobservedHandler === void 0) { onBecomeUnobservedHandler = noop; }
var... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Atom(name_) {\n if (name_ === void 0) {\n name_ = 'development' !== \"production\" ? \"Atom@\" + getNextId() : \"Atom\";\n }\n\n this.name_ = void 0;\n this.isPendingUnobservation_ = false;\n this.isBeingObserved_ = false;\n this.observers_ = new Set();\n this.diffValue_ = 0;\n ... | [
"0.69662064",
"0.68747485",
"0.6587929",
"0.65179497",
"0.65179497",
"0.6450906",
"0.6261985",
"0.60060495",
"0.60060495",
"0.60060495",
"0.584701",
"0.5670167",
"0.5670167",
"0.5670167",
"0.53892046",
"0.5295733",
"0.5295733",
"0.52500814",
"0.50421333",
"0.50403297",
"0.504... | 0.70615345 | 0 |
Executes the provided function `f` and tracks which observables are being accessed. The tracking information is stored on the `derivation` object and the derivation is registered as observer of any of the accessed observables. | function trackDerivedFunction(derivation, f, context) {
// pre allocate array allocation + room for variation in deps
// array will be trimmed by bindDependencies
changeDependenciesStateTo0(derivation);
derivation.newObserving = new Array(derivation.observing.length + 100);
derivation.unboundDepsCou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function trackDerivedFunction(derivation, f, context) {\n var prevAllowStateReads = allowStateReadsStart(true);\n // pre allocate array allocation + room for variation in deps\n // array will be trimmed by bindDependencies\n changeDependenciesStateTo0(derivation);\n derivation.newObserving = new Arr... | [
"0.7400853",
"0.7367009",
"0.7367009",
"0.7367009",
"0.7367009",
"0.7365409",
"0.7347099",
"0.7346069",
"0.73341674",
"0.72148925",
"0.7166499",
"0.7166499",
"0.7166499",
"0.5429252",
"0.5382901",
"0.537117",
"0.53518754",
"0.5346029",
"0.5346029",
"0.5346029",
"0.5341488",
... | 0.7377363 | 1 |
Get the tree's checkedNodes (todo: can merge to the `handleCheckState` function) If one node checked, it's all children nodes checked. If sibling nodes all checked, the parent checked. | function filterAllCheckedData(vs, treeNodes) {
var vals = [].concat(__WEBPACK_IMPORTED_MODULE_1_babel_runtime_helpers_toConsumableArray___default()(vs));
if (!vals.length) {
return vals;
}
var data = recursiveGen(treeNodes);
var checkedNodesPositions = [];
function checkChildren(children) {
childr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkAllChildren(treeNode, checked) {\n treeNode.ultimateChildren.forEach(function (uchild) {\n uchild.isChecked = checked;\n });\n treeNode.children.forEach(function (child) {\n child.isChecked = checked;\n checkAllChildren(child, checked);\n });\n}",
"function checkedN... | [
"0.66263896",
"0.6555805",
"0.65550405",
"0.6504717",
"0.6454302",
"0.6205501",
"0.615545",
"0.6129937",
"0.601864",
"0.59988356",
"0.59556586",
"0.59556586",
"0.5794625",
"0.57362354",
"0.5658624",
"0.56140035",
"0.5583234",
"0.5471907",
"0.54553354",
"0.53593016",
"0.535451... | 0.68004584 | 0 |
takes HTML string and returns DraftJS ContentState | function customHTML2Content(HTML, contentState) {
var tempDoc = new DOMParser().parseFromString(HTML, 'text/html');
// replace all <img /> with <blockquote /> elements
(0, _toArray2["default"])(tempDoc.querySelectorAll('img')).forEach(imgReplacer);
// use DraftJS converter to do initial conversion. I do... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initStateMarkdown() {\n let pageContent = '';\n\n const rawText = document.getElementById('raw-text-original');\n if (rawText) {\n pageContent = rawText.innerHTML;\n }\n const markdown = entities.decodeHTML(pageContent);\n\n this.state.markdown = markdown;\n }",
"function htmlToDelta(docu... | [
"0.6352289",
"0.59633917",
"0.5899255",
"0.5779816",
"0.5635549",
"0.55496085",
"0.5492783",
"0.5449299",
"0.5423577",
"0.54104245",
"0.5408357",
"0.53951144",
"0.5381824",
"0.5372",
"0.5367487",
"0.5340275",
"0.5307283",
"0.5298068",
"0.5287164",
"0.52798456",
"0.5236074",
... | 0.6576604 | 0 |
Private Functions Library: T1.C2.Client.Controls.ActionBar | function T1_C2_Shell_Controls_ActionBar() {
/// <summary>
/// Initialises a new instance of the actionsPane control
/// </summary>
/*
* Private Members
*/
var myPublicApi;
/*
* Private Functions
*/
/*
* Public API
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function T1_C2_Shell_Controls_ActionBar_Public() {\n /// <summary>\n /// Constructor for the librarys public API\n /// </summary>\n }",
"function kbase_toolbar_action(strToolBarItemID)\r\n{\r\n\talert(strToolBarItemID)\r\n}",
"function Accessibility_Menu() \n{\n this.... | [
"0.82504576",
"0.65720606",
"0.64579374",
"0.6039616",
"0.59533066",
"0.5907777",
"0.5806348",
"0.5723865",
"0.56438345",
"0.5631384",
"0.5606663",
"0.5556155",
"0.55504036",
"0.5546142",
"0.55073327",
"0.550219",
"0.5500859",
"0.5479851",
"0.5478247",
"0.54774666",
"0.546565... | 0.7465656 | 1 |
Build a Graphql query statement for the provided queries. | buildGraphqlQuery(queries) {
/** The query object for graphql. */
const graphqlQuery = {};
const { owner, name: repo } = this.git.remoteConfig;
/** The Github search filter for the configured repository. */
const repoFilter = `repo:${owner}/${repo}`;
queries.forEach(({ na... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toQuery(q) {\n var query = '';\n for (var key in q.prefixes)\n query += 'PREFIX ' + key + ': <' + q.prefixes[key] + '>\\n';\n\n if (q.queryType)\n query += q.queryType.toUpperCase() + ' ';\n if (q.reduced)\n query += 'REDUCED ';\n if (q.distinct)\n query += 'DISTINCT ';\n\n if (q.variabl... | [
"0.6292721",
"0.6292721",
"0.60809433",
"0.60576016",
"0.5969664",
"0.58479935",
"0.58056813",
"0.57068086",
"0.5657673",
"0.56401896",
"0.55785394",
"0.55754274",
"0.5570225",
"0.55563724",
"0.55316335",
"0.55206275",
"0.55102706",
"0.55097336",
"0.5498174",
"0.54748976",
"0... | 0.7204444 | 0 |
Checking if keypad is showing. | function Update ()
{
if(Input.GetKeyDown(KeyCode.K) && showing == false) //If Not
{
showing = true;
if(keypad != null) //Checking if keypad exists.
{
keypad.active = true;
}
}
else if(Input.GetKeyDown(KeyCode.Escape) && showing == true) //If Yes
{
showing = false;
if(keypad != null && code != null)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get _visible() {\n\n try {\n return (\n _WinRT.Windows.UI.ViewManagement.InputPane &&\n _WinRT.Windows.UI.ViewManagement.InputPane.getForCurrentView().occludedRect.height > 0\n ... | [
"0.6568794",
"0.6501127",
"0.64588416",
"0.63394773",
"0.6338296",
"0.6260427",
"0.62547606",
"0.624494",
"0.62330407",
"0.6208814",
"0.62057495",
"0.6195842",
"0.6195842",
"0.61936903",
"0.6188941",
"0.6188941",
"0.6188941",
"0.6188941",
"0.6188941",
"0.6140956",
"0.6114488"... | 0.7386385 | 0 |
Internal: Add a new component into the store. If there is an existing component with that identifier, replace it. identifier String, a unique identifier for this component. To help separate out hooked components, use dot namespaces e.g. 'MyScene.mycomponent'. component Component returned by React `ref` function. Return... | add(identifier, component) {
this.hooks[identifier] = component;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_registerComponent(comp) {\n let id = this.nextComponentId++;\n\n comp.id = id;\n this.componentMapping.set(id, comp);\n }",
"function Newcomponent() {\n return (\n <div>\n <p>This is a new component 123</p>\n </div>\n );\n}",
"function renderNewComponentN... | [
"0.5340122",
"0.5100128",
"0.5063644",
"0.5023693",
"0.48629037",
"0.48601457",
"0.48583287",
"0.48050004",
"0.47841808",
"0.47831413",
"0.47766793",
"0.47530285",
"0.472133",
"0.47166345",
"0.47115448",
"0.45882127",
"0.45631218",
"0.4557923",
"0.45139113",
"0.44578263",
"0.... | 0.6909313 | 0 |
Deletes an item from store itemId String Item id to delete api_key String (optional) no return value expected for this operation | function deleteItem(itemId) {
return Item.findByIdAndRemove(itemId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deleteItem(id) {\n const oz = this._appContext.oz, url = oz.getItemURI(this.name, id);\n return oz.request(url, {\n method: 'DELETE',\n });\n }",
"function deleteItem(itemId) {\n const url = '/api/item/' + itemId;\n fetch(url, {\n method: 'DELETE',\n headers... | [
"0.78155065",
"0.75922376",
"0.7447313",
"0.7376906",
"0.7274397",
"0.72258776",
"0.71836615",
"0.7175185",
"0.7158503",
"0.71025443",
"0.7063096",
"0.6923279",
"0.6887445",
"0.688001",
"0.6857085",
"0.684321",
"0.68161154",
"0.6813305",
"0.68112314",
"0.67863506",
"0.6769789... | 0.7753124 | 1 |
Updates an existing item in the store itemId String ID of item that needs to be updated body Item Item object to update no return value expected for this operation | function updateItem(itemId, itemName, itemPrice) {
return (Item.findByIdAndUpdate(itemId,
{
name: itemName,
price: itemPrice
}, {new: true}));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateItem(id, item) {\n var deferred = q.defer();\n delete item._id;\n\n CartModel.findByIdAndUpdate(id, { $set: item }, { new: true },\n function(err, item) {\n if(err) {\n deferred.reject(err);\n } else {\n ... | [
"0.7354445",
"0.7064509",
"0.7016012",
"0.6994739",
"0.6985483",
"0.68973887",
"0.6878919",
"0.68565613",
"0.6774347",
"0.67448026",
"0.6705121",
"0.66607225",
"0.664825",
"0.6643506",
"0.6625646",
"0.6619938",
"0.6562425",
"0.6524471",
"0.6502263",
"0.6484712",
"0.6484199",
... | 0.7374765 | 0 |
DataProvider containing Records and record display expectations for Text field with various record values | function textRecordsDataProvider(fid) {
var smallText = generateRandomString(10);
var maxText = generateRandomString(3990);
// Small text value
var smallInput = [{id: fid, value: smallText}];
var expectedSmallRecord = {id: fid, value: smallText, display: smal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatRecordValue(fieldValue, fieldInfo) {\n\n var tempFieldInfo = fieldInfo ? _.cloneDeep(fieldInfo.datatypeAttributes) : {};\n switch (tempFieldInfo.type) {\n case consts.PHONE_NUMBER:\n // An object that contains all relevant information to display phone ... | [
"0.5439305",
"0.5286945",
"0.5190643",
"0.51058376",
"0.5099285",
"0.50814396",
"0.5070735",
"0.5038031",
"0.50344425",
"0.50344425",
"0.50344425",
"0.50344425",
"0.50106347",
"0.50106347",
"0.4986906",
"0.49709928",
"0.49703342",
"0.49561638",
"0.49464738",
"0.4905489",
"0.4... | 0.71534115 | 0 |
end Polygon class / Child of Polygon class Info Class | function Info(polygon,map){
this.parent = polygon;
this.map = map;
this.color = document.createElement('input');
this.button = document.createElement('input');
jQuery(this.button).attr('type','button');
jQuery(this.button).val("Change Color");
var thisOjb=this;
//change color action
this.changeCo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Polygon(listOfDots,map,pen,color){\n this.listOfDots = listOfDots;\n this.map = map;\n this.coords = new Array();\n this.parent = pen;\n this.des = 'Hello';\n\n var thisObj=this;\n jQuery.each(this.listOfDots,function(index,value){\n thisObj.coords.push(value.getLatLng());\n });//end each\n\n ... | [
"0.7438351",
"0.67833966",
"0.66327554",
"0.6547565",
"0.6514791",
"0.6392207",
"0.6380805",
"0.6324466",
"0.629933",
"0.6214828",
"0.6188566",
"0.6114837",
"0.6067593",
"0.604002",
"0.5989655",
"0.59873843",
"0.5952354",
"0.59410006",
"0.5916883",
"0.58871746",
"0.58808374",... | 0.6899175 | 1 |
RENDER SETTINGS PAGE Function to render the login page | function renderSettings(req, res, next) {
// Initialize empty context object with Google user props
let context = {};
context.id = req.user.id;
context.email = req.user.email;
context.name = req.user.displayName;
context.photo = req.user.picture;
context.accessLevel = req.session.accessL... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"showLoginPage() {\n blogId = -1;\n init = false;\n owner = undefined;\n\n }",
"function loginRender(state, element) {\n $(element).find('.js-login-page').show();\n $(element).find('.js-main-page').hide();\n $(element).find('.js-question-display-page').hide();\n $(eleme... | [
"0.67090636",
"0.669519",
"0.6424769",
"0.63932025",
"0.6377286",
"0.6259571",
"0.6138254",
"0.61286664",
"0.61282295",
"0.60770524",
"0.6074003",
"0.60488296",
"0.6036079",
"0.6026384",
"0.6014446",
"0.59801286",
"0.59625816",
"0.594666",
"0.59292465",
"0.591803",
"0.5915848... | 0.67196804 | 0 |
BUGS PAGE RESET TABLES Function to drop and repopulate database | function resetTable(req, res, next) {
// Import the reset query from file
let recreateQuery = require('../sql/reset_database.js');
const mysql = req.app.get('mysql');
mysql.pool.query(recreateQuery, (err, result) => {
if(err) {
next(err);
return;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static dropTables() {\n SQL.tables = {};\n }",
"function dropTables(){\n pw.db.transaction(\n function(transaction){\n console.log(\"dropping existing tables\");\n //projects table\n transaction.executeSql(\"DROP TABLE IF EXISTS projects\")... | [
"0.73966914",
"0.71380764",
"0.71049595",
"0.69287527",
"0.6897107",
"0.6721763",
"0.66632766",
"0.666041",
"0.665984",
"0.6657234",
"0.65825313",
"0.65113616",
"0.6482095",
"0.64405143",
"0.6437114",
"0.63791156",
"0.63621473",
"0.63321126",
"0.62222815",
"0.62112695",
"0.61... | 0.7424123 | 0 |
Variable management. Get variable value | getVariable(name) {
return this.variables[name];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get variable() {\n\t\treturn this.__variable;\n\t}",
"getVariable(name) {\n\t\t\tvar self = this;\n\n\t\t\t// The var exists?\n\t\t\tif (typeof self._var[name] !== \"undefined\") {\n\t\t\t\treturn self._var[name];\n\t\t\t} else {\n\t\t\t\treturn \"undefined\";\n\t\t\t}\n\t\t}",
"static getValue(storyVar) {\n\t... | [
"0.7268492",
"0.71579903",
"0.7048085",
"0.6835835",
"0.67054594",
"0.6652309",
"0.6643151",
"0.6553391",
"0.65437603",
"0.6509767",
"0.65049136",
"0.6491428",
"0.6479453",
"0.64723796",
"0.6459775",
"0.64565665",
"0.64420295",
"0.64128083",
"0.6278104",
"0.6258941",
"0.62468... | 0.7436448 | 1 |
Get parent resource data | getParentData() {
const data = {};
if (this.parent) {
data[this.parent.key] = this.parent.value.id;
}
return data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get parentUrl() {\n return this.data.parentUrl;\n }",
"get parent() {\n const currentPath = path_info_1.PathInfo.fillVariables2(this.path, this.vars);\n const info = path_info_1.PathInfo.get(currentPath);\n if (info.parentPath === null) {\n return null;\n }\n ... | [
"0.71837497",
"0.7181405",
"0.6894441",
"0.67147905",
"0.67139274",
"0.66893876",
"0.66831386",
"0.66831386",
"0.6642529",
"0.6626927",
"0.65971065",
"0.65662885",
"0.6530908",
"0.653068",
"0.653068",
"0.653068",
"0.653068",
"0.653068",
"0.653068",
"0.653068",
"0.653068",
"... | 0.76230586 | 0 |
Read links from Show pages | readShowLinks() {
let links = {};
cy.get(fieldSel).each(field => {
const label = field.find('label').text();
const value = field.find('label + *').text();
const url = field.find('a').attr('href');
if (url) links[label] = { value, url };
});
return links;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showlinks()\n\t\t{\n\t\t\talert(\"showlinks\");\n\t\tconsole.log(JSON.stringify(allfilelinks));\n\t\tconsole.log(JSON.stringify(page));\n\t\t}",
"async function ripCurrentFromPage2(page){\r\n\tlet $ = cheerio.load(page);\r\n\tlet indShowDivs = $(\".all-shows-link\").toArray();\r\n\treturn indShowDivs.ma... | [
"0.71515405",
"0.6426268",
"0.6233426",
"0.620361",
"0.6156712",
"0.6142846",
"0.6139034",
"0.6130863",
"0.6121921",
"0.6116157",
"0.6057764",
"0.60275084",
"0.6004591",
"0.59843487",
"0.5980253",
"0.5969956",
"0.5946122",
"0.5944038",
"0.58993614",
"0.5864161",
"0.58486205",... | 0.6444988 | 1 |
sets and unset offset classes | function set_offset_class() {
var top = document.body.scrollTop,
add = [];
if (!top || top < 100) {
add.push(generate_offset_class(0));
} else if (top >= 100) {
add.push(generate_offset_class(100));
}
$(document.body)
.addClass(ad... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateClassProp(context, offset, addOrRemove, directiveRef) {\n _updateSingleStylingValue(context, offset, addOrRemove, !0, directiveRef);\n }",
"function updateClassProp(context, offset, addOrRemove, directiveRef) {\n _updateSingleStylingValue(context, offset, addOrRemove, true, di... | [
"0.62787867",
"0.6128212",
"0.6128212",
"0.60543776",
"0.6018027",
"0.58039397",
"0.57919425",
"0.5694791",
"0.56771344",
"0.56771344",
"0.56572956",
"0.56505895",
"0.561539",
"0.561539",
"0.561539",
"0.561539",
"0.561539",
"0.561539",
"0.561539",
"0.561539",
"0.561539",
"0... | 0.66917944 | 0 |
Problem Diberikan sebuah function angkaPrima(angka) yang menerima satu parameter berupa angka. Function akan mereturn true jika angka tersebut adalah bilangan prima. Jika tidak, return false. Code | function angkaPrima(angka) {
// you can only write your code here!
for(var i = 2; i < angka; i++) {
if(angka % i == 0) {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function angkaPrima(angka) {\r\nif(angka==2 || angka==3 || angka==5 || angka==7){\r\n return true;\r\n}else {\r\n if(angka%2===0 || angka%3===0 || angka%5===0 || angka%7===0){\r\n return false\r\n }else {\r\n return true\r\n }\r\n}\r\n}",
"function perpangkatanDuaRecursive(angka) {\n if (angka == 1) {... | [
"0.82590675",
"0.67386943",
"0.63688695",
"0.6368715",
"0.633935",
"0.61862946",
"0.6080255",
"0.6074619",
"0.6072846",
"0.60401696",
"0.60102284",
"0.60062206",
"0.5976583",
"0.5946281",
"0.5901192",
"0.59007406",
"0.5892902",
"0.5868891",
"0.5864967",
"0.5837081",
"0.582110... | 0.76121426 | 1 |
Call API with Axios in /wilders root and edit the wilder state with wilders datas | componentDidMount() {
axios
.get("http://localhost:8000/wilders")
.then(response => {
this.setState({
wilder: response.data.wilders
});
})
.catch(err => console.log(err));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sub_category_sliders(context) {\n axios.get('/_public/api/display/sub/category/slider')\n .then(resp => {\n // console.log(resp);\n context.commit('sub_category_sliders', resp.data.sub_category_sliders);\n })\n }",
"sub_sub_category_sliders(context) {... | [
"0.58284026",
"0.58153",
"0.55754143",
"0.5428072",
"0.5419667",
"0.53957844",
"0.5363385",
"0.53627914",
"0.534477",
"0.527102",
"0.5215116",
"0.519775",
"0.51769656",
"0.5148891",
"0.51442397",
"0.5136273",
"0.513388",
"0.51244926",
"0.5119401",
"0.5108384",
"0.5080711",
... | 0.5861814 | 0 |
Defines function to retrieve all items in todolist | function getAllItems() {
return element.all(by.repeater('todo in todos'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTodos() {\n\t//FYI DONT EDIT ME :)\n\ttodoService.getTodos(drawTodos)\n}",
"function getTodos(){\n\t\t//FYI DONT EDIT ME :)\n\t\ttodoService.getTodos(draw)\n\t}",
"function getAll(cb) {\n cb(todos);\n }",
"function getTodos() {\n\t\t//FYI DONT EDIT ME :)\n\t\ttodoService.getTodos(draw)\... | [
"0.7385741",
"0.7383453",
"0.73624045",
"0.7325865",
"0.7280914",
"0.7170204",
"0.7169047",
"0.7127484",
"0.71192974",
"0.7108896",
"0.7087444",
"0.70758814",
"0.7023883",
"0.7021607",
"0.701455",
"0.6970482",
"0.6956594",
"0.6920153",
"0.69190735",
"0.69183654",
"0.6833568",... | 0.7457581 | 0 |
A content subcomponent for Accordion component. | function AccordionContent(props) {
var active = props.active,
children = props.children,
className = props.className,
content = props.content;
var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('content', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__["a" /* useKeyOnly */])... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AccordionContent(props) {\n var active = props.active,\n children = props.children,\n className = props.className,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()('content', __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__lib__[\"a\" /* u... | [
"0.7720222",
"0.7720222",
"0.7720222",
"0.7709001",
"0.767763",
"0.76677907",
"0.7589016",
"0.7589016",
"0.7589016",
"0.7577536",
"0.75726324",
"0.7513348",
"0.7501841",
"0.7501841",
"0.7482979",
"0.74829555",
"0.7381224",
"0.7352793",
"0.70160705",
"0.6634843",
"0.65635616",... | 0.7728581 | 0 |
Get the gaia address used for servicing multiplayer reads for the given (username, app) pair. | function getGaiaAddress(app, username, zoneFileLookupURL) {
return Promise.resolve().then(function () {
if (username) {
return getUserAppFileUrl('/', username, app, zoneFileLookupURL);
} else {
return (0, _hub.getOrSetLocalGaiaHubConnection)().then(function (gaiaHubConfig) {
return (0, _hu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getAddress() {\n if (this.mode == \"node\")\n return this.web3.eth.accounts.privateKeyToAccount(this.privateKey)\n .address;\n\n // otherwise, browser\n let address = await this.web3.eth.getAccounts();\n if (address.length == 0)\n return console.log(\"No ethereum address detected... | [
"0.58070064",
"0.5685342",
"0.5652412",
"0.5625396",
"0.5531522",
"0.5423347",
"0.53455925",
"0.5326667",
"0.52875584",
"0.52467704",
"0.5243519",
"0.5227422",
"0.52116257",
"0.51304287",
"0.5089588",
"0.5080949",
"0.507881",
"0.5050974",
"0.5038282",
"0.50139236",
"0.5000285... | 0.7062765 | 0 |
Handle signature verification and decryption for contents which are expected to be signed and encrypted. This works for single and multiplayer reads. In the case of multiplayer reads, it uses the gaia address for verification of the claimed public key. | function handleSignedEncryptedContents(path, storedContents, app, username, zoneFileLookupURL) {
var appPrivateKey = (0, _auth.loadUserData)().appPrivateKey;
var appPublicKey = (0, _keys.getPublicKeyFromPrivate)(appPrivateKey);
var addressPromise = void 0;
if (username) {
addressPromise = getGaiaAddress(ap... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function verify (keys, sig, msg) {\n if(isObject(sig))\n throw new Error('signature should be base64 string, did you mean verifyObj(public, signed_obj)')\n return curves[getCurve(keys)].verify(\n u.toBuffer(keys.public || keys),\n u.toBuffer(sig),\n isBuffer(msg) ? msg : new Buffer(msg)\n )\n}",
"... | [
"0.60653055",
"0.6003184",
"0.59082913",
"0.5814317",
"0.56034493",
"0.5589229",
"0.5573837",
"0.5567899",
"0.55661225",
"0.5519977",
"0.548409",
"0.54811966",
"0.54600555",
"0.54600555",
"0.54600555",
"0.54600555",
"0.54600555",
"0.54600555",
"0.54600555",
"0.5422808",
"0.54... | 0.6722924 | 0 |
A placeholder segment can be inline. | function SegmentInline(props) {
var children = props.children,
className = props.className,
content = props.content;
var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()('inline', className);
var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__["b" /* getUnhandledProps */])(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SegmentInline(props) {\n var children = props.children,\n className = props.className,\n content = props.content;\n var classes = (0, _classnames.default)('inline', className);\n var rest = (0, _lib.getUnhandledProps)(SegmentInline, props);\n var ElementType = (0, _lib.getElementType)(Segmen... | [
"0.56758404",
"0.56595147",
"0.56595147",
"0.56595147",
"0.5654488",
"0.5654488",
"0.5592767",
"0.55723023",
"0.5518887",
"0.5398974",
"0.5389112",
"0.5216845",
"0.5207425",
"0.5178983",
"0.51680857",
"0.51358396",
"0.51236933",
"0.50981796",
"0.50981796",
"0.50623816",
"0.50... | 0.5809735 | 0 |
A comment can contain an action. | function CommentAction(props) {
var active = props.active,
className = props.className,
children = props.children,
content = props.content;
var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__["a" /* useKeyOnly */])(active, 'acti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CommentAction(props) {\n var active = props.active,\n className = props.className,\n children = props.children,\n content = props.content;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */... | [
"0.6987916",
"0.6909862",
"0.6909862",
"0.6909862",
"0.69056785",
"0.69050986",
"0.6884219",
"0.6884219",
"0.68713546",
"0.6868042",
"0.68362707",
"0.68362707",
"0.68362707",
"0.6803314",
"0.67701775",
"0.6739555",
"0.67039335",
"0.66840464",
"0.66776836",
"0.6638037",
"0.663... | 0.6938635 | 1 |
A comment can contain content. | function CommentContent(props) {
var className = props.className,
children = props.children,
content = props.content;
var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'content');
var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__["b" /* getUnhandledProps */]... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CommentContent(props) {\n var className = props.className,\n children = props.children,\n content = props.content;\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(className, 'content');\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnha... | [
"0.7336902",
"0.7304992",
"0.72492427",
"0.72492427",
"0.72492427",
"0.7241406",
"0.7241406",
"0.7241406",
"0.723419",
"0.7232204",
"0.7232204",
"0.7229308",
"0.72221285",
"0.7214218",
"0.71813846",
"0.71483636",
"0.69880587",
"0.69667894",
"0.69667894",
"0.68637925",
"0.6661... | 0.7311046 | 1 |
A statistic can contain a numeric, icon, image, or text value. | function StatisticValue(props) {
var children = props.children,
className = props.className,
content = props.content,
text = props.text;
var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__["a" /* useKeyOnly */])(text, 'text'), '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function StatisticValue(props) {\n var children = props.children,\n className = props.className,\n content = props.content,\n text = props.text;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(... | [
"0.60392356",
"0.60084486",
"0.58937037",
"0.58906734",
"0.58686984",
"0.58686984",
"0.58686984",
"0.58646667",
"0.5864007",
"0.5864007",
"0.5840225",
"0.58378667",
"0.5829265",
"0.5829265",
"0.5829265",
"0.5827998",
"0.5827961",
"0.5818613",
"0.5790558",
"0.57811475",
"0.569... | 0.6027128 | 1 |
Inspection class (Base class) Use to extend Validation and Sanitization prototypes. Inspection constructor shall be called in derived class constructor. | function Inspection(schema, custom) {
var _stack = ['@'];
this._schema = schema;
this._custom = {};
if (custom != null) {
for (var key in custom) {
if (custom.hasOwnProperty(key)){
this._custom['$' + key] = custom[key];
}
}
}
this._getDepth = function () {
return _stack.length;
};
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function BaseReporter() {\n this._typeUtils = new TypeUtils();\n}",
"function Sanitization(schema, custom) {\n\t\tInspection.prototype.constructor.call(this, schema, _merge(Sanitization.custom, custom));\n\t\tvar _reporting = [];\n\n\t\tthis._basicFields = Object.keys(_sanitizationAttribut);\n\t\tthis._customFi... | [
"0.57260114",
"0.556944",
"0.55523574",
"0.5432307",
"0.5390885",
"0.5348771",
"0.5277838",
"0.51733685",
"0.51722807",
"0.5080483",
"0.50734454",
"0.50712204",
"0.5070929",
"0.49293858",
"0.49023375",
"0.48779207",
"0.48708808",
"0.4862355",
"0.48470515",
"0.484587",
"0.4845... | 0.604277 | 0 |
Sanitization Class inherits from Inspection class (actually we just call Inspection constructor with the new context, because its prototype is empty | function Sanitization(schema, custom) {
Inspection.prototype.constructor.call(this, schema, _merge(Sanitization.custom, custom));
var _reporting = [];
this._basicFields = Object.keys(_sanitizationAttribut);
this._customFields = Object.keys(this._custom);
this.origin = null;
this.report = function (message... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Sanitize(){\n var i, e, options;\n options = arguments[0] || {};\n this.config = {};\n this.config.elements = options.elements ? options.elements : [];\n this.config.attributes = options.attributes ? options.attributes : {};\n this.config.attributes[Sanitize.ALL] = this.config.attributes... | [
"0.61091053",
"0.5784661",
"0.5525475",
"0.5456382",
"0.5386936",
"0.53587306",
"0.5323757",
"0.52538997",
"0.5162765",
"0.51248217",
"0.51217616",
"0.5093775",
"0.50692534",
"0.49899873",
"0.4988551",
"0.4988096",
"0.49852404",
"0.4972556",
"0.49685085",
"0.4960417",
"0.4957... | 0.59579974 | 1 |
.invert() Creates an object composed of the inverted keys and values of object. If object contains duplicate values, subsequent values overwrite property assignments of previous values. | invert(object){
let invertedObject = {};
for(let key in object){
let originalValue = object[key];
invertedObject = {originalValue : key};
}
return invertedObject;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"invert(object) {\n let invertedObject = {};\n for (let key in object) {\n // get old value\n let originalValue = object[key];\n // set new key as old value, with key as new value\n invertedObject[originalValue] = key; \n }\n return inverte... | [
"0.8466642",
"0.83809054",
"0.83618975",
"0.83024037",
"0.8053437",
"0.805199",
"0.7808425",
"0.77481264",
"0.77331233",
"0.77331233",
"0.77140015",
"0.7710937",
"0.7710937",
"0.7710937",
"0.7710937",
"0.76882166",
"0.7650586",
"0.7643962",
"0.7617568",
"0.76139915",
"0.75924... | 0.83813345 | 1 |
Called to initialize as new instance. This should be implemented by each subclass that support this and then call up via super.initNew(); | initNew() {
super.initNew();
this._setTypeID();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initNew() {\n super.initNew();\n }",
"function NewObj() {\n if(!initializing && this.init)\n this.init.apply(this, arguments)\n }",
"function Constructor() {\n\t\t\t\t// All construction is actually done in the init method.\n\t\t\t\tif ( ! initializing ) {\n\t\t\t\t\treturn this.constructor ... | [
"0.7671852",
"0.6875078",
"0.64931256",
"0.6488597",
"0.64089525",
"0.6335622",
"0.6327979",
"0.6245444",
"0.62387896",
"0.6237888",
"0.6237888",
"0.6095237",
"0.60759795",
"0.6074536",
"0.60650665",
"0.60628706",
"0.60628706",
"0.60628706",
"0.6053782",
"0.604614",
"0.604400... | 0.71508056 | 1 |
Set the timestamp to now for the last edit. Edit TS is used to track the last time user edited this object. This is different that last updated when imply being written. | setEditedTS() {
const retVal = XObject.SetEditedTS(this.getData());
if (this.isDirty() === false) { this.setDirty(); }
return retVal;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set timestamp(newTime) {\n this._timestamp = newTime;\n }",
"setTimestamp(timestamp) {\n this.timestamp = timestamp;\n }",
"async preSave (options = {}) {\n\t\tthis.attributes.modifiedAt = options.setModifiedAt || Date.now();\n\t\tawait super.preSave(options);\n\t}",
"setTimestamp() {\n ... | [
"0.6553003",
"0.6200581",
"0.6170731",
"0.60800546",
"0.6066458",
"0.59313273",
"0.5859611",
"0.5769557",
"0.5726843",
"0.56868607",
"0.5654489",
"0.5599959",
"0.5571905",
"0.5540865",
"0.5514909",
"0.54961884",
"0.5458502",
"0.545527",
"0.5442602",
"0.5440413",
"0.54268587",... | 0.63059765 | 1 |
Report on whether this object has been marked as deleted for visibility. | isDeleted() {
const data = this.getData(false);
return data ? XObject.IsDeleted(data) : false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isDeleted() {\n const dam = this.flags & Flags.DAM_MASK;\n if (this.isDoubleDensity()) {\n return dam === Flags.DAM_DD_F8;\n }\n else {\n return dam !== Flags.DAM_SD_FB;\n }\n }",
"getIsDeleted() {\n return this.isDeleted;\n }",
"gotDeleted(... | [
"0.6762932",
"0.67079234",
"0.66452223",
"0.64207095",
"0.61584103",
"0.61207026",
"0.6006902",
"0.6006902",
"0.60045135",
"0.5847837",
"0.56909484",
"0.55443627",
"0.5456468",
"0.5456033",
"0.54535294",
"0.54528046",
"0.5448016",
"0.5437836",
"0.5419691",
"0.5410438",
"0.538... | 0.70423543 | 0 |
Retrieve the auxillary (json) data wrapped by this object. The content of the AUX can be object type | getAuxData(create = false) {
if (this[XObject.AUX_DATA] == null && create) {
this[XObject.AUX_DATA] = {};
// this.warn("getAuxData", "delayed creation of data content");
}
return this[XObject.AUX_DATA];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_rec_data() {\n return rec_data\n }",
"get data() {return this._data;}",
"data() {\n return this._dataValues ?? {}\n }",
"function IjData() {}",
"get data() {\n return this._realData;\n }",
"GetObjectData() {\n\n }",
"createDataObject() {\n\n return $... | [
"0.5592722",
"0.5377818",
"0.53449863",
"0.5330762",
"0.5319041",
"0.53096825",
"0.52629155",
"0.52396667",
"0.5209828",
"0.52062607",
"0.52024657",
"0.5188178",
"0.5158157",
"0.5133622",
"0.512101",
"0.5091054",
"0.5084374",
"0.50821304",
"0.5074097",
"0.50700885",
"0.504142... | 0.66461897 | 0 |
Function for load the grid | function LoadGrid() {
var gridder = $('#as_gridder');
var UrlToPass = 'action=load';
gridder.html('loading..');
$.ajax({
url : '<?php echo siteurl(); ?>ajax.php?my_project_id='+my_project_id,
type : 'POST',
data : UrlToPass,
success: function(responseText) {
gridder.html(responseText);
}
})... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadGrid()\n{\n\tprintGrid();\n\taddEvents();\n}",
"function loadGrid() {\n var sql = pjs.query(\"SELECT name, email, type, text FROM nodepf1\");\n display.grid.replaceRecords(sql);\n }",
"function load() {\r\n\tmgmt_list = Factory.newCSVFile(\"\");\r\n\tmgmt_list.loadFile(Globals.path('gis/mgm... | [
"0.8171226",
"0.71971977",
"0.6925626",
"0.6914958",
"0.6707357",
"0.6705312",
"0.66942346",
"0.66917366",
"0.6688135",
"0.66815",
"0.6651598",
"0.6641462",
"0.6614786",
"0.6614737",
"0.660217",
"0.6584046",
"0.6549226",
"0.65405416",
"0.6531258",
"0.65238714",
"0.65123504",
... | 0.72115135 | 1 |
Set the coordinates to use based on environement and settings (promise functionality) | function setCoordinates(configObj, coordinatesObj) {
"use strict";
return new Promise(
function (resolve, reject) {
var presetCoordinates = { // default locations
Brisbane: { // As a local city
latitude: -27.470125,
longit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function useCurrentCoordinates() {\n\n function success(position) {\n const latitude = position.coords.latitude;\n const longitude = position.coords.longitude;\n\n let queryURL = \"https://developers.zomato.com/api/v2.1/geocode?lat=\" + latitude + \"&lon=\" + longitude;\n\n let settings = {\n \"u... | [
"0.62345123",
"0.6078315",
"0.6038676",
"0.6004051",
"0.5970753",
"0.5970753",
"0.5849634",
"0.58133477",
"0.5766575",
"0.5737307",
"0.57064056",
"0.57031685",
"0.5676832",
"0.56755435",
"0.5673789",
"0.5637982",
"0.56318074",
"0.5625993",
"0.5597929",
"0.5596084",
"0.5595748... | 0.6845525 | 0 |
Get image locations informations from tpl files | function imageLocationsFromTpl() {
const templateFileNames = getTemplateFileNames()
templateFileNames.forEach(function(tplName) {
nbLocations += 1
const tplContent = getTemplateFileContent(tplName)
const srcsetArr = tplContent.match(regex.srcset)
const cropArr = tplContent.match(regex.crop)
con... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function evalImgSrc() {\n var leftImgSrc = imgContainers.first().children().first().attr('src');\n var centerImgSrc = imgContainers.next().children().first().attr('src');\n var rightImgSrc = imgContainers.last().children().first().attr('src');\n return {leftImgSrc: leftImgSrc, centerImg... | [
"0.59790593",
"0.55983543",
"0.55492455",
"0.55036235",
"0.5494536",
"0.549417",
"0.54116917",
"0.54016066",
"0.53752834",
"0.5363433",
"0.534935",
"0.5343094",
"0.5324769",
"0.53060627",
"0.52941936",
"0.5287309",
"0.52830166",
"0.52688384",
"0.52501136",
"0.52412856",
"0.52... | 0.7547184 | 0 |
const sumofArray = sourceArray.reduce(reduceToTotal,0); | function reduceToTotal(sourceArray, startingPoint = 0){
function addition(num1, num2){
let sumofArray = num1 + num2;
return sumofArray
};
return sourceArray.reduce(addition, startingPoint);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reduceToTotal(sourceArray, startingPoint = 0) {\n return sourceArray.reduce(function sum(previousValue, currentValue) { \n return previousValue + currentValue; \n }, startingPoint )\n}",
"function arraySumWithReduce(incomingArray) {\r\n\treturn incomingArray.reduce((acc, val) => {\r\n\t... | [
"0.8441358",
"0.83322173",
"0.826191",
"0.806486",
"0.806144",
"0.79724187",
"0.78858995",
"0.7855908",
"0.77919734",
"0.7764731",
"0.7749765",
"0.7738702",
"0.77202845",
"0.76699704",
"0.76493627",
"0.764696",
"0.7617764",
"0.7606783",
"0.756399",
"0.75537324",
"0.7528826",
... | 0.84734595 | 0 |
create a mouse with a specific head size: the length of the mouse's snout the rest of the mouse's dimensions are calculated from the headSize, so all mice of different sizes will have the same proportions. the mouse is centered at the middle of its torso with its feet on the ground. the bounding box dimensions are as f... | function ali7Mouse(headSize) {
// materials -----------------------------------------------------------------
// basic colors for mouse and scene
var mouseBodyMat = new THREE.MeshBasicMaterial({color: 0x886655});
var mouseNoseMat = new THREE.MeshBasicMaterial({color: 0xd58775});
var mouseTailMat = new THREE.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createHead(mouseParams) {\n var head = new THREE.Object3D();\n\n var headGeometry = new THREE.CylinderGeometry(mouseParams.headRadiusTop, mouseParams.headRadiusBottom,\n mouseParams.headHeight, fixedParams.sphereDetail);\n var neckGeometry = new TH... | [
"0.62140405",
"0.5807793",
"0.5737412",
"0.5680049",
"0.5603847",
"0.54510623",
"0.54281676",
"0.5382011",
"0.5374713",
"0.53034",
"0.52915984",
"0.52545905",
"0.5235349",
"0.5223256",
"0.520998",
"0.51824296",
"0.51628286",
"0.5157024",
"0.5145097",
"0.51177955",
"0.5083143"... | 0.658249 | 0 |
make the mouse's head | function createHead(mouseParams) {
var head = new THREE.Object3D();
var headGeometry = new THREE.CylinderGeometry(mouseParams.headRadiusTop, mouseParams.headRadiusBottom,
mouseParams.headHeight, fixedParams.sphereDetail);
var neckGeometry = new THREE.Cylind... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ali7Mouse(headSize) {\n\n // materials -----------------------------------------------------------------\n // basic colors for mouse and scene\n var mouseBodyMat = new THREE.MeshBasicMaterial({color: 0x886655});\n var mouseNoseMat = new THREE.MeshBasicMaterial({color: 0xd58775});\n var mouseTailMat =... | [
"0.65478355",
"0.65257114",
"0.6272374",
"0.6231252",
"0.6193858",
"0.61695975",
"0.6166099",
"0.6165926",
"0.6165351",
"0.616147",
"0.61386114",
"0.6057841",
"0.6046862",
"0.604487",
"0.6029563",
"0.6025385",
"0.60119164",
"0.6011891",
"0.60058177",
"0.599838",
"0.59826094",... | 0.70238054 | 0 |
make ears ear is made from a hemisphere | function createEar(mouseParams) {
var earGeometry = new THREE.SphereGeometry(mouseParams.earRadius,
fixedParams.sphereDetail, fixedParams.sphereDetail,
0, fixedParams.phiLength,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeEarth($solid) {\n $solid.addMesh(() => {\n const material = new THREE.MeshPhongMaterial({\n bumpScale: 0.04,\n specular: 0xa2a2a2,\n shininess: 5\n });\n const textureLoader = new THREE.TextureLoader();\n f... | [
"0.62004226",
"0.5642661",
"0.5618753",
"0.5608724",
"0.55688447",
"0.5523269",
"0.5442791",
"0.5442189",
"0.5429042",
"0.5422995",
"0.5398056",
"0.53945065",
"0.537922",
"0.5359482",
"0.53405184",
"0.5329021",
"0.5310785",
"0.5296644",
"0.52919847",
"0.52852315",
"0.5253109"... | 0.6426245 | 0 |
make toes toeNum means which toe is being created: my mouse has 4 toes: 2 inside toes and 2 outside that are off to the side and angled. | function createToe(mouseParams, toeNum) {
var toeRadius = mouseParams.legRadiusBottom/4;
var toeGeom = new THREE.ConeGeometry(toeRadius, mouseParams.legRadiusTop,
fixedParams.sphereDetail, fixedParams.sphereDetail,
false, 0, fixed... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newTetrimino() {\n currType = nextType;\n currentRotation = nextRotation;\n ifRotated = (currentRotation + 1)%currType.length;\n currentTet = tetArr[nextType][nextRotation];\n currentPosition = 4;\n undrawNext();\n nextTetrimino();\n atBott = false;\n drawNext();\n draw();\n gameOver();\n}",
... | [
"0.5684811",
"0.5579651",
"0.5438153",
"0.5437589",
"0.5416538",
"0.53946275",
"0.53924924",
"0.52727884",
"0.5205131",
"0.5180357",
"0.51685774",
"0.51174",
"0.51173013",
"0.51128113",
"0.5110191",
"0.508211",
"0.5061674",
"0.5046819",
"0.5046395",
"0.50330067",
"0.50201535"... | 0.73856395 | 0 |
add a leg of the mouse if you were the mouse looking down at your legs, leg 1 is the front left foot, and the rest are numbered clockwise. | function addLeg(mouse, mouseParams, legNum) {
var leg = createLeg(mouseParams);
var legFront = (legNum == 1 || legNum == 2) ? 1 : -1;
var legSide = (legNum == 1 || legNum == 4) ? 1 : -1;
leg.position.x = mouseParams.torsoRadius * .3 * legSide;
leg.position.y = -mouseParams.torsoRadius * .8;
le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function leftLeg(){\n context.beginPath();\ncontext.lineWidth = 8;\ncontext.strokeStyle = 'pink';\n\ncontext.moveTo(197, 297);\ncontext.lineTo(120, 347);\ncontext.moveTo(197, 297);\ncontext.stroke();\n\n}",
"function addPencilPoint(x,y, mouseDown){\n pencilXPoints.push(x);\n pencilYPoints.push(y);\n ... | [
"0.6052493",
"0.6015349",
"0.59278965",
"0.5893969",
"0.58935416",
"0.585871",
"0.5829965",
"0.5816796",
"0.5782784",
"0.57353944",
"0.57289666",
"0.56915617",
"0.56775695",
"0.5663872",
"0.56623405",
"0.5661485",
"0.56542736",
"0.5653157",
"0.564329",
"0.56208205",
"0.561687... | 0.748877 | 0 |
Sets up the expandable info boxes | function setupExpandInfo() {
var expandTitles = document.getElementsByClassName('expandTitle');
var expandContents = document.getElementsByClassName('expandContent');
for (i = 0; i < expandTitles.length; i++) {
var t = expandTitles[i];
var c = expandContents[i];
t.dataset.expandId = i;
t.addEvent... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function expandContents(data) {\n parent=$(data).parent().parent();\n $(data).parent().css('display', 'none');\n $(parent).css('height','380px');\n $(parent).find('.content').css('display','block');\n $(parent).addClass('mui-panel');\n $(parent).css('margin-left', '1%');\n $(parent).css('paddi... | [
"0.67043096",
"0.6555507",
"0.64834976",
"0.6409149",
"0.64018035",
"0.6355732",
"0.6318807",
"0.63112664",
"0.62502056",
"0.61956054",
"0.6189241",
"0.6164353",
"0.60827106",
"0.60645205",
"0.60610175",
"0.60527414",
"0.6036851",
"0.60343903",
"0.6027286",
"0.6022408",
"0.60... | 0.71866363 | 0 |
draw a trunk of a bamboo | function trunk(){
context.setTransform(stack[0][0],stack[0][1],stack[0][3],stack[0][4],stack[0][6],stack[0][7]);
context.fillStyle = "#95b391";
context.fillRect(460,380,80,100);
context.fillStyle = "#393737";
context.fillRect(460,482,80,5); //leave a 2-pixel blank space
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"drawTree() {\r\n sechsteAufgabe.crc2.beginPath();\r\n sechsteAufgabe.crc2.moveTo(this.x, this.y);\r\n sechsteAufgabe.crc2.lineTo(this.x + 30, this.y - 60);\r\n sechsteAufgabe.crc2.lineTo(this.x + 60, this.y);\r\n sechsteAufgabe.crc2.strokeStyle = this.color;\r... | [
"0.54215974",
"0.5408363",
"0.54065007",
"0.5359974",
"0.5327592",
"0.52857906",
"0.52307045",
"0.52204245",
"0.52121806",
"0.52079004",
"0.51823854",
"0.51660824",
"0.51630867",
"0.51625353",
"0.5126186",
"0.51251465",
"0.50807613",
"0.50552654",
"0.49993262",
"0.49890405",
... | 0.56153834 | 0 |
Take a dump and return a sanitized image if it is valid, null otherwise. | function loadImage (dump) {
let {name, operation, operands, operationParams} = dump;
operation = OPERATIONS.find(op => op.name === operation);
const {numOperands, params} = operation;
const numParams = params ? params.length : 0;
if (operands.length < numOperands) {
return null;
}
/* In old dumps oper... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sanitizeCard(parsecard) {\n\tvar sanitized = parsecard.toJSON();\n\t// Remove parse data from the JSON object before returning it\n\tdelete sanitized.createdAt;\n\tdelete sanitized.objectId;\n\tdelete sanitized.updatedAt;\n\n\tif (sideLoadImages && sanitized.image != null) {\n\t\tvar image = sanitized.ima... | [
"0.56218797",
"0.50909865",
"0.50776494",
"0.50577843",
"0.5010175",
"0.47432113",
"0.45314464",
"0.45252585",
"0.44946247",
"0.44620666",
"0.44616202",
"0.44572613",
"0.44480583",
"0.44257218",
"0.4379905",
"0.43723023",
"0.43629986",
"0.43121228",
"0.42671117",
"0.42531323",
... | 0.5492319 | 1 |
Show License Expire Calander | function driverToggleLicExpCalendar()
{
if (licExpCal) {
var cal = licExpCal;
var fld = document.getElementById(ID_LICENSE_EXPIRE);
if (cal.isExpanded()) {
// collapse
cal.setExpanded(false, CALENDAR_FADE);
if (cal) { fld.value = cal.getDateAsString(); }
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showDisclaimerIfExpired() {\n if (isDisclaimerExpired()) {\n openDisclaimerBox();\n setDisclaimerExpiry();\n }\n}",
"static showExpired() {\n LocationInfos.hideLocationInfo();\n LocationInfos.showsectionLoc();\n LocationInfos.expirationFooter.style.display = 'block';\n }",
"function ... | [
"0.678075",
"0.6353453",
"0.6318285",
"0.63035697",
"0.57988423",
"0.5772332",
"0.5772332",
"0.5772332",
"0.5772332",
"0.5772332",
"0.5772332",
"0.5772332",
"0.5772332",
"0.57335454",
"0.5725771",
"0.5725771",
"0.57143086",
"0.5688033",
"0.56840265",
"0.5643115",
"0.5636091",... | 0.6601048 | 1 |
functions section arc drawing function | function drawArc(start,end,mid,vertical,num){
ctx.beginPath();
ctx.strokeStyle = "#990099"
ctx.lineWidth = 2;
ctx.moveTo(start, vertical);
ctx.quadraticCurveTo(mid, vertical - (num * 80) / 4, end, vertical);
ctx.lineTo(end - 10, vertical - 16);
ctx.moveTo(end, vertical);
ctx.lineTo(end - 16, vertical - ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\n background(220);\n // arc(centerX, centerY,\n // width, height,\n // startAngle, endAngle,\n // optionalparm);\n\n // Optionalparm = CHORD, PIE\n\n // W/o optional argument,\n // the arc perimeter is not closed.\n arc(100,200,\n 100,100,\n 0,PI/2);\n\n // Optional C... | [
"0.7553056",
"0.69395924",
"0.69206417",
"0.6845247",
"0.68422383",
"0.6813327",
"0.6725229",
"0.66818124",
"0.6667876",
"0.66423297",
"0.662015",
"0.6541686",
"0.65234846",
"0.6512378",
"0.6493042",
"0.6491004",
"0.64842385",
"0.6471668",
"0.6463203",
"0.6451805",
"0.6449507... | 0.725777 | 1 |
Converts a JSON pointer to array. | function jsonPointerToArray(pointer) {
if (typeof pointer !== 'string') {
throw new TypeError(`Expected a string, got a ${typeof pointer}`);
}
if (pointer[0] === '/') {
pointer = pointer.substr(1);
}
if (pointer === '') {
return [];
}
return pointer.split('/').map(unescapeJsonPointerToken);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jsonPointerToArray(pointer) {\n if (typeof pointer !== 'string') {\n throw new TypeError(\"Expected a string, got a \".concat(typeof_default()(pointer)));\n }\n\n if (pointer[0] === '/') {\n pointer = pointer.substr(1);\n }\n\n if (pointer === '') {\n return [];\n }\n\n return pointer.spli... | [
"0.7501591",
"0.68554515",
"0.6807336",
"0.6608169",
"0.61761224",
"0.610697",
"0.60714537",
"0.6070281",
"0.603063",
"0.5932278",
"0.5832847",
"0.5707451",
"0.5580795",
"0.55574816",
"0.5543503",
"0.55173755",
"0.55157036",
"0.5487384",
"0.54387254",
"0.5438081",
"0.54375964... | 0.744152 | 1 |
Unescapes a JSON pointer. | function unescapeJsonPointerToken(token) {
if (typeof token !== 'string') {
return token;
}
const params = new URLSearchParams(`=${token.replace(/~1/g, '/').replace(/~0/g, '~')}`);
return params.get('');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unescapeJsonPointerToken(token) {\n if (typeof token !== 'string') {\n return token;\n }\n return external_querystring_browser_default.a.unescape(token.replace(/~1/g, '/').replace(/~0/g, '~'));\n}",
"function dereferenceJSON (source) {\n\treturn JSON.parse(JSON.stringify(source))\n}",
"function ... | [
"0.6921209",
"0.57884943",
"0.5777714",
"0.57734394",
"0.57136947",
"0.5638722",
"0.5638722",
"0.5638722",
"0.56062394",
"0.5552433",
"0.5525625",
"0.548214",
"0.53601897",
"0.53404605",
"0.531142",
"0.5279748",
"0.5257071",
"0.52476746",
"0.5175148",
"0.51673037",
"0.5109055... | 0.65569234 | 1 |
This will adjust the position of the labels to the appropriate place below the axis. | function placeXLabel() {
xAxisLabels.attr("transform", "translate(" + (width / 2) + ", " + (height + margin.top + 20) + ")");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function placeYLabel() {\n yAxisLabels.attr(\"transform\", \"translate(0,\" + (height)/2 + \")rotate(-90)\");\n }",
"function position_labels(labels, data) {\n labels.transition()\n .duration(500)\n .text(function(d) {\n return d;\n })\... | [
"0.7616365",
"0.76002043",
"0.75044054",
"0.7145688",
"0.706661",
"0.70395595",
"0.6952093",
"0.6742751",
"0.67292184",
"0.6727423",
"0.6724116",
"0.66978496",
"0.66893834",
"0.66823655",
"0.6627123",
"0.6594554",
"0.65862966",
"0.6583257",
"0.6420684",
"0.6420683",
"0.640648... | 0.7670937 | 0 |
Funcion para cargar un reporte con solo / El horario especificado | function generarReporteHorario(){
var horario = $("#selectHorario").val();
if (horario != -1) {
var url = '../controller/generarReporteTourHora.php?horario='+horario;
window.open(url,'Reporte del Dia', 'width=800, height=600');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Cargar_reporte_caja_diario(){\nvar fecha_inicio = $('#fecha_inicio').val();\nvar cantidad_caja = 0;\nif (fecha_inicio == \"\") {\n alertify.alert(\"ADVERTENCIA\",\"INTRODUSCA LA FECHA\");\n} else {\n var tabladatos=$(\"#datos_rcd\");\n var route = \"listareportecajadiario/\"+fecha_inicio;\n $(... | [
"0.59579724",
"0.58499664",
"0.58034796",
"0.5791207",
"0.57728183",
"0.57704884",
"0.5622305",
"0.5589725",
"0.55763113",
"0.5573548",
"0.5530502",
"0.5512895",
"0.54882306",
"0.5423133",
"0.53843695",
"0.5366152",
"0.5365771",
"0.53407276",
"0.53175104",
"0.53046227",
"0.53... | 0.58957464 | 1 |
Get selected sku based on the itemId | getSelectedSku(skuList = [], itemId) {
return skuList.find(item => item.itemId === itemId);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_item (sku) {\n var product = null;\n for (p_ind in products){\n if (products[p_ind]['sku'] == sku) {\n product = products[p_ind];}\n }\n return product;\n}",
"function findItem(sku) {\n\n // map function : \"item\" here is an array composed of object data\n // ... | [
"0.73456925",
"0.6447259",
"0.6397131",
"0.6285499",
"0.59641784",
"0.58810884",
"0.580606",
"0.5776304",
"0.5618315",
"0.5617054",
"0.5605408",
"0.55922955",
"0.5587319",
"0.55248934",
"0.55181926",
"0.5514673",
"0.54946476",
"0.54882514",
"0.54749954",
"0.54525864",
"0.5431... | 0.7983031 | 0 |
Display only products Items that can't be purchased online (e.g. Firearms that are not eligible for Ships to Store) | isProductDisplayOnly() {
const { ecomCode } = this.createOnlineMessage();
return ecomCode === ECOM_CODE_STORE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"availableProducts(state, getters) {\n return state.products.filter(product => product.inventory > 0);\n }",
"validateItemsQty() {\n const { product_list } = this.props;\n let res = true;\n if (product_list && product_list.items && product_list.items.length > 0) {\n product_list.items.map((i... | [
"0.6501353",
"0.62089515",
"0.6167862",
"0.6128069",
"0.60839516",
"0.59851325",
"0.5924762",
"0.58554274",
"0.5796355",
"0.5777822",
"0.5748148",
"0.57146263",
"0.56909764",
"0.5681364",
"0.56677186",
"0.5654727",
"0.5645597",
"0.5627485",
"0.56176394",
"0.557932",
"0.555702... | 0.6449909 | 1 |
The idea here is to perform fast updates. See But our implementation is a bit buggy: flickering, bad rendering when someone types very fast. If you want to enable such buggy fast updates, you should add something like onkeypress="Preview.UpdateKeyPress(event)" to textarea's attributes. | UpdateKeyPress({
keyCode
}) {
if (keyCode < 16 || keyCode > 47) {
this.preview.innerHTML = `<p>${marked(this.textarea.value)}</p>`
this.buffer.innerHTML = `<p>${marked(this.textarea.value)}</p>`
}
this.Update()
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleTextAreaUpdate() {\n updateLinePreview();\n updateOutput();\n updateUrl();\n}",
"function updatePreview(textareaID){\r\n var textarea = getInput(textareaID);\r\n var preview = getPreview(textareaID);\r\n var latex = textarea.val();\r\n var html = compileLaTeX(l... | [
"0.6795442",
"0.6525544",
"0.60813373",
"0.593713",
"0.59256464",
"0.5889686",
"0.58570963",
"0.5852682",
"0.5852571",
"0.58446336",
"0.5839471",
"0.58175737",
"0.58083266",
"0.58060986",
"0.576497",
"0.5745293",
"0.57433546",
"0.5738301",
"0.57369304",
"0.57056797",
"0.57048... | 0.7522011 | 0 |
check number of hits (correct answers) | function checkHits() {
let hits = 0;
answers.forEach(e => e.correct === true ? hits++ : null)
return hits
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gameCheck(){\r\n\t\tfor(var i=0; i<answerKey.length; i++){\r\n\t\t\tif (userAnswers[i] == answerKey[i]){\r\n\t\t\t\tcorrectGuesses++;\r\n\t\t\t\tconsole.log(\"correct guesses is \" + correctGuesses);\r\n\t\t\t\tconsole.log(correctGuesses/totalQuestions);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tconsole.log(\"... | [
"0.71042687",
"0.6754875",
"0.6715384",
"0.65754485",
"0.6538326",
"0.6523209",
"0.6489717",
"0.6481685",
"0.6468159",
"0.6462587",
"0.6457389",
"0.64461416",
"0.64310986",
"0.6428921",
"0.6370332",
"0.63555765",
"0.6338738",
"0.6337838",
"0.632887",
"0.62979126",
"0.62911314... | 0.8484145 | 0 |
merge() merges two associative arrays (objects) | function merge(a, b)
{
for (key in b)
a[key] = b[key];
return a;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function merge(array1, array2) \r\n{\r\n for (key in array1) \r\n array2[key] = array1[key];\r\n return array2;\r\n}",
"function merge ( a, b ) {\n for ( var k in b ) {\n a[ k ] = b[ k ];\n }\n return a;\n }",
"function merge(array1, array2) {}",
"function merge(a, b) {\n for (var key ... | [
"0.77530193",
"0.7606896",
"0.74516976",
"0.7416796",
"0.7416796",
"0.7335718",
"0.7314895",
"0.7244374",
"0.7181873",
"0.71721405",
"0.7158473",
"0.7124643",
"0.7121975",
"0.71191585",
"0.7083421",
"0.7050175",
"0.70489347",
"0.7042919",
"0.7037928",
"0.7013001",
"0.7012455"... | 0.76413786 | 1 |
decrypt string with password | function decrypt(text, password) {
var decipher = crypto.createDecipher(ENCRYPTION_ALGORITHM, password);
var dec = decipher.update(text, 'hex', 'utf8');
try {
dec += decipher.final('utf8');
return dec;
} catch (ex) {
return;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function decrypt(password) {\n const decipher = crypto.createDecipher(algorithm, privateKey)\n let dec = decipher.update(password, 'hex', 'utf8')\n dec += decipher.final('utf8')\n return dec\n}",
"function decrypt(ciphertext, password) {\n return CryptoJS.AES.decrypt(ciphertext, password);\n}",
"functio... | [
"0.74385685",
"0.73431903",
"0.7248517",
"0.7195143",
"0.71676517",
"0.7152794",
"0.7100831",
"0.7039476",
"0.6988816",
"0.69485533",
"0.6946059",
"0.6818138",
"0.6767573",
"0.6755964",
"0.6528749",
"0.64867437",
"0.64802635",
"0.64792573",
"0.6426257",
"0.6422798",
"0.641189... | 0.7426232 | 1 |
Block Encryption encrypt text into encrypted blocks with id and sequence info max size of block is 128 characters | function encryptToBlocks(text, password) {
var textBlocks = [];
for (var i = 0; i < text.length; i += BLOCK_PAYLOAD_SIZE) {
textBlocks.push(text.substring(i, (i + BLOCK_PAYLOAD_SIZE < text.length ?
i + BLOCK_PAYLOAD_SIZE : text.length)));
}
var blocks = [];
var id = createRandStr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"encrypt(text) {\n this.iv = crypto.randomBytes(IV_LENGTH);\n const cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(this.secret), this.iv);\n let encrypted = cipher.update(text);\n\n encrypted = Buffer.concat([ encrypted, cipher.final() ]);\n\n return `${this.iv.toString... | [
"0.6139418",
"0.60511005",
"0.59973997",
"0.59748423",
"0.5964538",
"0.5946813",
"0.5946813",
"0.5946813",
"0.5946813",
"0.5946813",
"0.5927954",
"0.5916561",
"0.5916561",
"0.5916561",
"0.5916561",
"0.5916561",
"0.5813449",
"0.5808619",
"0.5781391",
"0.57563025",
"0.57424927"... | 0.7135987 | 0 |
decrypt comments from Imgur gallery comments JSON | function decryptComments(d, password) {
// decrypt each ciphered block if possible
var commentBlocks = {};
d.data.forEach(function(e) {
var block = decrypt(e.comment, password);
if (block != undefined) {
var id = block.substring(0, BLOCK_ID_INDEX);
var m = parseInt(bl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getComments(accessToken, galleryId, password) {\n var options = {\n hostname: getHostname(),\n port: 443,\n path: getCommentPath(galleryId),\n method: 'GET',\n headers: {\n 'Authorization': getAuthHeader(accessToken),\n }\n };\n var str = '';\n... | [
"0.6582615",
"0.6026684",
"0.59384567",
"0.5632497",
"0.5286844",
"0.5281669",
"0.51339495",
"0.51339495",
"0.51339495",
"0.51339495",
"0.49973872",
"0.499301",
"0.4981846",
"0.49616167",
"0.4897849",
"0.48559108",
"0.48499078",
"0.48386213",
"0.48362163",
"0.48361233",
"0.48... | 0.6769079 | 0 |
Imgur API encrypt comment post | function encryptComment(accessToken, galleryId, password, comment) {
var encryptedBlocks = encryptToBlocks(comment, password);
encryptedBlocks.forEach(function(e) {
postComment(accessToken, galleryId, e);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function PostComment() {\n var message = commentBuffer.shift();\n var encryptedMessage = EncryptMessage(message, true);\n SendMessage(encryptedMessage);\n}",
"function encryptCommentString(fEncrypt, sUserData, bufKeyIv) {\n var bufPt;\n\n bufPt = new Buffer(\n 'comment1=cooking%20MCs;userdata=' +... | [
"0.6369992",
"0.62538767",
"0.6222395",
"0.6210104",
"0.59490126",
"0.5900981",
"0.56265247",
"0.5474875",
"0.54621404",
"0.5451965",
"0.54281485",
"0.54037863",
"0.5401572",
"0.5370905",
"0.5347727",
"0.5322043",
"0.5322043",
"0.5305196",
"0.5278587",
"0.5259304",
"0.5259304... | 0.7039945 | 0 |
post comment to Imgur gallery | function postComment(accessToken, galleryId, comment) {
var options = {
hostname: getHostname(),
port: 443,
path: getCommentCreationPath(galleryId, comment),
method: 'POST',
headers: {
'Authorization': getAuthHeader(accessToken),
}
};
var req = htt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function comments(e) {\n commentSection.textContent = \"\";\n commentModal.style.backgroundImage = 'url(\"' + e.currentTarget.getElementsByTagName('img')[1].src + '\")';\n commentModal.classList.toggle('hidden');\n postId = e.currentTarget.getAttribute('data-id');\n var data = {\n post_id: postId\n };\n ... | [
"0.6466728",
"0.6409561",
"0.6294336",
"0.62917316",
"0.6208758",
"0.6174472",
"0.6163961",
"0.61533004",
"0.6125535",
"0.6121436",
"0.60219693",
"0.6003803",
"0.59955645",
"0.5980998",
"0.5965333",
"0.595335",
"0.59501094",
"0.5948417",
"0.59280723",
"0.5926866",
"0.59184784... | 0.7302525 | 0 |
get Imgur comments from gallery in JSON | function getComments(accessToken, galleryId, password) {
var options = {
hostname: getHostname(),
port: 443,
path: getCommentPath(galleryId),
method: 'GET',
headers: {
'Authorization': getAuthHeader(accessToken),
}
};
var str = '';
callback = f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function galleryGet() {\n const REDDIT_URL = `https://www.reddit.com/r/aww.json?jsonp=?`;\n \n }",
"function commentJSONReady(comments) {\n const commentsDiv = document.getElementById(\"comments\");\n let commentsHTML = \"\";\n for (let i = 0; i < comments.length; i++) {\n const comment = comments[i... | [
"0.7066007",
"0.6257431",
"0.62295455",
"0.62209386",
"0.6071641",
"0.60275745",
"0.60070395",
"0.60070395",
"0.59618783",
"0.59421265",
"0.59407234",
"0.5905831",
"0.58986324",
"0.5888526",
"0.5886307",
"0.58408535",
"0.583198",
"0.58303356",
"0.5770733",
"0.5770598",
"0.576... | 0.6392248 | 1 |
share image to publicly accessible gallery for comment posting | function shareGallery(accessToken, imageId, groupName) {
var options = {
hostname: getHostname(),
port: 443,
path: getShareGalleryPath(imageId, createRandStr(32)),
method: 'POST',
headers: {
'Authorization': getAuthHeader(accessToken),
}
};
var req... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function share_image_tw(){\r\n\t\t$.post('/account/upload/tw', { input: 'image', tw_share_text: $('#share_text').val(), tw_url: $('#share_url').val() }, function(){\r\n\t\t$('#share_text').val('');\r\n\t\t$('.share_box').slideUp(200);\r\n\t\t\r\n\t\t});\r\n\t}",
"function _addShareUrls() {\n for (var i = ... | [
"0.6486004",
"0.6367355",
"0.62672067",
"0.617931",
"0.6119239",
"0.61109304",
"0.6090099",
"0.6087773",
"0.6019352",
"0.59861064",
"0.59776217",
"0.597431",
"0.59351945",
"0.5920843",
"0.5890689",
"0.5880418",
"0.5870419",
"0.5860261",
"0.585822",
"0.5854983",
"0.5849808",
... | 0.65608716 | 0 |
Console set console prompt username and group name | function setPrompt(username, groupName) {
rl.setPrompt(`${username}/${groupName}> `);
rl.prompt();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_prompt() {\n\n let _this = this,\n overrides = {};\n\n // If non-interactive, skip\n if (!S.config.interactive || _this.evt.options.name) return BbPromise.resolve();\n\n let prompts = {\n properties: {\n name: {\n description: 'Enter a new plugin name: '.yel... | [
"0.6441564",
"0.61574626",
"0.61343753",
"0.61105907",
"0.60872966",
"0.6011647",
"0.6006077",
"0.59798974",
"0.59798974",
"0.59533083",
"0.58995193",
"0.58799875",
"0.58361906",
"0.5824215",
"0.58215684",
"0.5796733",
"0.57673424",
"0.5754964",
"0.5747836",
"0.5747836",
"0.5... | 0.80496615 | 0 |
parses argument text within quotation marks | function parseTextArg(args) {
var text = args.slice(2, args.length).join(' ');
text = text.substring(1, text.length - 1);
return text;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function argToUnquotedString(arg) {\n arg = argToString(arg);\n arg = arg.replace(/^\"(.*)\"$/, '$1');\n arg = arg.replace(/^'(.*)'$/, '$1');\n return arg;\n }",
"function parse_parameters(cmdline) {\n// var re_next_arg = /^\\s*((?:(?:\"(?:\\\\.|[^\"])*\")|(?:'[^']*')|\\\\.|\\S)... | [
"0.6342207",
"0.6136132",
"0.61337113",
"0.61226606",
"0.5862817",
"0.5715856",
"0.5669518",
"0.5662955",
"0.56122345",
"0.5604068",
"0.5524927",
"0.5510378",
"0.5505816",
"0.5496709",
"0.5485316",
"0.54633415",
"0.5451067",
"0.5434138",
"0.541632",
"0.5406456",
"0.5406456",
... | 0.6624669 | 0 |
Check whether the map is in the edit mode | function isEditMapMode()
{
if ( jQuery( '.btn_edit-map' ).length == 0 ) return true;
else return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isEditMode(){\r\n\t\t\treturn ctrl.view == views.EDIT;\r\n\t\t}",
"get editing() {\n return !!(this.nameSpan.inplaceEditor || this.valueSpan.inplaceEditor ||\n this.ruleView.tooltips && this.ruleView.tooltips.isEditing) || this.popup.isOpen;\n }",
"isEditMode() {\n return !isEmpty(this.w... | [
"0.7836286",
"0.70670325",
"0.69151545",
"0.6891214",
"0.67978483",
"0.67865014",
"0.6627955",
"0.6558515",
"0.65171957",
"0.6513003",
"0.6513003",
"0.648783",
"0.6460192",
"0.63893694",
"0.63707983",
"0.62220526",
"0.6220201",
"0.6149056",
"0.6134738",
"0.60987574",
"0.60935... | 0.86262554 | 0 |
Using Async Functions make use of the previously defined getMovieWithPromises since async functions return a Promise | async function showDataWithAsync(title) {
var data = await getMovieWithPromises(title);
console.log(data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getMovies() {\n var movieList = await Promise.all([\n $.getJSON(`https://omdbapi.com?t=taken&apikey=thewdb`),\n $.getJSON(`https://omdbapi.com?t=troy&apikey=thewdb`)\n ]);\n\n console.log(movieList[0]);\n console.log(movieList[1]);\n}",
"async function get... | [
"0.7112769",
"0.6881614",
"0.6815409",
"0.67822516",
"0.67778605",
"0.67290777",
"0.6639915",
"0.66140485",
"0.65946007",
"0.6580477",
"0.6544474",
"0.6441096",
"0.6426537",
"0.64057267",
"0.6387519",
"0.63685495",
"0.6293493",
"0.6293248",
"0.627194",
"0.62652534",
"0.625443... | 0.7946724 | 0 |
renderTable renders the filteredAddresses to the tbody | function renderTable() {
$tbody.innerHTML = "";
// Set the value of endingIndex to startingIndex + resultsPerPage
var endingIndex = startingIndex + resultsPerPage;
// Get a section of the addressData array to render
var addressSubset = filteredAddresses.slice(startingIndex, endingIndex);
fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredAddresses.length; i++) {\n // Get get the current address object and its fields\n var address = filteredAddresses[i];\n var fields = Object.keys(address);\n // Create a new row in the tbody, set the index to be i + star... | [
"0.85320383",
"0.80689687",
"0.80142945",
"0.7909394",
"0.7821939",
"0.74442947",
"0.70185745",
"0.69871247",
"0.6933696",
"0.68724257",
"0.68063116",
"0.67423296",
"0.66854995",
"0.6633452",
"0.66291225",
"0.66104645",
"0.64937115",
"0.64552236",
"0.6313087",
"0.6182964",
"0... | 0.8222825 | 1 |
Displays the current five streams based on the page the user is on. | function displayStreams() {
document.getElementById('stream').innerHTML = '';
for (var i = 0; i < currentStreams[currentPage - 1].length; i++) {
document.getElementById('stream').innerHTML += currentStreams[currentPage - 1][i];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function afterPage() {\n if(endCount!=streamsObj.streams.length) {\n beginCount = endCount + 1;\n endCount = (endCount == streamsObj.streams.length) ? streamsObj.streams.length : endCount+5;\n if(endCount > streamsObj.streams.length) {\n endCount = streamsObj.streams.length;\n }\n var enC = en... | [
"0.706599",
"0.6750271",
"0.6535457",
"0.6514874",
"0.6440241",
"0.62074196",
"0.62040806",
"0.59868383",
"0.59288776",
"0.592445",
"0.58136916",
"0.577561",
"0.577074",
"0.5750199",
"0.5741369",
"0.57243145",
"0.5706417",
"0.5696883",
"0.5690669",
"0.56543463",
"0.56501245",... | 0.722848 | 0 |
table types first, functions last, other than that alphabetically | function tblrowcmp(a,b) {
if ((a.type == "table") && (b.type != "table")) {
return -1 ; // table allways smaller than other types
} else if ((b.type == "table") && (a.type != "table")) {
return 1 ;
} else {
if ((a.type == "function") && (b.type != "function")) {
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tableSortDataType(name) {\n var string_types = [\"allele\", \"associated with\", \"association type\", \"authors\", \"data type\", \"disease\",\n \"similar diseases\", \"evidence\", \"gene\", \"gene A\", \"gene B\", \"gene B organism\", \"genotype\", \"hit\",\n \"homolog\", \"homology cla... | [
"0.6201059",
"0.5848733",
"0.580959",
"0.580959",
"0.580959",
"0.58024275",
"0.56621176",
"0.5651683",
"0.56419617",
"0.56400615",
"0.56322634",
"0.56060654",
"0.5543369",
"0.5520221",
"0.5520221",
"0.5510964",
"0.5468565",
"0.5465075",
"0.54637545",
"0.5439675",
"0.5431958",... | 0.5867692 | 1 |
==FUNCTIONS========================================= open connection function | function openConnection() {
connection.connect(function (err) {
if (err) throw err;
// console.log("connected as id " + connection.threadId);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static _openDbConnection() {\n const con = process.env.RETHINKDB_CONNECTION;\n this.indicatorTable = 'indicators';\n this.database = 'bitfinex';\n return r.connect(JSON.parse(con));\n }",
"connect() {\n this.connection.connect()\n this.connection.on('error', err => {\... | [
"0.6855787",
"0.68557835",
"0.6848867",
"0.67108196",
"0.6706408",
"0.67056024",
"0.66937715",
"0.66413796",
"0.6637185",
"0.66264445",
"0.66222495",
"0.6545166",
"0.6530192",
"0.65160197",
"0.64939296",
"0.6460583",
"0.6445309",
"0.6424237",
"0.6424237",
"0.64085",
"0.638879... | 0.77980447 | 0 |
loginStatus(): checks whether customer is logged in and executes the the relevant functions. | function loginStatus(){
// Step 1: Create XMLHttpRequest Object
if (window.XMLHttpRequest) {
var xHRObject = new XMLHttpRequest();
}
else if (window.ActiveXObject) {
var xHRObject = new ActiveXObject("Microsoft.XMLHTTP");
}
//Step 2: Prepare arguments for XHR object
xHRObject.open("GET", "manageLogin.php?ac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mainlogin(userStatus) { //TODO: rename to \"create Login Fields\" or something\n\n\tconsole.log(\"mainlogin(\" + userStatus + \")\");\n\t//saveToLocalStorage('userType', text); //ui-btn ui-corner-all ui-shadow ui-btn-inline ui-btn-b\"\n\n\tif (userStatus == 1) {\n\t\t$('#loginError').removeClass('hidden'... | [
"0.71757907",
"0.67951894",
"0.67302126",
"0.66232586",
"0.65067214",
"0.6483047",
"0.6471818",
"0.6446894",
"0.6429982",
"0.63971627",
"0.6355202",
"0.62815034",
"0.6254292",
"0.6231157",
"0.6214707",
"0.61971194",
"0.6191974",
"0.61906564",
"0.6113002",
"0.61027956",
"0.608... | 0.7119792 | 1 |
javascript Function for k_calculus ////////////////////////////////////////////////////////////////////////////////////////////////////// / Function to calculate the number of active attributes (minimum 2 attributes are needed) | function number_attributes_checked(){
var assess_session = JSON.parse(localStorage.getItem("assess_session")),
counter=0;
for (var i=0; i < assess_session.attributes.length; i++){
if(assess_session.attributes[i].checked){
counter++;
};
};
return counter;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_calculateAttrPoints() {\n let { str, agi, vit, luk, dex } = this.config.attributes;\n let attr = { str, agi, vit, luk, dex };\n\n let statusPoints = -50;\n\n for (let value in attr) {\n let val = parseFloat(attr[value]) || 0;\n\n statusPoints += val;\n }\n return stat... | [
"0.6753589",
"0.5867151",
"0.5730823",
"0.57305527",
"0.5579766",
"0.55548984",
"0.55183357",
"0.5461204",
"0.5438174",
"0.53901905",
"0.53745186",
"0.53681034",
"0.5365552",
"0.5365552",
"0.53600156",
"0.5356771",
"0.5356771",
"0.5354645",
"0.5349117",
"0.5345973",
"0.534392... | 0.6346355 | 1 |
Function to test if an object (obj) appears in the list (list_to_test) | function isInList(obj, list_to_test) {
if (list_to_test.indexOf(obj) != -1){
return true;
} else {
return false;
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function containsObject(obj, list) {\n var i;\n for (i = 0; i < list.length; i++) {\n if (list[i] === obj) {\n return true;\n }\n }\n return false;\n }",
"function isInList(obj, list) {\n\tfor (var i = 0, len = list.length; i < len; i++) {\n\t\tif (obj === list[i]) { return ... | [
"0.840956",
"0.84070754",
"0.8340327",
"0.83210033",
"0.82957363",
"0.8261321",
"0.82441807",
"0.81950915",
"0.7891576",
"0.76597846",
"0.7597451",
"0.73165053",
"0.66462743",
"0.6628529",
"0.65855616",
"0.65855616",
"0.65855616",
"0.6527452",
"0.6509029",
"0.64956343",
"0.64... | 0.8615814 | 0 |
function getStaticFileContent will read the file path of documents | function getStaticFileContent(response, filepath, contentType){
fs.readFile(filepath, function(error, data){
if(error){
response.writeHead(500, {'contentType': 'text/plain'});
response.end('500 - Internal Server Error.');
}
if(data){
response.writeHead(200, {'Content-Type': 'text/html'});
response.en... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getDocument(filePath) {\n return templateCache[filePath] = templateCache[filePath] || fs.readFileSync(filePath).toString();\n }",
"function staticFile(fileName, res)\n{\n var fileContents = '';\n\n try\n {\n fileContents = fs.readFileSync(__dirname + fileName, 'utf8');\n } \n catc... | [
"0.6728031",
"0.65580565",
"0.65084565",
"0.62915933",
"0.62600756",
"0.6218535",
"0.6211312",
"0.60926735",
"0.60624707",
"0.60415506",
"0.60323423",
"0.60109925",
"0.59985226",
"0.59862846",
"0.5976512",
"0.5967212",
"0.595873",
"0.5949396",
"0.59362817",
"0.5932521",
"0.59... | 0.73129755 | 0 |
This sample demonstrates how to Returns a specified private link resource that need to be created for Backup and SiteRecovery | async function getPrivateLinkResource() {
const subscriptionId =
process.env["RECOVERYSERVICES_SUBSCRIPTION_ID"] || "6c48fa17-39c7-45f1-90ac-47a587128ace";
const resourceGroupName = process.env["RECOVERYSERVICES_RESOURCE_GROUP"] || "petesting";
const vaultName = "pemsi-ecy-rsv2";
const privateLinkResourceNa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function createPrivateLinkService() {\n const credential = new DefaultAzureCredential();\n const client = createNetworkManagementClient(credential);\n const subscriptionId = \"\";\n const resourceGroupName = \"rg1\";\n const serviceName = \"testPls\";\n const options = {\n body: {\n location: \... | [
"0.614729",
"0.5991938",
"0.5805156",
"0.5761902",
"0.5647042",
"0.56128716",
"0.556497",
"0.54873276",
"0.548475",
"0.547782",
"0.5465775",
"0.5415707",
"0.5402057",
"0.5374296",
"0.5374296",
"0.53134716",
"0.52768034",
"0.5261532",
"0.5240346",
"0.5215471",
"0.5214264",
"... | 0.7882483 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.