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 |
|---|---|---|---|---|---|---|
import addReply from "./ReplyListItem/ReplyListItem"; | function ReplyList(props) {
return (
<div className="listView">
{props.replies.map(individualReply => (
<ReplyListItem
reply={individualReply}
key={individualReply.objectId}
onDelete={() =>
this.props.handleDeleteReply(individualReply.objectId)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Reply() {\n debug('Go get some Replies!');\n}",
"function ReplyDetails(props) {\n\n return (\n <div className=\"ui segment ReplyDetails\">\n <div className=\"ui header\"></div>\n <p>\n {props.body} <br />\n </p>\n <p>\n <small> Replier: {props.replier_full_name} |<... | [
"0.5294552",
"0.52271384",
"0.51243484",
"0.5119472",
"0.51077944",
"0.5089758",
"0.50797385",
"0.5039867",
"0.5027051",
"0.48238313",
"0.4786621",
"0.47856998",
"0.47488216",
"0.47464874",
"0.47032782",
"0.46991187",
"0.46990174",
"0.46990174",
"0.46921787",
"0.4677479",
"0.... | 0.607873 | 0 |
This function sends a POST request to twitch to handle the situation wher a token needs to be refreshed | async function postRefreshToken() {
// DBG
console.log('Need to refresh');
// Set up the url and body
var url = 'https://id.twitch.tv/oauth2/token?grant_type=refresh_token&refresh_token=' + refreshToken + '&client_id=' + clientId + '&client_secret=' + clientSecret;
var body = JSON.stringify({
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async refreshTokens(bot) {\n\t\tawait fetch(`https://id.twitch.tv/oauth2/token?client_id=${bot.config.api_keys.twitch.clientID}&client_secret=${bot.config.api_keys.twitch.clientSecret}&grant_type=client_credentials`, {\n\t\t\tmethod: 'POST',\n\t\t}).then(res => res.json()).then(data => {\n\t\t\taccess_token = data... | [
"0.69462",
"0.6759391",
"0.64835775",
"0.63056165",
"0.6281583",
"0.62113",
"0.6170575",
"0.6061744",
"0.60363734",
"0.60208696",
"0.5983546",
"0.5973333",
"0.59626657",
"0.5954167",
"0.5938598",
"0.59303755",
"0.5922613",
"0.59083396",
"0.58981186",
"0.58698297",
"0.58589596... | 0.7822196 | 0 |
Update the image in the html, passed the url | function updateImage(url) {
// Function created as we may need to do more than update the image.
// Select the image from the htnl
var image = document.getElementById("myImage");
// Check if the url passed in is invalid, this should never be the case but if it is then set the image
// to be the de... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateImage(url) {\n\n //function created as we may need to do more than update the image.\n //Select the image from the htnl\n var image = document.getElementById(\"myImage\");\n\n //Check if the url passed in is invalid, this should never be the case but if it is then set the image\n //to... | [
"0.7702177",
"0.70219314",
"0.68782777",
"0.68662983",
"0.6747873",
"0.6596761",
"0.65385747",
"0.65357435",
"0.64735496",
"0.6438",
"0.64328533",
"0.64053047",
"0.6403032",
"0.6386359",
"0.6334839",
"0.632214",
"0.6318375",
"0.6292281",
"0.6222231",
"0.6221823",
"0.6212566",... | 0.7762206 | 0 |
Return flat forms if cached, otherwise call getAllFlatFormsFromDatabase() method | function getAllFlatForms(hardReload) {
if ((!areAllFlatFormsLoaded && !areAllFlatFormsLoading) || hardReload) {
getAllFlatFormsFromDatabase();
}
return allFlatForms;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFlatForms(hardReload) {\n\t\t\tif ((!areFlatFormsLoaded && !areFlatFormsLoading) || hardReload) {\n\t\t\t\tgetFlatFormsFromDatabase();\n\t\t\t}\n\t\t\treturn flatForms;\n\t\t}",
"function loadExistingFormsAsList(){\n \n }",
"renderForms() {\n for (const form of this._configForms.... | [
"0.7945295",
"0.601338",
"0.533132",
"0.530337",
"0.5110625",
"0.5109756",
"0.50663733",
"0.49485585",
"0.49293303",
"0.49113977",
"0.4910871",
"0.49057245",
"0.48717862",
"0.48640874",
"0.48489305",
"0.48472753",
"0.48470518",
"0.482398",
"0.48216027",
"0.4810139",
"0.474268... | 0.7841026 | 1 |
Set the positive answer regex and optional sub flow to start when a positive answer was given | setPositive(regex, subFlow) {
this.positiveRegex = regex;
this.positiveFlow = subFlow;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkAndParseAnswer(matches, message) {\n let value = message.text;\n if(value == null || (matches == null && (typeof(value) !== \"boolean\"))) {\n return null;\n }\n if(value === true || (value.match && value.match(this.positiveRegex))) {\n this.setSubFlow(this.po... | [
"0.6546633",
"0.60721815",
"0.5978695",
"0.5780774",
"0.5409121",
"0.5312629",
"0.5258614",
"0.52187616",
"0.5189553",
"0.5162241",
"0.51527333",
"0.50435454",
"0.5024137",
"0.4998747",
"0.49717313",
"0.49620244",
"0.4947269",
"0.49363503",
"0.48920295",
"0.4886649",
"0.48858... | 0.753338 | 0 |
Set the negative answer regex and optional sub flow to start when a negative answer was given | setNegative(regex, subFlow) {
this.negativeRegex = regex;
this.negativeFlow = subFlow;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setPositive(regex, subFlow) {\n this.positiveRegex = regex;\n this.positiveFlow = subFlow;\n }",
"handelNegative() {\n if (this.state.resetNext) {\n // reset input if resetNext = true\n this.setState({input: \"-\", resetNext: false});\n } else if (this.state.input.includes(\"-\")... | [
"0.6725723",
"0.60321915",
"0.57352495",
"0.5501705",
"0.547788",
"0.5471023",
"0.5445873",
"0.5378593",
"0.52568024",
"0.52392536",
"0.5170059",
"0.5070646",
"0.5056127",
"0.49169046",
"0.4907319",
"0.49029487",
"0.489644",
"0.48940977",
"0.48587376",
"0.48323143",
"0.483154... | 0.7521148 | 0 |
Set the name, label and style of the positive answer button | setPositiveButton(name, label, style) {
this.useButtons = true;
this.positiveName = name;
this.positiveLabel = label;
this.positiveStyle = style;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setNegativeButton(name, label, style) {\n this.useButtons = true;\n this.negativeName = name;\n this.negativeLabel = label;\n this.negativeStyle = style;\n }",
"function changeButtonText () {\n\t\t\t// Ideally, we could show two radio buttons, labeled Auto and Manual, for Move and ... | [
"0.6931042",
"0.64654493",
"0.63933957",
"0.6377788",
"0.6355352",
"0.6346863",
"0.63385296",
"0.6336492",
"0.63307935",
"0.63207626",
"0.627604",
"0.61375624",
"0.6052344",
"0.60377747",
"0.6020781",
"0.598901",
"0.5955726",
"0.5906595",
"0.5900547",
"0.5892343",
"0.58917487... | 0.7993682 | 0 |
Set the name, label and style of the negative answer button | setNegativeButton(name, label, style) {
this.useButtons = true;
this.negativeName = name;
this.negativeLabel = label;
this.negativeStyle = style;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setPositiveButton(name, label, style) {\n this.useButtons = true;\n this.positiveName = name;\n this.positiveLabel = label;\n this.positiveStyle = style;\n }",
"function setDislikeButton() {\n $('#leafletLikeButton').removeClass('fa-thumbs-up').addClass('fa-thumbs-o-up').css... | [
"0.67395604",
"0.61512846",
"0.584735",
"0.57973135",
"0.5779262",
"0.57564354",
"0.5746767",
"0.57332",
"0.5703569",
"0.5673766",
"0.5649719",
"0.56336373",
"0.5607826",
"0.55852264",
"0.55575573",
"0.55533874",
"0.55433315",
"0.5532859",
"0.5532221",
"0.5498533",
"0.5498504... | 0.825256 | 0 |
Set the question payload style | setQuestionStyle(style) {
this.questionStyle = style;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function quizMessageStyling() {\n jsQuizQuestionEl.setAttribute(\n \"style\",\n \"margin-left: 85px; margin-right: 85px; margin-top: 18px; font-style: italic;\"\n );\n}",
"function setQuestion(question) {\n\n}",
"handleQuestionColorChange(color,bg,qInd){\n let changeField = bg ? \"backgroundColo... | [
"0.63320816",
"0.5731937",
"0.5666526",
"0.53944343",
"0.53889185",
"0.5380059",
"0.52467895",
"0.5189234",
"0.51533693",
"0.51337653",
"0.5066453",
"0.50561357",
"0.5052646",
"0.50387144",
"0.5006421",
"0.4943099",
"0.49387825",
"0.49357963",
"0.4926945",
"0.49191022",
"0.48... | 0.79472935 | 0 |
waits for all transactions in the array and outputs gas usage stats | async function waitForAll(txs) {
// track cumulative gas usage
let cumulativeGasUsed = 0;
console.log("\twaiting for %o transactions to complete", txs.length);
// wait for all pending transactions and gather results
if(txs.length > 0) {
(await Promise.all(txs)).forEach((tx) => {
// measure gas used
const ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getAllExistingTransactions() {\n \n await getEveryTransaction()\n .then((value) => {\n const t = value.data.data;\n if (t.length > 0) {transactions = t}\n sortTransactions(transactions);\n })\n .catch(err => {\n console.error(\"Connection error\", err.message)\n }... | [
"0.62182426",
"0.6160201",
"0.6086474",
"0.5975434",
"0.5966375",
"0.5948902",
"0.59186244",
"0.5870003",
"0.5741237",
"0.5726258",
"0.5726023",
"0.56251377",
"0.56041086",
"0.5599937",
"0.5595982",
"0.5584385",
"0.55784124",
"0.5562745",
"0.55452555",
"0.55404955",
"0.552267... | 0.76912034 | 0 |
tost chat body scroll | function scrollToastChatBody() {
$('#chat-body').animate({scrollTop: $('#chat-body')[0].scrollHeight});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scrollMessaggio (){\r\n var pixelScroll = $(\".right-messages.active\").height();\r\n\r\n $(\"#body_chat\").animate({\r\n scrollTop: pixelScroll\r\n },500)\r\n }",
"function scrollMessage () {\n // Misurazione dell'altezza della chat\n var scroll = $(\".chat\")[0].scrollHeight;\n ... | [
"0.7808027",
"0.7787698",
"0.767139",
"0.7642084",
"0.75602674",
"0.75207657",
"0.75141877",
"0.74693614",
"0.74393255",
"0.740645",
"0.7384204",
"0.73144835",
"0.7314452",
"0.7300228",
"0.7287253",
"0.7253775",
"0.7230748",
"0.72076815",
"0.72000873",
"0.7189616",
"0.7182445... | 0.82113016 | 0 |
Draws an icon (animal) | _drawIcon(i, animal) {
var selectedClass = (animal.active)? "selected":"";
var resp = `<div class="icon_wrapper ${selectedClass}"
onclick="controller.toggleAnimal(${i});"
onmouseover="TextView.showAnimalCallInfo(${i});"
onmouseout="Tex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw_icon(pos, id, select) {\n var x = ((pos % 3)*80) + 2; \n var y = 80;\n\n g.setColor(-1);\n g.drawImage(s.read(apps[id].icon),x+2,y+11,{scale:1.625});\n\n if (select) {\n g.setColor(1,1,1).drawRect(x,y,x+79,y+99); // white bounding box\n }\n}",
"function drawMark(o,x,y) {\n strokeWeight(... | [
"0.6730014",
"0.6415401",
"0.63242924",
"0.62974817",
"0.6262835",
"0.61647797",
"0.6164018",
"0.61483145",
"0.614733",
"0.61433834",
"0.61281997",
"0.6066772",
"0.60643166",
"0.6057338",
"0.60454726",
"0.60316795",
"0.6021669",
"0.60187477",
"0.60038835",
"0.5961003",
"0.595... | 0.7505983 | 0 |
Draw current noise icons | _drawCurrentNoises(currentNoises) {
var noiseButtons = "";
var resp = "";
for (var n in currentNoises) {
var noise = currentNoises[n];
var pos = {x:noise.x, y:noise.y};
// place the button, if a slot and position could be found
noiseButtons += this... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawNoiseMenu () {\n const menuX = menu.open ? menu.openX : menu.closedX;\n const yOffset = getMenusYOffset('boxes') + getMenusYOffset('confetti') + 236;\n push();\n noStroke();\n // Translate to starting position first, to make things easier...\n translate(-width / 2, (-height / 2) + yOffset);\n /... | [
"0.6824683",
"0.6701438",
"0.6520325",
"0.6385489",
"0.6265092",
"0.60982275",
"0.60936886",
"0.60614157",
"0.6000602",
"0.59994495",
"0.5988065",
"0.59406674",
"0.59223336",
"0.5912636",
"0.5896128",
"0.5884463",
"0.5868633",
"0.58609575",
"0.58568794",
"0.58480084",
"0.5847... | 0.69327945 | 0 |
We have two monkeys, a and b, and the parameters aSmile and bSmile indicate if each is smiling. We are in trouble if they are both smiling or if neither of them is smiling. Return true if we are in trouble. | function monkeyTrouble(aSmile, bSmile)
{
return (aSmile && bSmile) || (!aSmile && !bSmile)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function monkey_trouble (aSmile, bSmile) {\n if (aSmile && bSmile) {\n return true;\n }\n if (!aSmile && !bSmile) {\n return true;\n }\n return false;\n}",
"function isWinner(m1, m2) {\n\tvar winningMove = results[m1 + m2];\n\tif (winningMove === m1) {\n\t\treturn true;\n\t}\n\tretur... | [
"0.7605946",
"0.57364637",
"0.5706114",
"0.55919427",
"0.55810475",
"0.55290926",
"0.55197656",
"0.54656947",
"0.54434484",
"0.54425937",
"0.5434285",
"0.53841794",
"0.5376357",
"0.5356907",
"0.53558254",
"0.53145534",
"0.5286077",
"0.5284552",
"0.52621776",
"0.5231687",
"0.5... | 0.776413 | 0 |
Given two int values, return their sum. Unless the two values are the same, then return double their sum. | function sumDouble(a, b)
{
if (a == b) {
return 2 * (a + b)
} else {
return a + b
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSum(a, b) {\n return Math.abs((a - b) / 2) % 2 === 0\n ? Math.abs((a - b) / 2) * (a + b) + (a + b)\n : Math.abs((a - b) / 2) * (a + b) + (a + b) / 2;\n}",
"function getSum (a, b) {\n // Check if both integers are same\n if (a === b) return a\n\n // Check if a > b, sort them accordingly\n i... | [
"0.72016037",
"0.71571934",
"0.7013923",
"0.6922486",
"0.68807954",
"0.68485606",
"0.67998403",
"0.6789283",
"0.67708737",
"0.6638948",
"0.6620776",
"0.66143036",
"0.66143036",
"0.65803415",
"0.6571172",
"0.6571172",
"0.6552628",
"0.6488749",
"0.64715004",
"0.6464556",
"0.645... | 0.73384815 | 0 |
Given an n, return the absolute difference between n and 21, except return double the absolute difference if n is over 21. | function diff21(n)
{
if (n > 21) {
return 2 * Math.abs(21 - n)
} else {
return Math.abs(21 - n)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function crazyDiff(n) {\n let absoluteDiff = n - 19\n \n if (absoluteDiff < 0) {\n absoluteDiff = -absoluteDiff\n } else if (n > 19){\n absoluteDiff = absoluteDiff * 3\n }\n return console.log(absoluteDiff)\n}",
"function diff(num) {\n let d = Math.abs(num - 19);\n if (d > ... | [
"0.79648495",
"0.7289055",
"0.72152096",
"0.7189226",
"0.6613077",
"0.65442526",
"0.65442526",
"0.6435699",
"0.6343026",
"0.62707067",
"0.6141557",
"0.6029368",
"0.59863555",
"0.59692186",
"0.5947459",
"0.5947038",
"0.5913454",
"0.5878781",
"0.5834866",
"0.58192426",
"0.58192... | 0.8396731 | 0 |
We have a loud talking parrot. The "hour" parameter is the current hour time in the range 0..23. We are in trouble if the parrot is talking and the hour is before 7 or after 20. Return true if we are in trouble. | function parrotTrouble(talking, hour)
{
return talking && ((hour < 7) || (hour > 20))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isValidTime(hour) {\nreturn true;\n if (hour > 7 && hour < 22) {\n \treturn true;\n } else {\n //return true;\n return false;\n }\n}",
"function isNowActiveTime(h, m){\n hh = parseInt(h);\n if ((hh > 6) && (hh < 22)){\n return true;\n }else{\n return false;\n }\n}",
"function greet... | [
"0.7725602",
"0.64770985",
"0.64368343",
"0.63783425",
"0.6373811",
"0.63167435",
"0.6250005",
"0.6235011",
"0.62095153",
"0.61896455",
"0.6175623",
"0.61594146",
"0.6154675",
"0.61276394",
"0.60666573",
"0.6062896",
"0.6043781",
"0.6020363",
"0.60045093",
"0.59774315",
"0.59... | 0.8637224 | 0 |
Given 2 ints, a and b, return true if one if them is 10 or if their sum is 10. | function makes10(a, b)
{
return (a == 10) || (b == 10) || ((a + b) == 10)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SumTen(p1, p2) {\n if (Number(p1) + Number(p2) == 10) {\n console.log('makes 10');\n } else {\n console.log('nope');\n }\n}",
"function sumOfTwo(a,b,v) {\n for (let num of a) {\n if (b.includes(v-num)) {\n return true\n }\n }\n return false\n }",
"function checkFif... | [
"0.70943105",
"0.70834494",
"0.70666385",
"0.7036163",
"0.6939158",
"0.6870397",
"0.6760951",
"0.6710293",
"0.6664595",
"0.6651526",
"0.6604688",
"0.655323",
"0.6539142",
"0.6528591",
"0.6481267",
"0.64505565",
"0.64070004",
"0.6356095",
"0.63317025",
"0.63087606",
"0.6295498... | 0.83033156 | 0 |
Given an n, return true if it is within 10 of 100 or 200. Note: Math.abs(num) computes the absolute value of a number. | function nearHundred(n)
{
if ((Math.abs(100 - n) <= 10) || (Math.abs(200 - n) <= 10)) {
return true
} else {
return false
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function within10(num){\n if (randomNumber + 10 >= num && randomNumber - 10 <= num) {\n return true;\n } else {\n return false;\n }\n}",
"function check20(num) {\n\n var difFrom100 = Math.abs(num - 100);\n var difFrom400 = Math.abs(num - 400);\n\n if (difFrom100 <= 20 || difFrom400 <= 20) {\n ... | [
"0.6934315",
"0.6880611",
"0.6676812",
"0.66684514",
"0.65896827",
"0.6512039",
"0.64986074",
"0.64692724",
"0.64692724",
"0.64656544",
"0.6457839",
"0.64224935",
"0.64150894",
"0.6378213",
"0.63505644",
"0.6334117",
"0.6290806",
"0.62299675",
"0.6188423",
"0.61803263",
"0.61... | 0.8232314 | 0 |
Given a string, return a new string where "not " has been added to the front. However, if the string already begins with "not", return the string unchanged. Note: use .equals() to compare 2 strings. | function notString(str)
{
if ((str.length >= 3) && (str.substring(0, 3) =="not")) {
return str
} else {
return "not " + str
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fearNotLetter(str) {\n let alphabet = \"abcdefghijklmnopqrstuvwxyz\";\n let begin = alphabet.indexOf(str[0]);\n let end = Number(alphabet.indexOf(str[str.length-1])) + 1;\n let fixedPiece = alphabet.slice(begin, end);\n\n fixedPiece = fixedPiece.split('');\n str = str.split('');\n \n let newStr = ... | [
"0.6335286",
"0.6313045",
"0.61696166",
"0.61254936",
"0.6021735",
"0.5994549",
"0.5862498",
"0.58139557",
"0.5797573",
"0.5785697",
"0.5776702",
"0.569753",
"0.5689453",
"0.5680882",
"0.5661985",
"0.5657248",
"0.563701",
"0.5620876",
"0.5610928",
"0.55704343",
"0.55623317",
... | 0.6910947 | 0 |
Given a string, we'll say that the front is the first 3 chars of the string. If the string length is less than 3, the front is whatever is there. Return a new string which is 3 copies of the front. | function front3(str)
{
if (str.length < 3) {
return str + str + str
} else {
var first3 = str.substring(0, 3)
return first3 + first3 + first3
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeNewString(str) {\n if (str.length < 3) {\n return str;\n } else {\n let newString = str.slice(0,3) + str.slice(-3);\n return newString;\n }\n}",
"function firstLetters(str){\n let first3 = str.slice(0, 3);\n return first3;\n }",
"function ... | [
"0.7260178",
"0.70575917",
"0.68266207",
"0.6814721",
"0.67933124",
"0.67282534",
"0.6673322",
"0.6522774",
"0.6448595",
"0.6392936",
"0.6233681",
"0.6231523",
"0.62003577",
"0.6169854",
"0.61578363",
"0.6096303",
"0.6067933",
"0.60611594",
"0.6055748",
"0.6041252",
"0.601687... | 0.85181487 | 0 |
Given a string, take the last char and return a new string with the last char added at the front and back, so "cat" yields "tcatt". The original string will be length 1 or more. | function backAround(str)
{
var last = str.charAt(str.length - 1)
return last + str + last
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lastLetter(string) {\n return string.charAt(string.length -1)\n}",
"function getLastChar(string) {\n return string[string.length - 1];\n}",
"function lastCharacter(s){return(s[s.length-1])}",
"function removeLastChar(string) {\n return string.substring(0, string.length - 1);\n}",
"function la... | [
"0.78643346",
"0.78193647",
"0.77392733",
"0.7708003",
"0.7693127",
"0.7637927",
"0.76148015",
"0.75718546",
"0.7555688",
"0.75112844",
"0.75076884",
"0.74873585",
"0.74801344",
"0.7450058",
"0.7438222",
"0.7387635",
"0.734673",
"0.7263687",
"0.7248838",
"0.72402674",
"0.7234... | 0.79283774 | 0 |
Given a string, take the first 2 chars and return the string with the 2 chars added at both the front and back, so "kitten" yields"kikittenki". If the string length is less than 2, use whatever chars are there. | function front22(str)
{
if (str.length <= 2) {
return str + str + str
} else {
return str.substring(0, 2) + str + str.substring(0, 2)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function returnFirstTwo(str){\n var newStr = str.slice(0,2);\n return newStr;\n}",
"function snipLetter(string1,num1) {\n stringLength = string1.length //gets length of string\n if (num1 > stringLength) {\n console.log(\"Your string isn't long enough to have a \" + num1 + \"th character\") //f... | [
"0.71112806",
"0.68583065",
"0.6814851",
"0.6735858",
"0.6634749",
"0.6621588",
"0.64867646",
"0.639285",
"0.63621616",
"0.63531774",
"0.63387036",
"0.63251394",
"0.6304344",
"0.6280307",
"0.62662953",
"0.6255098",
"0.62038606",
"0.6176763",
"0.6164174",
"0.6163953",
"0.61331... | 0.73516256 | 0 |
Given a string, return true if the string starts with "hi" and false otherwise. | function startHi(str)
{
if (str.length < 2) return false
if (str.substring(0, 2) == "hi") {
return true
} else {
return false
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function string_starts_with(st, prefix) {\n return st.slice(0, prefix.length) === prefix;\n}",
"function startsWith(str, test) {\n if (str.length < test.length) {\n return false;\n }\n return str.substr(0, test.length) == test;\n}",
"function startsWith(s, str) {\n return (s.indexOf... | [
"0.7546404",
"0.7375276",
"0.7370054",
"0.73369724",
"0.73097277",
"0.72790164",
"0.72105104",
"0.72105104",
"0.71872336",
"0.71872336",
"0.7180959",
"0.71805483",
"0.71757734",
"0.71572345",
"0.71521235",
"0.71521235",
"0.71521235",
"0.71521235",
"0.71521235",
"0.71521235",
... | 0.8474881 | 0 |
Given two temperatures, return true if one is less than 0 and the other is greater than 100. | function icyHot(temp1, temp2)
{
return (((temp1 > 100) && (temp2 < 0)) || ((temp1 < 0) && (temp2 > 100)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function almCheckTemp( currentTemp, tempMax, tempMin ) {\r\n var retVal = false;\r\n if (currentTemp === NaN ) {\r\n retVal = false;\r\n } else {\r\n if ( currentTemp > tempMax || currentTemp < tempMin ) {\r\n retVal = true;\r\n };\r\n };\r\n return retVal\r\n}",
"f... | [
"0.6229547",
"0.6190397",
"0.60295343",
"0.59880865",
"0.5961287",
"0.5955007",
"0.58727664",
"0.5855779",
"0.58542436",
"0.583868",
"0.5827977",
"0.5796254",
"0.57911474",
"0.5786088",
"0.5777256",
"0.5776074",
"0.5734044",
"0.5724258",
"0.57023424",
"0.5698895",
"0.56876355... | 0.7211628 | 0 |
We'll say that a number is "teen" if it is in the range 13..19 inclusive. Given 3 int values, return true if 1 or more of them are teen. | function hasTeen(a, b, c)
{
return ((a >= 13) && (a <= 19)) ||
((b >= 13) && (b <= 19)) ||
((c >= 13) && (c <= 19))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function thirteen(){\n\tvar num = 13;\n\tif (num % 3 === 0){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"function check3and7(N) {\n if (N 33 % 3 || 14 N % 7) === true) {\n return \"true\"\n\n}\n}",
"function canThemBe12131Set(a, b, c) {\r\n if (Math.max(a, b, c) % 13 == 12) {\r\n ... | [
"0.70237756",
"0.65610504",
"0.635184",
"0.6302044",
"0.62462664",
"0.6237452",
"0.6175484",
"0.6166553",
"0.6124719",
"0.6075872",
"0.60566694",
"0.5990339",
"0.59610754",
"0.59080774",
"0.590783",
"0.58865654",
"0.58861697",
"0.5848021",
"0.5820687",
"0.5816001",
"0.5799928... | 0.741907 | 0 |
We'll say that a number is "teen" if it is in the range 13..19 inclusive. Given 2 int values, return true if one or the other is teen, but not both. | function loneTeen(a, b)
{
return (((a >= 13) && (a <= 19)) || ((b >= 13) && (b <= 19))) &&
(!(((a >= 13) && (a <= 19)) && ((b >= 13) && (b <= 19))))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasTeen(a, b, c)\n {\n return ((a >= 13) && (a <= 19)) ||\n ((b >= 13) && (b <= 19)) ||\n ((c >= 13) && (c <= 19))\n }",
"function check28 (int1, int2) {\n if (Number.isInteger(int1) && Number.isInteger(int2)) {\n if ((int1 >= 50 && int1 <= 99) || (int2 >= 50... | [
"0.6800549",
"0.66616935",
"0.6652759",
"0.64772016",
"0.6438601",
"0.6291274",
"0.6282609",
"0.61978334",
"0.6176824",
"0.6156458",
"0.60889167",
"0.604888",
"0.6044575",
"0.60364735",
"0.6006831",
"0.6006551",
"0.60036093",
"0.59666735",
"0.59372836",
"0.5902129",
"0.589563... | 0.7402706 | 0 |
Given a string, if the string "del" appears starting at index 1, return a string where that "del" has been deleted. Otherwise, return the string unchanged. | function delDel(str)
{
if ((str.length > 3) && (str.substring(1, 4) == "del")) return str.substring(0, 1) + str.substring(4)
else return str
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteOne(str, bl){\n return bl?str.slice(1):str.slice(0,-1)\n}",
"function deleteOne(str, bool) {\n return bool == true\n ? str.substring(1, str.length)\n : str.substring(0, str.length - 1);\n}",
"function removeStuff(string) {\n let index = string.indexOf('house');\n return string.slice(... | [
"0.70196354",
"0.6799405",
"0.61558104",
"0.6150679",
"0.6121187",
"0.594607",
"0.5775116",
"0.5771308",
"0.56993794",
"0.5685763",
"0.5660091",
"0.56284",
"0.56232256",
"0.56197405",
"0.56196415",
"0.56059456",
"0.5596011",
"0.55878025",
"0.5584249",
"0.5579207",
"0.5564176"... | 0.73626924 | 0 |
Return true if the given string begins with "mix", except the 'm' can be anything, so "pix", "9ix" .. all count. | function mixStart(str)
{
return str.length >= 3 && str.substring(1, 3) =="ix"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isCaught(string) {\n if (typeof string !== 'string') return false;\n for (var i = 0; i < string.length; i++) {\n if (string[i] === 'C' && (string.slice(i, i+4)).includes('m')) return true; \n }\n return false;\n}",
"function string_starts_with(st, prefix) {\n return st.slice(0, prefix.length) =... | [
"0.6208987",
"0.5512301",
"0.54778117",
"0.54605985",
"0.5451213",
"0.5430001",
"0.5410211",
"0.53996766",
"0.5377625",
"0.53357273",
"0.5259714",
"0.52381766",
"0.5225257",
"0.52054226",
"0.5198183",
"0.51847357",
"0.5175435",
"0.51676196",
"0.5159908",
"0.51571476",
"0.5156... | 0.6323314 | 0 |
Given a string, return a string made of the first 2 chars (if present), however include first char only if it is 'o' and include the second only if it is 'z', so "ozymandias" yields "oz". | function startOz(str)
{
var o
var z
if (str.length == 1) {
o = str.substring(0, 1) == "o" ? "o" : ""
return o
}
if (str.length >= 2) {
o = str.substring(0, 1) == "o" ? "o" : ""
z = str.substring(1, 2) == "z" ? "z" : ""
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function returnFirstTwo(str){\n var newStr = str.slice(0,2);\n return newStr;\n}",
"function keepFirst(s){\n let l=s.length;\n if (l>=2){\n s = s.substring(0,2);\n } \n return s;\n}",
"function front22(str)\n {\n if (str.length <= 2) {\n return str + str + ... | [
"0.700165",
"0.6884217",
"0.67808247",
"0.6638557",
"0.65927684",
"0.6592257",
"0.65276515",
"0.65122086",
"0.6336407",
"0.63330525",
"0.63175154",
"0.62934",
"0.6246202",
"0.6236433",
"0.62076944",
"0.6159364",
"0.61477953",
"0.6139261",
"0.6112842",
"0.61031103",
"0.6097603... | 0.72830874 | 0 |
Given 2 int values, return true if they are both in the range 30..40 inclusive, or they are both in the range 40..50 inclusive. | function in3050(a, b)
{
return (((a >= 30) && (a <= 40)) && ((b >= 30) && (b <= 40))) ||
(((a >= 40) && (a <= 50)) && ((b >= 40) && (b <= 50)))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function in_range(a, b) {\n if (\n (a >= 40 && a <= 60 && b >= 40 && b <= 60) ||\n (a >= 70 && a <= 100 && b >= 70 && b <= 100)\n ) {\n return true;\n } else {\n return false;\n }\n}",
"function checkRange(intA, intB) {\n\n if (intA >= 50 && intA <= 99)\n {\n console.log(\"IntA is within ... | [
"0.7824431",
"0.74398774",
"0.72559434",
"0.7134051",
"0.69528764",
"0.69395995",
"0.6894463",
"0.6755978",
"0.6755304",
"0.6754473",
"0.66907465",
"0.6666449",
"0.6658521",
"0.66222674",
"0.6603702",
"0.6603702",
"0.6580291",
"0.65680283",
"0.6542345",
"0.64779025",
"0.64701... | 0.7786134 | 1 |
Given 2 positive int values, return the larger value that is in the range 10..20 inclusive, or return 0 if neither is in that range. | function max1020(a, b)
{
if (((a >= 10) && (a <= 20)) && ((b >= 10) && (b <= 20))) {
if (a > b) {
return a
} else {
return b
}
} else if ((a >= 10) && (a <= 20)) {
return a
} else if ((b >= 10) && (b <= 20)) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function largerNum(a, b) {\n if (Math.abs(50 - a) <= 10 && Math.abs(50 - b) <= 10) {\n if (a > b) {\n return a;\n } else return b;\n } else return 'beyond the range of 40 to 60';\n}",
"function higher(var1, var2) {\n if ((var1 > 60 || var1 < 40) || (var2 > 60 || var2 < 40)) {\n ... | [
"0.71102214",
"0.6949205",
"0.67903966",
"0.67870855",
"0.67226803",
"0.67174816",
"0.67021483",
"0.67021483",
"0.66928536",
"0.66928536",
"0.6686161",
"0.6683955",
"0.6636541",
"0.6609338",
"0.66034657",
"0.66024864",
"0.6596594",
"0.65391463",
"0.6526974",
"0.65247846",
"0.... | 0.76134187 | 0 |
Return true if the given string contains between 1 and 3 'e' chars. | function stringE(str)
{
if (str.indexOf("e") != -1) {
var count = 0
var i = 0
while (count < 4) {
if ("e" == str.substring(i, i + 1)) {
count++
}
if (++i >= str.length) {
break
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isCaught(string) {\n if (typeof string !== 'string') return false;\n for (var i = 0; i < string.length; i++) {\n if (string[i] === 'C' && (string.slice(i, i+4)).includes('m')) return true; \n }\n return false;\n}",
"function contains(){\n var string=\"hhE3lo\"\n for(var i=0; i<string.lengt... | [
"0.68407106",
"0.6717782",
"0.6687551",
"0.65662676",
"0.6478989",
"0.6417531",
"0.63901883",
"0.6388653",
"0.6388653",
"0.638621",
"0.63608235",
"0.63116807",
"0.63114",
"0.628725",
"0.6283425",
"0.62161005",
"0.62086886",
"0.6206964",
"0.6206938",
"0.6203511",
"0.61884385",... | 0.8367213 | 0 |
Given two nonnegative int values, return true if they have the same last digit, such as with 27 and 57. Note that the % "mod" operator computes remainders, so 17 % 10 is 7. | function lastDigit(a, b)
{
return (a % 10) == (b % 10)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CompLast(x, y) { return x % 10 < y % 10; }",
"function test_same_digit(num) {\n const unit = num % 10;\n\n while (num) {\n if (num % 10 !== unit) return false;\n num = Math.floor(num/10);\n }\n\n return true;\n}",
"function checkDigitsSame(num){\n let ref = num%10;\n ... | [
"0.743834",
"0.69901854",
"0.6737453",
"0.6688819",
"0.65181494",
"0.6455848",
"0.6411479",
"0.62730896",
"0.6265855",
"0.6258583",
"0.6165587",
"0.6148777",
"0.6132438",
"0.6131895",
"0.60906386",
"0.60657734",
"0.604882",
"0.60453594",
"0.6013011",
"0.59685695",
"0.59627557... | 0.8032731 | 0 |
Given a string, return a new string where the last 3 chars are now in upper case. If the string has less than 3 chars, uppercase whatever is there. Note that str.toUpperCase() returns the uppercase version of a string. | function endUp(str)
{
if (str.length < 4) {
return str.toUpperCase()
} else {
String
last3 = str.substring(str.length - 3)
return str.substring(0, str.length - 3) + last3.toUpperCase()
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeCase(string) {\n if (string.length >= 3) {\n return string.slice(0, 3).toLowerCase() + string.slice(3).toUpperCase();\n } else if (string.length < 3) {\n return string.toUpperCase();\n }\n}",
"function upper_lower(str) {\n if (str.length <= 3) {\n return str.toUpperCase... | [
"0.78441995",
"0.75877136",
"0.7248197",
"0.72401804",
"0.7226976",
"0.7186395",
"0.716888",
"0.71548706",
"0.71475387",
"0.7090718",
"0.7006182",
"0.6950726",
"0.69129556",
"0.6894873",
"0.68556094",
"0.6848301",
"0.6767833",
"0.67578995",
"0.67529595",
"0.67529595",
"0.6744... | 0.79657793 | 0 |
Given a nonempty string and an int N, return the string made starting with char 0, and then every Nth char of the string. So if N is 3, use char 0, 3, 6, ... and so on. N is 1 or more. | function everyNth(str, n)
{
var i = 0
var newStr = ""
while (i <= str.length - 1) {
newStr = newStr + str.substring(i, i + 1)
i += n
}
return newStr
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function repeat1(str, n){\n\tif(n <= 0) return '';\n\treturn (new Array(n)).fill(str).join('');\n}",
"function front_times (str, n) {\n frontLen = 3;\n if (frontLen > str.length) {\n frontLen = str.length;\n }\n front = str.substring(0, frontLen);\n result = '';\n for (x = 0; x < n; x++)... | [
"0.76619416",
"0.75349176",
"0.7380704",
"0.7376104",
"0.7372241",
"0.73708576",
"0.73243636",
"0.73034275",
"0.73034275",
"0.73034275",
"0.7300536",
"0.72991127",
"0.7287831",
"0.72813934",
"0.72710955",
"0.7266712",
"0.7249131",
"0.7234033",
"0.7231485",
"0.72120494",
"0.72... | 0.76016927 | 1 |
Adds a blip to the global Google Map | function addBlipToMap(blip) {
console.log('Adding blip to map...');
var marker = new google.maps.Marker({
position: new google.maps.LatLng(blip.latitude, blip.longitude),
map: map,
title: blip.title,
animation: google.maps.Animation.DROP
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mapBlip(loc){\r\n\t//Show the appropriate floor(s)\r\n\t$(\"#floor3-image\").hide();\r\n\t$(\"#floor2-image\").hide();\r\n\t$(\"#basement-image\").hide();\r\n\t$(\".pathblip\").remove();\r\n\t$(\".bliptitle\").remove();\r\n\tvar data = mapData[loc];\r\n\tvar selector = \"#\" + data[\"floor\"] + \"-image\"... | [
"0.6402857",
"0.61815405",
"0.60676223",
"0.6066408",
"0.6004831",
"0.59976465",
"0.5988764",
"0.59756756",
"0.59750783",
"0.5896248",
"0.5891561",
"0.5823507",
"0.57755685",
"0.57651466",
"0.5763774",
"0.5751778",
"0.57375693",
"0.5731497",
"0.5726385",
"0.5719615",
"0.57094... | 0.8182826 | 0 |
Submits a new blip to the database | function addNewBlip(event) {
var title = $('#blipTitle').val();
var text = $('#blipText').val();
var photo = $('#blipPhotoUpload')[0].files[0];
var lat = $('#blipLat').val();
var lon = $('#blipLon').val();
var blip = {
datetime: new Date().toISOString(),
title: title,
user: 'thomas',
karma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function postSlip (number) {\n var key = datastore.key(slips);\n const slip = {\n\t\"number\": number,\n\t\"current_boat\": null,\n\t\"arrival_date\": \"\"\n };\n const newSlip = {\n\tkey: key,\n\tdata: slip\n };\n\n return datastore.insert(newSlip).then(() => {return key});\n}",
"function post... | [
"0.6690901",
"0.61083347",
"0.610068",
"0.5897523",
"0.58637315",
"0.58389074",
"0.57859313",
"0.5736652",
"0.570312",
"0.56975263",
"0.56594044",
"0.559822",
"0.55643076",
"0.5551453",
"0.55451316",
"0.55388904",
"0.55207103",
"0.55084664",
"0.5507224",
"0.55003035",
"0.5480... | 0.62031955 | 1 |
Converts canvas to an image | function convertCanvasToImage(canvas) {
var image = new Image();
image.src = canvas.toDataURL("image/png");
return image;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertCanvasToImage(canvas) {\n var image = new Image();\n image.src = canvas.toDataURL(\"image/png\");\n return image;\n }",
"convertCanvasToImage (canvas) {\n var image = new Image()\n image.src = canvas.toDataURL('image/png')\n\n return image\n }",
"function convert... | [
"0.83392066",
"0.8317588",
"0.82148856",
"0.8210288",
"0.80948037",
"0.8006403",
"0.7966154",
"0.77847075",
"0.76443535",
"0.75177103",
"0.7500043",
"0.7465",
"0.725217",
"0.71598864",
"0.7073016",
"0.69881546",
"0.69178355",
"0.6914152",
"0.6904462",
"0.6874838",
"0.67926645... | 0.8331578 | 1 |
Lookup attributes and uniforms in source by searching directly in the shader. | function lookupAttributes(src) {
var lookup = Tatsu.Graphics.lookupAttributes(src);
for (var i = lookup.names.length - 1; i >= 0; i--) {
attributeName = lookup.names[i];
attributeType = lookup.types[attributeName];
this.attributes.push(attributeName);
th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getShader(gl, id) {\n var vs = \"attribute vec3 aVertexPosition;\\\n attribute vec2 aTextureCoord;\\\n uniform mat4 uMMatrix;\\\n uniform mat4 uVMatrix;\\\n uniform mat4 uPMatrix;\\\n varying highp vec2 vTextureCoord;\\\n void main(void) {\\\n gl_Position = uPMatrix * uVMatrix ... | [
"0.599731",
"0.59693503",
"0.5945853",
"0.5933196",
"0.59224254",
"0.5907876",
"0.5899764",
"0.5879278",
"0.5836245",
"0.5809555",
"0.577213",
"0.5708482",
"0.56991285",
"0.56555337",
"0.5647282",
"0.56440634",
"0.56311285",
"0.5630357",
"0.5609117",
"0.5570546",
"0.55679786"... | 0.6325561 | 0 |
DOM manipulation Sidebar update (room name) | function updateRoom(room) {
document.getElementById('room-name').innerText = room;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateRoomName(room) {\n roomName.innerText = room;\n}",
"function changeRoomName(roomName) {\n $('.name-room').html(\"\");\n $('.name-room').append(`<p>${roomName}</p>`)\n }",
"function updateSidebar() {\n let html = '';\n\n for (const san in moveHistory) {\n html += `${san}: $... | [
"0.67517036",
"0.6667407",
"0.6516506",
"0.64618796",
"0.6417612",
"0.6241133",
"0.61894274",
"0.6176729",
"0.6122982",
"0.6102532",
"0.608882",
"0.608646",
"0.6062735",
"0.6047307",
"0.6029579",
"0.6022321",
"0.60011685",
"0.60011685",
"0.5990083",
"0.5985749",
"0.5985248",
... | 0.6703865 | 1 |
set cache and redisplay message | function flash_now( key, msg ) {
flash_cache[key] = msg;
$( '#flash-' + key ).text( msg );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setCache(data) {\n // Cache messages data.\n cache = {\n data: data,\n timestamp: new Date()\n };\n // Clear cache in 60 seconds.\n $timeout(function() {\n cache.data = undefined;\n }, 60000);\n $rootScope.$broadcast(broadcastUpdateEventName);\n }... | [
"0.7006397",
"0.6354357",
"0.6345914",
"0.6279952",
"0.6233669",
"0.613581",
"0.60905313",
"0.6077242",
"0.60487276",
"0.60133904",
"0.5920342",
"0.5916775",
"0.5887761",
"0.5886386",
"0.5844259",
"0.58405745",
"0.58132434",
"0.5773662",
"0.57539296",
"0.5743932",
"0.57423353... | 0.63728553 | 1 |
convert string from database to grid to load the game | function stringToGrid(str,object){
object.CELL_SIZE = parseInt(str.substring(str.indexOf("C")+1,str.indexOf("X")));
object.X = parseInt(str.substring(str.indexOf("X")+1,str.indexOf("Y")));
object.Y = parseInt(str.substring(str.indexOf("Y")+1,str.indexOf("L")));
object.WIDTH = object.X / object.CELL_SIZE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"stringToGrid(board)\n {\n var output = [[0, 0, 0, 0, 0 ,0 ,0 ,0 ,0],\n [0, 0, 0, 0, 0 ,0 ,0 ,0 ,0],\n [0, 0, 0, 0, 0 ,0 ,0 ,0 ,0],\n [0, 0, 0, 0, 0 ,0 ,0 ,0 ,0],\n [0, 0, 0, 0, 0 ,0 ,0 ,0 ,0],\n [0, 0... | [
"0.6123743",
"0.5884609",
"0.5878389",
"0.58282745",
"0.58233196",
"0.57867205",
"0.5755349",
"0.5743473",
"0.56868035",
"0.5615395",
"0.55982965",
"0.5585383",
"0.54921585",
"0.5475702",
"0.54573363",
"0.54218906",
"0.5410114",
"0.54070956",
"0.5402567",
"0.53865534",
"0.538... | 0.639723 | 0 |
copy grid from source to target | function copyGrid(source,target){
// for (var h = 0; h < target.length; h++) {
// target[h] = source[h].slice(0);
// }
var height = Math.min(target.length,source.length);
for(var h = 0; h < height; h++) {
var targets = target[h];
var width1 = target[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_deepCopy(grid) {\n const newGrid = [];\n\n grid.forEach((gridRow) => {\n const newRow = [];\n\n gridRow.forEach((gridCell) => {\n newRow.push(gridCell);\n });\n\n newGrid.push(newRow);\n });\n\n return newGrid;\n }",
"static cloneInto(source, target) {\n for (let i... | [
"0.6464787",
"0.6383197",
"0.60373664",
"0.59980595",
"0.5939972",
"0.5914866",
"0.5826349",
"0.58102524",
"0.58073944",
"0.574184",
"0.5733645",
"0.5709054",
"0.5673243",
"0.5647987",
"0.5626359",
"0.55976486",
"0.5568897",
"0.5555062",
"0.5518569",
"0.54995114",
"0.5494288"... | 0.83573174 | 0 |
if browser has geolocation then get current location | function getLocation() {
if (Modernizr.geolocation) {
navigator.geolocation.getCurrentPosition(currentLocation, handle_error, {timeout:10000});
console.log ("browser has geolocation");
}
else {
/* trigger manual entry if no geolocation */
console.log("no geolocation available");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_location() {\n\tif (Modernizr.geolocation) {\n\t\tnavigator.geolocation.getCurrentPosition(successFunction, geoFallback());\n\t} else {\n\t\tgeoFallback();\n\t}\n}",
"function getLocation() {\n\t//if the browser supports geolocation\n\tif (navigator.geolocation) {\n\t\t//if successful -> userLoc\n\t... | [
"0.84913427",
"0.8475839",
"0.8470127",
"0.84684694",
"0.8316893",
"0.82416755",
"0.8168098",
"0.8158895",
"0.8141041",
"0.8132692",
"0.8129116",
"0.8127712",
"0.8115446",
"0.8114948",
"0.81027967",
"0.8086088",
"0.8057006",
"0.80447745",
"0.80445814",
"0.80113256",
"0.799394... | 0.85793966 | 0 |
Zooms to selected track and shows properties in the table | function chooseTrack() {
var id = this.value;
// entities have the same id as the track in the db. zooms to the corresponding entity
viewer.zoomTo(viewer.entities.getById(id));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectionChange(){\n heatMap.wrangleData();\n heatMap.hideTutorial();\n}",
"function Zoom(info, Vlt) {\n\t\tif (info.Action == 'Harvest') {\n\t\t\tconsole.log('Harvest-Zoom');\n\t\t\tinfo.Keys.push('Idle.Wheel');\n\t\t\treturn;\n\t\t}\n\t\t//console.log(\"Zooooooming\");\n\t\tlet View = Vlt.div.da... | [
"0.5680356",
"0.56691897",
"0.5506048",
"0.54937303",
"0.5489241",
"0.54874957",
"0.54685926",
"0.5431144",
"0.5415928",
"0.5373114",
"0.5369287",
"0.5341727",
"0.5336486",
"0.53119177",
"0.5308822",
"0.5294052",
"0.5239789",
"0.52379525",
"0.522538",
"0.5219272",
"0.52158225... | 0.69881284 | 0 |
setter opposite of getQueryVariable | function setQueryVariable(qvar, value) {
var query = window.location.search.substring(1);
var vars = query.split('&');
var d = {};
d[qvar] = value;
var found = false;
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split('=');
if (decodeURIComponent(pair[0]) === qvar) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set query(value) {\n this._parsedUrl.set('query', value);\n }",
"set queryString(value) {\n this._parsedUrlString.set('query', value);\n }",
"function doSetQuery(pQueryTag,pQueryString){_Queries[pQueryTag]=pQueryString;return _Meadow;}",
"function setQueryTextIfPresent() {\n\tvar query = getParameter... | [
"0.6466894",
"0.6259191",
"0.62574524",
"0.5986384",
"0.5960992",
"0.56642",
"0.55985105",
"0.55933285",
"0.55838835",
"0.5576495",
"0.5461413",
"0.5427693",
"0.5418116",
"0.5405854",
"0.5398924",
"0.5387549",
"0.5363949",
"0.5341771",
"0.5341703",
"0.5328861",
"0.52967125",
... | 0.6310488 | 1 |
build a graph with the distances from k computed from r2i | function ljmix_mkgraph2(lj, g, k, rm)
{
var i, j, np = lj.np[0];
var r2, rm2 = rm * rm;
g.empty();
for ( i = 0; i < np; i++ ) {
for ( j = i + 1; j < np; j++ ) {
if ( i === k ) {
r2 = lj.r2i[j];
} else if ( j === k ) {
r2 = lj.r2i[i];
} else {
r2 = lj.r2ij[i][j];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lj_mkgraph2(lj, g, k, rm)\n{\n var i, j, n = lj.n;\n var r2, rm2 = rm * rm;\n\n g.empty();\n for ( i = 0; i < n; i++ ) {\n for ( j = i + 1; j < n; j++ ) {\n if ( i === k ) {\n r2 = lj.r2i[j];\n } else if ( j === k ) {\n r2 = lj.r2i[i];\n } else {\n r2 = lj.r2ij[i... | [
"0.6996043",
"0.563031",
"0.5588307",
"0.5544899",
"0.54990274",
"0.5331939",
"0.52657205",
"0.52540696",
"0.52490306",
"0.5186118",
"0.51513237",
"0.51382136",
"0.51381236",
"0.5129291",
"0.5116032",
"0.5116032",
"0.5116032",
"0.5116032",
"0.5116032",
"0.5116032",
"0.5116032... | 0.6248679 | 1 |
BUILD METHODS //////////////////////////////////////////////////////////////////////////// build team admin controller | build() {
//
// REGISTER BLOCKS
//
// register simple block
blockHelper.block('admin.team.grid', {
acl : ['admin.team'],
for : ['admin'],
title : 'Team Grid',
description : 'Team Grid block',
}, async (req, block) => {
// get notes block from ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildTeam(){\n console.log(\"Your team template has been built!\");\n return;\n}",
"function admin_api (r) {\n let keys = Object.keys(models)\n let i = keys.length\n let model, name, action;\n while (i--) {\n model = models[keys[i]]\n name = model.modelName\n action = actions(model)\n... | [
"0.5836029",
"0.5648607",
"0.56127346",
"0.56112134",
"0.5542101",
"0.5496523",
"0.54475904",
"0.5379258",
"0.5261866",
"0.5255865",
"0.5235702",
"0.5218557",
"0.52119946",
"0.51954764",
"0.5139013",
"0.5135924",
"0.5121585",
"0.5117103",
"0.51134354",
"0.5104511",
"0.5089583... | 0.57389325 | 1 |
Impostazione della tabella con i conti figli ottenuti dalla ricerca. | function impostaTabellaRisultati() {
var tableId = "#tabellaRisultatiRicercaPrimaNota";
var opts = {
bServerSide: true,
sServerMethod: "POST",
sAjaxSource : "risultatiRicercaPrimeNoteAjax.do",
bPaginate: true,
bLengthChange: false,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function impostaTabellaModale(list) {\n var tableId = \"#modaleDettaglioMovimentiTabella\";\n var opts = {\n bServerSide: false,\n aaData: list,\n bPaginate: true,\n bLengthChange: false,\n iDisplayLength: 5,\n bSort: false,\n ... | [
"0.677726",
"0.65901333",
"0.6561588",
"0.6472844",
"0.64228714",
"0.63967896",
"0.63840866",
"0.6351661",
"0.6329612",
"0.6291052",
"0.6271995",
"0.6256141",
"0.6231189",
"0.6226411",
"0.62171197",
"0.6214881",
"0.6207897",
"0.61945057",
"0.61797434",
"0.6160439",
"0.6150902... | 0.7070116 | 0 |
Constructor: OnvifServiceImaging(params) params: xaddr : URL of the entry point for the imaging service (Required) user : User name (Optional) pass : Password (Optional) time_diff: ms | function OnvifServiceImaging(params) {
this.xaddr = '';
this.user = '';
this.pass = '';
let err_msg = '';
if(err_msg = mOnvifSoap.isInvalidValue(params, 'object')) {
throw new Error('The value of "params" was invalid: ' + err_msg);
}
if('xaddr' in params) {
if(err_msg = mOnvifSoap.isInvalidValue(params['x... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ImageService() {\n this.url = 'https://api.giphy.com/v1/gifs/search';\n}",
"constructor(imageService){\n super(imageService);\n }",
"function initParams(width, height) {\n //initiate the params\n params = {\n 'x0': width / 2,\n 'y0': height / 2,\n 'angle': 0,\n ... | [
"0.5158496",
"0.5112056",
"0.50277567",
"0.5027002",
"0.49958593",
"0.49760565",
"0.49230984",
"0.48789087",
"0.48705828",
"0.48249024",
"0.48051167",
"0.4780413",
"0.47754422",
"0.47719255",
"0.47372723",
"0.4735267",
"0.47342566",
"0.47257006",
"0.46238017",
"0.4621884",
"0... | 0.87023646 | 0 |
Extracts the list of tag classes from the complete class list. | function getTagClasses(classList) {
var tagList = new Array();
var prefix = psClass('tag-');
for (var i = 0; i < classList.length; i++) {
if (classList[i].indexOf(prefix) == 0) {
tagList.push(classList[i]);
}
}
return tagList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"classes() {\n const classNames = this._node.getAttribute(\"class\");\n return classNames ? classNames.trim().split(/\\s+/) : [];\n }",
"function extractClasses(html) {\n const document = (new JSDOM(html)).window.document;\n\n const htmlClasses = [];\n const elements = document.getElementsByTa... | [
"0.7070879",
"0.65793306",
"0.6475469",
"0.620505",
"0.6172606",
"0.6159229",
"0.6159229",
"0.60801286",
"0.60737187",
"0.6055231",
"0.6055231",
"0.6055231",
"0.6055231",
"0.6055231",
"0.6055231",
"0.6055231",
"0.6055231",
"0.6055231",
"0.6055231",
"0.6055231",
"0.6055231",
... | 0.7143924 | 0 |
Sets the highlight status for the given list of tags | function setTagsHighlight(tagClasses, highlight) {
var allTags = $('.' + psClass('tags-label'));
for (var i = 0; i < tagClasses.length; i++) {
var tagLabel = allTags.filter('.' + tagClasses[i]);
setHighlight(tagLabel, highlight);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function highlightTags() {\r\n\r\n // check the difference between the tags that are now in the tags input and\r\n // the ones that were in there the last time we highlighted\r\n var newTags = tagsInput.value.trim().toLowerCase();\r\n if (newTags == \"\") {\r\n newTags = [];\r\n }\r\n else {\r\n newTag... | [
"0.69446707",
"0.6678146",
"0.65202636",
"0.63443226",
"0.63426197",
"0.61613214",
"0.6095628",
"0.6078569",
"0.6037774",
"0.59917337",
"0.5973123",
"0.5901509",
"0.5891256",
"0.5848258",
"0.57972735",
"0.57909226",
"0.5769354",
"0.5767936",
"0.57473123",
"0.5710781",
"0.5676... | 0.7293589 | 0 |
Get contents from tsconfig.json | async function getTsConfig() {
if (!fs.existsSync(TSCONFIG_PATH)) {
throw new Error(`${TSCONFIG_PATH} does not exists.`);
}
return require(path.relative(__dirname, TSCONFIG_PATH));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getConfig(){\n return JSON.parse(fs.readFileSync(configFile, 'utf8'));\n}",
"async function readConfigFile() {\n try {\n const data = await readFile(CONFIG_PATH, \"utf8\");\n const parsed = JSON.parse(data);\n return parsed;\n } catch (e) {\n return null;\n }\n}",
"function loadConfi... | [
"0.65267426",
"0.62330806",
"0.6163344",
"0.6161567",
"0.61325616",
"0.60186666",
"0.59980714",
"0.59857154",
"0.5941279",
"0.5906441",
"0.58798414",
"0.5871571",
"0.58400863",
"0.5824221",
"0.5773302",
"0.5772437",
"0.57414615",
"0.5685754",
"0.56809247",
"0.5669341",
"0.566... | 0.6661528 | 0 |
Get each package json from mono repo and append location | async function getRepoPackages() {
const projectPackages = await getPackages(PROJECT_FOLDER);
return projectPackages.map(pkg => {
return {
...pkg.toJSON(),
location: pkg.location,
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function mergePackageJsons () {\n // transform our package.json incase we need to replace variables\n const rawJson = await template.generate({\n directory: `${ignite.ignitePluginPath()}/templates`,\n template: 'package.json.ejs',\n props: templateProps\n })\n const newPackageJson ... | [
"0.671377",
"0.6704455",
"0.6658622",
"0.62132937",
"0.6164323",
"0.6128831",
"0.6120393",
"0.60634875",
"0.60383767",
"0.5980166",
"0.5969889",
"0.5900868",
"0.5837612",
"0.5800965",
"0.5781431",
"0.57711",
"0.57551473",
"0.57159203",
"0.5711823",
"0.5691504",
"0.56798613",
... | 0.7245753 | 0 |
Objective: Go through each item in the list and have console print object every time there is an article published by NPR | function IDnpr(listOfArticles) {
for (var counter = 0; counter < listOfArticles.length; counter++) {
/*Test if an article has "NPR" as "newssource"
* If it does, print the object.
* If it does not, print "Not NPR."
* Articles_RefugeeWorkResources[counter] has also been replaced with "RefugeeArticle"
*/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_items(o){\n var items = o.query.results.RDF.item;\n var output = '';\n var number_of_items=items.length;\n for(var i=0;i<number_of_items;i++){\n var title = items[i].title;\n var link = items[i].link;\n var desc = items[i].description;\n output += \"<h3>... | [
"0.6507061",
"0.61850494",
"0.61641663",
"0.6043627",
"0.604063",
"0.60335994",
"0.6002806",
"0.5964729",
"0.59644145",
"0.5943204",
"0.58837485",
"0.58352053",
"0.5827158",
"0.5820365",
"0.5797754",
"0.57523334",
"0.57230204",
"0.5700578",
"0.5659184",
"0.5651556",
"0.564911... | 0.6784723 | 0 |
Check if two players are colliding horizontally, x by 1 currently scale width the same way we scale the images | function HorizontalCollision(player, enemy) {
//enemy.position.x *= -1;
if (player.position.x + (player.width / 2) > enemy.position.x - (enemy.width / 2) &&
enemy.position.x + (enemy.width / 2) > player.position.x - (player.width / 2)) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isCollide(a,b){\n aRect=a.getBoundingClientRect(); //Is used to get exact location of all side \n bRect=b.getBoundingClientRect(); //Enemy CAr\n return!((aRect.bottom < bRect.top)||(aRect.top>bRect.bottom)||(aRect.left>bRect.right)||(aRect.right<bRect.left));\n}",
... | [
"0.69902515",
"0.69802463",
"0.68408096",
"0.67383087",
"0.6736219",
"0.6730111",
"0.67237306",
"0.6684295",
"0.66536564",
"0.6616158",
"0.65880555",
"0.6584595",
"0.65790135",
"0.6517646",
"0.65088445",
"0.64918506",
"0.6482611",
"0.6480306",
"0.6460941",
"0.645619",
"0.6447... | 0.7343142 | 0 |
Moves selected options in the source list to the target list. | function moveSelected( fromList, targetList ) {
if ( fromList.selectedIndex == -1 ) {
return;
}
else {
var selLength = fromList.length;
var selectedText = new Array();
var selectedValues = new Array();
var selectedCount = 0;
var i;
for(i=selLength-1;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveDualList( srcList, destList, moveAll ) \n{\n\tif ( ( srcList.selectedIndex == -1 ) && ( moveAll == false ) )\n \t{\n\t\treturn;\n\t}\n\t\n\tnewDestList = new Array( destList.options.length );\n\tvar len = 0;\n\t\n\tfor( len = 0; len < destList.options.length; len++ ) {\n \tif ( destList.options... | [
"0.7313195",
"0.7237649",
"0.7133537",
"0.699215",
"0.6858132",
"0.6688944",
"0.65699035",
"0.65695065",
"0.6538049",
"0.65245974",
"0.6522797",
"0.6459166",
"0.6454436",
"0.6371479",
"0.63081455",
"0.62838554",
"0.62429595",
"0.61848086",
"0.6123802",
"0.6113991",
"0.6109810... | 0.7587998 | 0 |
Marks all elements in a list as selected. | function selectAll( list ) {
for ( var i = 0; i < list.options.length; i++ ) {
list.options[i].selected = true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set allSelected(_value) {\n /**\n * This is a setter but we ignore the value.\n * It's strange, but it lets us have an indeterminate state where only\n * some of the items are selected.\n */\n this.selection.toggleAll();\n }",
"function selection(selected) {\n\t\t... | [
"0.70147675",
"0.6710944",
"0.6710944",
"0.66697645",
"0.66697645",
"0.66697645",
"0.66697645",
"0.64576495",
"0.64366686",
"0.63754946",
"0.63594717",
"0.6348262",
"0.63440865",
"0.63027966",
"0.6276099",
"0.62466955",
"0.62462175",
"0.6233022",
"0.6206808",
"0.6191851",
"0.... | 0.6939986 | 1 |
Removes the selected option from a select list. | function removeSelectedOption( listId ) {
var list = document.getElementById( listId );
for ( var i = list.length - 1; i >= 0; i-- ) {
if ( list.options[ i ].selected ) {
list.remove( i );
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removerItem(select) {\n\t$(\"#\"+select+\" option:selected\").remove();\n}",
"function selectRemoveSelectedOption(select_input) {\n for(var i=0; i<select_input.options.length; i++) {\n if ( select_input.options[i].selected ) {\n \t\t\tselect_input.options[i] = null;\n \t\t}\n\t}\n\tselect_i... | [
"0.75924814",
"0.73328197",
"0.7098777",
"0.7036636",
"0.7003285",
"0.69085795",
"0.68730056",
"0.6835467",
"0.68202525",
"0.6775727",
"0.67654717",
"0.6666221",
"0.6585844",
"0.6522491",
"0.64979655",
"0.6491301",
"0.6482393",
"0.6482393",
"0.6463482",
"0.6385044",
"0.637673... | 0.74847716 | 1 |
Moves the selected option in a select list up one position. | function moveUpSelectedOption( listId ){
var list = document.getElementById( listId );
for ( var i = 0; i < list.length; i++ ) {
if ( list.options[ i ].selected ) {
if ( i > 0 ) {// Cannot move up the option at the top
var precedingOption = new Option( list.options[ i - 1 ].t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveOptionUp(obj) {\n\t// If > 1 option selected, do nothing\n\tvar selectedCount=0;\n\tfor (i=0; i<obj.options.length; i++) {\n\t\tif (obj.options[i].selected) {\n\t\t\tselectedCount++;\n\t\t\t}\n\t\t}\n\tif (selectedCount != 1) {\n return;\n }\n\t// If this is the first item in the list, do nothing\... | [
"0.8323997",
"0.79951614",
"0.7628371",
"0.7404655",
"0.73843145",
"0.73711085",
"0.7085732",
"0.7061598",
"0.69961387",
"0.69958544",
"0.6903011",
"0.6827546",
"0.6722213",
"0.66725385",
"0.66477877",
"0.66141874",
"0.6594564",
"0.65905106",
"0.6573686",
"0.65734726",
"0.654... | 0.81875926 | 1 |
Moves the selected option in a list down one position. | function moveDownSelectedOption( listId ) {
var list = document.getElementById( listId );
for ( var i = list.options.length - 1; i >= 0; i-- ) {
if ( list.options[ i ].selected ) {
if ( i < list.options.length - 1 ) { // Cannot move down the option at the bottom
var subseque... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveOptionDown(obj) {\n\t// If > 1 option selected, do nothing\n\tvar selectedCount=0;\n\tfor (i=0; i<obj.options.length; i++) {\n\t\tif (obj.options[i].selected) {\n\t\t\tselectedCount++;\n\t\t\t}\n\t\t}\n\tif (selectedCount != 1) {\n return;\n }\n\t// If this is the last item in the list, do nothing... | [
"0.81360435",
"0.78435045",
"0.77169037",
"0.72483677",
"0.7194195",
"0.7192218",
"0.71831685",
"0.71721643",
"0.70848024",
"0.69166327",
"0.6906252",
"0.68331075",
"0.6813344",
"0.6811862",
"0.67696965",
"0.67471886",
"0.66926986",
"0.6666616",
"0.66344637",
"0.65881646",
"0... | 0.800838 | 1 |
Moves the selected options to the top of the list. | function moveSelectedOptionToTop( listId ) {
var list = document.getElementById( listId );
var listLength = list.options.length;
// Copy selected options to holding list and remove from main list
var moveOptions = [];
for ( var i = listLength - 1; i >= 0; i-- ) {
if ( list.options[ i ].sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveUpSelectedOption( listId ){\n var list = document.getElementById( listId );\n for ( var i = 0; i < list.length; i++ ) {\n if ( list.options[ i ].selected ) {\n if ( i > 0 ) {// Cannot move up the option at the top\n var precedingOption = new Option( list.options[... | [
"0.72561896",
"0.7161285",
"0.7037252",
"0.70015234",
"0.67823523",
"0.6740053",
"0.66518205",
"0.6639097",
"0.66216695",
"0.65523434",
"0.65365386",
"0.65159434",
"0.63980746",
"0.63612235",
"0.63270783",
"0.6323321",
"0.6315266",
"0.6248209",
"0.6246348",
"0.6236997",
"0.61... | 0.7847286 | 0 |
Moves the selected options to the bottom of the list. | function moveSelectedOptionToBottom( listId ) {
var list = document.getElementById( listId );
// Copy selected options to holding list and remove from main list
var moveOptions = [];
for ( var i = list.options.length - 1; i >= 0; i-- ) {
if ( list.options[ i ].selected ) {
moveOpti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveDownSelectedOption( listId ) {\n var list = document.getElementById( listId );\n\n for ( var i = list.options.length - 1; i >= 0; i-- ) {\n if ( list.options[ i ].selected ) {\n if ( i < list.options.length - 1 ) { // Cannot move down the option at the bottom\n v... | [
"0.71380603",
"0.70089346",
"0.6928409",
"0.68950766",
"0.6841569",
"0.65432197",
"0.65057164",
"0.6472641",
"0.63521045",
"0.63273615",
"0.63187283",
"0.627168",
"0.6242248",
"0.6183737",
"0.61642975",
"0.6125674",
"0.60847586",
"0.6067098",
"0.6013379",
"0.59550637",
"0.594... | 0.778349 | 0 |
Convert URL meta properties if they exist. Otherwise, run the resolveImportMeta hook. | function resolveMetaProperty (context, input, output, node, currentpath) {
if (node.meta_property) {
output.transpiled.overwrite(node.start, node.property.end, '__nollup__import__meta__', { contentOnly: true });
} else {
output.transpiled.overwrite(node.start, node.property.end, '__nollup__impor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function index () {\r\n return {\r\n name: 'transform-import-meta',\r\n visitor: {\r\n Program: function (path) {\r\n var metas = [];\r\n path.traverse({\r\n MemberExpression: function (memberExpPath) {\r\n var node... | [
"0.52435917",
"0.5090064",
"0.5008815",
"0.4956582",
"0.49538162",
"0.48792204",
"0.4876685",
"0.4850921",
"0.4829722",
"0.48264924",
"0.48069113",
"0.4781397",
"0.47229698",
"0.47136915",
"0.47053897",
"0.47053897",
"0.47053897",
"0.47053897",
"0.46921855",
"0.4686919",
"0.4... | 0.63623863 | 0 |
5724W86, 5724X63 Copyright IBM Corporation 2013, 2015. All Rights Reserved. US Government Users Restricted Rights Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. AlcatelLucent 5620 SAM Pack var schema_mpls_interface = createSAMUBASchema("SAM_mpls_interface", 900, 3); schema_mpls_in... | function process_mpls_interface_stats(record)
{
var myId;
var subelement = LOOKUP.get(record.monitoredObjectPointer);
if(subelement == null)
{
logP5Msg("process_mpls_mpls_interface_stats", "SAMUBA_mpls_mpls_interface", "Skipping 0 rid for --> "+ record.monitoredObjectPointer);
return;
}
myId = subelem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function iscsiServersListMetricDefinition() {\n const subscriptionId = \"9eb689cd-7243-43b4-b6f6-5c65cb296641\";\n const deviceName = \"HSDK-UGU4PITWNI\";\n const iscsiServerName = \"HSDK-UGU4PITWNI\";\n const resourceGroupName = \"ResourceGroupForSDKTest\";\n const managerName = \"hAzureSDKOperations\"... | [
"0.5453978",
"0.5391515",
"0.52826214",
"0.5263426",
"0.47138423",
"0.46882036",
"0.46009028",
"0.4567737",
"0.45546016",
"0.4511344",
"0.45082235",
"0.44622958",
"0.4459224",
"0.4438332",
"0.44339055",
"0.4431852",
"0.44213957",
"0.44061753",
"0.4401262",
"0.43545702",
"0.43... | 0.6822615 | 0 |
give the middle part of cxr stuff e.g. to take cadar of pair, give it 'ada' and pair | function do_cxr(cxr, start) {
var p = start;
for(var i=cxr.length-1; i>=0; i--) {
if(!(p instanceof Pair) || Util.isNull(p)) {
throw new IllegalArgumentTypeError(cxr, start, 1);
} else if(cxr[i] == 'a') {
p = p.car;
} else if(cxr[i] == 'd') {
p = p.cdr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"returnMiddle(){}",
"function cdr(pair) {\n\treturn pair(function(a, b) {\n\t\treturn b;\n\t})\n}",
"function middleWay(a, b){\n return [a[1], b[1]]\n}",
"function sc_consStar() {\n var res = arguments[arguments.length - 1];\n for (var i = arguments.length-2; i >= 0; i--)\n\tres = new sc_Pair(argumen... | [
"0.57316184",
"0.5631754",
"0.56177276",
"0.55391324",
"0.54840654",
"0.5471479",
"0.54591155",
"0.54386973",
"0.5399324",
"0.5385797",
"0.536388",
"0.53623736",
"0.5355261",
"0.53461605",
"0.53434235",
"0.53311723",
"0.5331118",
"0.53288454",
"0.5324862",
"0.5302135",
"0.529... | 0.6210447 | 0 |
log joint output for a child process | function logChild(child, slogan, write) {
if (child) {
logSocket(child.stdout, slogan, write)
logSocket(child.stderr, slogan, write)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function debugChildProcess(child){\n\tchild.stdout.on(\"data\", function(data){sails.log.debug(data.toString())})\n\tchild.stderr.on(\"data\", function(data){sails.log.error(data.toString())})\n\tchild.on(\"exit\", function(code){sails.log.info(\"command finished with code \",code)})\t\n}",
"function printProces... | [
"0.69851094",
"0.63576806",
"0.6024366",
"0.59812766",
"0.58977866",
"0.5897461",
"0.57839715",
"0.5780175",
"0.5726306",
"0.56178474",
"0.5582051",
"0.5568421",
"0.54896957",
"0.54675186",
"0.544385",
"0.5407977",
"0.5396837",
"0.539185",
"0.5381652",
"0.5374969",
"0.5340699... | 0.64295053 | 1 |
Capture output from a socket, preceding each line with slogan socket: a Socket such as child.stdout or child.stderr slogan: string, prepended to each line write(string): function listening to 'data' and 'end' events from the socket sets encoding to utf8 | function logSocket(socket, slogan, write) {
if (socket) {
socket.on('data', log).once('end', cleanUp)
socket.setEncoding('utf-8')
}
function cleanUp() {
socket.removeListener('data', log)
socket.removeListener('end', cleanUp)
}
var atEndOfLine = true
/*
str: string
prepend a slogan to each line
if th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"connect(config, charName) {\n\n let charConfig = config[charName];\n let port = charConfig.port;\n let host = charConfig.host;\n\n const telnetInput = this.telnetInput = new TelnetInput();\n const telnetOutput = this.telnetOutput = new TelnetOutput();\n\n this.ipc = ipc(charName);\n this.socke... | [
"0.57863826",
"0.54065925",
"0.5337727",
"0.53302103",
"0.5252912",
"0.5225956",
"0.5219833",
"0.5187367",
"0.5150619",
"0.51367646",
"0.51257664",
"0.51149666",
"0.5101597",
"0.50658774",
"0.50544065",
"0.5052621",
"0.50246024",
"0.500263",
"0.4963205",
"0.49474406",
"0.4941... | 0.66923356 | 0 |
preventing spacebar in inputs | function restrictSpace(e)
{
if(e.key==' ')
e.preventDefault();
console.log("key :"+e.key);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"avoidSpace(name, value, event) {\n if (event.key === \" \") {\n event.preventDefault()\n return false\n }\n }",
"function no_around_spaces( selector )\n{\n\t$( selector+\">input[type=text]\" ).keyup(function(){\n\t\tthis.value=this.value.trim();\n\t});\n}",
"function disableSpace (event) {\n ... | [
"0.75479585",
"0.6941403",
"0.6751896",
"0.656195",
"0.64667326",
"0.6400742",
"0.63884765",
"0.63435596",
"0.63435596",
"0.63435596",
"0.6310582",
"0.6261295",
"0.62371904",
"0.6219625",
"0.61750215",
"0.6173486",
"0.6119814",
"0.6114265",
"0.60268027",
"0.60241383",
"0.5998... | 0.7072115 | 1 |
Display a message inside the feedback container div | function feedback(klass, message) {
var msg = $('<span class="' + klass + '">' + message + '</span>');
msg.css('display', 'none');
$('#feedback').html(msg);
msg.fadeIn(500).delay(2000, function() { msg.fadeOut(1000); });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function feedback(text) {\n var feedback = document.getElementById('feedback');\n var message = document.getElementById('errorMessage');\n message.innerHTML = text;\n feedback.style.display = \"block\";\n}",
"function setFormFeedback(msg, severity) {\n $(\"#feedback\")[0].innerHTML = '<div id=\"fe... | [
"0.77245295",
"0.7251485",
"0.7179145",
"0.71709377",
"0.7134331",
"0.69943845",
"0.68536407",
"0.6842643",
"0.68281484",
"0.68281484",
"0.6822896",
"0.681335",
"0.6780385",
"0.6768436",
"0.67398494",
"0.67375815",
"0.67225504",
"0.67224556",
"0.6710107",
"0.66958",
"0.669552... | 0.7522746 | 1 |
2D cross product of OA and OB vectors, i.e. zcomponent of their 3D cross product, in traditional Cartesian coordinate system (x value grows from left to right, y value grows from bottom to top). Returns a positive value if OAB makes a counterclockwise turn, negative for clockwise turn, and zero if the points are collin... | function d3_cross2d(o, a, b) {
return (a[0] - o[0]) * (b[1] - o[1]) - (a[1] - o[1]) * (b[0] - o[0]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cross(a, b) {\n _ch_checkExactArgs(arguments, 2, \"cross(a, b)\");\n if ('z' in a) {\n return vec3(a.y * b.z - a.z * b.y, a.z * b.x - a.x * b.z, a.x * b.y - a.y * b.x);\n } else {\n // Compute just the \"Z\" coordinate\n return a.x * b.y - a.y * b.x;\n }\n}",
"function c... | [
"0.5953034",
"0.5836798",
"0.5776025",
"0.5776025",
"0.5776025",
"0.57695484",
"0.5719565",
"0.5636704",
"0.5626804",
"0.56154025",
"0.5607771",
"0.5605943",
"0.5576577",
"0.5517251",
"0.5517251",
"0.54937136",
"0.54665595",
"0.54665595",
"0.5459222",
"0.54503244",
"0.5441246... | 0.61038816 | 0 |
when the Route component of reactrouter renders this component reactrouterdom passes many props to rendered component console.log(props); console.log(props.match.params.id); when we directly goes to /streams/edit/3 redux store has no data so streams will be undefined at begin Every component needs to fetch its own data... | componentDidMount() {
this.props.fetchStream(this.props.match.params.id)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentDidMount() {\n // fetchStream action creator with id of stream we want to edit passed in\n this.props.fetchStream(this.props.match.params.id)\n }",
"componentDidMount() {\n this.props.fetchStream(this.props.match.params.id);\n }",
"function mapStateToProps(state, ownProps) {\n // con... | [
"0.7215191",
"0.69090635",
"0.6740654",
"0.6729531",
"0.66534233",
"0.66193527",
"0.66010195",
"0.65333325",
"0.63994527",
"0.6376909",
"0.6376314",
"0.6348301",
"0.63012266",
"0.6252924",
"0.62390983",
"0.62198406",
"0.6218482",
"0.61892045",
"0.6176427",
"0.61615527",
"0.61... | 0.7075688 | 1 |
method to add crust | addCrust(crust) {
this.crustName = crust;
this.userConversastionValue(crust);
this.customizationCrust = false;
console.log("crust name:" + this.crustName);
this.anyThingExtra();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add() { } //FIXME::add implementation ",
"function add (){}",
"function add() {\n\n }",
"_handleAddClick() {\n let materialsObject = {\n id: this.listOfMaterials.length,\n name: \"Insert Name\",\n color: \"\",\n volume: 0,\n cost: 0,\n deliveryDate: \"1/1/2020... | [
"0.65656066",
"0.6211903",
"0.6120007",
"0.59603715",
"0.5860165",
"0.5858945",
"0.5848643",
"0.5816339",
"0.5812075",
"0.57742476",
"0.5756539",
"0.57550985",
"0.5745398",
"0.57282746",
"0.56814116",
"0.56757843",
"0.56485355",
"0.56415325",
"0.5636127",
"0.5616057",
"0.5614... | 0.7498827 | 0 |
show full window loader | function full_window_loader() {
$('.full_window_loader').fadeIn(0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showLoaderToScreen()\n{\n\t$(\"#overLayLoader\").height($(window).height());\n\t$(\"#overLayLoader\").show();\n}",
"function showLoader() {\n\t\t$(_element).find('.loader').show();\n\t}",
"function showLoader()\n {\n\t\t$('.loader-container').show();\n $('.loader-back').show();\n }",
"f... | [
"0.7596598",
"0.75050783",
"0.74522007",
"0.7356644",
"0.7309521",
"0.72290057",
"0.71784115",
"0.71130174",
"0.70950794",
"0.7093507",
"0.70800143",
"0.70785815",
"0.7054623",
"0.7054346",
"0.7050171",
"0.70368123",
"0.70227253",
"0.70209295",
"0.6993615",
"0.69012165",
"0.6... | 0.7954952 | 0 |
The highspeed train leaves the forest and quickly carries you south. You can even see a desert in the distance! Since you have some spare time, you might as well see if there was anything interesting in the image the Mythical Information Bureau satellite captured. After decoding the satellite messages, you discover tha... | function analyzeImage (part, inputStr) {
const inputArr = inputStr.split('\n\n');
// HELPFUL CONSTANTS
const numTiles = inputArr.length;
const len = 10; // both the sample data and the actual data feature 10 x 10 images
// DATA STRUCTURES AND U... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function solution() {\n const input = fs.readFileSync(\"./testInput\").toString().split(\"\\n\\n\");\n // const input = fs.readFileSync(\"./input\").toString().split(\"\\n\\n\");\n\n const ids = [];\n const images = input.reduce((imgs, tileBlock) => {\n const lines = tileBlock.split(\"\\n\");\n con... | [
"0.5722371",
"0.55229276",
"0.54905224",
"0.5301006",
"0.5271691",
"0.5222307",
"0.5167121",
"0.5145852",
"0.50924057",
"0.5055418",
"0.5052785",
"0.50406927",
"0.50163794",
"0.50132006",
"0.49909428",
"0.49601334",
"0.49488714",
"0.49472535",
"0.49104854",
"0.49091566",
"0.4... | 0.6128854 | 0 |
End Global Variables Start Helper Functions Creating a function that deal with all sections in HTML and get throw it : 1 Name of Section 2 Link of Section 3 Creating unordered list to contain all sections 4 Passing Section Name and Section Link from HTML to JS to make it dynamic as much we can | function creationOfListItem(){
/* Creating a Loop to select and apply all for each section in HTML */
for (section of navbarSections){
/* Get name of Section by a specific way to hunt the actual name store in (data-nav) in HTML */
nameOfSection = section.getAttribute('data-nav');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function build_sections() {\n let text = \"\";\n\n\n for (let i = 0; i < page_sections_arr.length; i++) {\n\n let section = page_sections_arr[i];\n let section_title = section.title;\n let section_content = section.content;\n let section_id = \"section\" + (i + 1)\n\n text ... | [
"0.70570517",
"0.701791",
"0.6995341",
"0.6968507",
"0.6900311",
"0.6878747",
"0.681653",
"0.68023115",
"0.6801728",
"0.678907",
"0.6747434",
"0.67291635",
"0.6718522",
"0.6677741",
"0.6674298",
"0.66573226",
"0.6647346",
"0.6642144",
"0.663828",
"0.6614535",
"0.66007435",
... | 0.7474999 | 0 |
A utility function to add one minute to a time. | function addOneMinute(date) {
date.setMinutes(date.getMinutes() + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addTime(time, minutes) {\n var hours = Number(time.substr(0, 2));\n var min = Number(time.substr(3, 2));\n\n var totalMin = 60*hours + min;\n totalMin += minutes;\n\n return militaryTime(totalMin);\n }",
"function addMinutes(initialTime, h) {\n console.log(initia... | [
"0.7219523",
"0.706358",
"0.6878023",
"0.67814994",
"0.67814994",
"0.67814994",
"0.66337794",
"0.6498603",
"0.6491141",
"0.64440155",
"0.6410834",
"0.64039767",
"0.6333718",
"0.62973714",
"0.62756956",
"0.62668043",
"0.6238726",
"0.6227358",
"0.6184867",
"0.61333656",
"0.6103... | 0.7700339 | 0 |
A utility function to subtract one hour from a time. | function oneHourAgo(date) {
date.setHours(date.getHours() - 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hh(date) {\n // return pad(this.h(date))\n return date.format(\"hh\")\n }",
"function get_utc_time_hours() {\n var date = new Date();\n return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), 0, 0);\n}",
"function decrementTime(hourMin) {\n switch(hourM... | [
"0.63728565",
"0.6329969",
"0.62916577",
"0.6269851",
"0.6255807",
"0.62196714",
"0.61655205",
"0.61134285",
"0.6061742",
"0.59769917",
"0.59593123",
"0.5950579",
"0.5949309",
"0.59460217",
"0.59341073",
"0.59102523",
"0.58925873",
"0.5882674",
"0.5882674",
"0.5882674",
"0.58... | 0.6493067 | 0 |
A utility function to add one hour to a time. | function addOneHour(date) {
date.setHours(date.getHours() + 1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"IncrementDateByHour(date) {\n return moment(date).add(1, 'h')\n }",
"function addMinutes(initialTime, h) {\n console.log(initialTime);\n console.log(h);\n return new Date(initialTime.getTime() + (h * 60 * 1000));\n}",
"function addHours(date, hours) {\n return new Date... | [
"0.7112481",
"0.6643017",
"0.65547407",
"0.6532273",
"0.6516044",
"0.64860356",
"0.6434007",
"0.64334625",
"0.64334625",
"0.64334625",
"0.64334625",
"0.64334625",
"0.64334625",
"0.64334625",
"0.64334625",
"0.64334625",
"0.64334625",
"0.64334625",
"0.6427682",
"0.63839334",
"0... | 0.7764431 | 0 |
The default timestamp formatter if it is not in any range. | function nonRelativeFormatter(timestamp) {
return {formattedTime: timestamp.toLocaleDateString()};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static formatTimestamp(timestamp, format = 'yyyy-mm-dd HH:MM:ss') {\n if (timestamp === undefined) {\n return '(unknown)';\n }\n const d = new Date(0);\n d.setUTCMilliseconds(timestamp);\n return dateFormat(d, format);\n }",
"function weekdayNoAtFormatter(timestamp) {\n return timestamp.t... | [
"0.60461456",
"0.5991452",
"0.59754884",
"0.58325547",
"0.58325547",
"0.58325547",
"0.58325547",
"0.58325547",
"0.5423097",
"0.5385371",
"0.5385229",
"0.5365922",
"0.53653586",
"0.53599924",
"0.5294893",
"0.51985776",
"0.51713014",
"0.51244664",
"0.5076693",
"0.5074206",
"0.5... | 0.62632924 | 0 |
The formatter for timestamps less than one hour before 'now'. | function lessThanAnHourFormatter(timestamp, now) {
var diff = now.getTime() - timestamp.getTime();
// 60 seconds.
if(diff < 60000) {
return 'Just now';
} else if(diff < 120000) {
// Less than 120 seconds.
return '1 minute ago';
} else {
return Math.floor(diff / 60000).toStri... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_shouldFormatHour() {\n if (this.format === 24 && this.hour.toString().length === 1) {\n this.hour = this.hour < 10 ? \"0\" + this.hour : this.hour;\n }\n }",
"function lessThanDayFormatter(timestamp) {\n return timestamp.toLocaleTimeString();\n }",
"function ReformatHours(nowtime, a) {\r\n\t\t... | [
"0.5620366",
"0.55271155",
"0.5266938",
"0.52010155",
"0.51277626",
"0.502012",
"0.50015956",
"0.4933375",
"0.48622918",
"0.485965",
"0.48427442",
"0.48310623",
"0.4814147",
"0.47786188",
"0.4763811",
"0.47560087",
"0.47162098",
"0.4698766",
"0.46832603",
"0.46815977",
"0.467... | 0.6813777 | 0 |
The formatter for timestamps less than one day ago. For these, the time, but not the date, is printed out. | function lessThanDayFormatter(timestamp) {
return timestamp.toLocaleTimeString();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lessThanAnHourFormatter(timestamp, now) {\n var diff = now.getTime() - timestamp.getTime();\n\n // 60 seconds.\n if(diff < 60000) {\n return 'Just now';\n } else if(diff < 120000) {\n // Less than 120 seconds.\n return '1 minute ago';\n } else {\n return Math.floor(diff ... | [
"0.6811069",
"0.6688342",
"0.64630556",
"0.6285494",
"0.61943704",
"0.6160229",
"0.6129913",
"0.6072545",
"0.60004526",
"0.59776026",
"0.5907125",
"0.5883451",
"0.58546",
"0.5852508",
"0.5838566",
"0.58009785",
"0.57847977",
"0.5778316",
"0.57782257",
"0.57615787",
"0.5716484... | 0.6751194 | 1 |
Request a Cellular scan to populate the list of networks. This will triger a change to managedProperties when completed (if Cellular.FoundNetworks changes). | onScanTap_() {
this.scanRequested_ = true;
this.getNetworkConfig_().requestNetworkScan(
chromeos.networkConfig.mojom.NetworkType.kCellular);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"managedPropertiesChanged_() {\n const cellular = this.managedProperties.typeProperties.cellular;\n this.mobileNetworkList_ = cellular.foundNetworks || [];\n if (!this.mobileNetworkList_.length) {\n this.mobileNetworkList_ = [\n {networkId: 'none', longName: this.i18n('networkCellularNoNetworks... | [
"0.5752194",
"0.53041136",
"0.51382357",
"0.505879",
"0.50511307",
"0.5039349",
"0.501584",
"0.49546263",
"0.4853748",
"0.48364115",
"0.48265016",
"0.48150465",
"0.4773841",
"0.47176176",
"0.4653685",
"0.4634452",
"0.46217617",
"0.4608992",
"0.46082565",
"0.45851415",
"0.4584... | 0.58544505 | 0 |
send location quick reply | function sendLocationQuickReply(sender_psid)
{
var request_body = {
"recipient": {
"id": sender_psid
},
"message": {
"text":"In trouble?or giving a treat. send the location to Milan quickly",
"quick_replies":[
{
"content_type":"lo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sendLocationPrompt(recipientId) {\n var messageData = {\n \"recipient\":{\n \"id\": recipientId\n },\n \"message\":{\n \"text\":\"Please share your location:\",\n \"quick_replies\":[\n {\n \"content_type\":\"location\",\n }\n ]\n }\n ... | [
"0.74577296",
"0.70489573",
"0.70489573",
"0.6546814",
"0.6535642",
"0.64082277",
"0.63613904",
"0.6280171",
"0.62433684",
"0.62232006",
"0.6192509",
"0.6082225",
"0.60426086",
"0.59758973",
"0.5956678",
"0.59485114",
"0.5917662",
"0.5908213",
"0.58823645",
"0.5875333",
"0.58... | 0.8409606 | 0 |
Given an obj, returns an object with all of the properties whose values are functions called. | function callPropertyFns(o) {
return Object.keys(o).reduce((result, k) => {
const v = o[k]
result[k] = typeof v == 'function' ? v.call(this) : v
return result
}, {})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function objectWithLoggingMethods(obj, recursive){\n var result = {};\n var properties = [];\n for (var i in obj)\n properties.push(i);\n \n properties.forEach(function(i) {\n if (typeof obj[i] === \"function\") {\n result[i] = function(){\n var args= Object.k... | [
"0.6556684",
"0.6536775",
"0.64602894",
"0.6444522",
"0.6383916",
"0.63636273",
"0.6339055",
"0.6330164",
"0.6330164",
"0.6330164",
"0.6330164",
"0.6330164",
"0.6330164",
"0.6321304",
"0.6306782",
"0.6306782",
"0.62941533",
"0.6286372",
"0.627994",
"0.627688",
"0.62764126",
... | 0.76397187 | 0 |
Given a function, returns a version of that function that will merges its output with the input. Assumes that if the function accepts an object, it will do the merging itself; therefore, just implemented for the arity of 0 case. | function buildMergeFn(fn) {
if (fn.length === 0) {
return function(input) {
const values = fn.call(this)
if (typeof values !== 'object') {
if (!isEmptyObject(input)) {
throw `Unable to combine '${typeof values}' with input '${JSON.stringify(input)}'`
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function merge() {\n const funcArgs = Array.prototype.slice.call(arguments); // eslint-disable-line prefer-rest-params\n\n return Object.assign.apply(\n null,\n removeEmpty([{}].concat(funcArgs))\n );\n}",
"function merge() {\n const funcArgs = Array.prototype.slice.call(arguments); // eslint-disable-l... | [
"0.69408804",
"0.69408804",
"0.6459586",
"0.6084488",
"0.60020626",
"0.5932004",
"0.58347464",
"0.57834715",
"0.57546204",
"0.57409966",
"0.57409966",
"0.57409966",
"0.5716852",
"0.5660666",
"0.5640244",
"0.557073",
"0.5517753",
"0.54995954",
"0.54995954",
"0.54729456",
"0.54... | 0.7745476 | 0 |
Processes the input opcode incrementing the opCodeLength after each instruction. | function processIntCode(input, noun, verb, opCodeLength) {
let tempInput = input;
tempInput[1] = noun;
tempInput[2] = verb;
let i = 0;
while (i <= tempInput.length - 1) {
const pos_one = tempInput[i + 1];
const pos_two = tempInput[i + 2];
const pos_three = tempInput[i + 3];
switch (tempInput... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function chickenasm2opcode(input) {\n\t\n\tvar output = [];\n\t//handle raw string and line splitted input too\n\tvar linesArray = (typeof(input) == \"string\") ? input.split(/[\\r\\n]+/) : input;\n\t\n\tvar instructions = [\"exit\", \"chicken\", \"add\", \"substract\", \"multiply\", \"compare\", \"load\", \"store... | [
"0.55464876",
"0.55101305",
"0.5494872",
"0.5474204",
"0.5388786",
"0.5375059",
"0.5281479",
"0.52696645",
"0.5193692",
"0.5183701",
"0.5171428",
"0.5146745",
"0.5131489",
"0.5119075",
"0.50134194",
"0.48842338",
"0.48632306",
"0.48235932",
"0.48219135",
"0.47983918",
"0.4751... | 0.7018536 | 0 |
This getFruit function takes in an arr paramenter | function getFruit(arr){
/*The following loop iterates over the arr paramenter as an array
* assigns fruits as fruit and logs the fruit parameter
*/
arr.forEach(fruit => {
console.log(fruit)
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFruit(arr) {\n for (let i = 0; i < arr.length; i++) {\n console.log(arr[i]);\n }\n}",
"function fruitArray(fruits) { // 👈 Change this to a rest parameter\n return fruits; // ['apple', 'kiwi', 'pear'];\n}",
"function getFruit(a, b, c, d) {\n return [a, b, c, d].sort()[1]\n}",
"function to... | [
"0.721635",
"0.7141929",
"0.63972634",
"0.6378717",
"0.6042267",
"0.6032643",
"0.5947192",
"0.58983153",
"0.58145833",
"0.58104455",
"0.5770644",
"0.57559896",
"0.56516516",
"0.5645443",
"0.5617862",
"0.5610735",
"0.5581421",
"0.5575183",
"0.5545981",
"0.544742",
"0.541381",
... | 0.7428611 | 0 |
Transfer values of keys from src to dst, where key exists in dst | function transfer(dst, src) {
for(var key in dst) {
if(src[key] && dst[key] !== undefined) dst[key] = src[key];
}
return dst;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static copy(to, to_key, from, from_key=null, from_key_2=null)\n {\n if ( to_key == null) return;\n if ( from_key == null ) from_key = to_key;\n let value = from[from_key];\n if ( value == null && from_key_2 != null) {\n value = from[from_key_2];\n }\n if ( va... | [
"0.6479883",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"0.6403416",
"... | 0.6951973 | 0 |
Creates a sorting list from ConfigService | function createSortList(){
var sortOptions = [{label:'default sort', type:'default', order:'', active: true}];
_.forEach(ConfigService.config.sort_fields, function(value){
sortOptions.push({label: value, type: 'text', order: 'asc', active: false});
sortOptions.push({label: value, type: 'text... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sort()\n {\n this.list = [];\n\n for (const plugin of PLUGIN_ORDER)\n {\n if (this.plugins[plugin])\n {\n this.list.push(this.plugins[plugin] );\n }\n }\n }",
"getSortSetting() {\n return this.template.settings.settings.sort_by;... | [
"0.5704655",
"0.56978065",
"0.55854017",
"0.5530497",
"0.5465869",
"0.54611236",
"0.54428923",
"0.53403664",
"0.5339231",
"0.5266483",
"0.52533543",
"0.52459055",
"0.52375644",
"0.5235411",
"0.5228368",
"0.5217656",
"0.5183748",
"0.51817137",
"0.51779103",
"0.51775354",
"0.51... | 0.7328894 | 0 |
Switches sort parameter in the page | function switchSort(sort){
sorting.selectedSort = sort;
var query = QueryService.getQueryObject();
switch(sort.type) {
case 'text':
query.sort = sort.label+' '+sort.order;
URLService.setQuery(query);
break;
default:
delete query.sort;
U... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sort() {\n index++;\n predicate = ng.isFunction(getter(scope)) ? getter(scope) : attr.stSort;\n if (index % 3 === 0 && attr.stSkipNatural === undefined) {\n //manual reset\n index = 0;\n ... | [
"0.7382526",
"0.72792375",
"0.7263423",
"0.71353096",
"0.70204055",
"0.7018449",
"0.6990508",
"0.68987805",
"0.6883708",
"0.6873795",
"0.685839",
"0.68473953",
"0.6842742",
"0.6828022",
"0.6828022",
"0.6827601",
"0.6827601",
"0.67936873",
"0.67829216",
"0.67673725",
"0.674398... | 0.7404748 | 0 |
Resolve to Obejct with all profs and their courses & TA applicants | async function buildProfsObj(semester) {
profsList = [];
coursesList = [];
profsObj = {};
const coursesRef = await db.collection(`courses/${semester}/courses`).get();
// course per term
coursesRef.forEach(async (course) => {
tempCourse = course.data();
tempCourse.course_code = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCoursesApplicants(req, res){\n \n // Check if course code to search by is specified in the request query\n if(req.query.course !== undefined) {\n getCourseApplicants(req.query.course, res);\n return res.json;\n }\n\n // Get all applicants for all courses if there is no quer... | [
"0.58721846",
"0.55943406",
"0.53071886",
"0.5165857",
"0.5102002",
"0.5077937",
"0.50760686",
"0.50623184",
"0.50583345",
"0.50355154",
"0.50190747",
"0.50062793",
"0.49919197",
"0.49912405",
"0.4953613",
"0.49029484",
"0.48882502",
"0.48684227",
"0.48576254",
"0.4851101",
"... | 0.60934794 | 0 |
Form Steps Navigation Navigation for moving onto other steps of the form | function goto_form_step(index, callback) {
var new_form = $("section.form-step:eq("+index+")"),
current_form = $("nav.form-steps li.current").index(),
navigation = $("nav.form-steps ol");
$("section.form-step:eq("+current_form+")").hide();
new_form.show();
if (index == 5) {
var ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function backToPrimaryStep() {\n\tconst active = document.querySelector('.forms__show');\n\tlet index = 0;\n\tindex = steps.indexOf(active);\n\tsteps[index].classList.remove('forms__show');\n\tsteps[0].classList.add('forms__show');\n}",
"function originNextStep() {\n console.log('Clicked');\n $scope.origin... | [
"0.6682048",
"0.66227037",
"0.64899516",
"0.6300172",
"0.6270683",
"0.6247659",
"0.6217017",
"0.61981785",
"0.6159205",
"0.60514396",
"0.60289615",
"0.5989181",
"0.5984356",
"0.5979363",
"0.5932822",
"0.5891258",
"0.58699423",
"0.58673185",
"0.58602464",
"0.5851565",
"0.58502... | 0.66815597 | 1 |
Start a named HDTimer instance | static startTimer(name){
if( !timers.hasOwnProperty(name) ){
timers[name] = new HDTimer();
}
timers[name].start();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"startTimer() {\n Timing.start(CONST.TIMING.SWITCH_REPORT);\n }",
"startTimer(id) {\n this._timers[id] = this._timerFactory(id);\n this._timers[id].start();\n }",
"function Timer(name){\n\tif( !(this instanceof Timer) ){\n\t\treturn new Timer(name);\n\t}\n\tthis.name = name;\n\tthis.s... | [
"0.66314244",
"0.6598686",
"0.6573105",
"0.65547884",
"0.6463394",
"0.6335937",
"0.6304303",
"0.62869185",
"0.6184062",
"0.6177255",
"0.615735",
"0.6152655",
"0.61288106",
"0.6107688",
"0.61024785",
"0.60902774",
"0.6081006",
"0.60698676",
"0.6016911",
"0.6010771",
"0.5945733... | 0.8087567 | 0 |
Stop a named HDTimer instance or ALL timers if '' is provided | static stopTimer(name){
let self = this;
if(name === '*'){
_.each( _.keys(timers), (k) => {
self.stopTimer(k);
});
} else if( timers.hasOwnProperty(name) ) {
timers[name].stop();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"stopTimer() {\n if (this.timeoutID) {\n clearTimeout(this.timeoutID);\n this.timeoutID = null;\n }\n }",
"stopTimer() {\n this.timer && this.timer.toggleTimer();\n }",
"stop() {\n if (!this.timer) return;\n\n clearInterval(this.timer);\n this.timer = null;\n }",
"function... | [
"0.66801184",
"0.66193944",
"0.661484",
"0.65040517",
"0.64977187",
"0.64508516",
"0.64467824",
"0.64394975",
"0.64104414",
"0.6406731",
"0.63666856",
"0.63633543",
"0.6341119",
"0.6337736",
"0.63263345",
"0.63242173",
"0.6314491",
"0.6312428",
"0.6309669",
"0.6285229",
"0.62... | 0.7623471 | 0 |
component for displaying a readonly list of average rating for breweries | function AverageRating({averageRating}) {
return (
<div>
<Box component="fieldset" mb={0} borderColor="transparent">
<Typography component="legend">Average Rating:</Typography>
<Rating
name="read-only"
size="large"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayAverage() {\n var average = ratingCount / reviewCount;\n\n $('#average-rating').addClass('rating')\n .raty({readOnly: true,\n score: (average)});\n }",
"averageRating(rating){\n\t\tif(rating){\n\t\t\tlet stars=[]\n\t\t\tfor(let i= 0; i < Math.floor(rating); ... | [
"0.76045406",
"0.7062787",
"0.70063144",
"0.68323046",
"0.68075424",
"0.6721102",
"0.6694004",
"0.6686732",
"0.6673915",
"0.6595069",
"0.658557",
"0.6583448",
"0.65401286",
"0.6479035",
"0.6420962",
"0.6407532",
"0.6203484",
"0.6127589",
"0.6061915",
"0.6031876",
"0.6021877",... | 0.7302625 | 1 |
loop until all rooms have been explored (all rooms added to visited) | async function roomStep() {
if (visited.length === 499) {
return
}
// get the current room, id, and exits
console.log('currroom', currRoom)
let roomId = currRoom.room_id
// create a list of unvisited rooms for the visited list
let unvisited = []
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findUnvisitedCells(gameMap) {\n var roomToDraw = new Room(new Point(0,0), 1, 1);\n\n for (var i = 0; i < gameMap.width; i++) {\n for (var j = 0; j < gameMap.length; j++) {\n roomToDraw.location.x = i;\n roomToDraw.location.y = j;\n if (gameMap.mapSpace[j][i] == BLOCK_TYPE.ROOM) {\n ... | [
"0.64861757",
"0.638165",
"0.63063043",
"0.6218835",
"0.608682",
"0.6022847",
"0.59520996",
"0.5917128",
"0.58438325",
"0.58201444",
"0.5814258",
"0.5807675",
"0.5769519",
"0.5731259",
"0.57243013",
"0.57185745",
"0.57167256",
"0.5632918",
"0.5632468",
"0.5612635",
"0.5610195... | 0.712816 | 0 |
A menu, where the user can select items. | function Menu(items) {
this.items = items;
this.selection = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function menu(){\n inquirer.prompt([{\n prefix: \"\",\n type: \"list\",\n name: \"menu\",\n message: [chalk.green(\"Excited about our products? Select the 'Shop' option below to continue!\\n\" +\" ───────────────────────────────────────────────────────────────────────\\n\")],\n ... | [
"0.72179407",
"0.6945306",
"0.69401497",
"0.6898055",
"0.68445176",
"0.68437546",
"0.68305945",
"0.67987335",
"0.6782398",
"0.67544395",
"0.675105",
"0.67498535",
"0.6741747",
"0.6692869",
"0.6677139",
"0.66598463",
"0.66448915",
"0.66239274",
"0.6620675",
"0.66074634",
"0.66... | 0.75598687 | 0 |
Recenter position go to current time line | recenterPosition() {
this.root.scrollToTime(this.timeLinePosition.time);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"stepExactCenter_() {\n this.mutateElement(() => {\n this.updatePositions_(0.5);\n });\n }",
"function updatePosition() {\r\n _x = Canvas.Timescale.getXPositionForTime(_beginDate);\r\n _width = Canvas.Timescale.getXPositionForTime(_endDate) - _x;\r\n }",
"function moveToCenter(){\n\... | [
"0.6535119",
"0.6485212",
"0.62665874",
"0.6207328",
"0.61983323",
"0.6184867",
"0.60450166",
"0.6025811",
"0.60242206",
"0.5929027",
"0.5886999",
"0.5886764",
"0.58658856",
"0.58376163",
"0.5747427",
"0.57249403",
"0.57228136",
"0.5706448",
"0.5706335",
"0.57033145",
"0.5694... | 0.833979 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.