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 |
|---|---|---|---|---|---|---|
Accepts a connection, returns rid. | function accept(serverRid) {
return Deno.core.opAsync("op_accept", serverRid);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function acceptConnection(socket) {\n}",
"function read(){\n connection.connect(function(err) {\n console.log(\"Connected!\");\n })\n}",
"accept(socket) {\n debug('accepting client');\n\n const client = new Client(socket);\n client.id = ++this.clientCounter;\n this.clients.push(client);\n ... | [
"0.6470262",
"0.53141636",
"0.5209366",
"0.50885016",
"0.50397724",
"0.5037466",
"0.50261503",
"0.50186306",
"0.50156194",
"0.5015447",
"0.50049853",
"0.4947489",
"0.49447232",
"0.49322233",
"0.49288547",
"0.49263468",
"0.4925193",
"0.48997843",
"0.48931062",
"0.48776892",
"0... | 0.5855899 | 1 |
Parse a contiguous block of positions into a Float64Array | function parsePositions(view, offset, nPoints, dim) {
const bufferOffset = view.byteOffset + offset;
const bufferLength = nPoints * dim * Float64Array.BYTES_PER_ELEMENT;
return [
new Float64Array(view.buffer.slice(bufferOffset, bufferOffset + bufferLength)),
offset + bufferLength
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function n$1(){return new Float32Array(4)}",
"function to_float(rows) {\n return rows.map(function(row) {\n return new Float32Array(row);\n });\n }",
"async function grabIndData(Float){\n let dataArr=[];\n let data = await fetchAndDecodeFloatData(`https://geoweb.princeton.edu/people/s... | [
"0.55842805",
"0.55721545",
"0.5565059",
"0.55268556",
"0.5301821",
"0.5276897",
"0.5232529",
"0.5226581",
"0.5200158",
"0.51878685",
"0.5134734",
"0.5129809",
"0.5119643",
"0.5094226",
"0.50344265",
"0.5022607",
"0.50011086",
"0.49455923",
"0.4936001",
"0.49321872",
"0.49056... | 0.67561275 | 0 |
Concatenate and interleave positions arrays xy positions are interleaved; mPositions, zPositions are their own arrays eslintdisablenextline complexity | function concatPositions(xyPositions, mPositions, zPositions) {
if (!(mPositions || zPositions)) {
return xyPositions;
}
let arrayLength = xyPositions.length;
let nDim = 2;
if (zPositions && zPositions.length) {
arrayLength += zPositions.length;
nDim++;
}
if (mPositions && mPositions.length... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"transformPositions4(m, p, p2 = p) {\n let i;\n const len = p.length;\n\n let x;\n let y;\n let z;\n\n const m0 = m[0];\n const m1 = m[1];\n const m2 = m[2];\n const m3 = m[3];\n const m4 = m[4];\n const m5 = m[5];\n const m6 = m[6]... | [
"0.59942627",
"0.59103936",
"0.575307",
"0.5696652",
"0.5610673",
"0.556627",
"0.55406237",
"0.54829186",
"0.5408938",
"0.53839374",
"0.53823626",
"0.53333783",
"0.53158426",
"0.53052104",
"0.52795714",
"0.52795714",
"0.52795714",
"0.5272258",
"0.52515256",
"0.5233867",
"0.52... | 0.7532734 | 0 |
JavascriptWriter : Compile a Process to Javascript (nodejs) sources // | function JavascriptWriter() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildJavascript() {\n return buildGenerator('javascript', 'JavaScript');\n}",
"function compileJS() {\r\n var files = [], //eventually an array of all the js to combine\r\n stream,\r\n replacements = jsReplacements || {},\r\n tokens = Object.keys(replacements);\r\n\r\n //add 3rd party ... | [
"0.6762471",
"0.6393826",
"0.633463",
"0.63308597",
"0.62573916",
"0.6234735",
"0.6172093",
"0.6152647",
"0.61521107",
"0.6113025",
"0.6106789",
"0.6101907",
"0.6006644",
"0.59848267",
"0.59645015",
"0.59504366",
"0.59328103",
"0.5923208",
"0.5895536",
"0.5891237",
"0.5887886... | 0.6837774 | 0 |
generates random position for new number added to board | function generateRandomPosition() {
var digitPosition = []; // coordinates of new digit
while (true) {
var currRow = Math.floor((Math.random() * Rows) + 0);
var currCol = Math.floor((Math.random() * Cols) + 0);
if (matrix[currRow][currCol] === 0) {
d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"randomPositionGenerator(){\n let x = Math.floor(Math.random() * BOARD_WIDTH);\n let y = Math.floor(Math.random() * BOARD_HEIGHT);\n x -= (x % this.cellWidth);\n y -= (y % this.cellWidth);\n return([x, y]);\n }",
"addRandomTile(board) {\n\t\t//open indicies\n\t\tlet open = []... | [
"0.7441892",
"0.7360763",
"0.73407555",
"0.7287889",
"0.7234998",
"0.7201842",
"0.7155814",
"0.715294",
"0.71173996",
"0.7084615",
"0.7056538",
"0.70506805",
"0.7044156",
"0.7012964",
"0.69700205",
"0.6952097",
"0.6938836",
"0.69333124",
"0.69313955",
"0.6885057",
"0.68698263... | 0.7605671 | 0 |
update board with the new number generated | function updateBoard(number, row, col) {
matrix[row][col] = number;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateInternalBoard() {\n const inputs = document.querySelectorAll('.cell');\n for (let i = 0, rowAndCol, row, col; i < inputs.length; i++) {\n rowAndCol = getRowAndCol(inputs[i].id);\n row = rowAndCol[0];\n col = rowAndCol[1];\n board[row][col] = parseInt(inputs[i].value);\n }\n}",
"func... | [
"0.6758331",
"0.67254555",
"0.66557395",
"0.6568838",
"0.65604866",
"0.6549307",
"0.6512964",
"0.6499978",
"0.64669627",
"0.6451812",
"0.644569",
"0.6443352",
"0.64322424",
"0.6418621",
"0.6403908",
"0.63861454",
"0.6383575",
"0.6371781",
"0.63699496",
"0.6368255",
"0.6360412... | 0.7514744 | 0 |
gets background color for tile at position i, j | function getBackgroundColor(i, j) {
var number = matrix[i][j];
if (number === 0) {
return DEFAULT_TILE_BG_COLOR;
} else {
var index = getBaseLog(DIGIT_TWO, number) - 1;
return tileBackgroundColor[index];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getBackgroundColor(row, i){\n\tvar squareBackground;\n\tif( Math.floor(row%2)===0 ){\n\t\tsquareBackground = Math.floor(i%2)===0?\"black\":\"grey\";\n\t} else {\n\t\tsquareBackground = Math.floor(i%2)===0?\"grey\":\"black\";\n\t}\n\treturn squareBackground;\n}",
"function addTileColor() {\n\n for (var ... | [
"0.7031234",
"0.6985156",
"0.6914839",
"0.66316706",
"0.6580085",
"0.6580085",
"0.6507866",
"0.6470196",
"0.6400507",
"0.6361444",
"0.6306053",
"0.62884486",
"0.62811095",
"0.62646145",
"0.6227717",
"0.62228197",
"0.62010175",
"0.61823934",
"0.6177263",
"0.61641514",
"0.61270... | 0.81274533 | 0 |
Shows the final animated image param endResult accepts "winner" or "loser" and shows corresponding image | function showEndImage(layer, endResult) {
var img = new Image();
img.src = IMAGE_PATH + endResult + ".jpg";
var player;
img.onload = function () {
player = new Kinetic.Image({
x: 0,
y: 0,
width: 410,
height: 0,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function endResultImage() {\n $(\"#start-over\").html(\"Start Over?\")\n $(\"#title\").empty();\n $(\"#clock\").empty();\n $(\"#question\").empty();\n\n if (answeredRight >= 8) {\n $(\"#result-image\").html(\"<img src='./assets/images/leo.gif'/>\"); // score between 8 - 11 gets... | [
"0.71302664",
"0.6560229",
"0.631272",
"0.6202281",
"0.61828357",
"0.61679393",
"0.60867125",
"0.6068367",
"0.60618967",
"0.59640026",
"0.5925418",
"0.58898443",
"0.58603334",
"0.58535695",
"0.5842161",
"0.5778411",
"0.5771344",
"0.574799",
"0.572635",
"0.5715874",
"0.5692179... | 0.7356348 | 0 |
Every View needs to have these arguments, for SEO and Social Media. If not have this tags, it'll be taken from gatsby.config | function SEO({ description, lang, meta, title, ogImage, ogType, ogUrl }) {
const { site } = useStaticQuery(
graphql`
query {
site {
siteMetadata {
title
description
author
ogImage
ogType
}
}
}
`
);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SEO({ description, lang, meta, title, image }) {\n const { site } = useStaticQuery(\n graphql`\n query {\n site {\n siteMetadata {\n title\n description\n siteUrl\n image\n author\n organization {\n nam... | [
"0.6409507",
"0.6018973",
"0.5741858",
"0.57239705",
"0.57036734",
"0.57036734",
"0.57036734",
"0.55362624",
"0.5473566",
"0.5406431",
"0.53569686",
"0.53331995",
"0.5308353",
"0.53021365",
"0.5265907",
"0.5242234",
"0.5221382",
"0.518511",
"0.51504254",
"0.51093996",
"0.5088... | 0.64800465 | 0 |
Funcion para q el slide se mueva a la izquierda | function moverIzquierda() {
if (!slider.is(':animated')) {
$('#slider .slide:last').insertBefore('#slider .slide:first');
slider.css('margin-left', '-105.6%');
slider.animate({
marginLeft: '-43%'
},700, function () {
resetInterval()
});
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function change_qs(i){\n $('.carousel').carousel(i);\n mrev(0);\n return false;\n}",
"function slider(){\n\t// Jesli dojdzie do ostatnie elementu zacznij od nowa \n\tif(slides < 0){\n\t\tslides = images.length - 1\n\t}\n\t// Wstaw animacje dla wszystkich divow\n\tarray.forEach(function(a){\n\t\ta.style.... | [
"0.6666486",
"0.65681434",
"0.6508183",
"0.6296523",
"0.62563676",
"0.6236085",
"0.6188207",
"0.61760163",
"0.6138941",
"0.61010456",
"0.6096813",
"0.60942787",
"0.6087834",
"0.6076381",
"0.6033531",
"0.60124606",
"0.59882176",
"0.59845537",
"0.5971013",
"0.59692067",
"0.5959... | 0.6678986 | 0 |
reads distance up and down from eventId or just expose eventIdToKey? | readAtEventId(eventId, distance) {
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"position_from_event(event) {\n return this.position_from_offset(this.offset_from_event(event));\n }",
"getEventOffset(e) {\n return this.eventCoordsToSVGCoords(e.clientX, e.clientY);\n }",
"function getEventLocation(event){\r\n // Relies on the getElementPosition function.\r\n var pos = thi... | [
"0.6308876",
"0.6263539",
"0.59475046",
"0.5895074",
"0.58737236",
"0.58737236",
"0.586803",
"0.5837171",
"0.5837171",
"0.5837171",
"0.5741965",
"0.5741965",
"0.5733981",
"0.572764",
"0.5698088",
"0.56591606",
"0.5612164",
"0.5573819",
"0.55408216",
"0.5508936",
"0.5457938",
... | 0.63418806 | 0 |
Represents a campaign Test Send in Constant Contact | function TestSend(listId) {
Component.call(this);
this.email_addresses = [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Campaign(CampaignName,CampaignStatus,Clicks,ClickType,Impressions,Ctr,AverageCpc,Cost,AveragePosition,Conversions,ConversionRate,CostPerConversion) {\n\t\t\tthis.CampaignName = CampaignName;\n\t\t\tthis.CampaignStatus=CampaignStatus;\n\t\t\tthis.Clicks = Clicks;\n\t\t\tthis.ClickType = ClickType;\n\t\t\tt... | [
"0.50695",
"0.5035103",
"0.49978736",
"0.49659473",
"0.48828968",
"0.48386967",
"0.47609767",
"0.46618524",
"0.46613815",
"0.46568388",
"0.465456",
"0.4627007",
"0.45841524",
"0.45822775",
"0.4564179",
"0.4564179",
"0.45413795",
"0.45188326",
"0.45188326",
"0.45188326",
"0.45... | 0.5795432 | 0 |
called after validation to transform field data to hidden fields used by millennium selfregistration (pulled from HTTP POST data) | function postproc_form() {
log("prostprocessing form");
var form = document.getElementById("selfreg");
// transform birth date (format MM-DD-YYYY)
var field = document.createElement("input");
year = form.elements["birth_year"].value;
month = form.elements["birth_month"].value;
day = form.ele... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setHiddenFields() {\n\tlet ans = Math.floor((Math.random() * 9999) + 1);\n\n\tlet temp = '';\n\twhile(ans.length < 4) {\n\t\ttemp = \"0\" + ans.toString();\n\t}\n\n\tanswer.value = temp;\n\tattempt = 0;\n}",
"function setHiddenFields()\n{\n\tlet ans_Num = Math.random();\n\tlet ans_str = \"\";\n\tans_Nu... | [
"0.6022263",
"0.59398335",
"0.5903603",
"0.58615303",
"0.5847639",
"0.58144134",
"0.5689784",
"0.56852627",
"0.5675046",
"0.566068",
"0.562305",
"0.562305",
"0.562305",
"0.55607235",
"0.5560396",
"0.553343",
"0.5478616",
"0.5471243",
"0.5471243",
"0.5471243",
"0.5471243",
"... | 0.6231093 | 0 |
Stubs the erlang_js builtin ejsLog function. | function ejsLog(file, message){
print("ejsLog: [" + file + "] " + message);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logger() {}",
"function Log() {}",
"function log(txt) {\n // commented out for production version\n // IJ.log(txt);\n}",
"function jsLogError(msg) {\n\t//log error\n}",
"log() {\n\n this.respond(undefined, \"log\", undefined, undefined, arguments);\n\n }",
"_log() {\n if (this... | [
"0.63249606",
"0.63115495",
"0.61847395",
"0.6166113",
"0.60258263",
"0.60183644",
"0.59721357",
"0.59474236",
"0.5946979",
"0.5946979",
"0.5946979",
"0.5945174",
"0.59009284",
"0.5891638",
"0.5890703",
"0.5852913",
"0.5844647",
"0.58388215",
"0.58207715",
"0.5819164",
"0.578... | 0.6893973 | 0 |
Returns the port number for the server. | function getPort() {
return server.get('port');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get port() {}",
"getPort() {\n return super.getAsInteger(\"port\");\n }",
"getPort() {\n return this._port;\n }",
"getPort() {\n return this._port;\n }",
"function getPort(){\n\t\treturn this.port;\n\t}",
"function getPort() {\n var self = this;\n if (typeof sel... | [
"0.7498945",
"0.7330259",
"0.71957093",
"0.71957093",
"0.71719867",
"0.7082614",
"0.69141513",
"0.6862001",
"0.67504287",
"0.6734909",
"0.67159957",
"0.6507011",
"0.6507011",
"0.64996934",
"0.6321329",
"0.62943894",
"0.6176025",
"0.6063348",
"0.5896577",
"0.5818789",
"0.57965... | 0.8641427 | 0 |
Create the DOM node for a scroll bar. | function createNode() {
var node = document.createElement('div');
var decrement = document.createElement('div');
var increment = document.createElement('div');
var track = document.createElement('div');
var thumb = document.createElement('div');
decrement.className ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createNodeScrollBar() {\r\n\tfor (let i = 0; i < nodesPayload.length; i++) {\r\n\t\tcreateNodeElement(nodesPayload[i]);\r\n\t}\r\n}",
"function createScrollBar() {\n\tvar $d = $('#skill_content');\n\tvar $j = $d.data('jsp');\n\n\tif ( $j ) {\n\t\t$j.reinitialise();\n\t} else {\n\t\t$d.jScrollPane({verti... | [
"0.77494735",
"0.7200533",
"0.69160736",
"0.6898864",
"0.6725358",
"0.6481364",
"0.64697343",
"0.6445678",
"0.62581474",
"0.6204076",
"0.61823",
"0.61265296",
"0.61265296",
"0.61169827",
"0.61169827",
"0.6065795",
"0.6049133",
"0.6022462",
"0.6020516",
"0.6013358",
"0.5957481... | 0.7632265 | 1 |
Find the scroll bar part which contains the given target. | function findPart(scrollBar, target) {
// Test the thumb.
if (scrollBar.thumbNode.contains(target)) {
return 'thumb';
}
// Test the track.
if (scrollBar.trackNode.contains(target)) {
return 'track';
}
// Test the decrement button.
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get scrollTarget(){return this.$.scrollable}",
"function checkScroll(el){\n if( $(el).attr('id') == 'next-resource' ||\n $(el).attr('id') == 'prev-resource' ||\n $(el).parent().hasClass('pages-resource-nav') ||\n $(el).attr('id') == 'scrollLine'\n ){\n re... | [
"0.6253964",
"0.6025095",
"0.594124",
"0.5877719",
"0.5868594",
"0.5868594",
"0.58512765",
"0.58512765",
"0.58512765",
"0.5842551",
"0.5842551",
"0.5841363",
"0.5836701",
"0.5836701",
"0.5836701",
"0.5836701",
"0.58194184",
"0.58194184",
"0.58194184",
"0.58194184",
"0.5819418... | 0.8001765 | 0 |
show only staged files | async function getStaged() {
// git diff --staged
// git diff --cached --name-only
// git diff --name-only --cached | xargs
const stream = execa.shell('git diff --name-only --cached', {
cwd: root
}).stdout
let stdout = await getStream(stream)
stdout = stdout.trim()
if (stdout) {
ctx.logger.info... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function allStagedFiles() {\n return gitOutputAsArray(\"git diff --staged --name-only --diff-filter=ACM\");\n}",
"async function getStagedFiles(hookTitle) {\n const { stdout } = await exec(gitStagedFiles, hookTitle)\n // Manage files, remove empty lines from `git diff` result\n return stdout.split('\\n').f... | [
"0.68644756",
"0.61891407",
"0.5960982",
"0.5923955",
"0.55571336",
"0.54972726",
"0.54300356",
"0.5427194",
"0.5412154",
"0.5396427",
"0.5357443",
"0.535283",
"0.53049874",
"0.5269868",
"0.5192229",
"0.51849866",
"0.5156793",
"0.50928396",
"0.50584984",
"0.5038514",
"0.49738... | 0.6416871 | 1 |
Check if the step tasks are complete with the current annotations. | get isComplete() {
return self.step.isComplete(self.annotations)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get completed() {\n return this.wizardSteps.every(step => step.completed || step.optional);\n }",
"function check_for_completion()\n{\n\tvar $btn_complete = $(\"#btn-complete\"),\n\t\t$tasks = $(\"#project .tasks li.task\"),\n\t\t$complete_tasks = $(\"#project .tasks li.task.complete\"),\n\t\ttask_len ... | [
"0.67207867",
"0.64678013",
"0.6438318",
"0.6438318",
"0.6347948",
"0.6338272",
"0.63123286",
"0.62858486",
"0.6128383",
"0.6124402",
"0.6089222",
"0.6089222",
"0.6070527",
"0.5958643",
"0.5958606",
"0.59491795",
"0.5899313",
"0.5866979",
"0.5866979",
"0.5855984",
"0.58447057... | 0.77550966 | 0 |
Get the next step key from any single choice answers, or the current step otherwise. | get nextStepKey() {
return self.step.nextStepKey(self.annotations)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function nextAnswers() {\n\t\tif (CURRENT_QNUM <= NUM_QUESTIONS) {\n\t\t\tvar index = order[CURRENT_QNUM-1]-1;\n\t\t\treturn answers[index];\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}",
"function getNextChoice() {\n selectInfo.choices.forEach(element => {\n\n if (element.key.match(currentKey)) {\n ... | [
"0.64415485",
"0.63594484",
"0.6257964",
"0.61306554",
"0.5841812",
"0.5841401",
"0.5838192",
"0.5830713",
"0.58277607",
"0.5817107",
"0.5807346",
"0.5765229",
"0.5732862",
"0.5697251",
"0.5679291",
"0.5667382",
"0.56394845",
"0.5625235",
"0.56205016",
"0.5618436",
"0.5594398... | 0.68496186 | 0 |
Returns the current latitude. | function YGps_get_latitude()
{
var res; // string;
if (this._cacheExpiration <= YAPI.GetTickCount()) {
if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {
return Y_LATITUDE_INVALID;
}
}
res = this._latitude;
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getRawLat() : number {\n return this._bitField.getInt(192,27,false);\n }",
"function getLatLon() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function setVariable(position) {\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n setApi();\n ... | [
"0.6973243",
"0.6720962",
"0.6684757",
"0.62713283",
"0.6252544",
"0.6075157",
"0.6054321",
"0.5987696",
"0.59835416",
"0.5966307",
"0.58758867",
"0.58582616",
"0.5856309",
"0.58445024",
"0.58441687",
"0.5802325",
"0.5801766",
"0.57965493",
"0.57738954",
"0.5765582",
"0.57589... | 0.76363623 | 0 |
Returns the current longitude. | function YGps_get_longitude()
{
var res; // string;
if (this._cacheExpiration <= YAPI.GetTickCount()) {
if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {
return Y_LONGITUDE_INVALID;
}
}
res = this._longitude;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getRawLon() : number {\n return this._bitField.getInt(164,28,false);\n }",
"function getLatLon() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function setVariable(position) {\n lat = position.coords.latitude;\n lon = position.coords.longitude;\n setApi();\n ... | [
"0.719712",
"0.6819988",
"0.67977387",
"0.6555981",
"0.65525264",
"0.6492527",
"0.6492411",
"0.64828086",
"0.6459875",
"0.64182895",
"0.6281253",
"0.62770617",
"0.6244329",
"0.6224425",
"0.6190329",
"0.617642",
"0.6158758",
"0.6140334",
"0.6081058",
"0.60253584",
"0.5980742",... | 0.8334472 | 0 |
Returns the current altitude. Beware: GPS technology is very inaccurate regarding altitude. | function YGps_get_altitude()
{
var res; // double;
if (this._cacheExpiration <= YAPI.GetTickCount()) {
if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {
return Y_ALTITUDE_INVALID;
}
}
res = this._altitude;
r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getAltitude() {\n return this.altitude;\n }",
"setAltitude(alt) {\n this.altitude = alt;\n }",
"function YGps_get_altitude_async(callback,context)\n {\n var res; // double;\n var loadcb; // func;\n loadcb = function(ctx,obj,res) {\n... | [
"0.78877723",
"0.69318074",
"0.66189224",
"0.6119995",
"0.57869697",
"0.57216793",
"0.5645952",
"0.55882215",
"0.55457324",
"0.5524455",
"0.5439663",
"0.5422901",
"0.539004",
"0.53538835",
"0.5241144",
"0.5238878",
"0.51043034",
"0.50714314",
"0.50512075",
"0.50487626",
"0.50... | 0.8311889 | 0 |
Returns the current ground speed in Km/h. | function YGps_get_groundSpeed()
{
var res; // double;
if (this._cacheExpiration <= YAPI.GetTickCount()) {
if (this.load(YAPI.defaultCacheValidity) != YAPI_SUCCESS) {
return Y_GROUNDSPEED_INVALID;
}
}
res = this._groundSpeed;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSpeed()\r\n {\r\n return speed;\r\n }",
"get maxFlightSpeed() {\n return configs.maxFlightSpeedKMPH / 3600000;\n }",
"getSpeed() {\n return this.kinematicQuantity.getSpeed();\n }",
"get maxSpeed() {\n return configs.maxSpeedKMPH / 3600000;\n }",
... | [
"0.71870476",
"0.707321",
"0.70369554",
"0.6973467",
"0.69127303",
"0.6893907",
"0.67323923",
"0.67246735",
"0.666339",
"0.6577693",
"0.6576914",
"0.6558923",
"0.6522475",
"0.65128213",
"0.6500624",
"0.6496631",
"0.6478766",
"0.64396405",
"0.63554823",
"0.6346489",
"0.6346489... | 0.7697434 | 0 |
Author name or name of first maintainers | function getAuthor(my) { return my.author || first(my.maintainers); } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_author_name() {\r\n\tif (this.author != null) {\r\n\t\treturn this.author.getTarget().fullname;\r\n\t}\r\n\treturn \"Unknown\";\r\n}",
"getAuthor() {return \"de/odex\";}",
"getAuthor(author) {\n // Remove email from returned author - only return users name\n const start = author.indexOf('\"'... | [
"0.7476825",
"0.73173356",
"0.6897396",
"0.67773634",
"0.66507405",
"0.6499148",
"0.6421983",
"0.6419164",
"0.63506675",
"0.63156873",
"0.61918473",
"0.6189401",
"0.6189401",
"0.6189401",
"0.6118858",
"0.6106968",
"0.6050891",
"0.6007008",
"0.5929968",
"0.5924334",
"0.5916544... | 0.7681659 | 0 |
Collect the widgets and submit them to the backend | function submitForm() {
let widgetForm = {'widgets': []};
let i = 0;
let csrfToken = $.cookie('csrftoken');
$('#widgets-holder').find('form').each(function() {
widgetForm.widgets[i++] = indexArray($(this).serializeArray());
});
widgetForm['meta'] = indexArray($('#form-title').serializeArray());
widget... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function submitButtonPush() {\n submitPost()\n ui.clearForm()\n getClients()\n hideMainForms()\n getClients()\n loadContractsBtn(); \n}",
"function initWidgetUI() {\n $(\".widget-wrapper\").each(function () {\n var widgetId = extractObjectIdFromElementId($(this).attr(\"id\"));\n ... | [
"0.625184",
"0.62187636",
"0.61071044",
"0.6059367",
"0.59587026",
"0.585997",
"0.58071536",
"0.5779492",
"0.5720254",
"0.57144797",
"0.5694302",
"0.5681555",
"0.5635551",
"0.56205374",
"0.56197125",
"0.5587155",
"0.5570864",
"0.55535793",
"0.55275553",
"0.5516666",
"0.545684... | 0.63686186 | 0 |
Returns a string that is a prefix of all strings matching the RegExp | function regExpPrefix(re) {
var prefix = /^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(re.source);
return (prefix != null) ? prefix[1].replace(/\\(.)/g, "$1") : '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }",
"function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*... | [
"0.7297094",
"0.7297094",
"0.7279479",
"0.7231805",
"0.72213405",
"0.7217655",
"0.6756196",
"0.6521537",
"0.6240544",
"0.6124427",
"0.60537714",
"0.602197",
"0.5986728",
"0.5980179",
"0.596505",
"0.5896466",
"0.58839536",
"0.58772177",
"0.5873311",
"0.5867613",
"0.5801498",
... | 0.73138875 | 1 |
Returns true if glob matches current $state name. | function doesStateMatchGlob (glob) {
var globSegments = glob.split('.'),
segments = $state.$current.name.split('.');
//match greedy starts
if (globSegments[0] === '**') {
segments = segments.slice(segments.indexOf(globSegments[1]));
segments.unshift('**');
}
//match greedy end... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function doesStateMatchGlob (glob) {\n var globSegments = glob.split('.'),\n segments = $state.$current.name.split('.');\n\n //match greedy starts\n if (globSegments[0] === '**') {\n segments = segments.slice(indexOf(segments, globSegments[1]));\n segments.unshift('**');\n }\n //m... | [
"0.8135545",
"0.8135545",
"0.8135545",
"0.813126",
"0.81297904",
"0.81231534",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
"0.8117629",
... | 0.81378806 | 0 |
Creates the container.. you can have multiple templates easily and can reference them by name. | function tTemplatesContainer()
{
this.templates = new Array();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createTemplates() {\n\n \t/** Template de las opciones principales del header **/\n\n \tthis.templates.container_filter_options =\n\t \t`<div class=\"`+this.getClassOrIdName(this.containers.filter_options) +` pull-right\">\n\t \t\t<a href=\"#\" class=\"`+this.getClassOrIdName(this.styles.save_filters_b... | [
"0.6729873",
"0.6584653",
"0.64556277",
"0.6285881",
"0.6230047",
"0.6195002",
"0.61561024",
"0.61448234",
"0.6139209",
"0.6137265",
"0.6070926",
"0.5964585",
"0.59582245",
"0.5929941",
"0.59231174",
"0.5919228",
"0.587864",
"0.58778787",
"0.58731145",
"0.586855",
"0.5839991"... | 0.66138226 | 1 |
if one or more of the item is checked, enable this button | function maybeEnableBtn(items) {
setStoreBtn(
!items.some(item => item.bought)
// !items.filter(item => !item.dateStored).some(item => item.bought)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function forEnableAndDisableButton() {\n\tvar chkArray = [];\n\t$(\"#tbodyData input:checked\").each(function() {\n\t\tchkArray.push($(this).val());\n\t});\n\tvar selected;\n\tselected = chkArray.join(',');\n\tif (selected.length > 0) {\n\t\t$(\"#deleteButtonID\").show();\n\t\t// alert(\"You have selected \" + sel... | [
"0.6667435",
"0.64842236",
"0.6448335",
"0.6444352",
"0.63888514",
"0.6371076",
"0.636671",
"0.6343923",
"0.6309945",
"0.62940925",
"0.6278229",
"0.6217419",
"0.6170458",
"0.61667806",
"0.6161716",
"0.6145796",
"0.6143442",
"0.6134214",
"0.61284775",
"0.61225903",
"0.61159855... | 0.68087167 | 0 |
Checks if css operation is supported as and when test is run. TODO: Simplify this code | function checkCSSsupport(){
var isSupported = true;
switch(testNumber){
case 0:
if (typeof document.body.style.boxShadow == "undefined" && typeof document.body.style.WebkitBoxShadow == "undefined")
isSupported = false;
break;
case 1:
if (typeof document.body.style.borderRadius == "undef... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isSupported() {\n const isSupported = CSS.supports(\"--custom-properties\", \"custom\");\n if (!isSupported && this.debug) {\n console.warn(\"Your browser does not support custom CSS properties.\");\n }\n return isSupported;\n }",
"function checkDevCSS(dev) {\n for (let technologies of dev.t... | [
"0.67971605",
"0.65939075",
"0.6494684",
"0.6446028",
"0.64291096",
"0.6407439",
"0.6397783",
"0.6397783",
"0.6397783",
"0.6397783",
"0.6397783",
"0.6397783",
"0.6130922",
"0.6130922",
"0.6130922",
"0.61138535",
"0.61055386",
"0.61055386",
"0.61004823",
"0.61004823",
"0.60715... | 0.73220855 | 0 |
RETRIEVE AN ADMIN LIST FOR NEW LETTERS AND STAMPS Gets a list of admins at a specific institution for the "Submitted By" field when creating a new letter or stamp request. The javascript function detects if user selects a member, then sends an AJAX request to server based on the member id. This function then retrieves ... | function activateSubmittedByDropdown()
{
// get the member id from the member name field
var memberId = document.getElementById("member_name").value;
// send member id as get request to list_admin function in LettersController
$.ajax({
url: 'list_admin',
type: 'GET',
data: {
member_id : memberId
},
err... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAdmin(){\n $.post(\"/chatroom/getAdmin\", {chatRoomId: chatroomId}, function (data) {\n adminList = data;\n getChatRoomUsers();\n loadUser();\n }, \"json\");\n}",
"function submittedByAndSmartFormsDropdowns()\n{\n\tvar memberId = document.getElementById(\"member_name\").val... | [
"0.65492237",
"0.6520383",
"0.5983498",
"0.5884526",
"0.5884526",
"0.57007396",
"0.5677855",
"0.5658875",
"0.5644863",
"0.56180197",
"0.5580498",
"0.5549065",
"0.5518821",
"0.5493015",
"0.5468158",
"0.54471254",
"0.5443053",
"0.54309994",
"0.54009724",
"0.5368178",
"0.5346769... | 0.6656858 | 0 |
Creates a new NotFoundController | function NotFoundController(options) {
if (!(this instanceof NotFoundController))
return new NotFoundController(options);
Controller.call(this, options);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function throwNotFound() {\n var error = new Error()\n error.statusCode = 404\n throw error\n}",
"function notFound(req,h){\n return h.view('404',{},{layout: 'error-layout'}).code(404)\n}",
"function customUrlNotFound() {\n return function raiseUrlNotFoundError(req, res) {\n var path = require('pat... | [
"0.61274844",
"0.6066551",
"0.5965157",
"0.5833549",
"0.568743",
"0.568743",
"0.5686473",
"0.56220084",
"0.5600573",
"0.5593075",
"0.5579442",
"0.5547735",
"0.55314624",
"0.5466377",
"0.54662555",
"0.54256254",
"0.5386293",
"0.5373354",
"0.5363161",
"0.5340785",
"0.53275573",... | 0.78625214 | 0 |
1) Enable / Disable panels as configured (in json file) 2) Load Panel Sequence from Storage (as saved from last update) | function configPanels(jsonPanel) {
//Enable / Disable panels as configured (in json file)
for (var currPanel in jsonPanel) {
if (jsonPanel[currPanel]["state"] === "visible")
$('#' + currPanel).show();
else
$('#' + currPanel).hide();
// Debug Panel -> Update Debug Log Button
if (currPanel == "debug") {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadPanels() {\n\t\t\tloadMonthlyCelebrants();\n\t\t\t//loadNewlyBaptized();\n\t\t}",
"function showPanel(panel){\n if(actualPanel!=panel){\n //We hide the previous panel and we show the new\n $(\"#panel\"+actualPanel).slideUp(\"slow\");\n $(\"#actived\"+actualPanel).html(\"\")\n $(\"#setti... | [
"0.5994435",
"0.5710545",
"0.5688388",
"0.56830305",
"0.55196214",
"0.5505336",
"0.5437908",
"0.54099464",
"0.53970325",
"0.53683156",
"0.53655976",
"0.5338085",
"0.532445",
"0.53047925",
"0.5292631",
"0.52817786",
"0.5267991",
"0.52668583",
"0.526168",
"0.524769",
"0.5227226... | 0.7439681 | 0 |
log = "a 1" indexOfFirstCharacter = 2 firstCharacter = "1" isNaN("1") => false Return false log = "b a" indexOfFirstCharacter = 2 firstCharacter = "a" isNaN("a") => true Return true | function isLetter (log) {
var indexOfFirstCharacter = log.indexOf(" ") + 1;
var firstCharacter = log[indexOfFirstCharacter];
if (isNaN(firstCharacter)) {
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function IsNumeric(valor)\n{\n var log = valor.length;\n var sw = \"S\";\n for (x = 0; x < log; x++)\n {\n v1 = valor.substr(x, 1);\n v2 = parseInt(v1);\n //Compruebo si es un valor numérico \n if (isNaN(v2)) {\n sw = \"N\";\n }\n }\n if (sw === \"S\"... | [
"0.60979354",
"0.59757614",
"0.5949843",
"0.5879621",
"0.5770727",
"0.57691514",
"0.5691386",
"0.5646824",
"0.56035364",
"0.5592212",
"0.5589576",
"0.5578337",
"0.5572289",
"0.5551759",
"0.55366236",
"0.55182934",
"0.55129564",
"0.5489346",
"0.5485695",
"0.54766107",
"0.54667... | 0.6453119 | 0 |
Copy the profile picture from the archive to the root directory | copyProfilePicture() {
fs.createReadStream(path.join(this._dataExportDirectory, PROFILE_PICTURE_FILE))
.pipe(fs.createWriteStream(path.join(__dirname, '..', COPIED_PROFILE_PICTURE_FILE)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setUserDefaultImage(dest) {\n fs.copy('./public/profileImage.jpg', dest)\n .then(function() {\n console.log('success!');\n }).catch(function(err) {\n console.error(err);\n });\n}",
"function copyPhoto(fileEntry) {\n\t\t\twindow.resolveLocalFileSystemURL(\n\t\t\t\tSencha.app.get... | [
"0.6664054",
"0.66470414",
"0.6115545",
"0.57161754",
"0.55053014",
"0.547439",
"0.54673773",
"0.54563063",
"0.54045755",
"0.53559214",
"0.5318811",
"0.5290245",
"0.52165043",
"0.51615757",
"0.5157826",
"0.51347697",
"0.5075988",
"0.50619656",
"0.5041192",
"0.50381446",
"0.50... | 0.7059888 | 0 |
2^(68) 1 Calculate a uniformly distributed random number less than bound avoiding "modulo bias". Returns random int between [0..bound) | async function internalRandomRange(
bound,
getRandomBytes = defaultGetRandomBytes
) {
if (bound > MAX_VAL) throw new ArgumentError(`bound must be <= ${MAX_VAL}`);
const range = bound - 1;
const excess = MAX_VAL % range;
const randLimit = MAX_VAL - excess;
while (true) {
const x = (await getRandomByte... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function randomPos(bound) {\n return Math.random() * bound;\n}",
"function randInt(lb, ub) {\r\n var rf = Math.random();\r\n rf = rf * (ub - lb) + lb;\r\n return Math.floor(rf);\r\n}",
"function randInt(lb, ub) {\r\n var rf = Math.random();\r\n rf = rf * (ub - lb) + lb;\r\n return Math.flo... | [
"0.74087834",
"0.7285011",
"0.7285011",
"0.7285011",
"0.72763383",
"0.7267805",
"0.7200848",
"0.71945447",
"0.71902853",
"0.71725655",
"0.7152354",
"0.7141094",
"0.71318823",
"0.7128235",
"0.71130365",
"0.70755506",
"0.70316076",
"0.70316076",
"0.701291",
"0.7006847",
"0.7004... | 0.75180566 | 0 |
Function to display the quote depending on the value of radio button that is checked | function displayQuotes(radioResult) {
if (radioResult === "successValue") {
quote_display.innerHTML += success.print() + "<br>" + "<hr>";
} else {
quote_display.innerHTML += life.print() + "<br>" + "<hr>";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function display(num) {\n num = num - 1;\n choices = \"'choices\" + num + \"'\";\n var text = \"\";\n if (questions[num].prompt && questions[num].prompt.includes(\" \")) {\n text += \"<p>\" + questions[num].prompt + \"</p>\";\n }\n text += \"<p>\" + questions[num].question +\"</p>\";\n ... | [
"0.6688703",
"0.64460695",
"0.6406599",
"0.63988674",
"0.62625265",
"0.62569857",
"0.6227204",
"0.6196483",
"0.6172141",
"0.61637485",
"0.61533153",
"0.61260486",
"0.6120542",
"0.6118522",
"0.6115305",
"0.6085382",
"0.60748595",
"0.6052383",
"0.6040972",
"0.6040783",
"0.60251... | 0.7805041 | 0 |
Select the number of quotes to be printed and print messages if errors Run a for loop for the number the user has input and run the displayQuotes function that multiple times | function generateMoreQuotes(radioResult) {
let num_quotes = quote_num.value;
errors.className = "error";
if (!num_quotes) {
errors.innerHTML = errorNumber;
} else {
errors.innerHTML = "";
for (let i = 0; i < quote_num.value; i++) {
displayQuotes(radioResult);
}
quote_num.value = "";
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printQuote() {\n\tlet number = getRandomQuote(quotes); // gets a number to be used for selecting quote out of array\n\tconsole.log(number);\n\tlet html = `<div id=\"quote-box\" class=\"quote-box\">\n <p class=\"quote\">${quotes[number].quote}</p>\n <p class=\"source\">${quotes[number].source}<span class... | [
"0.63154954",
"0.6313879",
"0.6275031",
"0.62437326",
"0.6233822",
"0.6141743",
"0.613025",
"0.6087981",
"0.60367125",
"0.60052913",
"0.60015815",
"0.5990047",
"0.598456",
"0.5917725",
"0.5902638",
"0.5896658",
"0.58906496",
"0.5889108",
"0.588576",
"0.58578444",
"0.5857461",... | 0.67512196 | 0 |
Prints the usage of each emoji | function printResults(emojiCounter, messageCount, ogMessage) {
console.log("Printing!");
ogMessage.reply("Emoji usage last " + messageCount + " messages:\n");
var entries = emojiCounter.entries();
var message = "";
for (let item of entries) {
var emote = ogMessage.guild.emojis.find("name", i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderEmojis() {\n emojiContainer.innerHTML=\"\";\n for (let i = 0; i < myEmojis.length; i++) {\n const emoji = document.createElement('span')\n emoji.textContent = myEmojis[i]\n emojiContainer.append(emoji)\n }\n }",
"function show_emoticons() {\n var list = docum... | [
"0.6661809",
"0.64117044",
"0.6175652",
"0.6164424",
"0.61616683",
"0.6118443",
"0.5951372",
"0.5938304",
"0.5885656",
"0.5883195",
"0.58610684",
"0.58601975",
"0.5849017",
"0.57746273",
"0.5758949",
"0.5732683",
"0.5662155",
"0.5657949",
"0.5652603",
"0.5641248",
"0.5638991"... | 0.6589874 | 1 |
Constructs a parser from a parse function | function parser(p) {
return new Parser(p);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Parser(f) {\n this.parse = f;\n }",
"function Parser() {\n}",
"function Parser() {\n}",
"function Parser() {\n\n}",
"function Parser() {\n var nodeFactory = arguments.length <= 0 || arguments[0] === undefined ? new _nodeFactory.NodeFactory() : arguments[0];\n\n _classCallCheck(... | [
"0.6979579",
"0.65565175",
"0.65565175",
"0.6475513",
"0.64613813",
"0.6327064",
"0.62658864",
"0.61911625",
"0.6089265",
"0.60734546",
"0.60160065",
"0.5989303",
"0.5892628",
"0.5890354",
"0.58866763",
"0.5817603",
"0.5817603",
"0.58094454",
"0.5786973",
"0.5754962",
"0.5745... | 0.6566327 | 1 |
Returns a parser that always succeed with value | function success(value) {
return parser(function (ps) {
return ps.succeed(value);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parserReturn(value){\r\n return function(scope, state, k){\r\n return k({ast: value, success: true});\r\n };\r\n}",
"function valueParser(v) {\n\tvar p = function(x){ return _.isEqual(x,v); };\n\n\tif (_.isObject(v))\t\tp = isObject;\n\tif (_.isArray(v))\t\tp = isArray;\n\tif (_.isUndefined... | [
"0.62447006",
"0.5877135",
"0.5874634",
"0.57682246",
"0.56671375",
"0.5647196",
"0.56320286",
"0.56221664",
"0.54042995",
"0.5396614",
"0.5388388",
"0.5325306",
"0.53138196",
"0.52951807",
"0.5292575",
"0.5288054",
"0.5265727",
"0.52644414",
"0.5253709",
"0.52328545",
"0.522... | 0.6617644 | 0 |
Returns a parser that always fails | function fail() {
return parser(function (ps) {
return ps.fail();
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tryParse(callback) {\n return speculationHelper(callback, /*isLookAhead*/ false);\n }",
"function parser(p) {\n return new Parser(p);\n }",
"function Parser() {\n var errors = this.errors = [];\n var warnings = this.warnings = [];\n}",
"function def(source, result) ... | [
"0.6165117",
"0.5904968",
"0.57963425",
"0.56754696",
"0.56544495",
"0.5546969",
"0.5546969",
"0.55164075",
"0.54970515",
"0.54631066",
"0.545832",
"0.53932464",
"0.5379456",
"0.535979",
"0.5357965",
"0.53577757",
"0.5349145",
"0.5347686",
"0.5312819",
"0.52815294",
"0.527625... | 0.7363325 | 0 |
Parser increases the current indent | function indent() {
return parser(function (ps) {
ps.increaseIndent();
return ps.succeed(undefined);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"startBlock()\n {\n this.indent++;\n }",
"function indention() {\n return parser(function (ps) {\n var snapshot = ps.snapshot();\n\n if (ps.indent === 0) {\n return ps.succeed(0);\n }\n\n var satisy = function (ch, pos) {\n ... | [
"0.68691987",
"0.6640085",
"0.63419926",
"0.6195448",
"0.616011",
"0.602832",
"0.5959154",
"0.5803967",
"0.57369196",
"0.57044953",
"0.56189114",
"0.5616165",
"0.5603141",
"0.5603141",
"0.5520762",
"0.5518118",
"0.54887694",
"0.54366904",
"0.54115045",
"0.54115045",
"0.540353... | 0.75550365 | 0 |
Parser decreases the current indent Fails if indent couldn't be decreased | function dedent() {
return parser(function (ps) {
if (!ps.decreaseIndent()) {
return ps.fail();
}
return ps.succeed(undefined);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function indent() {\n return parser(function (ps) {\n ps.increaseIndent();\n return ps.succeed(undefined);\n });\n }",
"function decrementsIndent(tokenType, stack) {\n return (tokenType == \"}\" && stack[stack.length - 1] != \"${\")\n || (tokenType == \"]\" && stack... | [
"0.674282",
"0.64936143",
"0.61277705",
"0.6079796",
"0.5909563",
"0.5897654",
"0.56978345",
"0.5686712",
"0.56078297",
"0.55591947",
"0.5556831",
"0.550531",
"0.5376564",
"0.5298691",
"0.52631474",
"0.5259449",
"0.5218559",
"0.51565856",
"0.515631",
"0.515631",
"0.51408994",... | 0.7142966 | 0 |
Parser parses the expected number of indent Fails if not enough indent characters could be consumed | function indention() {
return parser(function (ps) {
var snapshot = ps.snapshot();
if (ps.indent === 0) {
return ps.succeed(0);
}
var satisy = function (ch, pos) {
return pos < ps.indent && ch === 0x09;
};
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function indent() {\n return parser(function (ps) {\n ps.increaseIndent();\n return ps.succeed(undefined);\n });\n }",
"function dedent() {\n return parser(function (ps) {\n if (!ps.decreaseIndent()) {\n return ps.fail();\n }\n ... | [
"0.69025975",
"0.6255298",
"0.5511563",
"0.5502189",
"0.5485898",
"0.5425958",
"0.542058",
"0.54171497",
"0.538942",
"0.5282907",
"0.52146953",
"0.52052045",
"0.5193166",
"0.51710445",
"0.51532984",
"0.5147935",
"0.5135687",
"0.5094695",
"0.5091418",
"0.5087792",
"0.50762695"... | 0.64421254 | 1 |
Parses a string whose characters are a member of str | function anyStringOf(str) {
var numbers = [];
for (var iter = 0; iter < str.length; ++iter) {
numbers[iter] = str.charCodeAt(iter);
}
return parser(function (ps) {
var ch = 0;
var data = [];
var result = ps.advance(function (ch, pos) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function anyCharOf(str) {\n var numbers = [];\n\n for (var iter = 0; iter < str.length; ++iter) {\n numbers[iter] = str.charCodeAt(iter);\n }\n\n return parser(function (ps) {\n var ch = ps.currentCharCode();\n\n if (ch === undefined) {\n ... | [
"0.61180925",
"0.6038436",
"0.5831968",
"0.57864445",
"0.57801414",
"0.5766839",
"0.57660526",
"0.5753233",
"0.57380354",
"0.56493676",
"0.5597393",
"0.5587083",
"0.5576484",
"0.5555752",
"0.555376",
"0.5547488",
"0.5530256",
"0.55174017",
"0.55135196",
"0.54889446",
"0.54879... | 0.60529894 | 1 |
Parses EOS (end of stream) | function EOS() {
return parser(function (ps) {
if (!ps.isEOS()) {
return ps.fail();
}
return ps.succeed(undefined);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isEOF() {\n return this._cursor === this._string.length;\n }",
"function eof() {\n return peek() === \"\";\n }",
"function eof() {\n return peek() == \"\";\n }",
"eof(): boolean {\n return this.position >= this.input.length;\n }",
"function eof() {\n return peek() == null... | [
"0.67538244",
"0.6730374",
"0.6717297",
"0.6527448",
"0.64642054",
"0.640594",
"0.62817967",
"0.6219653",
"0.6157403",
"0.6027326",
"0.60271657",
"0.5978826",
"0.5932981",
"0.5922556",
"0.58914554",
"0.5886807",
"0.5877747",
"0.5875829",
"0.5856585",
"0.5833198",
"0.5816564",... | 0.79197854 | 0 |
Parses EOL (end of line) | function EOL() {
return parser(function (ps) {
if (ps.isEOS()) {
return ps.succeed(undefined);
}
if (ps.text[ps.position] === "\n") {
++ps.position;
return ps.succeed(undefined);
}
if (ps.text[ps.posit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"parseWhitespaceToEOL() {\n if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {\n return null;\n } else if (this.char === CHAR_NUM) {\n return this.goto(this.parseComment);\n } else if (this.char === Parser.END || this.char === CTRL_J) {\n return this.ret... | [
"0.6639238",
"0.6626834",
"0.6623901",
"0.6568244",
"0.6447104",
"0.6288739",
"0.6247679",
"0.6102362",
"0.5994048",
"0.5904782",
"0.5840708",
"0.5789635",
"0.57766503",
"0.57652783",
"0.57612467",
"0.5691603",
"0.56685185",
"0.56561655",
"0.56561655",
"0.56561655",
"0.565616... | 0.83397424 | 0 |
Skips a string that matches str Typically used to parse tokens in file | function skipString(str) {
return parser(function (ps) {
var snapshot = ps.snapshot();
var ss = str;
var result = ps.skipAdvance(function (s, pos) {
return pos < ss.length && ss.charCodeAt(pos) === s;
});
if (result === ss.length) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function noneOf(str){\n var chrs = str.split(\"\");\n return parser(function(st){\n if(st.length < 1) { return parse_error(\"Unexpect file ending.\"); }\n var fst = st.charAt(0);\n return jHaskell.elem(fst,chrs) ? \n parse_error(\"Unexpect \" +... | [
"0.6254519",
"0.6212622",
"0.6205554",
"0.617653",
"0.590929",
"0.590929",
"0.590929",
"0.590929",
"0.590929",
"0.590929",
"0.590929",
"0.590929",
"0.590929",
"0.590929",
"0.590074",
"0.590074",
"0.5864793",
"0.5824851",
"0.5824851",
"0.578252",
"0.57824093",
"0.5765696",
... | 0.7436951 | 0 |
Combines two parser results into a tuple value of both results | function combine2(p0, p1) {
return parser(function (ps) {
var snapshot = ps.snapshot();
var p0Result = p0.parse(ps);
if (!p0Result.success) {
return ps.fail();
}
var p1Result = p1.parse(ps);
if (!p1Result.success) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function combine3(p0, p1, p2) {\n return parser(function (ps) {\n var snapshot = ps.snapshot();\n\n var p0Result = p0.parse(ps);\n\n if (!p0Result.success) {\n return ps.fail();\n }\n\n var p1Result = p1.parse(ps);\n\n if (!p1R... | [
"0.66292804",
"0.5545137",
"0.5351005",
"0.5233608",
"0.5209453",
"0.51549256",
"0.50953263",
"0.50575083",
"0.5033157",
"0.49569064",
"0.49397826",
"0.4933359",
"0.490196",
"0.48864734",
"0.48230103",
"0.48199025",
"0.4809371",
"0.477915",
"0.47654703",
"0.4761764",
"0.47105... | 0.6934828 | 0 |
Combines three parser results into a tuple value of all results | function combine3(p0, p1, p2) {
return parser(function (ps) {
var snapshot = ps.snapshot();
var p0Result = p0.parse(ps);
if (!p0Result.success) {
return ps.fail();
}
var p1Result = p1.parse(ps);
if (!p1Result.success) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function many(parser) {\n return function(input) {\n var value = {rest: input, parsed: '', ast: []};\n for(var i = 0; true; i++) {\n var result = parser(value.rest);\n if(result != false) {\n if(result.ast != null) {\n value.ast.push(result.ast);\n }\n value = {rest: ... | [
"0.57452047",
"0.5588401",
"0.54726434",
"0.5330549",
"0.53202045",
"0.5281143",
"0.52081805",
"0.5185356",
"0.5182899",
"0.51311654",
"0.50832176",
"0.507281",
"0.5057774",
"0.49391133",
"0.49087477",
"0.4830756",
"0.48204973",
"0.47924054",
"0.47753027",
"0.4763037",
"0.472... | 0.64286023 | 0 |
chainLeft is typically used to implement left associative operators The p parser parser an expression The pSeparator parser parses the operator The combiner combines the result expressions into a new expression | function chainLeft(p, pSeparator, combiner) {
return parser(function (ps) {
var pResult = p.parse(ps);
if (!pResult.success) {
return ps.fail();
}
var snapshot = ps.snapshot();
var value = pResult.value;
var pSeparatorRes... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Left$prototype$chain(f) {\n return this;\n }",
"function parseExpression() {\n var left = parseTerm();\n var op = tokens[position];\n while (op === '+' || op === '-') {\n ++position;\n var right = ... | [
"0.6299421",
"0.620788",
"0.6116504",
"0.6113325",
"0.6029061",
"0.5913165",
"0.5598877",
"0.5551039",
"0.5545176",
"0.55423284",
"0.5525685",
"0.5507908",
"0.5492845",
"0.5446123",
"0.54437274",
"0.54298186",
"0.54298186",
"0.54298186",
"0.5407015",
"0.53990126",
"0.5395454"... | 0.74869126 | 0 |
choice applies each input parser in order and picks the first that matches | function choice() {
var choices = [];
for (var _i = 0; _i < (arguments.length - 0); _i++) {
choices[_i] = arguments[_i + 0];
}
return parser(function (ps) {
for (var iter = 0; iter < choices.length; ++iter) {
var p = choices[iter];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function choice() {\n var parsers = [];\n for(var i = 0; i < arguments.length; ++i)\n parsers.push(toParser(arguments[i]));\n var pid = parser_id++;\n return function(state) {\n var savedState = state;\n var cached = savedState.getCached(pid);\n if(cached) {\n ret... | [
"0.7103979",
"0.5941306",
"0.58130765",
"0.58036965",
"0.57197887",
"0.5582248",
"0.52625215",
"0.52298194",
"0.514235",
"0.51305467",
"0.50947434",
"0.5087232",
"0.50803816",
"0.50803816",
"0.50803417",
"0.50753117",
"0.50753117",
"0.50753117",
"0.50753117",
"0.50753117",
"0... | 0.73111284 | 0 |
Special parser used to be break circular parsers (very common) | function circular() {
return parser(null);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Parser() {\n\n}",
"function Parser() {\n}",
"function Parser() {\n}",
"_tokenizeToEnd(callback, inputFinished) {\n // Continue parsing as far as possible; the loop will return eventually\n var input = this._input,\n outputComments = this._comments;\n\n while (true) {\n // Count ... | [
"0.6341805",
"0.62561625",
"0.62561625",
"0.6191932",
"0.6056411",
"0.60538846",
"0.60480994",
"0.6024958",
"0.6021686",
"0.5977763",
"0.59594643",
"0.5932376",
"0.59323287",
"0.59323287",
"0.59323287",
"0.59323287",
"0.59323287",
"0.59323287",
"0.59323287",
"0.59323287",
"0.... | 0.7193732 | 0 |
sort an array of foodtrucks based on the calculated distances | function sortFoodTrucksByDistance(locationEnhancedFoodtrucks) {
return _.orderBy(locationEnhancedFoodtrucks, "distance");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortByDistance(distance){\n distance.sort(function(trainpointA, trainpointB){\n return trainpointA.distance - trainpointB.distance;\n });\n return distance;\n }",
"function sortCostLow(array) {\n array.sort((a, b) =>\n Number(a.restaurant.average_cost_for_two... | [
"0.68010455",
"0.6566639",
"0.647866",
"0.6324319",
"0.6280495",
"0.6218486",
"0.6212365",
"0.61580753",
"0.60848665",
"0.6066196",
"0.60524106",
"0.59931135",
"0.5987987",
"0.5982324",
"0.59566545",
"0.5947344",
"0.5944221",
"0.59401965",
"0.59340125",
"0.59274143",
"0.59187... | 0.72655284 | 0 |
Hides the page action in all tabs. | function hide_in_all_tabs()
{
for (const id_string in host_tab_ids)
{
browser.pageAction.hide(parseInt(id_string));
}
host_tab_ids = {};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hide() {\n if (\n $.getDataset(this._target, 'uiAnimating') ||\n !$.hasClass(this._target, 'active') ||\n !$.triggerOne(this._node, 'hide.ui.tab')\n ) {\n return;\n }\n\n this._hide();\n }",
"function hide_all_pages(){\n\tpages_to_hide = ... | [
"0.6731276",
"0.66145855",
"0.6605057",
"0.65709245",
"0.65487295",
"0.6458191",
"0.64400035",
"0.6429938",
"0.6373216",
"0.6371679",
"0.63472825",
"0.6274004",
"0.6255989",
"0.62477",
"0.62477",
"0.6215312",
"0.61170524",
"0.61134976",
"0.6095839",
"0.60694784",
"0.5937272",... | 0.7463537 | 0 |
Bookmarks the specified tab's page. | async function bookmark_tab(tab)
{
await bookmarks.add(tab.url, tab.title);
update_in_active_tabs();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function bookmarkPage(bookmark, mobBookmark){\r\n bookmark.addEventListener(\"click\", function(){\r\n showBookmarked(bookmark, mobBookmark);\r\n })\r\n mobBookmark.addEventListener(\"click\", function(){\r\n showBookmarked(bookmark, mobBookmark);\r\n })\r\n}",
"function setBookmark(){\... | [
"0.6465941",
"0.6462465",
"0.6336263",
"0.6316123",
"0.5981278",
"0.5908487",
"0.5802447",
"0.5798229",
"0.5775855",
"0.5761471",
"0.5718737",
"0.5654323",
"0.56178516",
"0.5605326",
"0.55579734",
"0.55495065",
"0.5544439",
"0.55348754",
"0.55153286",
"0.5510725",
"0.5484962"... | 0.724704 | 0 |
Handles changes in context requirements. | function handle_context_requirement_change(new_requirements)
{
do_limit_to_private_context = new_requirements.do_limit_to_private_context;
if (bookmarks.is_unlocked()) { update_in_active_tabs(); }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleContext(which)\n{\n}",
"onChange() {\n this.validate();\n this.triggerContextUpdate();\n }",
"contextDidChange() {\n this.currentModel = this.context;\n }",
"function updateContext() {\n\t// Switch the background image of the data – using an image to improve performance\n\tupdateCon... | [
"0.5875039",
"0.58027387",
"0.57515824",
"0.57396305",
"0.56789094",
"0.5643791",
"0.56181955",
"0.56167483",
"0.55604196",
"0.5553663",
"0.55231917",
"0.5441618",
"0.543086",
"0.53626764",
"0.5362574",
"0.5286099",
"0.5249536",
"0.5249189",
"0.52356976",
"0.5201681",
"0.5189... | 0.70118 | 0 |
int Read (Variant, int) | Read(Variant, int) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"read() {\n // Read next tag.\n let [op, arg] = this.read_tag();\n let object;\n switch (op) {\n case 0:\n // REF.\n object = this.refs[arg];\n if (object == undefined) throw \"Invalid reference\";\n break;\n\n case 1:\n // FRAME.\n object = this.read_... | [
"0.618375",
"0.59761727",
"0.59305143",
"0.592952",
"0.59285694",
"0.5915766",
"0.590815",
"0.58950937",
"0.5854459",
"0.5849154",
"0.58296466",
"0.57387483",
"0.57330793",
"0.57330793",
"0.57330793",
"0.57030797",
"0.57030797",
"0.57012224",
"0.56962276",
"0.5674986",
"0.567... | 0.9453856 | 0 |
Variant Seek (Variant, SpeechStreamSeekPositionType) | Seek(Variant, SpeechStreamSeekPositionType) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set seek(seek) {\n this.api.seek(seek)\n }",
"function seek(e){\n\t\tif(seeking){\n\t\t\tseekslider.value = parseFloat(e.clientX - seekslider.offsetLeft);\n\t\t\tconsole.log(typeof(seekslider.value));\n\t\t\tconsole.log(seekslider.value, audio.currentTime);\n\t\t\tseekto = audio.duration * (seekslider.value ... | [
"0.67855966",
"0.64898425",
"0.6470297",
"0.6363822",
"0.62680143",
"0.6207744",
"0.61076474",
"0.6101913",
"0.60133773",
"0.5937724",
"0.58602774",
"0.57194495",
"0.5717984",
"0.5716817",
"0.56992906",
"0.5677486",
"0.5673667",
"0.55967814",
"0.5558199",
"0.5527492",
"0.5502... | 0.92919314 | 0 |
fileName function: Allows req name to either include or exclude .html | function fileName(q_path) {
let fn = "." + q_path;
fn = fn.toString();
if (fn == './') {
fn = './index';
} else if (fn.substr(-5) == '.html') {
fn = fn.replace(".html", "");
};
fn = fn + ".html";
return fn;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addFlag() {\n const filename = arguments[0];\n const postfix = [].slice.call(arguments, 1).join('.');\n return filename.replace('.html', '.' + postfix + '.html');\n}",
"filename(req, file, cb) {\n cb(null, `${file.fieldname}-${Date.now()}${path.extname(file.originalname)}`)\n //path.extname() w... | [
"0.61398286",
"0.6007874",
"0.597217",
"0.58477664",
"0.5791354",
"0.56577045",
"0.56544363",
"0.5640918",
"0.5615426",
"0.5599294",
"0.55984247",
"0.5587807",
"0.55836844",
"0.55678463",
"0.55654746",
"0.5560452",
"0.5560452",
"0.5500145",
"0.54727983",
"0.5457544",
"0.54097... | 0.65783644 | 0 |
Current move being viewed | _getCurrentMove() {
const { moves } = this.props;
const moveIndex = this._getMoveIndex();
if (_.isEmpty(moves) || moveIndex === -1) {
return {};
} else {
return moves[moveIndex];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"showMoveMade(step) {\n const retrieveHistory = this.state.history[step];\n return retrieveHistory.moveMade;\n }",
"getMoveLocation() {\n return this.getLocationConfig(UpdateMode.move);\n }",
"getMoveNumber() {\n var c = ctrl;\n c.getHttpRequest('return_move');\n list.showActiveM... | [
"0.679673",
"0.6748171",
"0.65027076",
"0.6231644",
"0.61884624",
"0.6143058",
"0.6110799",
"0.61056906",
"0.60787225",
"0.6057527",
"0.60141164",
"0.59927666",
"0.59648955",
"0.59415185",
"0.5893496",
"0.588061",
"0.58668405",
"0.5849712",
"0.5832938",
"0.5830011",
"0.581072... | 0.70359623 | 0 |
_______________ Animating the spikes ___________________________________________ | function drawSpikes() {
// Redrawing the spieks everytime the leave the canvas at x = 0
if (spikes.desX + spikesImg.width <= 0)
{
spikes.desX = canvas.width;
}
// Making the spikes move smoothly along with the ground and background images
spikes.desX -= xv;
// A switch for each p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveSprikes() {\n setInterval(spikesComing, 4000);\n }",
"function shakeThecolorSpotter() {\n spotterContainer.animate([\n { transform: \"translateX(2px)\" },\n { transform: \"translateX(-2px)\", offset: 0.5 },\n { transform: \"translateX(0px)\" }\n ],\n ... | [
"0.68115145",
"0.6784755",
"0.6777688",
"0.66974497",
"0.6636101",
"0.66065246",
"0.66005075",
"0.6572518",
"0.65311664",
"0.6521975",
"0.6403963",
"0.6403753",
"0.639844",
"0.6384752",
"0.6369983",
"0.6368667",
"0.6312924",
"0.6304886",
"0.6297751",
"0.6282931",
"0.6277185",... | 0.7571246 | 0 |
____________ Function for checking collision between barrel and spikes _____________ | function isColliding() {
// Checks wether the image of spikes in every position except for 0 (Sheathed spikes) is below barrel
// and if the y value on the barrel is not touching the spikes at different levels for each case
if (j == 1 && (spikes.desX < barrel.desX + (barrel.w - 1)) && (spikes.desX + spikes.w > ba... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function collision(top_x, bottom_x, top_y, bottom_y) {\n\t\tfor (var i = 0; i < rows; i++) {\n\t\t\tfor (var j = 0; j < cols; j++) {\n\t\t\t\tvar b = bricks[j][i];\n\t\t\t\tif (b.exists == 1) {\n\t\t\t\t\tif (top_y < (b.y + block_height) && bottom_y > b.y && top_x < (b.x + block_width) && bottom_x > b.x) {\n\t\t\t... | [
"0.76089334",
"0.74563307",
"0.74365777",
"0.7419982",
"0.7360481",
"0.7336865",
"0.73217314",
"0.731794",
"0.7229438",
"0.72200286",
"0.7199683",
"0.7153965",
"0.71405494",
"0.71306545",
"0.70990866",
"0.7089369",
"0.70880115",
"0.70842564",
"0.70721895",
"0.7069544",
"0.706... | 0.82018757 | 0 |
Create a new empty texture. | function createEmptyTexture(gl, width, height) {
const texture = gl.createTexture()
gl.bindTexture(gl.TEXTURE_2D, texture)
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)
gl.texParameteri(gl.TEXTURE_2D, gl.TEXT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_createNewTexture(refTexture) {\n const texture = cloneTextureFrom(refTexture, {\n parameters: {\n [GL.TEXTURE_MIN_FILTER]: GL.NEAREST,\n [GL.TEXTURE_MAG_FILTER]: GL.NEAREST,\n [GL.TEXTURE_WRAP_S]: GL.CLAMP_TO_EDGE,\n [GL.TEXTURE_WRAP_T]: GL.CLAMP_TO_EDGE\n },\n pixelS... | [
"0.7223462",
"0.69364196",
"0.68558216",
"0.68144226",
"0.67030877",
"0.67030877",
"0.6679312",
"0.66365176",
"0.6539624",
"0.64944065",
"0.64543927",
"0.64160466",
"0.6407709",
"0.63859975",
"0.6351047",
"0.6348768",
"0.63332576",
"0.6329269",
"0.6257348",
"0.6221531",
"0.61... | 0.7203874 | 1 |
Create a new framebuffer object. | function createFramebuffer(gl, texture) {
const framebuffer = gl.createFramebuffer()
gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer)
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0)
return framebuffer
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initFramebuffer() {\n\n const gl = this.gl;\n\n // Create framebuffer object and texture.\n this.framebuffer = gl.createFramebuffer();\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer);\n this.framebufferTexture = new Texture(this.gl, this.size, gl.RGBA);\n\n // Creat... | [
"0.75230193",
"0.6601243",
"0.6600124",
"0.6532496",
"0.6401358",
"0.6383107",
"0.6370421",
"0.6370421",
"0.63255155",
"0.6251831",
"0.62499803",
"0.61779976",
"0.61709887",
"0.6143962",
"0.613829",
"0.61367345",
"0.60305864",
"0.5971671",
"0.5960588",
"0.5931407",
"0.5909105... | 0.68502903 | 1 |
Request the file at the given path. Returns a promise that resolves to a string of the file's contents. | function request(path) {
return new Promise((resolve, reject) => {
const request = new XMLHttpRequest()
request.open('GET', path)
request.responseType = 'text'
request.onload = () => {
if (request.status === 200) {
resolve(request.response)
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function retriveFile(path) {\n return new Promise((resolve, reject) => {\n var request = new XMLHttpRequest();\n request.open('GET', path, true);\n request.responseType = 'text';\n request.onload = () => resolve({\n fileData: request.response\n });\n request.onerror = reject;\n request.s... | [
"0.7809972",
"0.73602283",
"0.7161397",
"0.7101093",
"0.7017151",
"0.69743085",
"0.6934223",
"0.6926221",
"0.683686",
"0.6751397",
"0.66753906",
"0.6643945",
"0.6604826",
"0.65877134",
"0.6559096",
"0.65091103",
"0.65060925",
"0.6496854",
"0.6496633",
"0.64825374",
"0.6388092... | 0.7887979 | 0 |
Gets the expanded state string. | _getExpandedState() {
return this.expanded ? 'expanded' : 'collapsed';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toString() {\n\t\tvar state = {\n\t\t\tname: this._name,\n\t\t\torderer: this._orderer ? this._orderer._url : 'N/A'\n\t\t};\n\n\t\treturn JSON.stringify(state);\n\t}",
"toString() {\n return JSON.stringify({\n state: this.state,\n });\n }",
"toString() {\n return JSON.stringi... | [
"0.63273746",
"0.6244386",
"0.6244386",
"0.6244386",
"0.6244386",
"0.6163397",
"0.6041177",
"0.60285157",
"0.59751856",
"0.5913314",
"0.57853526",
"0.57853526",
"0.57853526",
"0.57853526",
"0.577366",
"0.55848193",
"0.5541905",
"0.5538639",
"0.55303174",
"0.552753",
"0.549092... | 0.7177445 | 0 |
Iterate over clients, store their credentials in DB with password hashed | function createAuthDB() {
clients.forEach(client => {
bcrypt.hash(client.password, saltRounds, (err, hash) => {
if (err) {
console.log(err);
} else {
authDB.push({
id: client.id,
password: hash
})... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getConnectedClients() {\n var connectedClients = []\n console.log(db.getData(\"/clients/\"))\n for (var client in db.getData(\"/clients/\")) {\n if (isConnected(client)) {\n connectedClients.push(client)\n }\n }\n return connectedClients\n}",
"function initializeS... | [
"0.5748523",
"0.5537588",
"0.5393129",
"0.5369489",
"0.5236794",
"0.5188181",
"0.51879424",
"0.51764035",
"0.5162004",
"0.5150361",
"0.5132069",
"0.5088361",
"0.50738734",
"0.50729364",
"0.5072188",
"0.5068646",
"0.5046306",
"0.504036",
"0.5029474",
"0.50209105",
"0.501923",
... | 0.75457525 | 0 |
How the mouse control the scrollbar | function mousemove(event) {
event.preventDefault();
event.stopPropagation();
var dist = event.clientY - clientY
, $that = $(this)
, top = $scrollbar.position().top;
clientY = event.clientY;
//$scrollbar.css({top: top + dist + 'px'});
scrolling.call($scrollbar, $this, dist, 1)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"e_mouseScroll(e)\n\t{\n\t\t\n\t}",
"function mouseOnScrollbar(){var clickOnScrollbar=false;if(ev&&ev.currentTarget.children.length>0){var child=ev.currentTarget.children[0];var hasScrollbar=child.scrollHeight>child.clientHeight;if(hasScrollbar&&child.children.length>0){var relPosX=ev.pageX-ev.currentTarget.getBo... | [
"0.7185195",
"0.68836105",
"0.68440783",
"0.6823696",
"0.6820511",
"0.67159927",
"0.6671179",
"0.66121733",
"0.6560931",
"0.6542613",
"0.6538105",
"0.6514054",
"0.6504577",
"0.6481593",
"0.6463204",
"0.6414658",
"0.63375354",
"0.62994874",
"0.62935096",
"0.6289916",
"0.628540... | 0.6916659 | 1 |
inint the showMsg function: called as showMsg.call($this, ....); userId: who send the messag imgExt: user's img extend name (e.g '.jpg') content: the message to be shown isSelf: boolean, true>the message will show on the right, else will show on the right | function initShowMsgFn() {
var $other = $template.filter('li.jhat-record-other');
var $self = $template.filter('li.jhat-record-self');
return function(userId, content, isSelf) {
var $msg = isSelf ? $self.clone(true) : $other.clone(true)
, $this = this
, $scroller = $this.find('ul.jhat-records')
, $out... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addImgFromUser(msgObj, isSelf)\n{\n var msgHtml = isSelf ? $('<div><div class=\"from-me\"><img src=\"#\" class=\"imgBox\"></img></div><img src=\"#\" class=\"mychatAvator\"><div class=\"clear\"></div></div>') :\n $('<div><img src=\"#\" class=\"otherchatAvator\"><div class=\"from-the... | [
"0.72944915",
"0.70381",
"0.69922113",
"0.69588643",
"0.6953931",
"0.67123395",
"0.6689954",
"0.65723073",
"0.64803195",
"0.6475161",
"0.64099705",
"0.63773984",
"0.63716424",
"0.6338331",
"0.6338331",
"0.63056415",
"0.63029456",
"0.63018733",
"0.6300631",
"0.6298921",
"0.626... | 0.72037226 | 1 |
V2 Functions Requirements // It should have a function to display todos | function displayTodos() {
console.log('My todos:' , todos);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayTodos() {\n console.log(\"My todos:\", todos);\n}",
"function displayTodos() {\n console.log(\"My Todos: \", todos);\n}",
"function displayTodos() {\n console.log('My Todos:',todos)\n}",
"function displayTodos() {\n\tconsole.log('My todos: ', todos);\n}",
"function displayTodos() {\r\n ... | [
"0.74467516",
"0.72721356",
"0.72156507",
"0.72069764",
"0.717367",
"0.71285856",
"0.7101611",
"0.6789679",
"0.6776541",
"0.6673918",
"0.66236037",
"0.65982425",
"0.6563282",
"0.65511745",
"0.6543522",
"0.6530317",
"0.65003216",
"0.64753044",
"0.64744014",
"0.6463962",
"0.645... | 0.7355265 | 1 |
It should hava a function to add todos | function addTodos(todo) {
todos.push(todo);
displayTodos();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addTodos(todo) {\n todos.push(todo)\n displayTodos()\n}",
"function addTodo() {\n\ttodos.push('new todos');\n}",
"function addTodo(){\n \n const _todoList = [...todoList];\n _todoList.push({todo:createTodo, status :0});\n //setTodoList(_todoList);\n sortList(_todoL... | [
"0.80236065",
"0.79514956",
"0.7920295",
"0.7865725",
"0.7771715",
"0.77710027",
"0.77356285",
"0.77261037",
"0.7628105",
"0.76169425",
"0.7598592",
"0.75910324",
"0.75849783",
"0.75791365",
"0.75783485",
"0.75115573",
"0.7490055",
"0.7466742",
"0.7443372",
"0.7425109",
"0.74... | 0.7983892 | 1 |
when range diamater is changed, then need to reload the gazetteer layer | function reloadDimaterRange() {
var min = parseFloat(minSlider);
var max = parseFloat(maxSlider);
if (min < MIN_DIAMETER) {
alert("Min diameter must be greater than 0!");
return false;
} else if (max > MAX_DIAMTER) {
alert("Max diameter must b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onSetRangeRings() {\n // Save state to localStorage\n localStorage.setItem('SiteCirclesCount', parseFloat($(\"#range_ring_count\").val().trim()));\n localStorage.setItem('SiteCirclesBaseDistance', parseFloat($(\"#range_ring_base\").val().trim()));\n localStorage.setItem('SiteCirclesInterval', ... | [
"0.6326719",
"0.62667894",
"0.61936736",
"0.61072576",
"0.5979419",
"0.5950448",
"0.5943999",
"0.58838564",
"0.5856763",
"0.5839701",
"0.58212626",
"0.5770929",
"0.57510555",
"0.57381016",
"0.5711487",
"0.56997955",
"0.5694004",
"0.5675279",
"0.5660867",
"0.5653093",
"0.56393... | 0.70149946 | 0 |
make array of place markers and add it on Gazetteer layer | function addPlaceMarks() {
// first init layer
if (gazetteerLayer == null) {
gazetteerLayer = new WorldWind.RenderableLayer("GazetteerLayer");
for (var i = 0; i < availableRegionsCSV.length; i++) {
// create a marker for each point
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createMarkers(places, map) {\n\n var bounds = new google.maps.LatLngBounds();\n\n for (var i = 0, place; place = places[i]; i++) {\n var image = {\n url: place.icon,\n size: new google.maps.Size(71, 71),\n ... | [
"0.70198065",
"0.70015645",
"0.6881752",
"0.68644917",
"0.68615186",
"0.6816251",
"0.68100756",
"0.6805114",
"0.6802232",
"0.6770535",
"0.675547",
"0.6742659",
"0.67389876",
"0.6716204",
"0.6696516",
"0.6693059",
"0.66922057",
"0.6690633",
"0.668979",
"0.6672111",
"0.6665098"... | 0.7619532 | 0 |
Constructs a new `DFAState`. | function DFAState(configs) {
(0, _classCallCheck2["default"])(this, DFAState);
this.stateNumber = -1;
this.configs = configs;
this.edges = new Map();
this.contextEdges = new Map();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DFAState(stateNumber, configs) {\n\tif (stateNumber === null) {\n\t\tstateNumber = -1;\n\t}\n\tif (configs === null) {\n\t\tconfigs = new ATNConfigSet();\n\t}\n\tthis.stateNumber = stateNumber;\n\tthis.configs = configs;\n\t// {@code edges[symbol]} points to target of symbol. Shift up by 1 so (-1)\n\t// {... | [
"0.6937418",
"0.6937418",
"0.6466735",
"0.5877775",
"0.58537227",
"0.57996285",
"0.57996285",
"0.565744",
"0.54227746",
"0.5371671",
"0.5349591",
"0.5330748",
"0.5298402",
"0.52363604",
"0.52363604",
"0.5214269",
"0.5209149",
"0.5209149",
"0.5209149",
"0.5209149",
"0.5209149"... | 0.72475344 | 0 |
Multiples callbacks llamados en determinados casos | function multiplesCallbacks(callback1, callback2, callback3){
callback1('Primer paso');
callback2('Segundo paso');
callback3('Ultimo paso');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"runCallbacks(event, data, requestInfo, additionalData) {\n let callbacksToRun = this.callbacks[event];\n\n if (callbacksToRun) {\n for (let callback of callbacksToRun) {\n callback(data, requestInfo, additionalData);\n }\n }\n }",
"runCallbacks(){\n if(this.state == 'FULLFILLED'... | [
"0.62579304",
"0.6231357",
"0.62005484",
"0.61869705",
"0.59345365",
"0.59020585",
"0.5880923",
"0.5867849",
"0.5849265",
"0.58384585",
"0.5740304",
"0.57362854",
"0.5714768",
"0.5714768",
"0.5714768",
"0.5714768",
"0.5714768",
"0.5699816",
"0.56757504",
"0.56604815",
"0.5635... | 0.674124 | 1 |
implementation of reduce function | function myreduce(arr,cb,acc){
for(var i=0;i<arr.length;i++){
acc=cb(acc,arr[i])
}
return acc
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function myReduceFunc() {\n \n\n\n}",
"function reduce (a, f, x) {\n for (var i = 0; i < a.n; i++) x = f(x, a[i]);\n return x;\n}",
"function Array$prototype$reduce(f, initial) {\n var acc = initial;\n for (var idx = 0; idx < this.length; idx += 1) acc = f (acc, this[idx]);\n return acc;\n }",
"... | [
"0.76853675",
"0.73932314",
"0.7330556",
"0.72821665",
"0.7239816",
"0.7238836",
"0.7196681",
"0.71302617",
"0.71283644",
"0.7113872",
"0.70953095",
"0.7083652",
"0.7075568",
"0.70612216",
"0.70521396",
"0.7051662",
"0.70380336",
"0.70187545",
"0.70112354",
"0.69936615",
"0.6... | 0.75844926 | 1 |
Gets the regex match pattern for finding database string tags. | getTagPatternDb() {
const start = escapeRegex(DB_TAG_START);
const end = escapeRegex(DB_TAG_END);
const type = escapeRegex(TAG_TYPE_ATTR_NAME);
return new RegExp(`${start}(?=\\s${type}=).+?(?<=\\s)${end}`, 'gi');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function RegExpPattern(){\n\t//\n}",
"static _tag_35(v) {\n\t return new RegExp(v)\n\t }",
"function getSubtagPattern( subtag ) {\n\t\t\tfor (var pattern in subtagRegexes) { // These regexes are mutually exclusive, so order is immaterial\n\t\t\t\tif (subtagRegexes[pattern].test(subtag)) {\n\t\t\t\t\treturn... | [
"0.58885896",
"0.5654668",
"0.5654114",
"0.5627484",
"0.5508858",
"0.54941994",
"0.54622877",
"0.5434217",
"0.5434217",
"0.5349397",
"0.5349397",
"0.5349397",
"0.5332717",
"0.53222126",
"0.52116615",
"0.520258",
"0.520053",
"0.5086581",
"0.5070381",
"0.50567555",
"0.50567555"... | 0.8100153 | 0 |
Puts each person on their respective card and adds functionality to the card | function createCard(people) {
// Puts each person's information on their respective card
for (let i = 0; i < cards.length; i++) {
cards[i].querySelector('img').src = people[i].picture.large;
cards[i].querySelector('h3').textContent = `${people[i].name.first} ${people[i].name.last}`;
cards[i].querySelec... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addAllCards() {\r\n for (var i = 3; i < profileData.allnames.length; i++){\r\n let newProfile = new Profile(profileData.allnames[i],\r\n profileData.allage[i],\r\n profileData.alltitles[i],\r\n profileData.all... | [
"0.6916762",
"0.6897594",
"0.68088925",
"0.6791753",
"0.6688021",
"0.6643384",
"0.651829",
"0.6493359",
"0.647577",
"0.64679366",
"0.6436789",
"0.6428617",
"0.63770086",
"0.636386",
"0.6353357",
"0.6332277",
"0.6331978",
"0.6316199",
"0.62966925",
"0.62835854",
"0.6278075",
... | 0.7002839 | 0 |
Only shows the people who have names that contain the search value, and creates a list of people who have been searched | function checkSearch() {
searchPeople = [];
for (let i = 0; i < cards.length; i++) {
if (`${people[i].name.first} ${people[i].name.last}`.includes(searchInput.value)) {
cards[i].style.display = '';
searchPeople.push(people[i]);
} else {
cards[i].style.display = 'none';
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function searchCoffeeNames(e) {\n e.preventDefault();\n var userCoffeeName = document.getElementById(\"user-search\").value;\n var filteredNames = [];\n coffees.forEach(function(coffee) {\n\n if(coffee.name.toLowerCase().includes(userCoffeeName.toLowerCase())){\n filteredNames.pus... | [
"0.738702",
"0.73751193",
"0.7231882",
"0.7222967",
"0.71801656",
"0.712515",
"0.7124034",
"0.71179724",
"0.70729876",
"0.7013684",
"0.700427",
"0.6998716",
"0.69949996",
"0.69931006",
"0.6878925",
"0.6821023",
"0.68164533",
"0.6793207",
"0.679194",
"0.6782051",
"0.6767074",
... | 0.74850166 | 0 |
url (required) the url you are requesting data from elementID the html element id to fill (innerHTML) with returned data globalVar name of global variable to fill with returned data confirmMessage popup message for user, yes/no hideEmpty boolean set id display to none for empty data set callback function to call after ... | function makeRequest (url, elementID, confirmMessage, hideEmpty, callback) {
var params = [];
params['url'] = url;
params['elementID'] = elementID;
params['confirmMessage'] = confirmMessage;
params['hideEmpty'] = hideEmpty;
params['callback'] = callback;
var ajax = new amsAjax(params);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function view_details(value_passed){\nvar current_id=document.getElementsByClassName('hidden_value')[value_passed].value;\n$.ajax({\nmethod: \"GET\",\nurl: \"http://localhost:3000/user/\"+current_id,\n \n})\n.done(function( msg ) {\n let innerForm=\n \"<p><input type=\\\"hidden\\\" class=\\\"update_text\\\" id=\... | [
"0.59783834",
"0.59509265",
"0.5881973",
"0.58366597",
"0.58132386",
"0.57824695",
"0.5774633",
"0.57607126",
"0.57473713",
"0.57337976",
"0.57325715",
"0.5728424",
"0.57104313",
"0.5691238",
"0.5653515",
"0.5636748",
"0.56270254",
"0.56171453",
"0.5591064",
"0.5588811",
"0.5... | 0.6344887 | 0 |
helping functions find container containing a mineral, not just energy | function findMineralContainer(creep, resourceType){
var terminal = creep.room.terminal;
//creep.say('minCon: '+resourceType);
//console.log(resourceType);
for(var i = 0; i < containerIDs.length; i++){
container = Game.getObjectById(containerIDs[i]);
//creep.say(ter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLowestContainer(creep) {\n var before=2000;\n var result;\n for(var i = 0; i < containerIDs.length; i++) {\n var container = (Game.getObjectById(containerIDs[i]));\n if(container.store[RESOURCES_ALL] <= before) { //GEÄNDERT UM NUR ENERGY ZU BEKOMMEN\n before = con... | [
"0.70669407",
"0.6243811",
"0.5595167",
"0.5486552",
"0.5457004",
"0.52641445",
"0.5259052",
"0.5242655",
"0.5199522",
"0.51745355",
"0.51637304",
"0.51389825",
"0.5110298",
"0.5109853",
"0.5107881",
"0.50540876",
"0.5035076",
"0.502567",
"0.50236046",
"0.49951327",
"0.499336... | 0.7358902 | 0 |
highest tower returns cotainer > maxFill% | function getHighestTower(creep) {
var result;
var before=0;
for(var i = 0; i < towerIDs.length; i++) {
var tower = Game.getObjectById(towerIDs[i]);
if(tower.energy>= before) { //GEÄNDERT UM NUR ENERGY ZU BEKOMMEN
before = tower.energy;
result = tower;
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillUp(creep, towerOrContainer) {\n //var highest = undefined;\n \n if(towerOrContainer=='container') {\n var highest = getHighestContainer();\n \n if(highest.transfer(creep, RESOURCES_ALL, creep.carryCapacity) == ERR_NOT_IN_RANGE) {\n creep.moveTo(highest, {reuseP... | [
"0.6341523",
"0.58328015",
"0.5778528",
"0.5630242",
"0.5625059",
"0.5611042",
"0.56052846",
"0.55862886",
"0.55395406",
"0.55041003",
"0.55000764",
"0.5484399",
"0.5481938",
"0.54801136",
"0.54719925",
"0.5457764",
"0.5443379",
"0.5431755",
"0.54258364",
"0.54222643",
"0.541... | 0.5862032 | 1 |
display markers function for nearby store locations relative to searched location. Begin storeMarker function | function storeMarkers() {
$.ajax({
url: queryURL,
method: "GET"
}).then(function (response) {
var JSONObject = JSON.parse(response);
var stores = JSONObject.stores;
for (var i = 0; i < s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function geocodeAddress(geocoder, resultsMap) {\n\n var address = document.getElementById('location-input').value;\n\n geocoder.geocode({ 'address': address }, function (results, status) {\n if (status === 'OK') {\n resultsMap.setCenter(results[0].geometry.location);\n\n ... | [
"0.689907",
"0.68806285",
"0.68450284",
"0.68406904",
"0.68076754",
"0.67890525",
"0.6747671",
"0.67391723",
"0.67348653",
"0.6728247",
"0.6669024",
"0.66545033",
"0.6645162",
"0.6621318",
"0.66109085",
"0.66109085",
"0.66088533",
"0.6606205",
"0.65880895",
"0.6577684",
"0.65... | 0.7131496 | 0 |
helper function of checking a value is perfect square, if yes return true. | function isPerfectSquare(value) {
var result = false;
var sqrt = Math.floor(Math.sqrt(value));
result = value == sqrt * sqrt;
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isPerfectSquare(x){\n\tvar root = Math.sqrt(x);\n\treturn Number.isInteger(root);\n}",
"function isPerfectSquare(input) {\n // Square numbers are non-negative\n if (input < 0) return false;\n\n let count = 0;\n while (true) {\n const squared = count * count;\n if (input === squared) {\n r... | [
"0.78868407",
"0.77442634",
"0.76767796",
"0.7574018",
"0.74198335",
"0.7268053",
"0.7199801",
"0.71892273",
"0.71275616",
"0.7113046",
"0.7079575",
"0.6978033",
"0.67881227",
"0.6743936",
"0.6615547",
"0.65455973",
"0.6526596",
"0.6525482",
"0.6508112",
"0.64751863",
"0.6471... | 0.8461006 | 0 |
Simple wrapper around an Axios call to get extended patient detail and display it. | function getPatientAsJson() {
axios.get('/patient/2Y9ovLbO93RUekOOu75TV5')
.then(response => {
if (response['error']) {
console.log(response['error']);
} else {
$(document)
.ready(() => {
// Switched b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get_diagnosis(symptoms, gender, year_of_birth, div_id) {\n var data = {\"language\": this.lang, \"format\": \"json\",\n \"symptoms\": JSON.stringify(symptoms), \"gender\": gender,\n \"year_of_birth\": year_of_birth.toString()}\n\n axios.get(this.url + \"diagnosis\", {hea... | [
"0.6180492",
"0.5868167",
"0.56442106",
"0.5642627",
"0.5595089",
"0.55719274",
"0.5482776",
"0.54825455",
"0.5465129",
"0.5434185",
"0.5402838",
"0.53903526",
"0.53882104",
"0.5352271",
"0.5315777",
"0.5307871",
"0.53071773",
"0.5289626",
"0.52142566",
"0.5213049",
"0.520748... | 0.5880408 | 1 |
Add icon to weather div | function addIcon(object) {
// get icon code from object
const iconCode = object.weather[0].icon;
const iconUrl = `http://openweathermap.org/img/w/${iconCode}.png`;
const newIcon = document.createElement('img');
newIcon.setAttribute('src', iconUrl);
newIcon.classList.add('conditions');
const conditionsText = document.cr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function attachIcon (){ \n var iconID= data.current.weather[0].icon;\n\n var iconURL= \"https://api.openweathermap.org/img/w/\" + iconID + \".png\"\n \n $('#weather-icon').attr('src', iconURL);\n $('#weather-icon').attr('alt', data.current.weather.description);\n}",
"function renderIcon(currentWea... | [
"0.7877688",
"0.7491315",
"0.73906386",
"0.7331363",
"0.71028763",
"0.70957434",
"0.7061739",
"0.7058813",
"0.7053523",
"0.70456845",
"0.70435536",
"0.7033873",
"0.70289516",
"0.70033187",
"0.6977095",
"0.6945434",
"0.6910215",
"0.690757",
"0.68949825",
"0.6837064",
"0.682946... | 0.752711 | 1 |
adds whatever data is passed to the weather div | function addToWeather(data) {
const newData = document.createElement('h2');
newData.textContent = data;
weatherDiv.append(newData);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayWeather( weather ) {\n $( \"#weather\" ).show();\n $( \"#weather\" ).html(\n $( \"<div class=temperature id=weather-temp>\" ).text( weather.currently.temperature.toFixed() + \"°F\" )\n );\n $( \"#weather\" ).append(\n $( \"<div class=details id=weather-details>\" )\n );... | [
"0.7220803",
"0.7173031",
"0.7167858",
"0.7165182",
"0.7164104",
"0.71565247",
"0.7100703",
"0.7076844",
"0.7062132",
"0.70462924",
"0.70428663",
"0.70421153",
"0.7037109",
"0.70237505",
"0.70096236",
"0.70082897",
"0.70042795",
"0.69906765",
"0.69747525",
"0.69670856",
"0.69... | 0.717387 | 1 |
check to see if any animation containers are currently in view | function check_if_in_view() {
//get current window information
var window_height = web_window.height();
var window_top_position = web_window.scrollTop();
var window_bottom_position = (window_top_position + window_height);
//iterate through elements to see if its in view
$.each(animation_element... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_if_in_view() {\n //get current window information\n var window_height = web_window.height();\n var window_top_position = web_window.scrollTop();\n var window_bottom_position = (window_top_position + window_height);\n\n //iterate through elements to see if its in view\n ... | [
"0.74753255",
"0.74157524",
"0.7351285",
"0.6987511",
"0.6747944",
"0.67368567",
"0.6694213",
"0.6644134",
"0.6632564",
"0.66202426",
"0.6550476",
"0.65072775",
"0.6457474",
"0.6393178",
"0.63799787",
"0.635903",
"0.63508785",
"0.6262158",
"0.62334955",
"0.6219847",
"0.619200... | 0.74495655 | 1 |
every number occurs exactly two times. If true, return true, otherwise false. Your solution should not modify the input array. | function twins(myArray){
var copy= myArray.slice();
copy.sort();
for(let i=1;i<=copy.length;i++){
if(i%2==1){
if(copy[i]!=copy[i-1]){return false};
if(copy[i]==copy[i+1]){return false};
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function twin(array){\n for(var i = 0; i < array.length; i+=2){\n if(array[i]!== array[i+1]){\n return false;}\n }return true;\n}",
"function isNice (arr) {\n return arr.length === 0 ? false : arr.every(n => arr.includes(n - 1) || arr.includes(n + 1));\n}",
"function hasOnlyOddNumbers(array... | [
"0.7268023",
"0.7182888",
"0.7079192",
"0.7062104",
"0.70604986",
"0.7028549",
"0.69920594",
"0.69326174",
"0.6887762",
"0.68680555",
"0.6801897",
"0.67426527",
"0.6642654",
"0.6637617",
"0.662928",
"0.65823406",
"0.6564241",
"0.6553969",
"0.65360117",
"0.65288305",
"0.652383... | 0.7233886 | 1 |
Converts total numbers of minutes remaining to proper format and adds to HTML | function displayTime(totalMins) {
const hours = Math.floor(totalMins / 60);
const mins = Math.ceil(totalMins - hours * 60);
$('#group-duration').html(hours + " hr " + mins + " min remaining");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function formatTime (totalMinutes) {\n let hours = Math.floor(totalMinutes / 60);\n let minutes = totalMinutes % 60;\n \n if (hours > 23) {\n hours = hours - 24;\n }\n \n if (hours < 0) {\n hours = 24 + hours;\n }\n \n if (minutes < 0) {\n minutes = 60 + minutes;\n }\n \n return hours + ' ' +... | [
"0.72153455",
"0.7182969",
"0.71315295",
"0.70943767",
"0.70524347",
"0.69699144",
"0.69545877",
"0.6935521",
"0.6865546",
"0.6812957",
"0.6755709",
"0.67238873",
"0.67186636",
"0.67168885",
"0.6690478",
"0.66802603",
"0.6567952",
"0.656437",
"0.65556204",
"0.6546101",
"0.654... | 0.773231 | 0 |
Analyze ciphertext to see if ECB mode can be detected. Looks for repeated blocks. If plaintext can be chosen, call with with a repeated sequence of characters 3 x blocksize in length. | function detectECBMode(ciphertext){
var matchCount = 0;
const blocks = getBlockArray( ciphertext, 16 );
for( var i=0; i<blocks.length; i++ ){
for( var j=i+1; j<blocks.length; j++ ){
if( blocks[i].compare(blocks[j]) == 0 ){
matchCount++;
//console.log(`Bloc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function guessEncryption(encryptionFunction) {\n if(!encryptionFunction) { //should return encrypted data and mode used ( for sanity checks )\n encryptionFunction = encryptUnknownKey;\n }\n //64 bytes of As\n let plaintext = \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\"\n var ECB = 0... | [
"0.6518797",
"0.618354",
"0.618354",
"0.5354055",
"0.5057729",
"0.47671095",
"0.4737426",
"0.47312468",
"0.4658995",
"0.4586328",
"0.45299762",
"0.45248047",
"0.45094946",
"0.45085707",
"0.45074433",
"0.45010355",
"0.44989282",
"0.44478443",
"0.44416225",
"0.4418321",
"0.4370... | 0.6524485 | 0 |
set 'owner' property of state.newcar to the '_id'(ObjectId) of the user | componentDidMount(){
let carowner = getUser()
let car = {
owner:carowner._id
}
this.setState({
newcar:car
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"changeOwner(newOwner){\n this.owner = newOwner;\n }",
"takeOwnership()\n\t{\n\t\tthis.ownerRef.set(this.syncSys.clientId);\n\n\t\t//clear our ownership if we disconnect\n\t\t//this is needed if we are the last user in the room, but we expect people to join later\n\t\tthis.ownerRef.onDisconnect().set(null);\n... | [
"0.7223513",
"0.6357214",
"0.63350964",
"0.62494767",
"0.61544687",
"0.61290276",
"0.60139275",
"0.5978959",
"0.59608895",
"0.59553725",
"0.59028035",
"0.5813196",
"0.58015",
"0.58015",
"0.58015",
"0.58015",
"0.58015",
"0.58015",
"0.58015",
"0.58015",
"0.58015",
"0.58015",
... | 0.697286 | 1 |
======================= FUNCIONES ======================== Crea un directorio | function crearDirectorio(directorio) {
return new Promise(function(resolve, reject) {
fs.stat(directorio, function(error, stats) {
// Si no existe el directorio, lo creamos
if (error && !stats) {
fs.mkdir(directorio, function(error) {
// Si hay un error, se rechaza la promesa.
if (error) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createDirectory() {\n\t\t// Check if create dir is posible\n\t\tif (dir_content.inf.is_writable != 1) return alert(msg.writeProtectTitle);\n\n\t\tvar newDir = prompt(msg.enterNewDirNameStr, msg.defaultNewDirNameStr);\n\t\tif (newDir) {\n\t\t\tshowLoading();\n\t\t\tsendXMLHttpReq(req_url, {\n\t\t\t\tmode: ... | [
"0.7117508",
"0.7046112",
"0.7043566",
"0.7029658",
"0.7020921",
"0.6987445",
"0.695111",
"0.6840926",
"0.67904073",
"0.6786623",
"0.6730866",
"0.6705832",
"0.6688175",
"0.6687053",
"0.6657857",
"0.66333604",
"0.6497663",
"0.6492647",
"0.6458456",
"0.64520174",
"0.6449374",
... | 0.7103024 | 1 |
adds the hookfunctions to the collections prototype this runs only once | function _applyHookFunctions(collection) {
if (hooksApplied) return; // already run
hooksApplied = true;
var colProto = Object.getPrototypeOf(collection);
HOOKS_KEYS.forEach(function (key) {
HOOKS_WHEN.map(function (when) {
var fnName = when + ucfirst(key);
colProto[fnName] = function (fun, pa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_initHooks() {\n for (let hook in this.opts.hooks) {\n this.bind(hook, this.opts.hooks[hook]);\n }\n }",
"bindHooks() {\n //\n }",
"function ElementHookCollection() {\n /**\n * @type {Function[]}\n */\n this.onElementReferenceSetCallbacks = [];\n /**\n * @ty... | [
"0.6935692",
"0.6618215",
"0.6601126",
"0.63668644",
"0.63641536",
"0.63612896",
"0.6328751",
"0.6328751",
"0.6300417",
"0.62599313",
"0.6186216",
"0.6113219",
"0.6056367",
"0.6016484",
"0.59948075",
"0.5983407",
"0.5954118",
"0.589485",
"0.58942133",
"0.5883056",
"0.58651805... | 0.7032145 | 0 |
Account functions: load, create, delete, transfer Initialize the select elements (Materialize method) | function initAccountSelects() {
const accountSelects = document.querySelectorAll('.account-select');
M.FormSelect.init(accountSelects);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() {\n this.construirSelect();\n }",
"function select() {\n const select = document.querySelectorAll('select');\n M.FormSelect.init(select);\n}",
"function getSetor(id, inputType) {\r\n // $('#setor-form').empty();\r\n\r\n $.ajax({\r\n type: \"GET\",\r\n url: u... | [
"0.6236889",
"0.6201581",
"0.61511594",
"0.6147963",
"0.6111267",
"0.60846776",
"0.60777044",
"0.60492533",
"0.60469973",
"0.6016416",
"0.5976629",
"0.5974823",
"0.5963804",
"0.5920362",
"0.590742",
"0.59070736",
"0.58818334",
"0.58789116",
"0.5872062",
"0.5860191",
"0.585913... | 0.6839878 | 0 |
Use of this source code is governed by a BSDstyle license that can be found in the LICENSE file. Sets up for directory tree context menu test. In addition to normal setup, we add destination directory. | function setupForDirectoryTreeContextMenuTest() {
var windowId;
return setupAndWaitUntilReady(
null, RootPath.DOWNLOAD).then(function(results) {
windowId = results.windowId;
// Add destination directory.
return new addEntries(['local'], [
new TestEntryInfo(
EntryType.DIRECTORY, nu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function setupForDirectoryTreeContextMenuTest() {\n const appId = await setupAndWaitUntilReady(RootPath.DOWNLOADS);\n\n // Add destination directory.\n await addEntries(['local'], [new TestEntryInfo({\n type: EntryType.DIRECTORY,\n targetPath: 'destination',\n ... | [
"0.8264015",
"0.6116908",
"0.6031735",
"0.5997652",
"0.57949185",
"0.5606583",
"0.55668414",
"0.5537507",
"0.5534278",
"0.5394702",
"0.53604925",
"0.53526014",
"0.53419673",
"0.53289557",
"0.52547854",
"0.5244341",
"0.52254677",
"0.52225006",
"0.52223754",
"0.5208548",
"0.518... | 0.8186871 | 1 |
Expands download volume in directory tree. | function expandDownloadVolumeInDirectoryTree(windowId) {
return expandTreeItemInDirectoryTree(
windowId, '[volume-type-for-testing="downloads"]');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function expandAllDirectories() {\n collapsedDirectoryPaths.clear();\n refreshExpandedState();\n}",
"function recursiveExpand(motherUl){\n\n\t\t\tvar arrayLis = motherUl.children(\".directory\");\n\n\t\t\t$.each (arrayLis, function(lp){\n\n\n\t\t\t\tif (\"/\" + arrayUri[s] == $(arrayLis[lp]).children(\"spa... | [
"0.55996937",
"0.5232685",
"0.5195013",
"0.5168193",
"0.49949172",
"0.4963713",
"0.48369744",
"0.48238006",
"0.47772425",
"0.475689",
"0.47125193",
"0.47118238",
"0.46478105",
"0.4639849",
"0.46345899",
"0.46281382",
"0.46266776",
"0.46156612",
"0.4614604",
"0.46100667",
"0.4... | 0.6486292 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.