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
Give the top associations, find the best one across all unique phenotypes available.
topAssociations() { // Filter by ancestry if one is provided let data = this.$store.state.ancestry == "" ? this.$store.state.topAssociations.data : this.$store.state.ancestryTopAssoc.data; let assocMap = {}; for (let i in data) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findBest() {\n if (minFitness) this.parentPop.sort(compareFitnessInc);\n else this.parentPop.sort(compareFitnessDec);\n bestSong = this.parentPop[0];\n }", "findBest () {\n if (!this.isValid || this.pieces.length < 3)\n return this.selector\n\n // Try the first and last...
[ "0.5720524", "0.5496428", "0.5491711", "0.5483065", "0.5469595", "0.54079616", "0.5359441", "0.5358358", "0.5304456", "0.5183946", "0.5134955", "0.510377", "0.5074726", "0.5068393", "0.5052344", "0.5044945", "0.50416595", "0.5024665", "0.4985692", "0.49843398", "0.49809316", ...
0.5638597
1
Problem 4: Deep comparison
function deepEqual(obj1, obj2) { // Your code here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deep_compare(a, base) {\n for (var i = 0; i < a.length; i++)\n if (a[i] != base[i])\n return false;\n return true;\n}", "function deepEqual(a,b) \n{\n//two inputs ob ojects\n\tif (a === b) return true; //this is true when these share same value prop.\n\tif (a == null || typeof ...
[ "0.61389506", "0.60906106", "0.60609895", "0.59983194", "0.59710824", "0.5967591", "0.58972985", "0.58972985", "0.5878766", "0.5852861", "0.583725", "0.58237857", "0.5813898", "0.5809628", "0.5804425", "0.57964385", "0.57964385", "0.5774665", "0.5757461", "0.57553506", "0.574...
0.62017894
0
create regex from start and end tags
function getInjectorTagsRegExp (starttag, endtag) { return new RegExp('([\t ]*)(' + escapeForRegExp(starttag) + ')(\\n|\\r|.)*?(' + escapeForRegExp(endtag) + ')', 'gi'); //return new RegExp('(' + escapeForRegExp(starttag) + ')(\\n|\\r|.)*?(' + escapeForRegExp(endtag) + ')', 'gi'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function task5 () {\n let str = ' some fdkaf;j <> <a href=\"/\"> sdfasdf <input type=\"radio\" checked> <b>';\n let filterTags = /<.+?>/gi\n let filterTagsU = /<[^>]+>/gi\n\n console.log(str.match(filterTags))\n console.log(str.match(filterTagsU))\n}", "function tag(element) {\n return new RegExp('\\<' + e...
[ "0.6264951", "0.60889244", "0.59937364", "0.5804714", "0.5681516", "0.5590306", "0.5539453", "0.55212283", "0.54804605", "0.5467228", "0.5457114", "0.54181653", "0.54175687", "0.54168755", "0.5406815", "0.5400379", "0.5372395", "0.5300922", "0.5294791", "0.52798647", "0.52658...
0.69928
0
receives the URL of status.json, and starts running the updater to repeatedly fetch from status.json; this may be overridden to integrate with any UI
function _defaultHandleStatusUrl(data) { console.log(data); statusUrl = "//export.mapknitter.org" + data; opts.updater = opts.updater || _defaultUpdater; // repeatedly fetch the status.json updateInterval = setInterval(function intervalUpdater() { $.ajax(statusUrl + "?" + Date.now...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update()\n\t{\n\t setNavBarState({buttonDisabled: true});\n\t\t\n\t fetch('/api/get_script_status').then(res => res.json()).then(data => {\n\n\t\t//If our script is not currently \"Running\", then we start it.\n\t if (data.hasOwnProperty('status') === false || data[0]['status'] !== \"Running\...
[ "0.6393218", "0.6251357", "0.62387645", "0.6162694", "0.6162694", "0.6058995", "0.60364115", "0.60192126", "0.6009619", "0.5971089", "0.5962603", "0.59530437", "0.58264846", "0.58132404", "0.5768143", "0.57639503", "0.5760176", "0.57585144", "0.57524985", "0.57382727", "0.572...
0.7020745
1
Declare function 'printHTML' and print to standard output
function printHTML (html) { console.log(html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printHTML() {\n\t\tif (notReady()) { return; }\n\t\t\n\t\t// Preserve formatting for white spaces, etc.\n\t\tvar colA = fixHTML('<h2>* QZ Print Plugin HTML Printing *</h2>');\n\t\tcolA = colA + '<color=red>Version:</color> ' + qz.getVersion() + '<br />';\n\t\tcolA = colA + '<color=red>Visit:</color> htt...
[ "0.74426246", "0.70152056", "0.696996", "0.6790534", "0.6778555", "0.6580895", "0.63470745", "0.63276494", "0.62760675", "0.6156658", "0.6146504", "0.61135024", "0.61121583", "0.6013871", "0.60082126", "0.5988529", "0.59630334", "0.5954961", "0.59395385", "0.5905323", "0.5888...
0.78208613
1
Parameter: category: category name number: number of images for category, or <0 if current number should be increased by one
updateCategoryButton(category, number) { var button = $("#categories .btn").filter(function () { return this.value == category; })[0]; var value = $(button).children().text().replace(/\D/g, ""); $(button).children().remove(); var numberDiv = document.createElement("div"); numberDiv.id = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCategory(cat) {\n\tcategory = cat;\n\tdisplayPic(1);\n}", "function postImage(category) {\n\n switch (category){\n case \"Home\":\n return imgArr[0];\n case \"Cars\":\n return imgArr[1];\n case \"Pets\":\n return img...
[ "0.64057624", "0.6292197", "0.6229797", "0.6206538", "0.6204315", "0.6183203", "0.61469626", "0.6101287", "0.6036749", "0.6025645", "0.59707904", "0.5934005", "0.58248127", "0.5804082", "0.57570165", "0.57488805", "0.56213856", "0.5608633", "0.5592568", "0.5574892", "0.555202...
0.63657135
1
When the user presses the delete match button, an AJAX request is sent to the server to delete the users from each other's matches, and the Send Message and Delete Match buttons are replaced with a Request Match button
function deleteMatch(id) { let csrftoken = Cookies.get('csrftoken'); $.ajax({ url: '/deleteMatch/', type: 'POST', beforeSend: function(xhr) { xhr.setRequestHeader("X-CSRFToken", csrftoken); }, data: { id: id }, success: function (data...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleDeleteButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"player\");\n var id = listItemData.id;\n $.ajax({\n method: \"DELETE\",\n url: \"/api/players/\" + id\n })\n .done(getPlayers);\n }", "function delete_bot(e){\n $.ajax({\n ur...
[ "0.6713364", "0.6448151", "0.6347787", "0.6245996", "0.6212591", "0.61792105", "0.6170086", "0.61476535", "0.6096588", "0.60652626", "0.60628164", "0.6024128", "0.6020493", "0.6013751", "0.59666044", "0.59659183", "0.5962018", "0.594773", "0.59450626", "0.5924864", "0.5921922...
0.74805856
0
Reads a number token from the source file, either a float or an int depending on whether a decimal point appears. Int: ?(0|[19][09]) Float: ?(0|[19][09])(\.[09]+)?((E|e)(+|)?[09]+)?
function readNumber(source, start, firstCode, line, col, prev) { var body = source.body; var code = firstCode; var position = start; var isFloat = false; if (code === 45) { // - code = body.charCodeAt(++position); } if (code === 48) { // 0 code = body.charCodeAt(++position); if (cod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readNumber(source, start, firstCode, line, col, prev) {\n var body = source.body;\n var code = firstCode;\n var position = start;\n var isFloat = false;\n\n if (code === 45) {\n // -\n code = body.charCodeAt(++position);\n }\n\n if (code === 48) {\n // 0\n code = body.charCodeAt(++posit...
[ "0.78387225", "0.7837319", "0.7828362", "0.77988875", "0.77988875", "0.7791793", "0.7791793", "0.7791793", "0.7785208", "0.7785208", "0.7769675", "0.77647936", "0.77565384", "0.7740202", "0.77199966", "0.76398957", "0.7632321", "0.7632321", "0.7632321", "0.7632321", "0.761315...
0.7857946
0
Render a helpful description of the location in the GraphQL Source document.
function printLocation(location) { return printSourceLocation(location.source, Object(_language_location__WEBPACK_IMPORTED_MODULE_0__["getLocation"])(location.source, location.start)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shortDescribeLocation(location) {\n if (location == undefined) {\n return undefined;\n }\n\n var locationBits = [];\n\n if (location.name != undefined) {\n locationBits.push(location.name);\n }\n\n switch (location.type) {\n case undefined:\n // Fall throu...
[ "0.62783587", "0.61345106", "0.61345106", "0.61130935", "0.61130935", "0.60348", "0.58654726", "0.58561265", "0.58488834", "0.58488834", "0.58488834", "0.58488834", "0.58488834", "0.5840514", "0.5832277", "0.57463217", "0.57336545", "0.57296383", "0.5689767", "0.5664802", "0....
0.64047027
1
first request API to get the name
function getBabyName(name) { // API request function $.ajax({ url: `https://data.novascotia.ca/resource/emf8-vmuy.json?`, type: "GET", data: { "$limit": 10000, "$$app_token": "whW6hkBV9XeQn2RtJhqKb9pzA", "first_name": name.toUpperCase(), } })...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPlayer2Name() {\n const url = 'https://randomuser.me/api/?inc=name';\n return new Promise(((resolve, reject) => {\n // the ajax request\n const xhr = new XMLHttpRequest();\n let response;\n let name = '';\n xhr.open('GET', url, true);\n\n function callback() {\n if (xhr.readySt...
[ "0.71583694", "0.7010128", "0.69762105", "0.69148403", "0.6894497", "0.6843907", "0.6782684", "0.6742087", "0.6727364", "0.67212", "0.67210937", "0.671103", "0.6667128", "0.6650387", "0.66471183", "0.65958846", "0.65643597", "0.65524554", "0.6550328", "0.6537007", "0.6532839"...
0.70499766
1
second request to get the sex, I had issue to do with only one request function so I try this and it works
function getGender(sex) { // API request function $.ajax({ url: `https://data.novascotia.ca/resource/emf8-vmuy.json?`, type: "GET", data: { "$limit": 10000, "$$app_token": "whW6hkBV9XeQn2RtJhqKb9pzA", "sex": sex } }).then(function(sex) { //wh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reqPerson() {\n\t\tif(this.status === 404){\n\t\tthrowError();\n\t}\n\tconst requestData = JSON.parse(this.responseText);\n\tconst name = requestData.name;\n\tone.innerHTML = 'Name: ' + name;\t\t\n\tconst gender = requestData.gender;\n\ttwo.innerHTML = `Gender: ${gender}`;\n\tconst twoReq = new XMLHttpReq...
[ "0.6475079", "0.59111184", "0.5909956", "0.5873405", "0.5853964", "0.5826323", "0.58024544", "0.5792154", "0.57515436", "0.5751429", "0.5731334", "0.5675453", "0.56696445", "0.5628502", "0.5613207", "0.5608606", "0.55679184", "0.5561951", "0.554343", "0.5531871", "0.5521873",...
0.6918806
0
Method to supply parameters to promise method
promiseParams() { return {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fullPromise(param) {\n\t//PLACE YOUR CODE HERE:\n}", "function generalPromise(f, ...params){\n return new Promise( function(resolve, reject){\n let fnc = params.length > 0 ? f.bind(f, params, resolve) : f.bind(f, resolve);\n fnc();\n }).then(function(text=\"\"){\n return text;\n });\n}", "...
[ "0.67492807", "0.6050873", "0.6003186", "0.58788073", "0.58668506", "0.5761126", "0.5704942", "0.562183", "0.5599443", "0.555684", "0.54627025", "0.5448921", "0.5439493", "0.5362626", "0.53605586", "0.53605586", "0.53472227", "0.5319693", "0.5315277", "0.5312511", "0.5312112"...
0.6558529
1
Challenge 3 Now that we can do rows and columns, let's find out how big the size of our GRID is. I checked in with the lead developer at a company I know of, and she told me that this is one of the areas where reusing code is a great idea. Write a function called gridSize() that will tell you the size of your grid in t...
function gridSize(){ var rows = countRows(); var cols = countColumns(); var sizeText = rows + " x " + cols; return sizeText; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gridSize(){\n return `${countColumns()} x ${countRows()}`;\n}", "function gridSize() {\n size = prompt(\"What size do you want the grid?\");\n createGrid(size, size);\n\n}", "function getGridCellSize() {\n return (min(width, height) / 2 - 50) / gridSize;\n}", "function gridSize(){\n\t//e...
[ "0.77427393", "0.73107404", "0.719714", "0.71615314", "0.7149433", "0.7128431", "0.7117986", "0.7101654", "0.7078981", "0.7043684", "0.6958646", "0.6878845", "0.6870132", "0.6859161", "0.685844", "0.68096", "0.6809169", "0.6809134", "0.6790096", "0.6746436", "0.6721677", "0...
0.78738284
0
Challenge 4 Awesome job! Other lighthouse operators are jealous of your grid. Just to show off, let's write a new function for the system which will count up how many cells total there are. Given the code you just wrote, this should be pretty easy. Write a new function called totalCells() which will return the total nu...
function totalCells(){ var rows = countRows(); var cols = countColumns(); var size = rows * cols; return size; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function totalCells(){\n return GRID.length * GRID[0].length;\n}", "function cellsALiveCount(){\n let newCells = createCells();\n let cellsAlive = 0\n for (let y = 0; y < resolution; y++){\n for (let x = 0; x < resolution; x++){\n const neighbours = getNeightbourCount(x,y);\n ...
[ "0.75520885", "0.6770451", "0.6723869", "0.6690196", "0.6689466", "0.6667436", "0.661916", "0.6550991", "0.65272903", "0.65176576", "0.6505946", "0.6438334", "0.6434779", "0.64220494", "0.6389627", "0.63733405", "0.63642704", "0.635209", "0.6343351", "0.6339885", "0.6323937",...
0.72692454
1
Challenge 5 Since our GRID is written in coordinates like A3 or D8, we need code that is going to be able to convert those coordinates to the numbers we need to fetch data out of the GRID array(s). All of the lighthouse operators have reported in and we know that their areas never go above Z. Let's build a function cal...
function convertColumn(cellString){ var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); var colChar = cellString.charAt(0); var col = letters.indexOf(colChar); return col; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCol(n) {\n return this.grid.map(function (x) {\n return x[n];\n });\n }", "function extractX(cellString) {\n let letters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\");\n let colChar = cellString.charAt(0);\n let col = letters.indexOf(colChar);\n return col + 1;\n}", "function getDiaCellsRight...
[ "0.6241967", "0.6042609", "0.6002486", "0.6001422", "0.59932625", "0.59899473", "0.5969", "0.59680307", "0.5928696", "0.590293", "0.5897777", "0.58783984", "0.58534205", "0.5799849", "0.5780153", "0.5765972", "0.56844044", "0.56734127", "0.56653243", "0.56591713", "0.56516826...
0.63769114
0
Challenge 6 Okay, let's get our lighthouse actually doing some work! As the lighthouse keeper, sometimes you'll need to shine the light directly on a particular cell in the grid, to alert passing ships to a danger there. Your job is to write a function called lightCell() that takes in the coordinates in the form of 'A3...
function lightCell(cellString){ var col = convertColumn(cellString); var row = Number(cellString.substring(1))-1; if (col < countColumns() && row >= 0 && row < countRows()) { var cellValue = GRID[row][col]; return cellValue; } else { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lightCell(str){\n if ( convertRow(str) <= countRows() && convertColumn(str) <= countColumns() ) {\n return GRID[convertRow(str)][convertColumn(str)];\n } else {\n return false;\n }\n}", "function getSurroundingCells(cell) {\n\n// NW N NE\n// W + E\n// SW S SE\n\n var cells = {};\n var...
[ "0.7458274", "0.6037773", "0.5987483", "0.58689135", "0.58685076", "0.5843304", "0.5831313", "0.5802159", "0.57771176", "0.5719142", "0.5706858", "0.57029235", "0.56989914", "0.566574", "0.5664109", "0.56491363", "0.5646303", "0.5609434", "0.559388", "0.55806315", "0.55759645...
0.76681477
0
Challenge 8 There are also areas where the currents are too strong for boats to be effective, and boats run the risk of being smashed up against the rocks if they get caught here. Strong currents are indicated with the ~ symbol. Write a function called isCurrent() which will take in a coordinate in the form of 'A4' and...
function isCurrent(cellString){ var current = '~'; return cellCompareStr(cellString, current); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isCurrent(str){\n if (lightCell(str) == \"~\"){\n return true;\n } else {\n return false;\n }\n}", "function checkCurrent(map, player, previous){\n\tlet spot = map[player.y][player.x];\n\tlet str = \"\";\n\t\n\tswitch (spot) {\n\t\tcase 2:\n\t\t\tstr = utils.updateUI(`Oh no you woke up th...
[ "0.7599549", "0.5918738", "0.58309036", "0.5614382", "0.558267", "0.556296", "0.551903", "0.5498895", "0.5426921", "0.5416547", "0.53929543", "0.5364904", "0.53280807", "0.5319161", "0.52883536", "0.5259397", "0.5258776", "0.52493894", "0.5243394", "0.522975", "0.5206325", ...
0.73635817
1
Challenge 9 And last, but certainly not least, there are cells with ships in them! We need to be able to query any cell in our GRID area and find out if it is occupied by a ship. Write a function called isShip() which will take in a coordinate in the form of 'I9' and return a true or a false boolean value depending on ...
function isShip(cellString){ var ship = 'v'; return cellCompareStr(cellString, ship); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isShip(str){\n if (lightCell(str) == \"v\"){\n return true;\n } else {\n return false;\n }\n}", "function hasShip(grid, row, column){\n return (grid[row][column] === 1 ? true : false)\n}", "checkCoordinates(ship,position){\n if(ship.vertical == false){\n // prevent...
[ "0.7580237", "0.71291757", "0.705225", "0.67764425", "0.6561728", "0.6517089", "0.64367384", "0.63654304", "0.6360198", "0.63364094", "0.6331543", "0.6267609", "0.6196765", "0.61794937", "0.61435497", "0.6121407", "0.61065483", "0.6071998", "0.6066296", "0.60571533", "0.60564...
0.80814105
0
Challenge 10 Your next job is to write a function so that your lighthouse can sweep a whole row of cells. Write a function named lightRow() that takes in the number of the row and returns its contents. (Example: lightRow(2); would return ["", "", "v", "", "~", "", "", "", "", ""]) Day 10
function lightRow(rowIndex){ var row = GRID[rowIndex - 1]; return row; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lightRow(rowNumber){\n let rowIndex = rowNumber - 1;\n return GRID[rowIndex];\n}", "renderRow(begin) {\n let row = [];\n for (let i = begin * 3; i < 3 + begin * 3; i++) {\n row.push(this.renderSquare(i));\n }\n return row;\n }", "function little(dataRow,dataCell){\n\tvar LR = (...
[ "0.67921066", "0.62995327", "0.6137966", "0.61292964", "0.61110353", "0.60525495", "0.6042675", "0.60421133", "0.60246694", "0.59623164", "0.5927282", "0.5914244", "0.58873886", "0.58473885", "0.58327585", "0.57810915", "0.57786655", "0.5762567", "0.5760336", "0.57515943", "0...
0.6622116
1
Challenge 11 Now that you can return the contents of the cells of a row, we also need to be able to return the cells of a column. Write a function called lightColumn() that takes in the letter of the column from the grid, and returns an array that is the contents of that grid column. (Ex: lightColumn('C'); would return...
function lightColumn(colLetter){ var colIndex = convertColumn(colLetter); var rowsCount = countRows(); var col = []; for (i = 0; i < rowsCount; i++) { row = lightRow(i+1); col.push(row[colIndex]); } return col; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lightColumn(letter){\n let columnContents = [];\n for (let i = 0; i < GRID.length; i++){\n if (columns.includes(letter) === true){\n let columnIndex = columns.indexOf(letter);\n columnContents.push(GRID[i][columnIndex]);\n }\n }\n return columnContents;\n}",...
[ "0.80662394", "0.68188584", "0.6788896", "0.6538", "0.6514269", "0.65136796", "0.6441455", "0.6324701", "0.6315291", "0.6285324", "0.62740004", "0.6216634", "0.6193641", "0.6172216", "0.61389256", "0.6096782", "0.6088589", "0.60871416", "0.6085546", "0.60542274", "0.60430694"...
0.7870853
1
Challenge 14 While we are reporting on things, let's make a report for all of the ships in our area. This one is for Transport Canada, as they are the ones watching all the movements of ships. Write a function called allShips() which, when called, will return an array of the coordinates of all the ships in your grid. D...
function allShips(){ var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); var rowsCount = countRows(); var colsCount = countColumns(); var ships = []; for (i = 0; i < rowsCount; i++) { for (j = 0; j < colsCount; j++) { var coordinate = letters[j]+(i+1); if (isShip(coordinate)) { sh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allShips(){\nshipcoordinates=[];\nfor (var i = 0; i < GRID.length; i++){\n for (var j = 0; j < GRID[0].length; j++){\n if (GRID[i][j] == \"v\"){\n shipcoordinates.push(indexToChar(j)+ (i+1));\n }\n \n }\n}\nreturn shipcoordinates;\n}", "function shipReport() {\n let result = [];\n let ...
[ "0.73252696", "0.7313568", "0.7192952", "0.69311666", "0.6878522", "0.64155746", "0.6378725", "0.63712424", "0.63240707", "0.6312007", "0.6234373", "0.6213053", "0.6118559", "0.610025", "0.6100147", "0.6089915", "0.6075479", "0.60653645", "0.60456276", "0.6038731", "0.6022313...
0.7806629
0
Challenge 15 Here is an opportunity to prove how powerful your Lighthousepowering skills are! Write a function called firstRock() which will return the coordinates of the first rock in your grid. Consider how you might use one of your previously written functions to simplify your task! Day 15
function firstRock() { let rocks = allRocks(); return rocks[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstRock(){\n let rocks = allRocks();\n return rocks[0];\n}", "function computerMove() {\n\n //If no strong moves are present, computer will move randomly\n \n var computerSquare = Math.ceil(Math.random() * 9);\n var corners = [1, 3, 7, 9];\n var counter = 0;\n \n ...
[ "0.66301394", "0.66291016", "0.6552603", "0.65404755", "0.65320534", "0.6520161", "0.6445", "0.6441947", "0.6423973", "0.6420394", "0.6384115", "0.6374656", "0.6371163", "0.6367274", "0.6366828", "0.63641316", "0.63582385", "0.6347168", "0.63462657", "0.63347316", "0.63305604...
0.6689238
0
Challenge 16 That was outstanding! Now do the same thing with firstCurrent(). Don't reinvent the wheel here, reuse existing code. This is one of the most important skills you can build as a coder...er, uh, I mean Lighthouse operator. Day 16
function firstCurrent() { let currents = allCurrents(); return currents[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstCurrent(){\n let currents = allCurrents();\n return currents[0];\n}", "function yFirstCurrent()\n{\n return YCurrent.FirstCurrent();\n}", "function YCurrent_FirstCurrent()\n {\n var next_hwid = YAPI.getFirstHardwareId('Current');\n if(next_hwid == null) return null;\n ...
[ "0.7634219", "0.72250706", "0.6651079", "0.6318042", "0.6102739", "0.59786797", "0.5941384", "0.5780054", "0.57558304", "0.5755339", "0.5746093", "0.5735215", "0.5702441", "0.5699654", "0.5697223", "0.5673059", "0.5639534", "0.56170774", "0.5579236", "0.5536823", "0.5528111",...
0.7621642
1
Challenge 17 Transport Canada called back. They want something similar to what you did for firstRock() and firstCurrent() but they want both the first AND the last ship in your area. Write a function called shipReport() which does not take any parameters, but will return an array of the coordinates of the ship furthest...
function shipReport() { let result = []; let ships = allShips(); if (ships.length > 0) { let topWestShip = ships[0]; let topEastShip = topWestShip; for (i = 0; i < ships.length; i++) { let col = convertColumn(ships[i]); let westCol = convertColumn(topWestShip); let eastCol = conve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shipReport(){\n let ships = allShips();\n let firstLastShips = [ships[0], ships[ships.length-1]];\n return firstLastShips;\n}", "function allShips(){\nshipcoordinates=[];\nfor (var i = 0; i < GRID.length; i++){\n for (var j = 0; j < GRID[0].length; j++){\n if (GRID[i][j] == \"v\"){\n s...
[ "0.7786739", "0.64260596", "0.62495494", "0.61914176", "0.61408997", "0.59446937", "0.58623207", "0.58538014", "0.58260477", "0.5799168", "0.56833774", "0.56776017", "0.5673763", "0.56645477", "0.5643633", "0.5622199", "0.5616584", "0.5608322", "0.56053746", "0.5603989", "0.5...
0.7672304
1
Challenge 20 Lighthouse HQ also wants a report of the safety of your GRID. Write another function called `safetyReport()` which will return your GRID with all of the values replaced by the percentage for how dangerous they are. The percentages for how dangerous a cell is were established in question 18. Day 20
function safetyReport(){ let letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""); let rowsCount = countRows(); let colsCount = countColumns(); let gridSafety = []; for (i = 0; i < rowsCount; i++) { let gridRow = []; for (j = 0; j < colsCount; j++) { var coordinate = letters[j]+(i+1); gridR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verify_result() {\n grid_end_time = Date.now();\n trial.grid_rt = grid_end_time - grid_start_time;\n\n document.getElementById(\"Verify_Test\").disabled = true;\n var index, tile_value, num_wrong=0;\n\n // count how many of user_input are hits, misses, false alarms\n // var h...
[ "0.58630866", "0.5796885", "0.5768578", "0.56289303", "0.5627027", "0.5583014", "0.55820715", "0.5569343", "0.55644095", "0.55174655", "0.5505007", "0.5481576", "0.54806364", "0.54792124", "0.54728043", "0.54375553", "0.5404167", "0.5395288", "0.5362648", "0.53548497", "0.532...
0.7263371
0
Parse info from the page pertaining to number of listings on page and total number of listings and stores it in pageState
function parseTotalListingsText(info){ var terms = info.split(' '); console.log(info, '\n'); pageState.numListings = (terms[2] - terms[0]) + 1; pageState.totalListings = terms[4]; console.log(pageState.numListings, ' Is number of listings-===='); console.log(pageState.totalListings, ' total numb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchListingsPagination(pageNum) {\n\tvar pageSize = 10;\n\tvar subQueryToFetchNumOfResults = 'count(*) OVER() AS numresults, ';\n\tvar subQueryToFetchPageCount = 'ceil((count(*) OVER())::numeric/'+ pageSize + ') AS numpages ';\n\tvar subQueryToHandlePagination = ' LIMIT ' + 10 + ' OFFSET ' + ((pageNum - ...
[ "0.6410866", "0.5888691", "0.58642185", "0.5721083", "0.558664", "0.55693895", "0.55352104", "0.55352104", "0.5533267", "0.5505981", "0.5450498", "0.5447729", "0.5435867", "0.54201305", "0.5387128", "0.5384291", "0.53720003", "0.5364059", "0.5344115", "0.53337276", "0.5325666...
0.7253055
0
Update a single feature
updateFeature (url, feature, token) { return this.updateFeatures(url, [feature], token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateFeatures (url, features, token) {\n return this.applyEdits(url, [], features, [], token);\n }", "async function update(req, res, next) {\n try {\n const { id } = req.params\n const { body, method } = req\n validation.validate({ body, method })\n const data = extractData({ body, i...
[ "0.7026061", "0.6735369", "0.624844", "0.61280423", "0.60776216", "0.5847491", "0.582504", "0.582504", "0.582504", "0.57927924", "0.5743555", "0.5742632", "0.5722666", "0.56197804", "0.55515486", "0.55262136", "0.5471491", "0.54458416", "0.5445547", "0.5426732", "0.5423676", ...
0.7811788
0
Update a set of features
updateFeatures (url, features, token) { return this.applyEdits(url, [], features, [], token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateFeatures() {\n if(window.updateFeaturesTimer) clearTimeout(window.updateFeaturesTimer);\n window.updateFeaturesTimer = setTimeout(_updateFeatures, 1);\n }", "function updateFeatures() {\n // Filter happiness data for x-Axis features\n featuresXAxis = Object.keys(happinessData[0]...
[ "0.68862975", "0.6650747", "0.6503106", "0.62666404", "0.62500274", "0.6143587", "0.6119223", "0.61043096", "0.59986436", "0.59463537", "0.5942268", "0.59291023", "0.59291023", "0.5917034", "0.58423084", "0.5833704", "0.5802131", "0.57965755", "0.5796504", "0.57430345", "0.56...
0.72198296
0
Add an single feature
addFeature (url, feature, token) { // wrap into an array... let adds = [feature]; // delegate to addFeatures return this.addFeatures(url, adds, token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(id, force = false) {\r\n return this.clone(Features_1, \"add\").postCore({\r\n body: jsS({\r\n featdefScope: 0,\r\n featureId: id,\r\n force: force,\r\n }),\r\n }).then(data => {\r\n return {\r\n data: da...
[ "0.73120147", "0.70947003", "0.707562", "0.6906973", "0.6758345", "0.6737475", "0.6615806", "0.6595282", "0.65877616", "0.65462804", "0.6536819", "0.6535825", "0.64442134", "0.6361708", "0.6346986", "0.63292813", "0.62593734", "0.6249408", "0.6183901", "0.6164152", "0.6138766...
0.74809045
0
Add a set of features
addFeatures (url, features, token) { return this.applyEdits(url, features, [], [], token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addFeatureOptions(features, options) {\n var feature, x;\n for (x in features) {\n if (features.hasOwnProperty(x)) {\n feature = features[x];\n var uid = utils.createUid();\n feature.uid = uid;\n var data = feature.k;\n ...
[ "0.70407313", "0.6697885", "0.6678368", "0.6667702", "0.6657551", "0.66509223", "0.66509223", "0.6649523", "0.6649523", "0.66426104", "0.66426104", "0.6631072", "0.64931846", "0.64133036", "0.62468594", "0.6221564", "0.6221486", "0.6213317", "0.6063096", "0.6061068", "0.59336...
0.6727383
1
Delete a single feature
deleteFeature (url, objectId, token) { return this.deleteFeatures(url, [objectId], token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(id, force = false) {\r\n return this.clone(Features_1, \"remove\").postCore({\r\n body: jsS({\r\n featureId: id,\r\n force: force,\r\n }),\r\n });\r\n }", "deleteRepresentation () {\n if (this.representation) {\n this.r...
[ "0.6928166", "0.6681152", "0.6619745", "0.6463553", "0.6450032", "0.6350492", "0.62087536", "0.61319613", "0.6116457", "0.6029025", "0.60050666", "0.5799376", "0.57789916", "0.5751496", "0.5748847", "0.574323", "0.5732272", "0.5731116", "0.57309824", "0.57293266", "0.57246697...
0.7740255
0
Delete a set of features
deleteFeatures (url, objectIds, token) { return this.applyEdits(url, [], [], objectIds, token); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deleteAll() {\n Object.keys(this._features).forEach(id => {\n this.delete(id);\n });\n }", "clearFeatures() {\n if (this.__featuresSource) {\n this.__featuresSource.clear();\n this._featuresChanged();\n }\n }", "function RemoveFeatures() {\n\t\t\t\ttry {\n\t\t\t\t\tif (!featuresAdd...
[ "0.7881519", "0.66169524", "0.65559286", "0.6482358", "0.6482077", "0.6481443", "0.6461925", "0.6461697", "0.64438486", "0.64285934", "0.6408113", "0.6399435", "0.632118", "0.6279624", "0.6243647", "0.6231202", "0.6192401", "0.61772645", "0.6144108", "0.6075003", "0.606926", ...
0.677095
1
Remove the title screen when buttons are clicked
destroyTitleScreen() { let titleScreen = document.querySelector(".titleScreen"); titleScreen.parentNode.removeChild(titleScreen); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function titleClear(){\n document.querySelector(\".title\").style.display = \"none\";\n document.querySelector(\".line\").style.display = \"none\";\n document.querySelector(\".intro\").style.display = \"none\";\n document.querySelector(\".start\").style.display = \"none\";\n }", "f...
[ "0.7130222", "0.707898", "0.6714623", "0.656883", "0.6531999", "0.6483418", "0.64776", "0.6464829", "0.64141816", "0.6402567", "0.63705474", "0.63645196", "0.63602704", "0.6354085", "0.6290226", "0.62884206", "0.6280276", "0.6264606", "0.62470454", "0.6227313", "0.6227181", ...
0.75328887
0
~ addingEmployeesIntoArray function ~ Straight JavaScript takes 5 parameters and creates an object then pushes object to global array
function addingEmployeesIntoArray(firstName, lastName, iD, title, annualSalary) { console.log('In addingEmployeesIntoArray function!', firstName, lastName, iD, title, annualSalary); const employeeNew = { first: firstName, last: lastName, id: iD, title: title, salary: annu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapEmployees(id,nome,cognome,livello,salario){\n var impiegato ={\n id : id,\n name : nome,\n surname : cognome,\n level : livello,\n salary: salario\n }\n employee.push(impiegato);\n}", "function updateEmployeeArr() { // creates new Class objects from existin...
[ "0.66616917", "0.65753424", "0.6510019", "0.64763224", "0.63297045", "0.6287559", "0.6203115", "0.6135099", "0.61142135", "0.6090236", "0.6082543", "0.5996712", "0.5961115", "0.5952879", "0.59411716", "0.590279", "0.58562165", "0.58411247", "0.5833681", "0.5812959", "0.580541...
0.7318941
0
~ End of addingEmployeesIntoArray function ~ ~ addInputsIntoArray function ~ jQuery variables from DOM inputs that are placed in as parameters into addingEmployeesIntoArray function
function addInputsIntoArray() { console.log('In addInputsIntoArray function!'); // Creates variables to pass in as parameters: const firstNameInputValue = $('#first-name').val(); const lastNameInputValue = $('#last-name').val(); const iDInputValue = Number($('#id').val()); const titleInputValue ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addEmployee() {\n console.log('Employee added.');\n let firstName = $('#firstNameIn').val();\n console.log(firstName);\n let lastName = $('#lastNameIn').val();\n console.log(lastName);\n let employeeID = $('#employeeIDIn').val();\n console.log(employeeID);\n let job = $('#jobTitleI...
[ "0.69298875", "0.68318236", "0.65642357", "0.6551911", "0.6537046", "0.6475625", "0.633623", "0.626742", "0.62655103", "0.6216647", "0.62115604", "0.6159608", "0.61151177", "0.6113487", "0.6085251", "0.60205805", "0.5995901", "0.5939663", "0.5893586", "0.58816546", "0.5880770...
0.77305657
0
~ End of addInputsIntoArray function ~ ~ inputSubmissionClickHandler function ~ on click this function will run addInputsIntoArray function so inputs will be added to array
function inputSubmissionClickHandler() { console.log('In inputSubmissionClickHandler function!'); const inputSubmissionButton = $('#submit-btn'); inputSubmissionButton.click(addInputsIntoArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addResourcesInput(e) {\n e.preventDefault();\n // Variables\n let pageElementContainer;\n let resourcesCount;\n let parentArray; /* This is the parentArray */\n\n let pageResourcesInput_div;\n let pageResourcesInput_btn;\n let pageResourcesInput_input;\n let pageResourcesInput_t...
[ "0.65102065", "0.63730407", "0.6210455", "0.6047316", "0.597933", "0.5938748", "0.591916", "0.59106266", "0.5874195", "0.5858896", "0.5830149", "0.57616884", "0.5752507", "0.5752507", "0.5752507", "0.5739949", "0.57243705", "0.57243705", "0.57243705", "0.57243705", "0.5724370...
0.76992697
0
~ monthlyTotalCalDOM function ~
function monthlyTotalCalDOM() { console.log('In monthlyTotalCalDOM function!'); $('.table-body tr').children('.annSal').each(function () { let element1 = $(this).text(); // http://jsfiddle.net/jinglesthula/hdzTy number = Number(element1.replace(/[^0-9\.-]+/g, "")); return number;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _computeTotalDaysOfMonth(_year,_month){var _totalDaysOfMonth=new Date(_year,_month+1,0).getDate();return _totalDaysOfMonth}", "function CalculateTotalsMonthToDate() {\n //use temp variables to prevent multiple dom updates\n var wt = 0; //written total\n var dt = 0; //delivered total\n ...
[ "0.72917044", "0.6925049", "0.6550779", "0.6533135", "0.63385004", "0.6302113", "0.63001263", "0.6242671", "0.6239003", "0.6196189", "0.6189096", "0.6177392", "0.61712974", "0.615457", "0.6152025", "0.6110161", "0.6098814", "0.603531", "0.6027093", "0.5977758", "0.58854586", ...
0.6979117
1
~ End of monthlyTotalCalDOM function ~ ~ annSalCal function ~ this function takes the personal annual salary and returns monthly salary
function annSalCal(salary) { console.log('In annSalCal function!'); // monthlySal is each annual salary devided my total months in year let monthlySal = Number(salary) / 12; // return the monthly salary return monthlySal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateMonthlySalary(annualSalary) {\n\n var monthlySalary = Math.round(annualSalary / 12);\n return monthlySalary;\n\n }", "function calculateMonthlySalary(annualSalary) {\n\n var monthlySalary = Math.round(annualSalary / 12);\n return monthlySal...
[ "0.77090716", "0.76375544", "0.7083443", "0.6927323", "0.6856588", "0.6824554", "0.6708305", "0.6520808", "0.64685655", "0.6463627", "0.64506507", "0.64200103", "0.6347515", "0.6216844", "0.60478365", "0.6014675", "0.5996876", "0.59588", "0.5908848", "0.5900445", "0.58691823"...
0.8235798
0
~ End of annSalCal function ~ ~ monthlyTotalCal function ~ this function appends the total of each monthly salary to the DOM
function monthlyTotalCal(monthlySals) { console.log('In monthlyTotalCal function!'); let element2 = $('#total-salary'); element2.empty(); element2.append(new Intl.NumberFormat().format(monthlySals)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateDomTotal(totalMonthlySalary) {\n $('#monthlysalarytotal').text('Monthly Salary Total for All Employees: $' + totalMonthlySalary);\n }", "function salCalc() {\n //loop through employees \n for (var i = 0; i < empArray.length; i++) {\n totalSal += Number(empArray[i].annualSala...
[ "0.766404", "0.76446795", "0.7555329", "0.7299517", "0.7155472", "0.7129895", "0.70940554", "0.7086961", "0.7024458", "0.7023268", "0.68911135", "0.68804246", "0.68674684", "0.6784432", "0.6502109", "0.6486582", "0.6404627", "0.63787603", "0.6370197", "0.63698494", "0.6314885...
0.8000414
0
~ End of monthlyTotalCal function ~ ~ newTotalMonthlyDisplay function ~ this function updates DOM with new array status
function newTotalMonthlyDisplay(monthlyTotalArray) { console.log('In newTotalMonthlyDisplay function!'); let newTotal = 0; for (const numberValues of monthlyTotalArray) { newTotal += numberValues; } let totalMonthlyDisplay = $('#total-salary'); totalMonthlyDisplay.empty(); total...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayMonthlyCosts() {\n var newCost = calculateMonthlyCosts();\n newCost = newCost - removedCosts;\n $('#monthlyCostsReport span').text(newCost);\n // NOTE: I didn't \"append\" this info to the DOM per the instructions, because we wanted to update the new value each time.\n} // END: displayMonthlyCo...
[ "0.69796365", "0.6587609", "0.6562749", "0.65486234", "0.65242684", "0.6434772", "0.63875896", "0.63723665", "0.63206667", "0.62768394", "0.62555826", "0.6253224", "0.61866945", "0.6182599", "0.6134989", "0.6129374", "0.6123766", "0.61065394", "0.6103891", "0.6103314", "0.609...
0.761032
0
Populate the global BTR Object variable
function PopulateBTRObject(oItem) { //console.log(oItem); _gBtrObj.btr_guid = oItem.btr_guid; _gBtrObj.approved_date = oItem.approvate_date; _gBtrObj.approval_status= oItem.approval_status; _gBtrObj.requestor_uni_code = oItem.requestor_uni_code; _gBtrObj.requestor_uni_key = oItem.requestor_uni_key; _gBtrO...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static initialize(obj, tx, secrets) { \n obj['tx'] = tx;\n obj['secrets'] = secrets;\n }", "static initialize(obj, complete) { \n obj['complete'] = complete;\n }", "static initialize(obj, activated, companyOwner, login) { \n obj['activated'] = activated;\n obj['companyO...
[ "0.60967964", "0.59143806", "0.5873146", "0.58533305", "0.58304834", "0.5794863", "0.5749442", "0.57422733", "0.5737926", "0.5727992", "0.5724735", "0.57040346", "0.5681306", "0.56743884", "0.56729895", "0.5654218", "0.5651987", "0.56422067", "0.5624155", "0.5623996", "0.5618...
0.6268179
0
Populate BTR form elements
function SetBTRForm(objBtr) { $('#txtBTR_Guid').val(objBtr.btr_guid); $('#txtBTR_ApprovedDate').val(objBtr.approved_date); $('#txtBTR_ApprovalStatus').val(objBtr.approval_status); $("#lblRequester").html(objBtr.requestor_uni_code); $("#txtBTR_Requestor").val(objBtr.requestor_uni_code); $('#budgetType').val(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadElementSeedForm() {\n currentState = \"ElementSeedForm\";\n var elementType = elementSeedForms[elementSeedIndex][\"element\"];\n customInputsTitle.innerText = elementType;\n customInputsContent.innerHTML = \"\";\n var formData = elementSeedForms[elementSeedIndex][\"json\"][\"fields\"];\n var for...
[ "0.6599486", "0.64418244", "0.64241177", "0.6333447", "0.62036234", "0.61683726", "0.61527073", "0.6128108", "0.61220914", "0.6090776", "0.60699785", "0.6058664", "0.60502666", "0.6045657", "0.6021203", "0.6020757", "0.6017899", "0.60093397", "0.60000885", "0.59734267", "0.59...
0.6698389
0
Pack 1float (0.01.0) to 4float rgba (0.01.0, 0.01.0, 0.01.0, 0.01.0)
pack(v) { let bias = [1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0]; let r = v; let g = this.fract(r * 255.0); let b = this.fract(g * 255.0); let a = this.fract(b * 255.0); let colour = [r, g, b, a]; let dd = [colour[1]*bias[0],colour[2]*bias[1],colour[3]*bias[2],...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EncodeFloatRGB(f)\n{\n\tvar enc = new THREE.Vector4( f * 1.0, f*255.0, f*65025.0, 0);\n\tenc.x = frac(enc.x);\n\tenc.y = frac(enc.y);\n\tenc.z = frac(enc.z);\n\t\n\tenc.x -= enc.y * (1.0/255.0);\n\tenc.y -= enc.z * (1.0/255.0);\n\tenc.z -= enc.w * 0;//(1.0/255.0);\n\t//enc -= enc.yzww * new THREE.Vector4(...
[ "0.6532728", "0.6281308", "0.62298745", "0.6145633", "0.6132984", "0.60839486", "0.6061662", "0.60590357", "0.5994478", "0.59204155", "0.5907331", "0.5896573", "0.5896356", "0.5871159", "0.58369905", "0.579872", "0.578523", "0.5771195", "0.5767965", "0.57347804", "0.57137597"...
0.65972865
0
Removes all workspace history entries from the menu.
_clearWorkspaceHistory() { const menu = this.getWorkspaceHistoryMenu(); const items = Array.from(menu.items); menu.clear(); if (!items[2].visible) { items[2].visible = true; } for (let i = 0; i < 3; i++) { menu.append(items[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearUndoHistory() {\n getHistoryFromServer(resetHistList);\n}", "function clearChangeHistory() {\n changeHistory = [];\n historyPosition = 0;\n }", "function removeAll(l) {\n for (var i in workspaces) {\n var ws = workspaces[i];\n if (removeWorkspace(ws.id...
[ "0.7063698", "0.6666161", "0.6495668", "0.6454437", "0.6425787", "0.6420237", "0.6396512", "0.63851666", "0.63851655", "0.63263434", "0.6305481", "0.63008964", "0.62969136", "0.6285436", "0.62300473", "0.6133961", "0.6122418", "0.6111207", "0.6070954", "0.60462904", "0.603845...
0.8599442
0
debug changes to health
function onStatusChange(healthState) { appHealthDebug(`🏥: APP HEALTHY?: ${healthState.healthy}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get health(){ return this._health}", "function updateHealth(health) {\n health += 10;\n }", "setHealth(health) {\n this.health = health;\n }", "function healthController() {\n\n }", "get Health() {\n return this.health;\n }", "function changeHealth(value){\n\tlet healthChan...
[ "0.67418224", "0.66693634", "0.638746", "0.62854314", "0.61988187", "0.6144739", "0.6128985", "0.6007678", "0.5988743", "0.5946417", "0.586902", "0.58218324", "0.58061844", "0.5778069", "0.57704705", "0.5764217", "0.57444346", "0.5739548", "0.56859535", "0.5685731", "0.566560...
0.6691037
1
Remove empty lines before a node. Mutates the node.
function removeEmptyLinesBefore( node, newline ) { node.raws.before = node.raws.before.replace(/(\r?\n\s*\r?\n)+/g, newline); return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trimLeadingLineBreaks(node) {\n\t\t\t\tdo {\n\t\t\t\t\tif (node.nodeType === 3) {\n\t\t\t\t\t\tnode.nodeValue = node.nodeValue.replace(/^[\\r\\n]+/, '');\n\t\t\t\t\t}\n\n\t\t\t\t\tnode = node.firstChild;\n\t\t\t\t} while (node);\n\t\t\t}", "function trimLeadingLineBreaks(node) {\n\t\t\t\tdo {\n\t\t\t\t\...
[ "0.69676644", "0.69676644", "0.69676644", "0.68541425", "0.6457119", "0.63211817", "0.6138642", "0.6052004", "0.6052004", "0.59632826", "0.59417284", "0.59036213", "0.5893064", "0.589159", "0.5864514", "0.58432794", "0.58296645", "0.5829088", "0.58201385", "0.5762283", "0.572...
0.8026712
0
This function is used to sort cases in order by date. Used by pastCasesList and setViewCaseList.
function sortByDate(caseArray){ for (var i = 1; i < caseArray.length; i++) { for (var j = 0; j < i; j++) { if (caseArray[i].dateOfCase > caseArray[j].dateOfCase) { var temp = caseArray[i]; caseArray[i] = caseArray[j]; caseArray[j] = temp; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortListsByDate() {\r\n\t\treturn getItems().sort(function(a,b){\r\n \t\t\treturn new Date(`${a.date} ${a.time}`) - new Date(`${b.date} ${b.time}`);\r\n\t\t});\r\n\t}", "function sortDate()\n{\n\tevents.sort( function(a,b) { if (a.startDate < b.startDate) return -1; else return 1; } );\n\tclearTable();\...
[ "0.7139447", "0.6930755", "0.6864116", "0.67686194", "0.6719908", "0.66948724", "0.66851467", "0.6671881", "0.66281873", "0.65228635", "0.65177304", "0.6501845", "0.64181715", "0.63617355", "0.6351145", "0.6340182", "0.63020897", "0.6259081", "0.62505126", "0.62211984", "0.62...
0.74393284
0
Update the list of usernames with SuperbExplanations and FirstSolvers to the case in the db, update the explanations to be displayed on the solution page
function storeSuperbExplanations(){ db.createCollection(community+'Cases', {w:1}, function(err, collection) { var caseCollection = db.collection(community+'Cases'); //In "caseCollection", find the case with the Date "Date", then in that document //set the fields to the new values var SuperbE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateInfo() {\n // get employees to populate the prompt\n const sqlEmpl = `SELECT * FROM employees`;\n let emplArr = [];\n let empData = [];\n db.query(sqlEmpl, (err, res) => {\n if (err) throw err;\n empData = res;\n res.forEach((employee) => emplArr.push(`${employee....
[ "0.62090725", "0.5574704", "0.5480303", "0.54319537", "0.52824914", "0.52680767", "0.52641594", "0.5242668", "0.5231871", "0.5225553", "0.51935154", "0.51860124", "0.5185784", "0.51599836", "0.5158045", "0.51512027", "0.51490265", "0.51343226", "0.5132978", "0.5126736", "0.51...
0.65626526
0
read the number stored in "num" property.
read() { return this.num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "readNumber() {\n let n;\n while (this.pos < this.line.length && BasicParser.isDigit(this.line.charCodeAt(this.pos))) {\n if (n === undefined) {\n n = 0;\n }\n n = n * 10 + this.line.charCodeAt(this.pos) - 0x30;\n this.pos++;\n }\n ...
[ "0.6538127", "0.65001786", "0.65001786", "0.64487255", "0.64487255", "0.6399345", "0.6360393", "0.62198746", "0.6135118", "0.60888654", "0.6080856", "0.6066682", "0.5971244", "0.59019846", "0.5822689", "0.5760962", "0.56950974", "0.5677706", "0.5647699", "0.56453305", "0.5635...
0.6798017
0
search to see if the value is in a tree starting at the root, check if root exists, if not we are done searching if there is a root, check if the value is the same as the value passed in. If so, we are done if not, check to see if the value is greater than or less than the root's value if it is greater, check to see if...
find(value) { if (!this.root) return false; if (value === this.root.value) return true; let current = this.root; while (true) { if (value > current.value) { if (!current.right) { return false; } current = cur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "search(root, value) {\n if (root == null) {\n return false;\n } else {\n if (value > root.data) {\n\n // go right.\n return this.search(root.right, value);\n\n } else if (value < root.data) {\n\n // go left.\n return this.search(root.left, value);\n\n } else {\...
[ "0.7864761", "0.7758307", "0.75985736", "0.7501893", "0.74547666", "0.7449877", "0.7428702", "0.73822045", "0.7357239", "0.7253477", "0.7242602", "0.7239046", "0.7216513", "0.7174089", "0.7158264", "0.7105803", "0.70866555", "0.7043524", "0.70289236", "0.7020844", "0.70129526...
0.785235
1
Define a function `increaseRankBy(n)` that increases the ranks in all of the `.rankedlist`s by `n`. (You might need to make use of [`parseInt()`](
function increaseRankBy(n) { var filterInt = function (value) { if(/^(\-|\+)?([0-9]+|Infinity)$/.test(value)) { return Number(value); }; return NaN; }; let list = document.querySelectorAll('.ranked-list').length; for(let i = 0; i < list; i++) { var current = document.getElementsByC...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function increaseRankBy(n) {\n var ranklist = document.querySelectorAll('.ranked-list')\n for (var i = 0; i < ranklist.length; i++) {\n ranklist[i].innerHTML = parseInt(ranklist[i].innerHTML) + n\n }\n}", "function increaseRankBy(n){\n const rankedlist = document.querySelectorAll(`.ranked-list li...
[ "0.8727467", "0.8678514", "0.8649963", "0.8648978", "0.8605755", "0.79203886", "0.7196957", "0.7076856", "0.6885419", "0.6753512", "0.6716732", "0.6607382", "0.6581015", "0.6555408", "0.654972", "0.6497243", "0.648086", "0.64176273", "0.6383277", "0.63109434", "0.6247546", ...
0.87105083
1
Lock record if attempting to edit Job with DATE INV FINALISED / DATE INVOICED / INVOICE field already set
function beforeLoad(type) { var id = nlapiGetRecordId(); // if attempting to edit if (type == 'edit') { if (role != 3) { // if DATE INV FINALISED / DATE INVOICED / INVOICE field is not blank, lock record if (!isNullorEmpty(nlapiGetFieldValue('custrecord_job_date_inv_finalised')) || !isNullorEmpty(nlapiGetF...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async editLock(locked){\n if(this.data.id === -1) Promise.reject(new CXError('No Department Selected'));\n\n\t\tPromise.all([\n\t\t\tdb.query('update groupRoles set locked = ? where groupID = ?',{conditions:[locked,this.data.id]}),\n\t\t\tdb.query('update users set locked = ? where groupRole = ? AND role = ...
[ "0.61610466", "0.5804966", "0.558837", "0.55630755", "0.55568093", "0.55451065", "0.5453222", "0.5444806", "0.53771573", "0.53743243", "0.5357995", "0.5345142", "0.5342785", "0.53257227", "0.53257227", "0.52720183", "0.52690655", "0.5267411", "0.52615154", "0.52561754", "0.52...
0.6954713
0
des_createKeys this takes as input a 64 bit key (even though only 56 bits are used) as an array of 2 integers, and returns 16 48 bit keys
function des_createKeys (key) { //declaring this locally speeds things up a bit var pc2bytes0 = new Array (0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204); var pc2bytes1 = new Array (0,0x1,0x100000,0x100001,0x4000000,0x40...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function des_createkeys (key) {\r\n //declaring this locally speeds things up a bit\r\n pc2bytes0 = new Array (0,0x4,0x20000000,0x20000004,0x10000,0x10004,0x20010000,0x20010004,0x200,0x204,0x20000200,0x20000204,0x10200,0x10204,0x20010200,0x20010204);\r\n pc2bytes1 = new Array (0,0x1,0x100000,0x100001,0x400000...
[ "0.73607516", "0.72948146", "0.7270519", "0.72333175", "0.7231052", "0.71925944", "0.7089492", "0.7017269", "0.6998668", "0.6998668", "0.6998668", "0.6998668", "0.6998668", "0.6998668", "0.6998668", "0.69354683", "0.64150935", "0.64071304", "0.6374496", "0.6296258", "0.606717...
0.73302615
1
Release WebGL resources used. Invalidates object, should be called before unreferencing.
releaseGL() { this.gl.deleteProgram(this.shaderProgram); this.gl.deleteVertexArray(this.squareVertexArray); this.gl.deleteBuffer(this.squareVertexBuffer); this.gl.deleteBuffer(this.translationsBuffer); this.gl.deleteBuffer(this.backgroundColorsBuffer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n if (this.frameBuffer.stencil) {\n this.gl.deleteRenderbuffer(this.frameBuffer.stencil);\n }\n this.frameBuffer.destroy();\n\n this.frameBuffer = null;\n this.texture = null;\n }", "dispose() {\n const { _context, _vertexBuffer, _indexBuffer } = this;\n\n if (!!_context) {...
[ "0.75891393", "0.7566501", "0.7548578", "0.7296847", "0.7277499", "0.72325414", "0.7169523", "0.7071286", "0.7055842", "0.6946781", "0.6929954", "0.6921759", "0.69054717", "0.685961", "0.68544847", "0.68201226", "0.6780624", "0.6760867", "0.6754826", "0.67205554", "0.6678338"...
0.77403396
0
Add an individual point to the 3d "subgeo" mesh
function addPoint(lat, lng, size, color, subgeo) { // Fancy maths var phi = (90 - lat) * Math.PI / 180; var theta = (180 - lng) * Math.PI / 180; // Create Spike geometry var geometry = new THREE.Cube(0.75, 0.75, 1, 1, 1, 1, null, false, { px: true, nx: true, py: true, ny: true, pz: false,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPoint(lat, lng, size, color, id) {\n geometry = new THREE.CubeGeometry(0.60, 0.60, 0.75);\n geometry.applyMatrix(new THREE.Matrix4().makeTranslation(0,0,-0.5));\n point = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({\n color:0xffffff,\n vertexColors: THREE.FaceColors,\n ...
[ "0.72447413", "0.5940125", "0.59292156", "0.5871033", "0.5861398", "0.5831877", "0.5814461", "0.57405245", "0.5733152", "0.5700136", "0.56963646", "0.566754", "0.56659985", "0.5663931", "0.56593895", "0.56554884", "0.56444466", "0.5601685", "0.5599507", "0.5599507", "0.555444...
0.7045927
1
merge combines two lexerStates. This implements the concat / 'merge' operation of the TokenSet algebra
static merge (s1, s2) { const label = s1.accepts == null ? s2.accepts : s1.accepts const derivs = RM1.merged (mergeSpecs, s1.derivs, s2.derivs) return new State (label, derivs) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeTokens(a, b) {\n\ta.text += ' ' + b.text;\n\ta.normalised += ' ' + b.normalised;\n\ta.pos_reason += '|' + b.pos_reason;\n\ta.start = a.start || b.start;\n\ta.noun_capital = a.noun_capital || b.noun_capital;\n\ta.punctuated = a.punctuated || b.punctuated;\n\ta.end = a.end || b.end;\n\treturn a;\n}", ...
[ "0.65076494", "0.55685544", "0.5499065", "0.53995144", "0.53959435", "0.51558644", "0.50866157", "0.50361913", "0.50331724", "0.4979844", "0.49723276", "0.49589822", "0.49257892", "0.4913621", "0.4909388", "0.4909388", "0.4909388", "0.4909388", "0.4909388", "0.4909388", "0.49...
0.64747834
1
Parse data coming from the entitysuggest service
parseEntitySuggestData(response) { const docs = []; const numItems = (response.response.suggestions.length <= 10) ? response.response.suggestions.length : 10; for (let i = 0; i < numItems; i++) { if (response.response.suggestions[i]) { docs.push({library: response.response.suggestions[i].sug...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseEntitySuggestData(response, query) {\n const index = this.getEntitySuggestIndex(response.params.method);\n const docs = [];\n\n const numItems = (response.response.suggestions.length <= 5) ? response.response.suggestions.length : 5;\n\n for (let i = 0; i < numItems; i++) {\n if (response.resp...
[ "0.7239293", "0.617069", "0.58724064", "0.5709289", "0.5566165", "0.5488181", "0.5426898", "0.54196197", "0.53791755", "0.53510326", "0.53331757", "0.5331417", "0.5328545", "0.52998173", "0.5266938", "0.526108", "0.525792", "0.5244326", "0.5227504", "0.51583266", "0.5137534",...
0.6997438
1
Function in charge of building and displaying an exercise based on pointer.
function buildAndShow () { sectionNameContainer.innerText = exercises[pointer].sectionName; sectionOrderContainer.innerText = exercises[pointer].sectionOrder; container.innerHTML = exercises[pointer].buildExercise(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function explainPuzzle(){\n\tlet ed = display.explanationDisplay;\n\ted.innerHTML = underground.selected.explanationDisplay();\n}", "function exercise07() {}", "function exercise11() {}", "function displayExercise(exerciseStructure) {\n editorDisplay.innerHTML = `\n <div class=\"display--exercise\">\n ...
[ "0.65458846", "0.654085", "0.64360607", "0.64184505", "0.6355388", "0.6168332", "0.6094029", "0.5780112", "0.57723016", "0.57444614", "0.57383597", "0.57226443", "0.56786704", "0.5672005", "0.56619644", "0.5653926", "0.5647953", "0.56453073", "0.5635503", "0.56272775", "0.562...
0.68248236
0
make image color different per upgrade tier
function updateUpgradeImage(val) { var idUpgrade = val.name.slice(0, val.name.length - 1) + "Upgrade"; // change upgrade color var idPurchase = val.name.slice(0, val.name.length - 1) + "Purchase"; // change purchase color $(`#${idUpgrade}`).attr("src", `img/upgrade/${idUpgrade}${val.upgradeTier}...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function imageMode(color) {\r\n image1.src = `img/rocket_${color}.svg`;\r\n image2.src = `img/alien_${color}.svg`;\r\n image3.src = `img/flat_${color}.svg`;\r\n starWarz.src = `img/warz_${color}.svg`;\r\n}", "function imageMode(color){\n \n image1.src = `img/undraw_among_nature_${color}.svg`;\n imag...
[ "0.6981844", "0.66040486", "0.6307299", "0.6225846", "0.62085706", "0.6125582", "0.6118409", "0.6111004", "0.6087947", "0.6080829", "0.6073451", "0.6056453", "0.60474724", "0.604028", "0.6038865", "0.6026286", "0.6016613", "0.6011833", "0.5997863", "0.59805006", "0.59691364",...
0.7077063
0
Add to Column List, Reset TextBox.
function addToColumn(column) { const itemText = addItems[column].textContent; const selectedArray = listArrays[column]; // Add to Array if (itemText !== "") { selectedArray.push(itemText); // Reset TextBox addItems[column].textContent = ''; // Update DOM updateDOM(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addToColumn(column){\n const itemText=addItems[column].textContent;\n const selectedArray=listArrays[column];\n selectedArray.push(itemText);\n addItems[column].textContent='';\n updateDOM();\n\n}", "function addToColumn(column) {\n const itemText = addItems[column].textContent\n const selectedArray =...
[ "0.67871225", "0.6650869", "0.6582284", "0.6544518", "0.62695336", "0.6151658", "0.61467", "0.61079586", "0.6026121", "0.6023949", "0.5988998", "0.5856156", "0.58267695", "0.58263564", "0.5802479", "0.5802479", "0.5791955", "0.57890564", "0.5783056", "0.57599336", "0.57307583...
0.7215641
0
Returns the YouTube API client for the specified client. The client is created if it has not been created already.
getClientForUser(accountId: string): Client { if (PRIVATE(this).clients.has(accountId)) { return PRIVATE(this).clients.get(accountId) } let tokenGenerator = new TokenGenerator(accountId) let apiClient = new ApiClient( "youtube", 3, PRIVATE(this).apiKey, tokenGenerator, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserFromClient(client) {\n const clients = this.clients.filter(savedClient =>\n savedClient.clientId === client.clientId && savedClient.clientSecret === client.clientSecret\n );\n\n return clients[0];\n }", "getClient() {\n return client;\n }", "_getClient () {\n...
[ "0.5621825", "0.5561114", "0.5511008", "0.54533297", "0.5416231", "0.53185946", "0.51820755", "0.5120426", "0.51001024", "0.50813097", "0.50716805", "0.50053555", "0.50053096", "0.49903297", "0.49748927", "0.49640778", "0.4950055", "0.4950055", "0.4950055", "0.4950055", "0.49...
0.6645388
0
isExpression :: MaybeNode > Boolean
function isExpression(node) { return node != null && EXPRESSIONS.indexOf(node.type) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isExpression(node) {\n return CodeGenerator.Expression.hasOwnProperty(node.type);\n }", "function isExpression(node) {\n return CodeGenerator.Expression.hasOwnProperty(node.type);\n }", "function isExpression(node) {\n return CodeGenerator.Exp...
[ "0.7293742", "0.716361", "0.716361", "0.716361", "0.716361", "0.6874103", "0.67002887", "0.6329266", "0.6027005", "0.583801", "0.583801", "0.58299804", "0.58168983", "0.57947123", "0.5704565", "0.57021946", "0.57021946", "0.5662799", "0.55309105", "0.55309105", "0.5526737", ...
0.7724078
0
isIterationStatement :: Maybe Node > Boolean
function isIterationStatement(node) { return node != null && ITERATION_STATEMENTS.indexOf(node.type) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isStatement(node) {\n return CodeGenerator.Statement.hasOwnProperty(node.type);\n }", "function isStatement(node) {\n return node != null && STATEMENTS.indexOf(node.type) >= 0;\n}", "function isStatement(node) {\n return CodeGenerator.Statement.hasOwnP...
[ "0.6350622", "0.6250846", "0.622681", "0.622681", "0.622681", "0.622681", "0.60220474", "0.5928788", "0.58698756", "0.57860076", "0.5770611", "0.57297903", "0.57297903", "0.5659577", "0.5618946", "0.559797", "0.55833274", "0.55562705", "0.5547711", "0.552741", "0.5519926", ...
0.84040296
0
isStatement :: Maybe Node > Boolean
function isStatement(node) { return node != null && STATEMENTS.indexOf(node.type) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isStatement(node) {\n return CodeGenerator.Statement.hasOwnProperty(node.type);\n }", "function isStatement(node) {\n return CodeGenerator.Statement.hasOwnProperty(node.type);\n }", "function isStatement(node) {\n return CodeGenerator.Statemen...
[ "0.82158065", "0.80929846", "0.80929846", "0.80929846", "0.80929846", "0.8005336", "0.72928625", "0.7286383", "0.67092603", "0.6558557", "0.65238166", "0.6408411", "0.6407413", "0.6407413", "0.6407413", "0.6407413", "0.6407413", "0.64052886", "0.6403225", "0.6398744", "0.6357...
0.84901494
0
isSourceElement :: Maybe Node > Boolean
function isSourceElement(node) { return isStatement(node) || node != null && node.type === "FunctionDeclaration"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNode(source){\n if (window.Node) {\n return source instanceof Node;\n }\n else {\n // the document is a special Node and doesn't have many of\n // the common properties so we use an identity check instead.\n if ...
[ "0.70851797", "0.70300037", "0.69787955", "0.6683466", "0.6541914", "0.64992875", "0.634173", "0.6313242", "0.6313242", "0.6313242", "0.6313242", "0.62751454", "0.6214212", "0.61900425", "0.61446726", "0.6115347", "0.6115347", "0.60956573", "0.60536903", "0.60433435", "0.6017...
0.74479026
0
isValidObjectProperty :: Maybe Node > (Maybe Node > Boolean) > Boolean
function isValidObjectProperty(node, isValid) { if (node == null || !isExpression(node.value) || !isValid(node.value) || ["init", "get", "set"].indexOf(node.kind) < 0) return false; switch (node.key.type) { case "Identifier": return isIdentifierName(node.key.name); case "Literal": return ["N...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function objectPropertyHasValue(prop) {\r\n\r\n return typeof prop !== 'undefined' && prop !== \"\" ? true : false;\r\n}", "function validateDoxProp(prop) {\n return (prop && prop.hasOwnProperty(\"owner\") && validateOwnerData(prop.owner));\n}", "function test_hasProperty_null (){ as...
[ "0.62243205", "0.62021536", "0.61562794", "0.60441566", "0.5715294", "0.5712742", "0.5706683", "0.5645666", "0.5645666", "0.5611012", "0.55743307", "0.55713516", "0.55635834", "0.5546305", "0.55253667", "0.5491636", "0.54834634", "0.5472654", "0.54577976", "0.545455", "0.5440...
0.68356496
0
isProblematicIfStatement :: Node > Boolean
function isProblematicIfStatement(node) { return node.type === "IfStatement" && ( node.alternate != null && isProblematicIfStatement(node.alternate) || node.alternate == null && node.consequent != null && (node.consequent.type !== "IfStatement" || isProblematicIfStatement(node.consequent)) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseIfStatement() {\n CST.addBranchNode(\"IfStatement\");\n if (match([\"T_keywordIf\"], false, false)) {\n parseBooleanExpr();\n parseBlock();\n log(\"If Statement\");\n }\n else {\n errorlog(\"Parse Error - Expected 'if' to begin if statement, got \" + tokens[cur...
[ "0.68248713", "0.678521", "0.6708928", "0.669807", "0.66703683", "0.66703683", "0.66703683", "0.6594349", "0.6348937", "0.6259015", "0.62346953", "0.6216286", "0.6175455", "0.6160188", "0.61172485", "0.6065693", "0.6052424", "0.59788436", "0.5961358", "0.59504145", "0.5881699...
0.8417608
0
isAssignmentOperator :: String > Boolean
function isAssignmentOperator(op) { return ASSIGNMENT_OPERATORS.indexOf(op) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_isAssignmentOperator(tokenType) {\n return tokenType === 'SIMPLE_ASSIGN' || tokenType === 'COMPLEX_ASSIGN';\n }", "function matchAssign()\n\t\t{\n\t\t\tvar op;\n\t\t\tif (lookahead.type !== Token.Punctuator)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\top = lookahead.value;\n\t\t\treturn op === '=' || op...
[ "0.8429601", "0.74977607", "0.74935347", "0.74935347", "0.74935347", "0.74935347", "0.74935347", "0.7485794", "0.7485794", "0.7485794", "0.7485794", "0.7485794", "0.7485794", "0.7485794", "0.7485794", "0.7485794", "0.7485794", "0.7485794", "0.7485794", "0.7485794", "0.7485794...
0.85343593
0
isBinaryOperator :: String > Boolean
function isBinaryOperator(op) { return BINARY_OPERATORS.indexOf(op) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOperator(str) {\n if (str == \"(\" || str == \")\" || str == \"+\" || str == \"-\" || str == \"*\" || str == \"/\" || str == \".\")return true;\n return false;\n}", "function isOperators(str){\n if (str == \"(\" || str == \")\" || str == \"+\" || str == \"-\" || str == \"*\" || str == \"/\"...
[ "0.7556413", "0.73604125", "0.73103875", "0.7278194", "0.71860135", "0.7136313", "0.71020824", "0.6994306", "0.6922652", "0.6826718", "0.6802445", "0.6799687", "0.6747621", "0.6723798", "0.6699942", "0.6590303", "0.65046686", "0.6486742", "0.6355629", "0.63218474", "0.6305143...
0.8293853
0
isLogicalOperator :: String > Boolean
function isLogicalOperator(op) { return LOGICAL_OPERATORS.indexOf(op) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isLogicalOperator (lo = Helpers._null) {\n return this.logicalOperators.hasOwnProperty(lo) === true;\n }", "function isLogicalOrOperator(node) {\n return (node.type === ts_estree_1.AST_NODE_TYPES.LogicalExpression && node.operator === '||');\n}", "function isLogicalOrOperator(node) {\n retu...
[ "0.79737514", "0.77128816", "0.7650506", "0.7326567", "0.6980357", "0.683058", "0.67154974", "0.657823", "0.65201056", "0.65195924", "0.6450159", "0.6449188", "0.6444341", "0.64149314", "0.63830864", "0.63793045", "0.63619685", "0.6237988", "0.6224929", "0.6224315", "0.618296...
0.8248149
0
isUnaryOperator :: String > Boolean
function isUnaryOperator(op) { return UNARY_OPERATORS.indexOf(op) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOperator(str) {\n if (str == \"(\" || str == \")\" || str == \"+\" || str == \"-\" || str == \"*\" || str == \"/\" || str == \".\")return true;\n return false;\n}", "function operator(op) {\n if (op == '+' || op == '-' ||\n op == '^' || op == '*' ||\n op == '/' || op == '(' ||\...
[ "0.7722551", "0.77101487", "0.76590663", "0.76498604", "0.7625589", "0.74638593", "0.74103963", "0.7407831", "0.7363706", "0.72099483", "0.7123391", "0.71190405", "0.69694304", "0.69148904", "0.68674725", "0.68460065", "0.68177253", "0.6674881", "0.6572072", "0.6554563", "0.6...
0.82774395
0
isUpdateOperator :: String > Boolean
function isUpdateOperator(op) { return UPDATE_OPERATORS.indexOf(op) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isUpdateOperator (uo = Helpers._null) {\n return this.updateOperators.hasOwnProperty(uo) === true;\n }", "function checkForAtomicOperators(update) {\n if (Array.isArray(update)) {\n return update.reduce((err, u) => err || checkForAtomicOperators(u), null);\n }\n\n const keys = Object.keys(upd...
[ "0.8399667", "0.66202056", "0.6580573", "0.6551631", "0.6342821", "0.6297469", "0.6124357", "0.61147743", "0.6045191", "0.6028041", "0.5967065", "0.59396595", "0.5939591", "0.5939591", "0.5934419", "0.59183824", "0.59090257", "0.5859982", "0.5833644", "0.5759906", "0.5743468"...
0.8612855
0
isValidPrime :: Node > [Label] > Boolean > Boolean > Boolean > Boolean
function isValidPrime(node, labels, inFunc, inIter, inSwitch) { if (!node.type || node.loc != null && (node.loc.source != null && typeof node.loc.source != "string" || node.loc.start == null || typeof node.loc.start.line != "number" || node.loc.start.line < 1 || typeof node.loc.start.column != "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isPrime(number) {\n\n }", "function isPrime(number) {\n return false;\n}", "function isPrime(n) {\n\t// TODO:\n}", "function isPrime(n)\r\n{\r\n if(n%2!==0){\r\n return true\r\n \r\n }\r\n}", "function primeTests() {\n console.log(isPrime(1), \" -> false\");\n console.log(isPrime(2), \" -> ...
[ "0.704502", "0.6934399", "0.6931429", "0.6725983", "0.67218095", "0.67142856", "0.6692915", "0.666691", "0.66565067", "0.66500044", "0.6607623", "0.6607623", "0.6592344", "0.6588802", "0.65759164", "0.6563884", "0.65542024", "0.65425557", "0.6538003", "0.6515725", "0.65110725...
0.74948066
0
! vuei18n v8.17.4 (c) 2020 kazuya kawaguchi Released under the MIT License.
function en(t,e){"undefined"!=typeof console&&(console.warn("[vue-i18n] "+t),e&&console.warn(e.stack))}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&conso...
[ "0.73578525", "0.73196423", "0.73196423", "0.73196423", "0.73196423", "0.7296826", "0.7296826", "0.72383755", "0.72216284", "0.72179204", "0.7151343", "0.71357846", "0.71319485", "0.712262", "0.712262", "0.712262", "0.7120479", "0.71174085", "0.7104255", "0.7089953", "0.70768...
0.73234457
1
get de sales por user
getSaleUser(user){ const query = Sale.findOne({ user }).exec(); return query; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUser(user) {\n\t\tlet db = this.db;\n\n\t\treturn new Promise((resolve, reject)=>{\n\t\t\tlet data = db.get(constants.DATABASE_NAMES.HISTORIC_STREAMLOOTS).find({ name: user }).value();\n\n\t\t\tif(data) {\n\t\t\t\tresolve(data.amount);\n\t\t\t} else {\n\t\t\t\tresolve(\"0\");\n\t\t\t}\t\t\t\n\t\t});\n\t}", "f...
[ "0.6243736", "0.60460186", "0.5979563", "0.593216", "0.5911974", "0.59038234", "0.589403", "0.5890436", "0.58804715", "0.5838259", "0.58324546", "0.58284557", "0.58173496", "0.5813429", "0.57884175", "0.5787302", "0.5781034", "0.57789147", "0.57789147", "0.57789147", "0.57756...
0.6992606
0
check for blank row
function rowIsBlank(rowData, numCol) { const lastCol = Math.min(numCol,rowData.length); for (let i = 0; i < lastCol; i++) { if (rowData[i].hasOwnProperty("effectiveValue")) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isEmpty(){\n return this.getRows().length == 0;\n }", "function checkRow(row) {\n return row.filter(function(value) {\n return !value;\n }).length === 0;\n }", "isRowEmpty(resourceRecord) {\n const events = this.store.getEventsForResource(resourceRecord);\n return !events ...
[ "0.75974244", "0.72821337", "0.7179546", "0.7179546", "0.7054276", "0.69426596", "0.69270813", "0.6907976", "0.6903146", "0.68859535", "0.68834335", "0.68489647", "0.68489647", "0.68489647", "0.68489647", "0.68489647", "0.68489647", "0.68480515", "0.682483", "0.6795752", "0.6...
0.79314923
0
get actual length of a row of cells by looking for only columns that have effective value
function getActualLength(rowData) { let i; for (i = 0; i < rowData.length; i++) { if (!rowData[i].hasOwnProperty("effectiveValue")) { break; } } return i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function columnLength(column) {\n var count = 0;\n while (column[count]) {\n count++;\n }\n return count;\n}", "function getColumnsCount() {\r\n}", "getColumnsAmount() { //metodo para calcular a quantidade de coluna disponivel baseado no tamanho do bloco, para saber as dimensoes do celular\n...
[ "0.64555573", "0.64290005", "0.64198035", "0.6406817", "0.63903826", "0.6374507", "0.6374507", "0.6374507", "0.6374507", "0.6374507", "0.6374507", "0.6374507", "0.6374507", "0.63114804", "0.63114804", "0.6296023", "0.6273614", "0.6273614", "0.6273614", "0.62620693", "0.626099...
0.74947375
0
console.log("logging the first question", story.q); console.log("logging the nested question:", story.answers.yes.q);
function askQuestion(storyObj) { if (storyObj.q === undefined) { console.log(chalk.bgYellowBright(storyObj)); rl.close(); } else { rl.question(chalk.magenta(storyObj.q), (answer) => { //check if the user has given us an answer we can understand if (storyObj.answer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "displayQuestion() {\n console.log(this.question_p);\n// Using for/in\n// for (let idx in this.answers_p) {\n // Using for\n for (let idx = 0; idx < this.answers_p.length; idx++) {\n console.log(idx + '. ' + this.answers_p[idx]);\n }\n }", "function ask(question) {...
[ "0.62982666", "0.6150851", "0.58775324", "0.5746449", "0.57426924", "0.5708452", "0.570281", "0.56415784", "0.5607542", "0.5591214", "0.55601406", "0.5557271", "0.5546815", "0.5495371", "0.5479993", "0.5478068", "0.54539704", "0.5448912", "0.54346985", "0.5424813", "0.5414477...
0.61700535
1
Split products for paginate and create product elements
splitProducts(data, page, itemCount) { for (let i = page; i < page + itemCount; i++) { let col = document.createElement("div"); col.classList.add("col"); let card = document.createElement("div"); card.classList.add("card"); let img ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildProductPage() {\n let distributionCounter = currentSelection.length,\n allProducts = [],\n tabIndexCounter = 0;\n\n columnOne.innerHTML = \"\";\n columnTwo.innerHTML = \"\";\n columnThree.innerHTML = \"\";\n\n currentSelection.forEach((product)...
[ "0.6739659", "0.6633161", "0.641221", "0.63461334", "0.6340089", "0.63017845", "0.6224453", "0.620479", "0.61888224", "0.61884725", "0.6178519", "0.615064", "0.6129996", "0.61200047", "0.6118113", "0.6106759", "0.6066842", "0.6049233", "0.6047274", "0.6043296", "0.6021448", ...
0.711544
0
Fired when the user starts dragging the scrollable up
function onDragStart(e) { var currentTop = (scrollCtrl ? scrollCtrl.getScrollPosition().top : scrollable[0].scrollTop); if (currentTop <= options.maxStartY) { if (rotableElement.length === 0) rotableElement = angular.element($element[0].querySelector('.mos-rotate')); drag.ena...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _scrollbarMoveStart() {\n\t\t\t\t\t_clearItemHiding.call(this._timetable._view)\n\t\t\t\t\t// we use this to tell if a change is a dragging change or set programmatically\n\t\t\t\t\tthis._isDraggingChange = true;\n\t\t\t\t\t_moveStart.call(this._timetable._view);\n\t\t\t\t}", "preparingDragScroll(){\n ...
[ "0.6856635", "0.67823744", "0.6631232", "0.6589396", "0.65599537", "0.6546319", "0.6479461", "0.64764553", "0.64618117", "0.64408517", "0.64139473", "0.64020574", "0.6372466", "0.6370435", "0.6344959", "0.63396436", "0.63289285", "0.63245434", "0.632028", "0.63190806", "0.631...
0.68151665
1
example2() / Spread operator info: fullName instead of arguments is fullfunctional Array
function example3() { function hi() { for (var _len = arguments.length, fullName = Array(_len), _key = 0; _key < _len; _key++) { fullName[_key] = arguments[_key]; } console.log(fullName.join(' ')); } hi('vlad', 'argentum'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildName2(firstName, ...restOfName) {\n return firstName + ' ' + restOfName.join(' ');\n}", "function fullName1(person) {\n console.log(person.firstName + \" \" + person.lastName);\n}", "function showName(firstName, lastName, ...titles) {\n console.log( firstName + ' ' + lastName ); // Julius ...
[ "0.6414164", "0.6338297", "0.6329597", "0.63147426", "0.6262775", "0.61868495", "0.6181752", "0.61789507", "0.6080021", "0.6070125", "0.6054659", "0.6040338", "0.60286796", "0.60150796", "0.60025746", "0.59984106", "0.5998226", "0.5996346", "0.59225124", "0.5921127", "0.58962...
0.65604794
0
render Conditionally render the Rounds mode page as either the rounds table, the rounds form set to obtain a new round, or the rounds form set to edit an existing round.
render() { switch(this.props.mode) { case AppMode.ROUNDS: return ( <React.Fragment> <RoundsTable rounds={this.state.rounds} setEditId={this.setEditId} setDeleteId={this.setDeleteId} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n return (\n <Switch>\n <Route path={`${this.props.match.path}/add`}>\n <RoundForm\n saveRound={this.addRound}/>\n </Route>\n <Route path={`${this.props.match.path}/edit/:id`}\n ...
[ "0.6077183", "0.59390515", "0.5735042", "0.5732764", "0.54860467", "0.5456666", "0.5453037", "0.5424738", "0.5331475", "0.5323422", "0.531959", "0.5310537", "0.5292914", "0.52919734", "0.5283775", "0.51848215", "0.5112029", "0.5109826", "0.50847447", "0.50845087", "0.5083673"...
0.6908031
0
Appends the string 'value' to the calculator's display. If this is the first time appendToDisplay() is being called since the page was loaded, this function replaces the value in the display.
function appendToDisplay (value) { if (!dirty) { dirty = true; $("[name=displayedValue]").val(value); } else { $("[name=displayedValue]").val($("[name=displayedValue]").val() + value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayValue(value) {\n if(!equalsPressed){\n display.innerHTML += value;\n } else {\n calcClear();\n equalsPressed = false;\n display.textContent += value;\n };\n}", "function changeDisplayContent(value) {\n\n if(value == '')\n {\n displayCalc = '';\n ...
[ "0.74459934", "0.72938424", "0.7266238", "0.72057587", "0.71423787", "0.70839626", "0.7065699", "0.70139855", "0.68984836", "0.6854135", "0.68394417", "0.68371063", "0.676604", "0.6753452", "0.6753452", "0.671959", "0.671959", "0.6712487", "0.66894263", "0.6683149", "0.661193...
0.7913987
0
Updates the hidden form field with the selected operator, then submits the form to the server.
function formSubmit (operator) { $("[name=operator]").val(operator); $("[name=calculator]").submit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doOperacion(operacion) {\r\n\tvar frm = document.forms[0];\r\n\tfrm.operacion.value = operacion;\r\n\t//alert('operacion : ' + operacion)\r\n\tfrm.submit();\r\n}", "function submitForm(form,command)\r\n{\r\n\tform.operation.value=command;\r\n\tform.submit();\r\n}", "function submitForm(form,command)\r...
[ "0.61976385", "0.6047217", "0.6047217", "0.59473777", "0.5910744", "0.5792458", "0.56264246", "0.5585262", "0.55297786", "0.55209684", "0.5490103", "0.5482056", "0.5464638", "0.54510653", "0.5436222", "0.5433729", "0.5415529", "0.5399921", "0.5371455", "0.5355979", "0.5337501...
0.7577044
0
Start the game. Get participants, start let the fight begin.
async start() { const participants = await this.readParticipats(); await this.fight(participants); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function startGame() {\n const teams = await getTeams();\n if (teams) {\n Rounds = initRounds(teams);\n if (Rounds) {\n startRound(1, Rounds[1]);\n }\n }\n}", "function startTheGame() {\n if (opponentReady) {\n startNewRound();\n }\n }", "function start() {\n room.se...
[ "0.68990266", "0.68526757", "0.6799246", "0.67034143", "0.66801", "0.6675149", "0.6663601", "0.6603754", "0.6486084", "0.6452161", "0.6443238", "0.64244217", "0.6417847", "0.63757503", "0.6357532", "0.63327235", "0.6326257", "0.63218707", "0.6313314", "0.62740254", "0.6231471...
0.81374437
0
MultiTokens Tokens composed of arrays of TextTokens Is the given token a valid domain token? Should nums be included here?
function isDomainToken(token) { return token instanceof _text.DOMAIN || token instanceof _text.TLD; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tokenify (typedItems) {\n\n // Cluster tokens by Dividers and Ors\n let clusters = [[[]]];\n typedItems.forEach(item => {\n if (item.type === \"divider\") {\n clusters.push([[]]);\n\n } else {\n let dividerCluster = clusters[clusters.length - 1];\n\n if (item.type === \"or\") {\n ...
[ "0.60166377", "0.5886923", "0.58250165", "0.58250165", "0.58250165", "0.554211", "0.54183555", "0.53296643", "0.5235199", "0.5182296", "0.51521325", "0.49339023", "0.49339023", "0.49250156", "0.4894568", "0.4883979", "0.4883979", "0.48772916", "0.48725647", "0.4848473", "0.48...
0.59166586
1
Set Loading Indicator Visibility
_setLoadingIndicatorVisibility() { const that = this; if (that.appearance.displayLoadingIndicator) { that.$.loadingIndicatorContainer.classList.remove('smart-visibility-hidden'); return; } that.$.loadingIndicatorContainer.classList.add('smart-visibility-hidden')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setLoadingIndicatorVisibility() {\n const that = this;\n\n if (that.displayLoadingIndicator) {\n that.$.loadingIndicatorContainer.classList.remove('jqx-visibility-hidden');\n return;\n }\n\n that.$.loadingIndicatorContainer.classList.add('jqx-visibility-hidden');\...
[ "0.8577228", "0.8033402", "0.7605907", "0.74891406", "0.74315315", "0.7294787", "0.7275462", "0.7251526", "0.724855", "0.7220033", "0.72061193", "0.72007525", "0.7175972", "0.71457577", "0.7133719", "0.7133043", "0.71145517", "0.7113742", "0.7096152", "0.707137", "0.7057861",...
0.86529136
0
Enable/Disable Horizontal Scroll bar.
_refreshHorizontalScrollBarVisibility(scrollWidth) { const that = this; that.scrollWidth = scrollWidth; if (!that.computedHorizontalScrollBarVisibility) { that.scrollLeft = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enable() {\n workspaceScroller.enable();\n}", "function horizontalScroll() {\n document.getElementById(\"visualizeprocess\").addEventListener('wheel', function (e) {\n if (e.type !== 'wheel') {\n return;\n }\n let delta = ((e.deltaY || -e.wheelDelta || e.detail) >> ...
[ "0.69006777", "0.6791575", "0.6733974", "0.67300814", "0.66054696", "0.6599914", "0.6560899", "0.65464735", "0.64451545", "0.6439948", "0.6381252", "0.6361753", "0.63473976", "0.6255376", "0.6239628", "0.619244", "0.61624855", "0.6139416", "0.61033636", "0.60916907", "0.60890...
0.6903688
1
Regex Creator This function creates a Regex Object based on the testNumber. It then calls the mainValidator function.
function regCreator(input, myID, testNumber){ var rTest = ""; switch(testNumber){ case 1: // Name rTest = /[A-Za-z]+\s[A-Za-z]?\s?[A-Za-z]+/; break; case 2: // Phone rTest = /\d{3}-\d{3}-\d{4}/; break; case 3: // Address rTest = /\d+ [A-Z]\. ([A-Za-z0-9]+) \w+/; break; case 4: //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DefaultRegularExpression() \n{\n\n\t\t this.txt_isdisfact = /^\\d+$/ ;\n\n\t\t this.txt_isnotspace = /^[a-zA-Z][\\w-_.]*$/ ;\n\n\t\t this.txt_limit1_999 = /^0*[0-9]$|^0*[1-9][0-9]$|^0*[1-9][0-9][0-9]$/ ;\n\n\t\t this.txt_numeric = /[0-9][0-9]*/ ;\n\n\t\t this.txt_checkinteger = /[0-9]*/ ;\n\n\t\t this.lim...
[ "0.6475155", "0.61476487", "0.6124889", "0.6014226", "0.58015704", "0.57615674", "0.5728263", "0.57174337", "0.5710192", "0.56942254", "0.56745535", "0.56745535", "0.5646136", "0.5630567", "0.5604146", "0.55199784", "0.54988", "0.5498551", "0.54658216", "0.5457327", "0.538355...
0.7096667
0
Function to display UFO Sightings data in an HTML table By default all available data is displayed, unless user applies a filter 1. Use d3 to append one table row `tr` for each ufoSightings object 2. Use `Object.entries` to append a cell to the table row for each value in the ufoSighting object 3. Use d3 to update each...
function displayUFOSightings(ufoSightings) { // Get a reference to the table body var tbody = d3.select("tbody"); // Get a reference to the table heading to display the search result count var ufoSearchResult = d3.select("#ufo-count"); // Store the count of UFOs in the dataset var ufoCount =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sightingData(data) { \n tbody.text(\"\")\n\ndata.forEach(function(UFOsightings) {\n \n// Use d3 to append one table row `tr` for each sighting report\nvar row = tbody.append(\"tr\");\n\n// Use `Object.entries` to console.log each sighting report value\nObject.entries(UFOsightings).forEach(function([...
[ "0.8239629", "0.820182", "0.8055616", "0.77863204", "0.76978", "0.7686889", "0.7640202", "0.756323", "0.7544611", "0.7404535", "0.7402412", "0.73403144", "0.73100615", "0.73097193", "0.7286293", "0.72302085", "0.72249717", "0.7215682", "0.72101104", "0.7202174", "0.7202015", ...
0.827487
0
Function to populate the State, Country and Shape dropdown filters
function populateDropdowns(ufoSightings) { // Get a reference to the state, country and shape dropdown lists var stateFilter = d3.select("#state-filter"); var countryFilter = d3.select("#country-filter"); var shapeFilter = d3.select("#shape-filter"); // Grab all the states from the dataset var states = ufo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterByCriteria() {\n const arrayOfShapes = data.map((data) => data.shape);\n const uniqueShapes = [...new Set(arrayOfShapes)];\n const select = document.getElementById(\"dropdown-shapes\");\n uniqueShapes.map((shape) => {\n const option = document.createElement(\"option\");\n option.innerHTML ...
[ "0.6874772", "0.6863775", "0.6718439", "0.6683433", "0.66688555", "0.66610545", "0.6625924", "0.6613029", "0.6522933", "0.6505548", "0.6486886", "0.64307433", "0.6425863", "0.64181703", "0.6395476", "0.637938", "0.6375673", "0.63329977", "0.6330899", "0.63287675", "0.63095343...
0.7352762
0
updateBarCharts() is intended to invoke legacy js code that mostly deals with the bar chart plotting and some hidden html fields. That functionality was packaged into an angular service called PlotService
function updateBarCharts() { // if some sections do not have computed scores (no selections made), then instead of the default // string value, we need to pass empty string '' to the plotservice var temporalTmp = vm.temporalScore; if(temporalTmp == 'NA') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateChart() {\n var chartData, types = ['string', 'number', 'number'];\n\n chartData = computeChartData();\n\n vm.chartConfig = {\n type: \"BarChart\",\n displayed: true,\n data: Utils.arrayToDataTable(chartData, types),\n options: {\n legend: {\n ...
[ "0.7304211", "0.72363585", "0.71128005", "0.6835613", "0.6790476", "0.6768132", "0.6759277", "0.67314065", "0.6728381", "0.6702037", "0.6700378", "0.6696491", "0.6682461", "0.66733325", "0.6655797", "0.6639684", "0.65879184", "0.6572547", "0.6562275", "0.65607667", "0.6546736...
0.79608077
0
HIDDEN FIELD handling ========================================================= Check for the existence of the hidden fields containing data. One hidden field is a vector string and the other is a Vuln Id (CveId). If these are present the page needs to be setup to perform computations and display results based on these...
function hiddenCheck() { if (PlotService.hiddenVector.length > 0) { var vectorStr = PlotService.hiddenVector; // set calculator selections based on the vector string BaseDataFactory.setValues(vectorStr); TemporalDataFactory.setValues(vectorStr)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hiddenFiledOnPreRender(ctx) {\n jQuery(\".csrHiddenField\").closest(\"tr\").hide();\n}", "function prepareElementHidden() { // 4683\n ...
[ "0.64175195", "0.5949962", "0.5821672", "0.5782332", "0.5659996", "0.56437427", "0.5608816", "0.55415523", "0.55023634", "0.55023634", "0.55023634", "0.54898584", "0.54753876", "0.547219", "0.5466088", "0.5463314", "0.5463314", "0.5463314", "0.5463314", "0.5463314", "0.543676...
0.6351403
1
Constructs a new ParticipantLeaveBody.
constructor() { ParticipantLeaveBodyUserId.initialize(this);ParticipantLeaveBodyUserExternalId.initialize(this);ParticipantLeaveBodyParticipantId.initialize(this); ParticipantLeaveBody.initialize(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ParticipantLeaveBodyUserExternalId() {\n _classCallCheck(this, ParticipantLeaveBodyUserExternalId);\n\n ParticipantLeaveBodyUserExternalId.initialize(this);\n }", "function createLeaveAlert(messageText) {\n var template = jQuery('#alert-leave-template').html();\n var html = Mustache.render(temp...
[ "0.6392352", "0.5744859", "0.5074617", "0.4798714", "0.47496378", "0.47016928", "0.461985", "0.46049607", "0.45890665", "0.45745152", "0.4565704", "0.45587596", "0.4508009", "0.4462085", "0.44585422", "0.44505346", "0.44423863", "0.44413388", "0.44212228", "0.44107884", "0.43...
0.6244362
1
async function on load make await axios request to API to get all cupcakes loop through list of cupcakes create a new list item element for each append list item to UL in HTML template
async function showCupcakesOnStart(){ let response = await axios.get(`${BASE_URL}cupcakes`); let cupcakes = response.data.cupcakes; for (let cupcake of cupcakes){ let $cupcakeDiv = $('<div>'); let $cupcakeImg = $('<img>').attr("src", cupcake.image); let $cupcakeFlavor = $('<h3>').text(cupcake.flavor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function displayCupcakes() {\n const response = await axios.get(`${BASE_URL}/cupcakes`);\n\n for (let cupcake of response.data.cupcakes) {\n let addCupcake = $(cupcakeHTML(cupcake));\n $(\"#menu-list\").append(addCupcake);\n }\n}", "async function showInitialCupcakes() {\r\n const r...
[ "0.81121695", "0.8087395", "0.7788447", "0.7608382", "0.7413486", "0.69400924", "0.69253427", "0.65525174", "0.65525174", "0.6532935", "0.6529163", "0.65199304", "0.651713", "0.6514527", "0.6496811", "0.6485366", "0.6469104", "0.640371", "0.6357898", "0.63412994", "0.633157",...
0.82354
0
Moving the cube to desired section
function jumpToSection(newRotateY, newRotateX){ jumpingToSection = true; cube.style.transition = "all 1s cubic-bezier(.96,-0.43,.76,.8)"; cube.style.transform = `rotateY(${newRotateY}DEG) rotateX(${newRotateX}DEG)`; setTimeout(()=>{ currentRotateX = newRotateX; currentRotateY = newRotateY; cube.styl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetCubePosition() {\n let camera = tomni.threeD.getCamera();\n camera.fov = 40;\n let center = tomni.getCurrentCell().getCenter();\n let shift = tomni.getCurrentCell().info.dataset_id === 1 ? 256 : 2014;\n switch (tomni.twoD.axis) {\n case 'x':\n ...
[ "0.67462724", "0.65072286", "0.6374397", "0.6366034", "0.6307947", "0.6293234", "0.62634987", "0.60821456", "0.60821456", "0.60486037", "0.5989524", "0.5935217", "0.5868672", "0.5810664", "0.57857984", "0.5774269", "0.574714", "0.56799877", "0.5659746", "0.56385374", "0.56256...
0.70420986
0
Diplicity data has significant metadata, but it breaks Restangular. Focus on what's in the Properties property.
function stripMetadata(data) { return data.Properties; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get properties() { return this._properties; }", "function descriminatingProperty() { }", "getProperties() {\n\t\treturn this.metadata.properties || {};\n\t}", "static get properties() {\n return {\n id: {\n attribute: \"mapid\",\n },\n derivation: {\n ...
[ "0.6218098", "0.6132815", "0.61165154", "0.6048434", "0.5951276", "0.59024405", "0.5825194", "0.577577", "0.57146144", "0.57123214", "0.5653393", "0.5634473", "0.5634473", "0.5634473", "0.5622588", "0.5597508", "0.55943054", "0.55943054", "0.55935097", "0.55885667", "0.555377...
0.6308341
0
Disable and hide scroll bar
function disableScrollBars() { document.documentElement.style.overflow = 'hidden'; // firefox, chrome document.body.style.overflow = "hidden"; document.body.scroll = "no"; // ie only }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disableHideOnScroll() {\n this.root.removeAttribute('data-hide-on-scroll');\n this.hideOnScroll = false;\n this.root.classList.remove('is-hidden-scroll');\n }", "hackScrollbar() {\n\t\tif (this.state.hackScrollbar) {\n\t\t\tdocument.querySelector(\"html\").style.overflowY = \"hidden\";\n\...
[ "0.7534998", "0.7403631", "0.7363749", "0.7133619", "0.7113771", "0.7113771", "0.7078863", "0.7069655", "0.7039901", "0.7035911", "0.6996309", "0.69479924", "0.69240266", "0.6921542", "0.69211525", "0.68794733", "0.6839145", "0.67417675", "0.6732432", "0.66858494", "0.668558"...
0.7641355
0
Verifies if a block should fall because is floating. Sets the locked timer to "fall_delay" if true.
function shouldBlockFall(row, col) { var block = blocks[row][col]; if(isLocked(row,col)) return; if (isFloating(row, col)) { block.properties.locked = fall_delay; blocks[row + 1][col].properties.locked = fall_delay; } if (isAboveFloating(row, col)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "gravity(forceRun = false) {\n this.fallTimer += deltaTime;\n if (this.fallTimer >= this.speed || forceRun) {\n // Kill tetri if hit block\n if (this.dead) {\n this.killTetri();\n this.dead = false;\n this.spawnTetri();\n } else {\n this.activeRow++;\n }\n ...
[ "0.6079464", "0.604961", "0.5637707", "0.55905277", "0.55496395", "0.55374014", "0.5473148", "0.5440155", "0.5434852", "0.5401233", "0.5348771", "0.53363156", "0.5332746", "0.5276672", "0.52548826", "0.5230867", "0.5122106", "0.51218134", "0.5109841", "0.50996375", "0.5058663...
0.6794877
0
Looks for any block that is floating. Returns true if at least one of all the exisiting blocks is floating. Returns false if all blocks are not floating.
function areBlocksFloating(){ for (var row = max_rows - 2; row >= 0; row--) { for (var col = 0; col < max_cols; col++) { if(isFloating(row,col)) return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIfStillFloating(haystack, needle) {\n var stillFloating = false;\n for (var i = 0; i < needle.length; i++) {\n if (haystack.includes(needle[i])) {\n stillFloating = true;\n }\n }\n return stillFloating;\n}", "function anyAddableBlocks() {\n return testAny(\n n...
[ "0.6193869", "0.6047995", "0.56547046", "0.5601267", "0.5557182", "0.55483925", "0.55419123", "0.5532661", "0.55074686", "0.5463719", "0.5452961", "0.54156667", "0.5401808", "0.53797966", "0.53797966", "0.53797966", "0.53797966", "0.53797966", "0.5372876", "0.5364713", "0.534...
0.82867175
0