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
function feedGrid(jsonObj, gridInfo, isAppend); Purpose: Load JSON object into data grid.
function feedGrid(jsonObj, gridInfo, isAppend) { var i = 0, id = 0, len = 0, rowCounter = 0, // count of existing rows of the grid obj = jsonObj; propExpression = gridInfo.ngTemplate, // property expression, e.g., student.detail_.name anchorElem = {}, // the ng-anchor ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function feedGridandLookup(jsonObj, gridInfo, isAppend) {\r\n feedGrid(jsonObj, gridInfo, isAppend);\r\n doLookupforGrid(gridInfo.gridId);\r\n}", "function renderGrid(obj) {\n\tno_data = false;\n\t\n\tif (nullOrEmpty(obj)) {\n\t\talert(\"No parameter is passed\");\n\t\treturn false;\n\t}\n\t\n\tvar target ...
[ "0.7943497", "0.6122319", "0.6096063", "0.6074111", "0.6053255", "0.60486853", "0.6001121", "0.59523153", "0.5832541", "0.5813574", "0.5777402", "0.56675607", "0.5663942", "0.5631025", "0.562188", "0.5575471", "0.5538752", "0.54999137", "0.54828376", "0.5476036", "0.5419257",...
0.69985473
1
Fill the grid row template with concrete data, to create a new grid row.
function fillRowTemplate(indexName, ngTemplate, data, gridInfo) { var rowTemplate = ""; rowGrid = {}, dropDownListElem = {}, prop = {}; rowTemplate = $.trim(templateMap[ngTemplate]).substring(7); rowTemplate = rowTemplate.substring(0, rowTemplate.length - 8); if (data.json != null...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createRowTemplate() {\n rowTemplate = angular.element(stTemplates.row.template);\n if (cells.length) {\n var warningIcon = angular.element(stTemplates.row.warningIcon);\n cells[0].prepend(warningIcon);\n cells[cells.len...
[ "0.6765696", "0.63270175", "0.6312085", "0.624496", "0.62246805", "0.61549926", "0.6143129", "0.6132826", "0.6098487", "0.6073667", "0.59800273", "0.592277", "0.5914533", "0.59048444", "0.5891674", "0.58839417", "0.5877092", "0.58725756", "0.5856749", "0.5847439", "0.5836173"...
0.67905724
0
Construct a grid ready json object out of an array or a single object. Grid ready json object means the structure of the object matches that of the ngTempalte.
function constructGridReadyObj(arr, tExp) { var pObj = {}, curObj = pObj; // Constructure the structure out of tExp(which // is usually a ngTempalte of the grid) while (tExp.indexOf(".") != -1) { var dPos = tExp.indexOf("."); var cProp = tExp.substring(0, dPos); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getJsonArrFromGrid(jsonObj, ngTemplate) {\r\n // the bottom hierarchy must be an array\r\n var hierarchies = ngTemplate.split('.');\r\n var depth = hierarchies.length;\r\n var result = {};\r\n var i = 0;\r\n var arrayName = '';\r\n\r\n if (depth <= 0) {\r\n return null;\r\n ...
[ "0.6434574", "0.61947006", "0.60758", "0.6035159", "0.5934838", "0.58544934", "0.5838825", "0.5823189", "0.5792651", "0.5715008", "0.56426793", "0.55814755", "0.55085754", "0.5504282", "0.5475427", "0.5471893", "0.5448986", "0.5406943", "0.5381899", "0.5341001", "0.5308424", ...
0.69085956
0
function feedGridandLookup(jsonObj, gridInfo); Purpose: Load JSON object into data grid and to lookup codes and display values Author: Mahen Date: 20151019 20160105 Zhou Kai adds isAppend, which is a flag indicating this feed is a update of existing row, or a appendent of a new row. For detailed description of this fla...
function feedGridandLookup(jsonObj, gridInfo, isAppend) { feedGrid(jsonObj, gridInfo, isAppend); doLookupforGrid(gridInfo.gridId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function feedGrid(jsonObj, gridInfo, isAppend) {\r\n var i = 0,\r\n id = 0,\r\n len = 0,\r\n rowCounter = 0, // count of existing rows of the grid\r\n obj = jsonObj;\r\n propExpression = gridInfo.ngTemplate, // property expression, e.g., student.detail_.name\r\n anchorElem = {}...
[ "0.7077864", "0.60141414", "0.58008635", "0.57847726", "0.5744787", "0.57258606", "0.57070935", "0.5697005", "0.562229", "0.5600042", "0.5525844", "0.5473346", "0.5461566", "0.54320073", "0.5428534", "0.5421086", "0.53662974", "0.53521097", "0.5346543", "0.53347266", "0.53092...
0.8636498
0
function doLookupforGrid(gridId); Purpose: Do lookup based on the data and the code group category and return the displayable field Author: Mahen Date: 20151019
function doLookupforGrid(gridId) { var table = $('#' + gridId)[0]; // zhou kai, for compatitility issue if (table == null) { return; } var spans = table.getElementsByTagName('span'); for (var i = 0; i < spans.length; i++) { if ($(spans[i]).html().indexOf('[') != -1) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preFilterReportingEntityLookup() {\n // get case guid\n var caseId = Xrm.Page.data.entity.getId();\n var formType = Xrm.Page.ui.getFormType();\n\n if (Xrm.Page.ui.getFormType() != 1) {\n Xrm.Page.getControl(\"ls_reportingunitid\").addPreSearch(function () {\n\n // find busine...
[ "0.57426107", "0.555217", "0.5481698", "0.53283745", "0.5296738", "0.52720153", "0.52594167", "0.5256317", "0.5187571", "0.51745677", "0.5164049", "0.5142481", "0.5115398", "0.50561875", "0.50561875", "0.5040939", "0.49543366", "0.49310645", "0.49239528", "0.48993093", "0.488...
0.74214995
0
through the grid has data or not to decide show "No Data Found" message or not parameters : anchorName : the table nganchor value
function showNoDataFoundMsg(anchorName) { if (anchorName == null) return; var noDataId = anchorName.replaceAll(".", "\\.") + "_NoData"; var anchorElem = $("tbody[ng-anchor='" + anchorName + "']"); if (anchorElem.length == 0) anchorElem = $("table[ng-anchor='" + anchorName + "']"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "noRowData () {\n return this.state.dataSource.getRowCount() === 0\n }", "_noRowData () {\n const { dataSource } = this.state\n return dataSource.getRowCount() === 0\n }", "function checkForNoResults() {\r\n\t\t\tif (state.paging.numMatchedItems == 0) {\r\n\t\t\t\t$('#noFilterResults').show();\r\n\t\...
[ "0.6175551", "0.6102577", "0.56792945", "0.5622373", "0.54689634", "0.5387061", "0.525537", "0.5251993", "0.51859426", "0.51736814", "0.5170843", "0.5138686", "0.5085174", "0.50640494", "0.50640494", "0.50481766", "0.5047699", "0.50454384", "0.50350565", "0.500216", "0.499914...
0.8011696
0
Get the interested array from the JSON object, the structure of jsonObj should map to ngTemplate.
function getJsonArrFromGrid(jsonObj, ngTemplate) { // the bottom hierarchy must be an array var hierarchies = ngTemplate.split('.'); var depth = hierarchies.length; var result = {}; var i = 0; var arrayName = ''; if (depth <= 0) { return null; } for (i = 0; i < ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsonObjectsToArrayHandler(data) {\n var str = '[' + data.replace(/\\n/g, ' ').replace(/\\}\\s*\\{/g, '}, {') + ']';\n return angular.fromJson(str);\n}", "json2array(json){\n let result = [];\n let keys = Object.keys(json);\n keys.forEach(function(key){\n result.push(jso...
[ "0.6230216", "0.61471677", "0.6121147", "0.5944804", "0.59005624", "0.5859125", "0.5836621", "0.57999814", "0.57757753", "0.57745117", "0.5763929", "0.57563037", "0.57520366", "0.56911683", "0.5667334", "0.5666159", "0.5620838", "0.5615424", "0.56054676", "0.56043005", "0.559...
0.7300861
0
In defaultValue was moved to RangeWithValue. This ES5 getter catches programming errors where defaultValue is still used with Range.
get defaultValue() { throw new Error( 'defaultValue is undefined, did you mean to use RangeWithValue?' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get defaultValue() {\n return undefined;\n }", "get range() {\n throw 'NOT_IMPLEMENTED_EXCEPTION';\n }", "properties() {\n return {\n minValue: range(0, 100),\n maxValue: range(0, 100),\n defaultValue: range(0, 100)\n }\n }", "function useRangeSlider(defaultValue, _a...
[ "0.6214759", "0.6187479", "0.60700524", "0.59875417", "0.5903599", "0.5823577", "0.58172905", "0.5813964", "0.5770688", "0.5760658", "0.57582474", "0.57426345", "0.57405084", "0.57237935", "0.5713335", "0.5711898", "0.5711898", "0.569776", "0.56835943", "0.5671984", "0.567198...
0.8706966
0
multiplies all of the integers together, divides the result by the number of entries in the array, and returns the result as a string with the value rounded to three decimal places. PROBLEM input: array of integers output: string of the value of the integer average rounded to three decimal places. AVERAGE: multiply int...
function multiplicativeAverage(integer) { let total = integer.reduce((accumulator, element) => accumulator * element, 1); return (total / integer.length).toFixed(3); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function multiplicativeAverage(integers) {\n let product = integers.reduce((acc, int) => acc * int, 1);\n return (product / integers.length).toFixed(3);\n}", "function calcAVG(array) {\r\n var total = 0;\r\n for (var i = 0; i < array.length; i++) {\r\n total += array[i];\r\n }\r\n var avg = ...
[ "0.77637804", "0.7222918", "0.7217605", "0.7192319", "0.7142551", "0.7136876", "0.71328694", "0.71328694", "0.7132696", "0.7097237", "0.70800275", "0.70667326", "0.7048352", "0.70418566", "0.7032808", "0.7010108", "0.7006553", "0.7006553", "0.7003775", "0.69809735", "0.695790...
0.7476526
1
add delete btn for each comment
function appendDeleteBtn(commentList){ const deleteBtn = document.createElement("button"); deleteBtn.innerText = "Delete"; commentList.appendChild(deleteBtn); deleteBtn.addEventListener("click", function(e){ e.target.parentElement.remove(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static removeComment(e) {\n // ! i had to target 3 classes cause iam using [e.target]\n let el = e.target.parentElement.parentElement.parentElement.parentElement;\n // ? trageting the element that has delete-text class\n if (e.target.classList.contains('delete-text')) {\n // ...
[ "0.67372894", "0.67240673", "0.67180264", "0.6653304", "0.6626328", "0.6585228", "0.65768814", "0.6546237", "0.6546237", "0.65266234", "0.64675444", "0.64565873", "0.64161074", "0.64050174", "0.63905513", "0.6383156", "0.63784575", "0.63760203", "0.63687485", "0.63479364", "0...
0.773457
0
called whenever the test is supposed to change
function changeTest() { // clear the main area main.empty(); // run the initialization and change the step function step = currentType.init( main ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTestResults(e){e.passesTest=getTestResult(e)}", "setUp() {}", "function setTesting(next) {\n state.isForTesting = true;\n next();\n}", "onTestsStart () {\n this.start = new Date()\n }", "changed() {}", "_afterSuite() {\n\n }", "before (callback) {\n\t\tBoundAsync.series(this, ...
[ "0.6883807", "0.6585684", "0.65192145", "0.6513127", "0.6480024", "0.64762175", "0.6455444", "0.6413868", "0.63892615", "0.6326496", "0.6303889", "0.62983465", "0.62807393", "0.62777764", "0.6268968", "0.6264845", "0.62475884", "0.62083244", "0.6181945", "0.6155953", "0.60767...
0.7511497
0
The core function of error handling, it receives the error message, stack trace, and name of the iframe that generated the error This handler confirms that a window with this error is not opened yet, and then opens a popup
function handleError(message,trace,iframe) { if(!err_wins[message]) { msgWindow=launchCenter("" , "" ,400, 540) doc = msgWindow.document; doc.clear(); doc.writeln('<HTML><HEAD><TITLE>Error Page</TITLE>'); doc.writeln('<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">'); doc.w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onError() {\n\ttry {\n\t\twindow.opener.ZoteroPane.displayErrorMessage();\n\t}\n\tcatch (e) {\n\t\tZotero.logError(e);\n\t}\n\twindow.close();\n}", "function errorhandled(iframe_name, title)\n{\n err_wins[title] = null;\n}", "function errorOpen(event) {\n window.alert(\"Open error !\");\n}", "clos...
[ "0.7203509", "0.7201821", "0.6851802", "0.663724", "0.6626808", "0.6626808", "0.65202695", "0.6498172", "0.64912903", "0.6465108", "0.6428268", "0.64232665", "0.64232665", "0.64232665", "0.64232665", "0.64232665", "0.63530064", "0.6097439", "0.6090618", "0.6090463", "0.609046...
0.7479165
0
Clean blocks with class tmp
function removeNameBlocks() { const blocks = document.querySelectorAll('.tmp'); blocks.forEach(function (el){ el.remove(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cleanupBlocks(ast) {\n \n esrecurse.visit(ast, {\n BlockStatement: function (node) {\n var cleaned = [];\n for (var i = 0; i < node.body.length; i++) {\n var stmt = node.body[i];\n this.visit(stmt);\n ...
[ "0.64643365", "0.6220446", "0.6195853", "0.61825466", "0.613272", "0.606836", "0.6036061", "0.6014418", "0.5855425", "0.58444226", "0.5796279", "0.57931274", "0.5747291", "0.572668", "0.5722754", "0.5689669", "0.5653695", "0.5608974", "0.5555337", "0.5516498", "0.5506135", ...
0.68276036
0
Remove focus from all buttons.
function removeBlurFromButton() { if (document.activeElement != document.body) document.activeElement.blur(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "unfocusAllWindows () {\n this._windows.forEach(function (element) {\n element.isNotFocused()\n })\n }", "unsetFocused() {\n this.focused = false;\n if (this.menuitem.children.repeats.length > 0) {\n this._closeSub();\n }\n }", "function clearFocus(e) {\n focus.textContent = '';\n}...
[ "0.7329708", "0.68108594", "0.66207093", "0.6533303", "0.65115684", "0.64779747", "0.64491254", "0.6403831", "0.63743407", "0.6370372", "0.6356655", "0.6354082", "0.6344228", "0.6264519", "0.6249771", "0.62239736", "0.6215587", "0.6200715", "0.61874604", "0.6184994", "0.61738...
0.70475125
1
Indicates if time is over and game not playing.
function isTimeOverAndGameNotPlaying() { var output = !isPlaying && !notStarted && timerSeconds === 0 && timerMinutes === 0; return output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isGameOver(){\n var remainingTime = this.updateTimer();\n return remainingTime <= 0;\n }", "get TimeIsOver () {\n var over = false;\n if (new Date().getTime() > this.stopTime) {\n over = true;\n }\n return over;\n }", "isGameOver() {\n return this.hasWinner()...
[ "0.7874038", "0.7603826", "0.73199266", "0.72482157", "0.72140104", "0.71330994", "0.7080494", "0.70792085", "0.70512474", "0.70278", "0.7021189", "0.69638985", "0.69395506", "0.69375026", "0.6922583", "0.68878096", "0.6883519", "0.68722075", "0.68696415", "0.6859608", "0.678...
0.849305
0
loop through quizzes to find appropriate one
function updateQuizzes() { "use strict"; quizFileNames.forEach(function(fileName) { let quizNameGroups = /(.*)Quiz.json/.exec(fileName); let answerKeyNameGroups = /(.*)QuizAnswerKeys.json/.exec(fileName); let actualQuizName = quizNameGroups ? quizNameGroups[1] : false; let actual...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Quizz(quizz) {\n if (quizz == undefined) {\n\tconsole.log('Warning quizz undefined');\n\treturn;\n }\n quizz.getPublicUrl = function() {\n\treturn url_site + \"/c/\" + quizz.url_id;\n }\n quizz.getAdminUrl = function() {\n\treturn url_site + \"/a/\" + quizz.url_id;\n }\n quizz.getResu...
[ "0.62492526", "0.58465576", "0.58003974", "0.5796687", "0.5757466", "0.5732657", "0.5726731", "0.5700122", "0.5679152", "0.5638863", "0.5576494", "0.5533583", "0.5517306", "0.54505575", "0.5437947", "0.5436198", "0.5436177", "0.543009", "0.5420626", "0.5419507", "0.5415089", ...
0.60684484
1
str byteToHex(uint8 byte) converts a single byte to a hex string
function byteToHex (byte) { return ('0' + byte.toString(16)).slice(-2) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function byteToHex(byte) {\n return ('0' + byte.toString(16)).slice(-2);\n}", "function toHexString(byte) {\n return byte.toString(16);\n}", "function byte2hexStr(byte) {\n var hexByteMap = \"0123456789ABCDEF\";\n var str = \"\";\n str += hexByteMap.charAt(byte >> 4);\n str += hexByteMap.charAt(byte & ...
[ "0.8548455", "0.8177799", "0.8167595", "0.81299525", "0.73864317", "0.710873", "0.70685434", "0.68887734", "0.6880621", "0.6879572", "0.6879572", "0.6879572", "0.6879572", "0.6851331", "0.6832223", "0.6832223", "0.6821195", "0.6817589", "0.68080676", "0.68080676", "0.68080676...
0.8538276
1
Make a supplier unavailable
function disableSupplier(supplier_id) { var ajax = $.ajax({ type: "PUT", url: "/suppliers/" + supplier_id + "/unavailable", contentType: "application/json" }) ajax.done(function(res){ clear_form_data() flash_message("Supplier unavaila...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unavailable() {\n alert(\"Source is unavailable\");\n}", "function ensuresupplier(id, callback){\r\n\r\n // do we have it already loaded\r\n if(suppliers[id]){\r\n callback(null, suppliers[id]);\r\n return;\r\n }\r\n\r\n if(!options.autocreate){\r\n throw new Error('autocreat...
[ "0.52559984", "0.5188111", "0.5153112", "0.5153112", "0.5090971", "0.5090971", "0.5090971", "0.5090971", "0.5090971", "0.5090971", "0.5023428", "0.5023428", "0.50221586", "0.49710718", "0.49710718", "0.49710718", "0.49710718", "0.49546713", "0.49506325", "0.4948931", "0.49489...
0.694175
0
The constructor needs two params : neurons : an already built neurons grid as an array data : data set to consider maxStep : the max step that will be clamped in scaleStepLearningCoef and scaleStepNeighborhood maxLearningCoef minLearningCoef maxNeighborhood minNeighborhood each neuron should provide a 2D vector pos, wh...
constructor({ neurons, data, maxStep = 10000, minLearningCoef = .1, maxLearningCoef = .4, minNeighborhood = .3, maxNeighborhood = 1, }) { // data vectors should have at least one dimension if (!data[0].length) { throw new Error('Kohonen constructor: data vectors should have ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(neuralNetwork) {\n this.setInitialPosition();\n this.setInitialRays();\n this.rayColor = color(200);\n this.bodyColor = color(0, 200);\n const numInputs = this.rays.length + 2;\n if (neuralNetwork) {\n this.neuralNetwork = neuralNetwork;\n } else {\n this.neuralNetwork = ...
[ "0.6150442", "0.59972656", "0.59474033", "0.5840894", "0.58071244", "0.5796386", "0.5794382", "0.5778173", "0.5776876", "0.5745234", "0.57428724", "0.5721293", "0.5714469", "0.569854", "0.569442", "0.56718856", "0.5645765", "0.559308", "0.5573832", "0.5556348", "0.5551101", ...
0.70413154
0
The UMatrix value of a particular node is the average distance between the node's weight vector and that of its closest neighbors.
umatrix() { const roundToTwo = num => +(Math.round(num + "e+2") + "e-2"); const findNeighors = cn => _.filter( n => roundToTwo(dist(n.pos, cn.pos)) === 1, this.neurons ); return _.map( n => mean(findNeighors(n).map(nb => dist(nb.v, n.v))), this.neurons ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeNodeValues() {\n nodes.forEach(function (node) {\n node.value = Math.max(d3Array.sum(node.sourceLinks, value), d3Array.sum(node.targetLinks, value));\n });\n }", "function computeNodeValues() {\r\n ...
[ "0.57338345", "0.5706168", "0.57006073", "0.56962883", "0.56914675", "0.5687005", "0.5687005", "0.5680191", "0.56793684", "0.56793684", "0.56793684", "0.5666479", "0.5666479", "0.5654197", "0.56046855", "0.55783355", "0.5484441", "0.5475755", "0.5376494", "0.5358178", "0.5347...
0.60290956
0
neighborhood function made with a gaussian
neighborhood({ bmu, n }) { const a = 1; const sigmaX = 1; const sigmaY = 1; return a * Math.exp( -(Math.pow(n.pos[0] - bmu.pos[0], 2) / 2 * Math.pow(sigmaX, 2) + Math.pow(n.pos[1] - bmu.pos[1], 2) / 2 * Math.pow(sigmaY, 2)) ) * this.scaleStepNeighborhood(this.step); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "gaussianPointAt(g) {\n var coeff = 1/( this.sigma * Math.sqrt(2 * Math.PI) );\n var powr = -1/2 * Math.pow((g - this.mu), 2) / Math.pow(this.sigma, 2);\n return coeff * Math.exp(powr);\n }", "function kde(gridPoint) {\n return d3.mean(xyPoints, function(p) { return gaussian(norm(p, gridPoint) / h) }) ...
[ "0.6095284", "0.5995132", "0.56636965", "0.5661384", "0.5634355", "0.5577348", "0.5572442", "0.5346303", "0.53455305", "0.531577", "0.5312398", "0.5295865", "0.5260393", "0.5246781", "0.5240626", "0.52226615", "0.52165574", "0.52165574", "0.5210917", "0.5120497", "0.51042515"...
0.7111668
0
send message to current tab
function send_message(message){ browser.tabs.sendMessage(currentTab.id, message, function() {}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function messageActiveTab(request){\n\tchrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n\t\tchrome.tabs.sendMessage(tabs[0].id,request);\n\t});\n}", "function messageClient(msg){\n\tchrome.tabs.sendMessage(currentTab.id,msg,function(result){\n\t});\n\n}", "function sendMessage(msg){\n\n...
[ "0.7711135", "0.76730084", "0.75261265", "0.74937725", "0.74323344", "0.73947006", "0.73779917", "0.73528045", "0.73377484", "0.7270346", "0.72647744", "0.72559327", "0.7252305", "0.7236763", "0.7229864", "0.7145353", "0.70016176", "0.69739616", "0.6961861", "0.6945122", "0.6...
0.82921815
0
Constructor for the Hotspot class
function Hotspot(id,coords){ var nArgs=arguments.length;//The number of arguments passed to the function if(nArgs===2) { this.id=id; this.coords=coords; } else if(nArgs===1){ this.id=id; this.coords=[]; } else{ this.id=0; this.coords=[]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Object_ImageMapHotspot() {\n Object_ImageMapHotspot.__super__.constructor.call(this);\n }", "constructor(name,rating,pricePerNight,distanceFromCity,wifi,\n\t\tpool){\n\tthis.name=name;\n\tthis.rating=rating;\n\tthis.pricePerNight=pricePerNight;\n\tthis.distanceFromCity=distanceFromCity;\n\tthis.wifi...
[ "0.6868454", "0.60682625", "0.5942919", "0.5942919", "0.5942919", "0.5942919", "0.5942919", "0.5942919", "0.5942919", "0.5874199", "0.5836222", "0.58312225", "0.58183515", "0.57946265", "0.57946265", "0.57946265", "0.57550967", "0.57550967", "0.57550967", "0.57550967", "0.575...
0.66851944
1
returns [ 1, 3, 5 ] var result = getFields(objArray, "foo"); / EXTRACT VALUE FROM OBJECT KNOWING KEY NAME
function getFieldByKey(theArray, theKey) { for(var theKy in theArray) { if(theArray.hasOwnProperty(theKey)) { var theVal = theArray[theKey]; } } // fine for return theVal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFields(input, field){\r\n var output=[];\r\n for(i=0; i<input.length; i++)\r\n {\r\n output.push(input[i][field]);\r\n }\r\n return output;\r\n }", "function getFields(...
[ "0.6612311", "0.6570529", "0.64813346", "0.6379937", "0.614162", "0.60664463", "0.60455567", "0.602772", "0.59815824", "0.5966402", "0.59615046", "0.5957061", "0.59525317", "0.59220946", "0.5920988", "0.59153056", "0.5907559", "0.59002346", "0.5895997", "0.58831245", "0.58656...
0.6800353
0
private methods get engine localStorage, sessionStorage, wxStorage
_getEngine() { switch (this.engine) { case 'localStorage': return localStorage[this.db_id]; case 'sessionStorage': return sessionStorage[this.db_id]; case 'wxStorage': return wx.getStorageSync(this.db_id); default: return wx.getStora...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _init(){\n /* Check if browser supports localStorage */\n var localStorageReallyWorks = false;\n if(\"localStorage\" in window){\n try {\n window.localStorage.setItem('_tmptest', 'tmpval');\n localStorageReallyWorks = true;\n win...
[ "0.67111397", "0.66866696", "0.6682433", "0.66317576", "0.64773524", "0.6474746", "0.64140123", "0.64057386", "0.6385209", "0.63614464", "0.6354161", "0.63294905", "0.6299549", "0.6283851", "0.62573314", "0.6243871", "0.6239604", "0.62159324", "0.62083364", "0.62040293", "0.6...
0.73631555
0
database functions drop the database from localStorage, sessionStorage, wxStorage
_drop() { switch (this.engine) { case 'localStorage': if (localStorage.hasOwnProperty(this.db_id)) { delete localStorage[this.db_id]; } break; case 'sessionStorage': if (sessionStorage.hasOwnProperty(this.db_id)) { delete ses...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drop() {\n\t\tdelete storage[db_id];\n\t\tdb = null;\n\t}", "function drop() {\n\t\tdelete storage[db_id];\n\t\tdb = null;\n\t}", "function delDB()\n\t{\n\t}", "function clearFromDB()\n{\n localStorage.clear();\n}", "function dropDatabase() {\n\n if (confirm(\"This will delete the ENTIRE dat...
[ "0.72617584", "0.72617584", "0.7231354", "0.7084395", "0.6954069", "0.6850591", "0.6841292", "0.6776268", "0.6754964", "0.6748872", "0.6742104", "0.6733716", "0.67244", "0.6642718", "0.65829784", "0.65634984", "0.6559141", "0.65091825", "0.6445971", "0.6445971", "0.6441784", ...
0.80554837
0
commit the database to localStorage, sessionStorage, wxStorage
_commit() { try { switch (this.engine) { case 'localStorage': localStorage.setItem(this.db_id, JSON.stringify(this.db)); break; case 'sessionStorage': sessionStorage.setItem(this.db_id, JSON.stringify(this.db)); break; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function commit() {\n\t\tstorage[db_id] = JSON.stringify(db);\n\t}", "function commit() {\n\t\tstorage[db_id] = JSON.stringify(db);\n\t}", "function saveFave() {\n db = window.openDatabase(\"repodb\",\"0.1\",\"GitHub Repo Db\", 1000);\n db.transaction(saveFaveDb, txError, txSuccessFave);\n}", "function...
[ "0.7624793", "0.7624793", "0.69508666", "0.67410636", "0.6577727", "0.65435266", "0.6390051", "0.635145", "0.6345736", "0.63438267", "0.6342443", "0.63406485", "0.63340497", "0.62592465", "0.62262124", "0.6184269", "0.6128168", "0.6122663", "0.6119453", "0.61193573", "0.61135...
0.7921872
0
table functions returns all fields in a table.
_tableFields(table_name) { return this.db.tables[table_name].fields; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tableFields(table_name) {\r\n return this._tableFields(table_name);\r\n }", "function get_table_info() {\n ;\n}", "function getTables() {\r\n\tvar ret = \"\";\r\n\tif ($('selCols')){\r\n\t\tvar tabCols = $('selCols').value; //Tabla.Columna.Tipo,Tabla.columna.tipo,..\r\n\t\t\t\r\n\t\tvar fields = tab...
[ "0.7773853", "0.62897784", "0.60373867", "0.6029863", "0.5906701", "0.58218706", "0.58122814", "0.5776703", "0.5765033", "0.57636607", "0.574009", "0.57060516", "0.564981", "0.5638952", "0.5633655", "0.5632288", "0.56234175", "0.55718505", "0.55662155", "0.5562665", "0.555591...
0.7277099
1
check whether a table exists
_tableExists(table_name) { return this.db.tables[table_name] ? true : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tableExists(tx, tablename, callback){\n\ttx.executeSql('SELECT * FROM '+tablename, [], function(tx, resultSet) {\n\t\tif (resultSet.rows.length <= 0){\n\t\t\tcallback(false);\n\t\t}\n\t\telse {\n\t\t\tcallback(true);\n\t\t}\n\t}, function(err){\n\t\tcallback(false);\n\t});\n}", "function tableExists(tab...
[ "0.837005", "0.83633476", "0.83633476", "0.82815844", "0.80456704", "0.80089587", "0.7630849", "0.761498", "0.7473821", "0.74151397", "0.7351731", "0.72303945", "0.7204677", "0.6982265", "0.6982265", "0.69681305", "0.69235826", "0.6919563", "0.6871534", "0.68077874", "0.66594...
0.84015316
0
check whether a table exists, and if not, throw an error
_tableExistsWarn(table_name) { if (!this._tableExists(table_name)) { this._error("The table '" + table_name + "' does not exist"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tableExists(tx, tablename, callback){\n\ttx.executeSql('SELECT * FROM '+tablename, [], function(tx, resultSet) {\n\t\tif (resultSet.rows.length <= 0){\n\t\t\tcallback(false);\n\t\t}\n\t\telse {\n\t\t\tcallback(true);\n\t\t}\n\t}, function(err){\n\t\tcallback(false);\n\t});\n}", "_tableExists(table_name)...
[ "0.7885085", "0.7536135", "0.7498743", "0.74377847", "0.7425339", "0.73598284", "0.73598284", "0.7274406", "0.7274406", "0.7218557", "0.7025549", "0.6975109", "0.6893245", "0.6890965", "0.6887157", "0.6808514", "0.6798529", "0.67262745", "0.659932", "0.65985423", "0.6583229",...
0.76116675
1
check whether a table column exists
_columnExists(table_name, field_name) { var exists = false; var table_fields = this.db.tables[table_name].fields; for (var field in table_fields) { if (table_fields[field] == field_name) { exists = true; break; } } return exists; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hasColumn(tableName, column) {\n const formattedColumn = this.formatter.parameter(column);\n const formattedTable = this.formatter.parameter(this.formatter.wrap(tableName));\n const sql =\n `select object_id from sys.columns ` +\n `where name = ${formattedColumn} ` +\n `and object_id = obje...
[ "0.8047777", "0.7657477", "0.7161053", "0.7066736", "0.6739159", "0.66741216", "0.6572872", "0.65596026", "0.6458638", "0.64224195", "0.6281856", "0.6247861", "0.6136341", "0.6111708", "0.6098253", "0.6030948", "0.60167074", "0.5984807", "0.59698963", "0.59556735", "0.586111"...
0.8311069
0
add a table index
__addIndexes(table_name, ifield, data, id) { data = data.toLowerCase() let index = this._indexes(table_name, ifield) if (indexTree.prototype.isPrototypeOf(index)) { let exist = this._indexes(table_name, ifield).find(data) if (exist) { if (index.type == "UNIQUE") { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTableIndex()\n{\n\tmysqlHandle.BwMysqlCreateIndex(connection,'CREATE INDEX mining_index_id ON mining (date)');\n\tmysqlHandle.BwMysqlCreateIndex(connection,'CREATE INDEX miners_index_id ON miners (mac)');\n\tmysqlHandle.BwMysqlCreateIndex(connection,'CREATE INDEX miner_index_id ON miner (mac,date)')...
[ "0.6871299", "0.6699068", "0.65862185", "0.6550301", "0.64264506", "0.6329082", "0.6266178", "0.6205707", "0.61819464", "0.61789596", "0.6146974", "0.6119892", "0.61160904", "0.60529965", "0.6051933", "0.6028072", "0.60200125", "0.5972718", "0.59605306", "0.59461236", "0.5942...
0.7012746
0
del a table index
__delIndexes(table_name, ifield, data, id) { data = data.toLowerCase() let index = this._indexes(table_name, ifield) if (indexTree.prototype.isPrototypeOf(index)) { let exist = this._indexes(table_name, ifield).find(data) if (exist) { if (exist.other.length > 1) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteAt(index) {\n}", "function deleteIndex(elasticObject, indexName){\n elasticObject.indices.delete({index: indexName},function(err,resp,status) { \n console.log(\"-- deleted\",resp);\n });\n}", "function btn_del_tr(index) {\n $(index).parent().parent().remove();\n GenerarArregloP...
[ "0.6964357", "0.656515", "0.6557027", "0.65484166", "0.6495934", "0.64520025", "0.6332533", "0.6323968", "0.630732", "0.63054097", "0.6297093", "0.6280788", "0.62563795", "0.62383085", "0.6218074", "0.61971545", "0.61942875", "0.6191565", "0.6186295", "0.6166161", "0.61290216...
0.6968517
0
update a table index
__updateIndexes(table_name, ifield, old_data, new_data, ids) { old_data = old_data.toLowerCase() new_data = new_data.toLowerCase() let index = this._indexes(table_name, ifield) if (indexTree.prototype.isPrototypeOf(index)) { let exist = this._indexes(table_name, ifield).find(old_dat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateIndex(newRow, newCol) {\r\n this.row = newRow;\r\n this.col = newCol;\r\n }", "setByIndex(index, value) {\n let key = this.getKeyByIndex(index);\n super.set(key, value);\n }", "setIndex(index) {\n\t\tthis.#index = index;\n\t}", "setIndex(index){\n this.index = index\n ...
[ "0.6423113", "0.6109518", "0.6063983", "0.60112417", "0.5994572", "0.5969522", "0.59651285", "0.5956499", "0.5935609", "0.59111834", "0.5876321", "0.5840745", "0.5817808", "0.580586", "0.5786036", "0.578553", "0.57817733", "0.57655513", "0.57583195", "0.57464147", "0.57363987...
0.68334764
0
check index field type
__checkIndexType(indexfield) { let type = indexfield[0] switch (type) { case '@': type = 'UNIQUE'; indexfield = indexfield.slice(1) break case '#': type = 'INDEX'; indexfield = indexfield.slice(1) break; default: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkFieldInIndex(index, field) {\n var indexFields = index.def.fields.map(getKey);\n for (var i = 0, len = indexFields.length; i < len; i++) {\n var indexField = indexFields[i];\n if (field === indexField) {\n return true;\n }\n }\n return false;\n}", "function checkFieldInIndex(index...
[ "0.65590703", "0.65590703", "0.6301434", "0.6099262", "0.60707104", "0.5979944", "0.5835905", "0.58261335", "0.5807817", "0.57232976", "0.5718823", "0.5715531", "0.5678159", "0.56685954", "0.56049293", "0.5597568", "0.55868167", "0.5532057", "0.5530225", "0.55089635", "0.5486...
0.80089664
0
select rows in a table by fieldvalue pairs, returns the IDs of matches
_queryByValues(table_name, data) { var result_ids = [], exists = false, row = null; // loop through all the records in the table, looking for matches for (var ID in this.db.data[table_name]) { if (!this.db.data[table_name].hasOwnProperty(ID)) { continue; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queryByValues(table_name, data, limit) {\n\t\tvar result_ids = [],\n\t\t\texists = false,\n\t\t\trow = null;\n\n\t\t// loop through all the records in the table, looking for matches\n\t\tfor(var ID in db.data[table_name]) {\n\t\t\tif( !db.data[table_name].hasOwnProperty(ID) ) {\n\t\t\t\tcontinue;\n\t\t\t}...
[ "0.63837427", "0.63837427", "0.5666673", "0.55329525", "0.54176843", "0.533437", "0.5295967", "0.5291594", "0.5155665", "0.5116198", "0.5045389", "0.5031911", "0.5031911", "0.4993819", "0.49695078", "0.49652186", "0.49652186", "0.49625343", "0.48915926", "0.48905003", "0.4864...
0.6504224
0
select rows in a table by a function, returns the IDs of matches
_queryByFunction(table_name, query_function) { var result_ids = [], row = null; // loop through all the records in the table, looking for matches for (var ID in this.db.data[table_name]) { if (!this.db.data[table_name].hasOwnProperty(ID)) { continue; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queryByFunction(table_name, query_function, limit) {\n\t\tvar result_ids = [],\n\t\t\texists = false,\n\t\t\trow = null;\n\n\t\t// loop through all the records in the table, looking for matches\n\t\tfor(var ID in db.data[table_name]) {\n\t\t\tif( !db.data[table_name].hasOwnProperty(ID) ) {\n\t\t\t\tcontin...
[ "0.6779154", "0.6779154", "0.5370629", "0.5370629", "0.5308974", "0.5288197", "0.5273945", "0.5172161", "0.5106792", "0.50829345", "0.50829345", "0.50686735", "0.50011307", "0.49937844", "0.49439985", "0.4920747", "0.4906228", "0.49053335", "0.48755077", "0.48297426", "0.4825...
0.70459354
0
return all the IDs in a table
_getIDs(table_name) { var result_ids = []; for (var ID in this.db.data[table_name]) { if (this.db.data[table_name].hasOwnProperty(ID)) { result_ids.push(ID); } } return result_ids; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIDs(table_name, limit) {\n\t\tvar result_ids = [];\n\t\tfor(var ID in db.data[table_name]) {\n\t\t\tif( db.data[table_name].hasOwnProperty(ID) ) {\n\t\t\t\tresult_ids.push(ID);\n\n\t\t\t\tif(result_ids.length == limit) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result_ids;\n\t}", "fun...
[ "0.75135595", "0.75135595", "0.71607006", "0.652198", "0.6413083", "0.6354972", "0.6313775", "0.61910254", "0.6188246", "0.6185133", "0.6135418", "0.6110142", "0.6072507", "0.6071914", "0.6071914", "0.5974947", "0.59611", "0.59389234", "0.58981365", "0.58504975", "0.5844442",...
0.7649913
0
delete rows, given a list of their IDs in a table
_deleteRows(table_name, ids) { for (var i = 0; i < ids.length; i++) { if (this.db.data[table_name].hasOwnProperty(ids[i])) { // remove indexes let del_data = this.db.data[table_name][ids[i]] for (var ifield in this._indexes(table_name)) { this.__delIndexes(t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteRows(table_name, ids) {\n\t\tfor(var i=0; i<ids.length; i++) {\n\t\t\tif( db.data[table_name].hasOwnProperty(ids[i]) ) {\n\t\t\t\tdelete db.data[table_name][ ids[i] ];\n\t\t\t}\n\t\t}\n\t\treturn ids.length;\n\t}", "function deleteRows(table_name, ids) {\n\t\tfor(var i=0; i<ids.length; i++) {\n\t\...
[ "0.7106423", "0.7106423", "0.6786345", "0.6720173", "0.669663", "0.6687864", "0.65984356", "0.65940714", "0.6557254", "0.64357847", "0.6363682", "0.62543017", "0.62167895", "0.61596364", "0.6116646", "0.6107882", "0.60984236", "0.60745084", "0.60312253", "0.6025778", "0.60087...
0.7115577
0
get data by ids
_getDataByIDs(table_name, ids) { return (ids || []).map(ID => { return this.db.data[table_name][ID] }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSpeciesByIds(...ids) {\n return data.species.filter(({ id }) => ids.includes((id)));\n // Função Filter juntamente com includes para localizar todos os IDS passados nos parâmetros.Localiza através das chaves nos objetos\n}", "function getId(data, id) {\n\t\treturn data.filter(\n\t\t\tfunction(data)...
[ "0.68727404", "0.6814126", "0.65907305", "0.6525035", "0.64876544", "0.6464148", "0.6464148", "0.6439039", "0.6392077", "0.6343787", "0.6315231", "0.6306419", "0.62789416", "0.6261766", "0.6249687", "0.61990875", "0.61547863", "0.6133519", "0.6117783", "0.6104927", "0.6104388...
0.7239579
0
Implement a function inside streams.js that will use fs.createReadStream() to pipe the given file to process.stdout
function inputOutput(file) { const readable = fs.createReadStream(file, { encoding: 'utf-8' }); readable.pipe(process.stdout) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createReadStream(path) {\n class Stream {\n constructor(path) {\n Transform.call(this, {});\n\n this.contentLength = 0;\n this.buff = '';\n\n new Promise((resolve, reject) => {\n // Initialize this.buff\n fs.access(path, (err) => {\n if (err) {\n r...
[ "0.6468688", "0.63656944", "0.6316048", "0.6271552", "0.61728764", "0.59468544", "0.59468544", "0.59121615", "0.59052813", "0.59031117", "0.5885829", "0.58810973", "0.58590704", "0.5840467", "0.5813652", "0.5809875", "0.5807826", "0.5807826", "0.5804154", "0.5802244", "0.5800...
0.7137057
0
Implement a function inside streams.js to convert data from process.stdin to uppercase data on process.stdout using the through2 module.
function transform() { process.stdin .pipe(through2({ objectMode: true }, function(chunk, enc, callback) { const upperCase = chunk.toString('utf8').toUpperCase(); this.push(Buffer.from(upperCase, 'utf8')); callback(); })) .pipe(process.stdout); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function write(buffer, encoding, next) {\n // convert the buffer to uppercase\n var converted = buffer.toString().toUpperCase()\n // push to output stream\n this.push(converted);\n // get next data or end\n next();\n}", "function CaseChangingStream(stream, upper) {\n\tthis._stream = stream;\n\tthis._upper ...
[ "0.6438677", "0.61496836", "0.58996105", "0.58996105", "0.5828857", "0.571868", "0.5607779", "0.5565609", "0.5422885", "0.53545773", "0.53361523", "0.5252536", "0.5247049", "0.522082", "0.51944536", "0.51919705", "0.5172766", "0.51381093", "0.51306975", "0.5113917", "0.509975...
0.8523152
0
Implement cssBundler function and introduce an extra parameter path.
function bundleCss(dir) { const bundleFile = join(dir, 'bundle.css'); const url = 'https://www.epam.com/etc/clientlibs/foundation/main.min.fc69c13add6eae57cd247a91c7e26a15.css'; const output = fs.createWriteStream(bundleFile); fs.readdir(dir, function(err, files) { if (err) { throw err; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cssBundler() {\n const files = fs.readdirSync(`${process.cwd()}/${program.path}`);\n const writeStream = fs.createWriteStream(`${program.path}/bundle.css`);\n files.forEach((fileName) => {\n const cssFileData = fs.readFileSync(`${process.cwd()}/${program.path}/${fileName}`, \"utf8\"); ...
[ "0.6726055", "0.5889233", "0.5838062", "0.57655054", "0.57574666", "0.5722413", "0.57021105", "0.5679941", "0.5678917", "0.5666907", "0.5653701", "0.562474", "0.562449", "0.56242716", "0.5621122", "0.5616006", "0.56090784", "0.5602667", "0.5602667", "0.5602667", "0.5592642", ...
0.6034276
1
Controls the addToStory button. Replaces the button with a form button and text box once clicked. Then listens for the form to be submitted, and once submitted call the addToStory function (below).
function addToStoryInit(e) { console.log("AddToStory button clicked."); var ID = window.location.pathname.match(/\/story\/(.*)/)[1]; console.log(ID); $(this).replaceWith("<form id ='textToAddForm' method ='post' action = '/story/update/"+ID+"'><div class='form-group'><textarea name = 'text' id='textToAdd' style='wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function storySubmission(evt) {\n console.debug(\"storySubmission\");\n evt.preventDefault();\n\n const title = $(\"#submit-title\").val();\n const author = $(\"#submit-author\").val();\n const url = $('#submit-url').val();\n\n const newStory = await storyList.addStory(currentUser, { \n title: title...
[ "0.7013375", "0.7001383", "0.6983669", "0.6947429", "0.69013643", "0.6863352", "0.67740196", "0.6695568", "0.6580364", "0.6547195", "0.64484286", "0.6436547", "0.63664293", "0.6233884", "0.61887586", "0.6085468", "0.60664177", "0.60167384", "0.5996945", "0.5911465", "0.591018...
0.783997
0
Preprocessing for choice: and decisions:. Gets all links to open in a new tab or window.
function parseBranchLinks(branch) { for (var i = 0; i < branch.length; i++) { if (branch[i].length > 0 && branch[i][0] === "link") { var attributes = branch[i][1]; if (attributes["href"].substring(0, 7) === "choice:") { var choice = attributes["href"].substring(7); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openSelectedLinks() {\n var links = extractLinksFromSelection();\n\n for (var [uri, link] of links) {\n //console.log('Opening ' + link.text + ' [' + uri + ']');\n tabs.open(uri);\n }\n}", "function openLinksNewTab() {\n const { links } = document;\n for (let i = 0; i < links.length; i++) {\n...
[ "0.6056545", "0.56314933", "0.5581454", "0.55141", "0.55037326", "0.5479927", "0.54738975", "0.54654205", "0.5426449", "0.5414673", "0.54110426", "0.5337783", "0.53254336", "0.5307508", "0.52922446", "0.52890354", "0.52562296", "0.5243135", "0.5239634", "0.52347594", "0.52177...
0.5780427
1
id, on which error has to be applied state, if is to add error or to remove 1=>True(for error) 0=>False(to remove error)
function input_error(id, state){ var div = $('#'+id).closest('div'); console.log(div); // var span = $('#'+id).closest('span'); if(state==='1'){ div.addClass("has-error"); // span.addClass("error"); }else if(state==='0'){ div.removeClass("has-error"); // span.re...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CHANGE_STATUS_ERROR(state, toggle) {\n state.isError = toggle;\n }", "function add_error (id, error) {\r\n\t\tvar error_id = id + '-error';\r\n\t\t\r\n\t\t//remove exisiting error\r\n\t\tif ($('#' + error_id).length != 0) { remove_error (id); }\r\n\t\t//add new error\r\n\t\t$('#' + id).after('<div class=...
[ "0.6084011", "0.60812825", "0.60630065", "0.59551764", "0.58254004", "0.5824804", "0.56916815", "0.5620301", "0.5587898", "0.5571269", "0.5536197", "0.553544", "0.5531483", "0.55167645", "0.5510031", "0.5451384", "0.54279804", "0.539895", "0.53965175", "0.5392744", "0.5388202...
0.6086255
0
Creates the guestrow in pending list and destroys old one
static setAssignedState(guest, waitidNumber, $tableRow) { let $pendingList = document.querySelector('.box__list--pending'), $box = GuestBox.createBox(guest, waitidNumber); $pendingList.appendChild($box); this.destroyRow($tableRow); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static setGoneState(\n table,\n guest,\n unoccupiedWaitidIds,\n waitidNumber,\n statesForCurrent,\n statesForHistory,\n $tableRow\n ) {\n GuestRow.createGuestRow(\n TablePosition.start(),\n table,\n guest,\n unoccupiedWaitidIds,\n waitidNumber,\n statesForCurr...
[ "0.6296472", "0.5665984", "0.5394176", "0.53720504", "0.52447367", "0.51576215", "0.5144818", "0.5144818", "0.5143115", "0.5117738", "0.50990444", "0.50972927", "0.5095442", "0.508996", "0.5080794", "0.505548", "0.5017661", "0.5005478", "0.500448", "0.49920925", "0.49780238",...
0.6601762
0
get extension for a given filename. Returns null if doesn't have an extension
function getFileExtension(filename) { var extensionIdx = filename.lastIndexOf("."); if (extensionIdx <= 0) return null; var extension = filename.substring(extensionIdx + 1); return extension; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFileExtension(filename) {\r\n\t\tvar ext = /^.+\\.([^.]+)$/.exec(filename);\r\n\t\treturn ext == null ? \"\" : ext[1];\r\n\t}", "function getExtension(filename) {\n return filename.split('.').pop();\n}", "function file_get_extension(filename) {\n var array = filename.split('.'),\n length = a...
[ "0.8324457", "0.8229158", "0.81850934", "0.8135373", "0.8128543", "0.8073645", "0.8065033", "0.8057761", "0.7933494", "0.7922908", "0.79154515", "0.79103535", "0.7908345", "0.78969866", "0.7894061", "0.7795495", "0.7775786", "0.7667127", "0.76007134", "0.75054014", "0.7381031...
0.8502189
0
Returns true if the given filename is pointing to a directory
function fileIsDirectory(filename) { return getFileExtension(filename) == null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDirectory(filename) {\n return filename.slice(-1) === '/';\n}", "function isDir(file) {\n\tvar dotPosition = file.indexOf('.');\n\tvar slashPosition = file.lastIndexOf('/');\n\treturn ((dotPosition === 0 && file.length === 1) || dotPosition === -1) || // . or no dot is usually a dir\n\t\t(file.ind...
[ "0.8249805", "0.7636155", "0.7534094", "0.736995", "0.7246148", "0.7025037", "0.7020643", "0.70144415", "0.69224674", "0.6917148", "0.68782413", "0.6807614", "0.6799681", "0.6724919", "0.66778505", "0.642752", "0.6418196", "0.6382821", "0.6277476", "0.61756366", "0.61576986",...
0.79989606
1
Replaces ~ with home directory
function replaceHomeDir(filepath) { if (filepath.charAt(0) == "~") filepath = path.join(path.homedir(), filepath.substring(1)); return filepath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolveHome(dir) {\n\treturn path.normalize(home ? dir.replace(/^~($|\\/|\\\\)/, `${home}$1`) : dir);\n}", "function homePath() {\n const homedir = os.homedir();\n const myPath = path.join(homedir, '.gitlab-play');\n try {\n fs.statSync(myPath);\n } catch (err) {\n fs.mkdir(myPath);\n }\n re...
[ "0.72963005", "0.6357344", "0.633349", "0.6314299", "0.61885345", "0.6175627", "0.58539927", "0.5774232", "0.57580644", "0.5740709", "0.5521844", "0.54982704", "0.54982704", "0.54982704", "0.54964626", "0.54424316", "0.5440066", "0.53073424", "0.52600485", "0.52600485", "0.50...
0.8102159
0
Check if browser supports HTML5 input placeholder
function supports_input_placeholder() { var i = document.createElement('input'); return 'placeholder' in i; var x = document.createElement('textarea'); return 'placeholder' in x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasPlaceholderSupport() {\n \"use strict\";\n\n var input = document.createElement('input');\n return ('placeholder' in input);\n}", "function supported(){\n var i = document.createElement('input');\n return 'placeholder' in i;\n }", "function placeholderFallback() ...
[ "0.82088286", "0.7970381", "0.72002774", "0.71278006", "0.711743", "0.6939118", "0.6793774", "0.6762959", "0.6592882", "0.6574396", "0.6564104", "0.65324676", "0.64272046", "0.6361421", "0.6213689", "0.61416495", "0.6140444", "0.6025801", "0.6025801", "0.6025801", "0.60175437...
0.8042794
1
Adds win to given color
addWin(color){ if(color == 'Red'){ this.redWins++; } else if(color == 'Blue'){ this.blueWins++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addColor (color, rune) {\n return overlay(rune, color(square));\n}", "function winColors(color){\nfor (j = 0; j < squares.length; j++){\n\t\tsquares[j].style.backgroundColor = color;\n\t}\n}", "function onWin(color) {\n for (var i = 0; i < numSqrs; i++) {\n squares[i].style.backgroundColo...
[ "0.71203506", "0.68931174", "0.6742302", "0.63604075", "0.61652994", "0.612442", "0.6109753", "0.6080587", "0.60446143", "0.6004219", "0.5883584", "0.5878527", "0.58522964", "0.58315027", "0.5761921", "0.57260484", "0.57002974", "0.5687279", "0.5667644", "0.56598854", "0.5639...
0.8084098
0
Sets this.hasWinner to true after called.
setWon(){ this.hasWinner = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetWon(){\r\n\t\tthis.hasWinner = false;\r\n\t}", "_checkForWinner () {\n\t\tfor (const player of this.players) {\n\t\t\tconst isWinner = testColor(this.targetColor, player.currentColor);\n\t\t\tif (isWinner) {\n\t\t\t\tthis._announceWinner(player);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\...
[ "0.7529673", "0.7130278", "0.71064234", "0.70606", "0.7044688", "0.6829169", "0.67703855", "0.6719838", "0.67102486", "0.6683891", "0.6659916", "0.6648445", "0.656252", "0.6524371", "0.6490748", "0.6486503", "0.644033", "0.64212066", "0.6399284", "0.63982517", "0.63891244", ...
0.7862992
0
Sets this.hasWinner to false after called
resetWon(){ this.hasWinner = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setWinsToFalse() {\n player1WinsRound = false;\n player2WinsRound = false;\n}", "setWon(){\r\n\t\tthis.hasWinner = true;\r\n\t}", "hasWinner() {\n return this.getWin() !== null;\n }", "function deactivateKikenWinner()\r\n{\r\n if ( !isActiveKikenWinner )\r\n {\r\n return;\r\n }...
[ "0.77639925", "0.74398184", "0.68411946", "0.68145233", "0.6728247", "0.6719556", "0.67054874", "0.6669867", "0.664765", "0.6645648", "0.6579686", "0.65776575", "0.6414416", "0.64093447", "0.63639027", "0.6349871", "0.63076085", "0.6305598", "0.63053364", "0.626986", "0.62674...
0.82420754
0
Inserts the color from the object PlayerColor into the next available row of the column, returns [1,1] on fail
takeTurn(colIndex, playerColor){ for(let rowIndex = this.rows-1; rowIndex >= 0; rowIndex--){ if (this.board[rowIndex][colIndex].getColor() == 'Empty'){ this.board[rowIndex][colIndex].setColor(this.turn.getColor()); return [rowIndex,colIndex]; } } return [-1,-1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextColor() {\n player.className = colors[indexColor];\n indexColor = (indexColor+1)%(colors.length);\n}", "function coloursList() {\n\n //the pointer.colIndex is incremented by 1\n //when the index reaches 3 it is reset back to 0\n pointer.colIndex ++;\n\n if(pointer.colIndex > 3){\n pointer...
[ "0.63235897", "0.62423855", "0.62265384", "0.61629057", "0.61279917", "0.602486", "0.6012878", "0.5880846", "0.5865223", "0.58045447", "0.5724274", "0.5710928", "0.5689595", "0.56451446", "0.5605882", "0.56055725", "0.56026584", "0.55839974", "0.558006", "0.55621684", "0.5552...
0.70528054
0
return current turn color, flip the turn after array and screen are updated.
getTurn(){ let currentTurn = new PlayerColor(this.turn.getColor()); this.turn.flipColor(); return currentTurn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getColor() {\r\n if (turn) {\r\n return 'red';\r\n }\r\n return 'yellow';\r\n}", "function changeTurns() {\n if (turn === RED) {\n turn = BLUE;\n $(\"#instr\").html(blueInstr);\n $(\"span\").css(\"color\", BLUE);\n } else if (turn === BLUE) {\n turn = RE...
[ "0.6770363", "0.6248187", "0.61689997", "0.6093898", "0.6047373", "0.60431266", "0.6008674", "0.59813964", "0.5954894", "0.5882037", "0.58614284", "0.58415383", "0.58415383", "0.5818035", "0.5807344", "0.5785726", "0.57629764", "0.57449985", "0.5737556", "0.5735403", "0.57347...
0.76947296
0
HELPER FUNCTION Round x value to nearest multiple of 80, this makes the mouse event listener cleaner
function toNearestEighty(x) { let i = 1; while(x % 80 != 0){ if(x < 80*i){ return (80*i); } i++; } // If it is already rounded return return(x); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function halfUp(x) { return Math.round(x) + 0.5; }", "xCoordToPercent(x) {\n x -= this.$parent.offset().left; // pixel position\n const max = this.$parent.innerWidth();\n return Number(((x / max) * 100).toFixed(2)); // round to 2 decimal places\n }", "function transformX(x) {\n return...
[ "0.65144867", "0.6508332", "0.64930075", "0.64744925", "0.6447448", "0.6446018", "0.6363751", "0.6328959", "0.6328929", "0.63023174", "0.6261279", "0.62500024", "0.6242606", "0.6228894", "0.6155982", "0.6092654", "0.60625154", "0.6058465", "0.6050553", "0.60441756", "0.604417...
0.66601574
0
Perform an ajax call to POST the selected teacher.
setTeacher() { var teacherId = document.getElementById('selected-teacher').value; if (teacherId === 'default') { return; } var rootUrl = window.location.origin; var endpoint = rootUrl + '/api/student/teachers'; $.ajax({ method: 'POST', url: endpoint, data: {studentId: 2, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enroll(name, period, teacher){\n $.ajax({\n method: \"POST\",\n url: \"enroll\",\n data: {\n name: name,\n period: period,\n teacher: teacher,\n _csrf: token\n },\n success: function(data){\n window.location.reload();\n },\n error: function(data){\n aler...
[ "0.6044976", "0.5980739", "0.58388984", "0.56530976", "0.557743", "0.55238575", "0.55134255", "0.5437295", "0.5427575", "0.5394589", "0.5388525", "0.5344516", "0.53268576", "0.53115124", "0.5261237", "0.5242443", "0.52347815", "0.5227027", "0.5205508", "0.5197529", "0.5182805...
0.645979
0
DATABASE FUNCTION update the screen clear search parameters, update recent and most popular
function updateScreen() { // Clear the input boxes on the screen and replace with placer text $("#destination").val("City, Country"); $("#popular-searches").empty(); // Update popular and recent searches updateRecentSearches(); updatePopularSearches(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_search_query(){\n\t\tcurrent_page = 1;\n\t\tredraw_table();\n\t}", "function updateAndDisplay() {\n var filterResults = displayLists(hitList);\n displayHitList = filterResults[0];\n displayHitListUpToDate = filterResults[1];\n display();\n updateFacetLists();\n}", "function updateLiveSearc...
[ "0.6865611", "0.6380877", "0.63693124", "0.63095045", "0.6252686", "0.6250004", "0.61048454", "0.59868044", "0.5936439", "0.59296596", "0.59275734", "0.5903129", "0.5871835", "0.58376515", "0.5806994", "0.5797191", "0.57790005", "0.5763291", "0.5761038", "0.57458943", "0.5740...
0.6676849
1
middleware for checking if the dish has an image property in order to move onto 'create' and 'update' handler
function bodyHasImg(req, res, next) { const { data: { image_url } = {} } = req.body // if there is an image url if (image_url) { res.locals.image_url = image_url // console.log("res locals =>",res.locals, "<=") // move onto next function return next() } // otherwise, return the following messa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateItemImage(req, res) {}", "function bodyHasDishesProperty(req, res, next) {\n const { data: { dishes } = {} } = req.body;\n if (dishes) {\n return next();\n }\n next({\n status: 400,\n message: \"Order must include a dishes\",\n });\n}", "handle() {\n const cacheUrl = this.event....
[ "0.6197224", "0.59314007", "0.5902589", "0.58168525", "0.5514949", "0.5485345", "0.54801524", "0.54131645", "0.5407699", "0.5400204", "0.53783214", "0.5367859", "0.53449553", "0.5338813", "0.533332", "0.5331624", "0.529239", "0.5291895", "0.52898204", "0.52687913", "0.5265434...
0.6228712
0
middleware for checking if the dish has a description in order to move onto 'create' and 'update' handler
function bodyHasDescription(req, res, next) { // description is the request body, but is empty object as default const { data: { description } = {} } = req.body // if there is a description, move on to the next function if (description) { res.locals.description = description // console.log("res locals =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bodyHasDishesProperty(req, res, next) {\n const { data: { dishes } = {} } = req.body;\n if (dishes) {\n return next();\n }\n next({\n status: 400,\n message: \"Order must include a dishes\",\n });\n}", "function reqBodyValidation(req,res,next){\n //stores the new dish info in res.locals...
[ "0.6369334", "0.5966497", "0.5953757", "0.5889682", "0.58429235", "0.58108497", "0.57850516", "0.57543933", "0.5703785", "0.56803614", "0.5640025", "0.56275904", "0.55037045", "0.5496857", "0.54948413", "0.54810584", "0.541977", "0.5402808", "0.53882086", "0.53780407", "0.537...
0.62872857
1
middleware for checking if the dish's price property is valid for updating it in order to move onto 'update' handler
function bodyHasValidPriceForUpdate(req, res, next) { const { data: { price } = {} } = req.body // if the price data type is not a number, or if // the price is less than or equal to $0, return the // following message if (typeof res.locals.price !== "number" || res.locals.price <= 0) { next({ statu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update( request, response, next ) {\n const data = request.body.data || {};\n const { data: { id, price, name, image_url, description } = {} } =\n request.body;\n\n const dish = response.locals.hasDish;\n const mustInclude = [\"name\", \"description\", \"price\", \"image_url\"];\n\n for (const i o...
[ "0.629704", "0.6099032", "0.6045427", "0.60422075", "0.6005935", "0.59792364", "0.59252846", "0.5924925", "0.5916498", "0.59004205", "0.58891904", "0.588791", "0.5862169", "0.5839188", "0.5833373", "0.582448", "0.58145845", "0.5809646", "0.5805508", "0.5803104", "0.5784064", ...
0.7248479
0
write a separate helper function to make sure req.body.data.id matches req.params.dishId middleware for checking if the data id matches it's parameters id in order to move onto 'update' handler
function dishIdMatchesDataId(req, res, next) { const { data: { id } = {} } = req.body const dishId = req.params.dishId // if the id is defined, not null, not a string, and not the dishId if (id !== "" && id !== dishId && id !== null && id !== undefined) { // return the following message next({ sta...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function routeIdBodyId(req, res, next) {\n const dishId = req.params.dishId;\n const { id } = req.body.data;\n if (!id || id === dishId) {\n return next();\n }\n next({\n status: 400,\n message: `Dish id doesn't match route id. The Dish ${id} is set to the Route ${dishId}`,\n });\n}", "function ro...
[ "0.7603451", "0.73074675", "0.7048427", "0.6809595", "0.6449803", "0.63841534", "0.635581", "0.6319746", "0.62795633", "0.6207732", "0.6203152", "0.61606765", "0.61518955", "0.6124811", "0.6117953", "0.61082107", "0.6106718", "0.6096697", "0.60928875", "0.6042263", "0.6008192...
0.8282663
0
handler for reading the dishes
function read(req, res) { // uses dish id parameter from request const dishId = req.params.dishId // create variable for finding the dish with the correct id const matchingDish = dishes.find((dish) => dish.id === dishId) // return that dish's data res.json({ data: res.locals.matchingDish }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDishes (){\n fetch(BaseUrl)\n .then(res => res.json())\n .then(dishes => {\n recipeForm(dishes)\n dishes.forEach(dish => buildCard(dish))\n })\n}", "function list( request, response, next ) {\n response.json({ data: dishes });\n}", "function list(req, ...
[ "0.5842026", "0.570323", "0.5453059", "0.5418237", "0.5415872", "0.5352841", "0.5352484", "0.53032416", "0.53032416", "0.53032", "0.5297292", "0.5275915", "0.5206099", "0.5127647", "0.5126167", "0.5076942", "0.50273496", "0.5026079", "0.49866447", "0.49687982", "0.4940933", ...
0.60528886
0
handler for creating a new dish
function create(req, res) { // the request body includes the new dish's name, price, and image const { data: { name, price, image_url } = {} } = req.body // dish object for making an update request const newDish = { id: nextId(), name, price, image_url, } // push the new dish onto the array...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create(req, res) {\n const dish = req.body.data;\n dish.id = nextId();\n dishes.push(dish);\n res.status(201).json({ data: dish });\n}", "function create(req, res) {\n const newDishWithId = { ...res.locals.newDish.data, id: nextId() };\n dishes.push(newDishWithId);\n res.status(201).json({ data: ...
[ "0.756354", "0.732326", "0.71767783", "0.7061622", "0.68243897", "0.6602757", "0.6298546", "0.6208505", "0.61638844", "0.61060214", "0.60250163", "0.60195845", "0.5974159", "0.59187186", "0.58999646", "0.58795834", "0.5815804", "0.58084035", "0.57987154", "0.5797369", "0.5790...
0.75105333
1
handler for updating a dish's data
function update(req, res) { const dishId = req.params.dishId // create variable that finds the dish with a matching id const matchingDish = dishes.find((dish) => dish.id === dishId) const { data: { name, description, price, image_url } = {} } = req.body // use that variable to define the key-value pairs of th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateDish(dish){\n dish.likes++\n \n fetch(BaseUrl + `/${dish.id}`, {\n method: 'PATCH',\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\"\n },\n body: JSON.stringify({likes: dish.likes})\n })\n .then(res...
[ "0.69219583", "0.66970354", "0.6486804", "0.6468902", "0.64688444", "0.64624375", "0.6447016", "0.6368196", "0.63620794", "0.6322869", "0.6322869", "0.6322869", "0.6140683", "0.61001563", "0.60918254", "0.6057838", "0.5981143", "0.5976289", "0.59755677", "0.59559035", "0.5952...
0.69275063
0
A formula will be looked up in the memoizer function and if it was calculated before it's value will be returned, else it will be added
function memoizer(memo, formula) { var recur = function(n) { // check if we have the result first var result = memo[n]; if (typeof result !== 'number') { // if result is not found (not calcualted) apply the formula // and calculate result = formula(recur, n); // assign the result t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function memoizer(memo, formula) {\n var recur = function (n) {\n var result = memo[n];\n if (typeof result !== \"number\") {\n memo[n] = formula(recur, n);\n result = memo[n];\n }\n return result;\n };\n return recur;\n}", "function memo(get_value, resu...
[ "0.68660456", "0.68647593", "0.64150023", "0.63826704", "0.62769604", "0.61846644", "0.61606735", "0.615542", "0.6112072", "0.61015797", "0.6070502", "0.6068716", "0.6063376", "0.6060808", "0.6060143", "0.6021075", "0.6014129", "0.5992713", "0.5990962", "0.5968478", "0.596615...
0.7205814
0
Converts a hexadecimal string to a ascii string
hexAsciiToAscii(myHexAscii) { var iLoop; var ascii = ""; var current; for (iLoop = 0; iLoop < ((myHexAscii.length) / 2); iLoop++) { current = parseInt(myHexAscii.substr(iLoop * 2, 2), 16); if ((current >= 0x20) && (current < 0x7f)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function asciiToHex (str) {\n const arr = []\n for (let i = 0, t = 3; i < t; i++) {\n for (let n = 0, l = str.length; n < l; n++) {\n const hex = Number(str.charCodeAt(n)).toString(16)\n arr.push(hex)\n }\n }\n return arr.join('').substring(0, 6)\n}", "function toHex(str) {\n var result = ...
[ "0.7586523", "0.735697", "0.7315818", "0.72672313", "0.725871", "0.72192466", "0.72150576", "0.7212627", "0.71359324", "0.7099685", "0.70886254", "0.70547175", "0.7026857", "0.70256793", "0.7011058", "0.70096827", "0.6983376", "0.698233", "0.698153", "0.69813776", "0.6969226"...
0.78589886
0
Check and delete todo
function checkDelete(e) { const item = e.target; if (item.classList[0] === "delete-btn") { const todo = item.parentElement; todo.classList.add("slideoff"); // Remove from storage todo.addEventListener("transitionend", () => { todo.remove(); }); removeTodo(todo); } // check todo i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteToDo(event) { /* create deleteToDo function */\n const btn = event.target; /* constant btn even */\n const li = btn.parentNode; /* constant li */\n toDoList.removeChild(li); ...
[ "0.77158356", "0.7613829", "0.75687", "0.75386566", "0.75185287", "0.74740446", "0.74494165", "0.742831", "0.7411823", "0.73631424", "0.7357108", "0.734829", "0.7334467", "0.73173237", "0.7303146", "0.7175616", "0.7175398", "0.7147955", "0.70897454", "0.7063397", "0.7043557",...
0.7681393
1
Store the todo as an object for filter persistence
function storeTodo(todoItem, filterClass) { let todo = { title: todoItem, filter: filterClass, }; return todo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveTodo(todo) {\n angular.extend(todo, this.editedTodo);\n this.storage.put(this.todos);\n this.editedTodo = null;\n }", "addToDo(todo){\n this.toDoList.push(todo);\n this.displayToDo(todo);\n this.runfilter();\n this.parent.parent.save();\n }", "function...
[ "0.73725474", "0.7079544", "0.6792276", "0.67811036", "0.6746025", "0.671952", "0.6704247", "0.66986907", "0.6672822", "0.665594", "0.6597129", "0.65857464", "0.6573376", "0.65657234", "0.6554684", "0.65415186", "0.6538462", "0.65350544", "0.65303785", "0.65238684", "0.651203...
0.7170613
1
Receive an object of type Trend, but without methods and extend it with the appropriate methods, returning the resulted object. function toTrend(trend: Trend): Trend
function toTrend(trend) { // Extending the object with methods. // // name (trending topic). // // hasName(): Boolean trend.hasName = function() { return (trend.hasOwnProperty('name') && trend.name !== null && trend.name !== ""); } // getName(): String trend.getName = function() { return trend.nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toTrend(response) {\n return new TrendingBill(response);\n}", "function addTrendLines() {\n\tif (document.getElementById('trend-lines').checked === true) {\n\t\treturn {\n\t\t\t0: {\n\t\t\t\ttype: 'linear',\n\t \t\tvisibleInLegend: true,\n\t \t\topacity: 0.5,\n\t \t\tpointsVisible: false,\n\t ...
[ "0.6446126", "0.5206824", "0.47092354", "0.46684805", "0.46576282", "0.4540114", "0.44813305", "0.44745314", "0.44527557", "0.4436522", "0.44336686", "0.44210532", "0.431726", "0.42849308", "0.4282021", "0.4264712", "0.4259369", "0.4256931", "0.4243287", "0.4235195", "0.42299...
0.8222654
0
function declaration to return organization information data to the client if exists else return not found message
function getOrganizationInfo(req, res, next) { organizationInformationController.getOrganizationInfo () .then(function(organizationInfo){ //if exists, return data in json format if (organizationInfo) { res.status(HTTPStatus.OK); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOrganization(req, res) {\n Organization.findOne({ _id: req.params.id, isActive: true }, function (err, organization) {\n if (err) {\n res.status(404).send(err);\n }\n else {\n if (organization) {\n res.json(organization);\n } else ...
[ "0.6845451", "0.64222866", "0.61904347", "0.6072716", "0.59345734", "0.58550113", "0.5838409", "0.57046974", "0.55944407", "0.5551702", "0.5487069", "0.5473559", "0.54290026", "0.53892165", "0.53661793", "0.53456867", "0.534289", "0.5340144", "0.5333925", "0.53232473", "0.531...
0.7361924
0
Takes a method parameter and serializes it to something that the JSON RPC accepts
function serializeToMethodParameter(param) { switch (typeof param) { case 'object': if (param instanceof bignumber_js_1.default) { return to_hex_1.default(param); } if (Array.isArray(param)) { return param.map(serializeToMethodParameter); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RpcSerializer() {}", "function serialize(gun, args,method) {\n // turn them into an array\n args = Array.prototype.slice.call(args);\n args.forEach(function (tag) {\n gun[method](tag);\n });\n\n return gun;\n}", "toJSON() {}", "static makeRPC(method, params = {}, id = uuid()) {\n return {...
[ "0.6250211", "0.5981544", "0.5966787", "0.5933427", "0.5909306", "0.58665425", "0.56641704", "0.5654506", "0.56290174", "0.56290174", "0.56140167", "0.5589907", "0.55731475", "0.55731475", "0.55719817", "0.55719817", "0.55719817", "0.55719817", "0.55719817", "0.55719817", "0....
0.69690055
0
Build a request for sending to the JSON RPC
function buildRequest(id, method, params) { return { id, jsonrpc: '2.0', method, params: serializeToMethodParameter(params) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BUILD_REQUEST(request) {\n var method = request.method;\n if (!R_METHODS[method] || !request._client.supported[method])\n throw TypeError(\"Method \" + method + \" is not supported\");\n\n var headers = request.headers;\n var chunks = [\n R_METHODS[method],\n Buffer(request.path),\n R_PROT...
[ "0.651257", "0.6381622", "0.63746905", "0.6267864", "0.61822486", "0.6123663", "0.6089599", "0.5961212", "0.59449446", "0.589651", "0.58524776", "0.58201176", "0.5785044", "0.5759475", "0.5754483", "0.5740858", "0.57312715", "0.5729097", "0.5712036", "0.5704447", "0.5695215",...
0.68533385
0
Toggle the unchchecking, disabling, and fading of the query publicity checkbox.
function handle_publicity_checkboxes(input) { var form = input.form; var q = $('command_public_queries') var l = $('command_public_queries_label') if (input.checked) { $('command_public_queries').checked = true; q.disabled = false; l.removeClassName("disabled"); } else { q.checked = false; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle() {\n this.checked = !this.checked;\n }", "toggle() {\n this.checked = !this.checked;\n }", "toggle() {\n this.checked = !this.checked;\n this._onChange(this.checked);\n }", "function toggleCheckBox(){\n checkBox = !checkBox;\n}", "function toggleCheckProblem() ...
[ "0.59640765", "0.59640765", "0.5929531", "0.58694124", "0.58045715", "0.5785455", "0.5776921", "0.5761931", "0.5753276", "0.57438225", "0.5680449", "0.56772804", "0.5673521", "0.5629878", "0.5621522", "0.5621522", "0.5621522", "0.56184566", "0.5598309", "0.55915326", "0.55903...
0.68227625
0
When the search bar is updated, refilter the array to only include patients that are searched for
handleSearchChange(e) { const filteredPatients = this.state.patients.filter(patient => patient.name.toLowerCase().includes(e.target.value)); this.setState({ filteredPatients: filteredPatients }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fSearch() {\n // trasformo il valore inserito in searchName in maiuscolo\n this.searchName = this.searchName.toUpperCase();\n // filtro l'array contacts in un nuovo array\n const newArray = this.contacts.filter((contact) => {\n if (contact.name.toUpperCase().includes(this.searchName)) {\...
[ "0.7138137", "0.6424984", "0.6373396", "0.635238", "0.6336676", "0.6306357", "0.62786394", "0.624089", "0.62165475", "0.61767226", "0.61693573", "0.6141711", "0.61394167", "0.61284363", "0.61236733", "0.61072254", "0.60692245", "0.6067445", "0.60636044", "0.6051047", "0.60485...
0.6912714
1
Calculates if the given component with the given view is currently the active folder content container that is selected in the collection view. The calculation is used e.g. to suppress content creation event for components that are currently not active.
function isActiveView(component/*:Component*/, view/*:String*/)/*:Boolean*/ { var cmManger/*:CollectionViewManagerInternal*/ =AS3.as( com.coremedia.cms.editor.sdk.editorContext.getCollectionViewManager(), com.coremedia.cms.editor.sdk.collectionview.CollectionViewManagerInternal); var mainStateBean/*:Bean*/ = c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "function viewAttachedToContainer(view) {\n return isLContainer(view[PARENT]);\n}", "function viewAttachedToContainer(view) {\n re...
[ "0.59627616", "0.59627616", "0.59627616", "0.59627616", "0.59627616", "0.59627616", "0.59627616", "0.59627616", "0.59627616", "0.59627616", "0.59627616", "0.59627616", "0.56996477", "0.557086", "0.5522808", "0.55165124", "0.55165124", "0.5248849", "0.5242999", "0.52426404", "...
0.78612584
0
Update sort change event
onSortChange(ev) { if (ev.moved) { const orderPromises = []; this.isProcessing = true; for (let i = Math.min(ev.moved.oldIndex, ev.moved.newIndex); i <= Math.max(ev.moved.oldIndex, ev.moved.newIndex); i += 1) { const sortOrder = i + 1; orderPromises.push(this....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CdkDragSortEvent() { }", "function CdkDragSortEvent() { }", "changeSort (event) {\n this.collection.setSorting(event.target.getAttribute('data-sort'), 1, {})\n console.log('changeSort', this.collection.state)\n }", "function addSortEvents() {\n query('.group')\n .bind('DOMSubt...
[ "0.7347037", "0.7347037", "0.73107415", "0.7190852", "0.7173428", "0.71389127", "0.71361476", "0.71048146", "0.7090463", "0.70466864", "0.7017103", "0.7012031", "0.6911155", "0.68667245", "0.6864206", "0.6861994", "0.68471795", "0.68367904", "0.6800008", "0.67860997", "0.6772...
0.7478265
0
FetchData Send componentData to node Build SCSS & compile SCC
fetchFormData(componentArray) { const self = this; fetch("https://"+window.location.hostname+":1337/compilesasscomponent", { method: "POST", mode: 'cors', body: JSON.stringify({ "payload": componentArray }), headers: { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sassComponentBuilder() {\n \n const self = this;\n \n if (!document.querySelector('.c-button--generate-css')) {\n return;\n }\n \n // Prepare to generate build\n const generateCSS = document.querySelector('.c-button--generate-css').getAttribute('id...
[ "0.59982467", "0.5307192", "0.52591664", "0.5179988", "0.51734555", "0.50361353", "0.50161123", "0.49958894", "0.49420923", "0.49354348", "0.490628", "0.49027583", "0.48950633", "0.48872954", "0.48796564", "0.48686466", "0.48496035", "0.48486587", "0.48407373", "0.48309427", ...
0.666475
0
Starts an RPC server that receives requests for the Greeter service at the sample server port
function main() { var server = new grpc.Server(); server.addService(hello_proto.Greeter.service, { sayHello: sayHello }); server.bind("0.0.0.0:9090", grpc.ServerCredentials.createInsecure()); server.start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n var server = new grpc.Server();\n server.addService(services.GreeterService, {sayHello: sayHello});\n server.bindAsync('0.0.0.0:50051', grpc.ServerCredentials.createInsecure(), () => {\n server.start();\n });\n}", "function main() {\r\n var server = new grpc.Server();\r\n server.addS...
[ "0.79640967", "0.776272", "0.7541216", "0.73772043", "0.7165172", "0.7154019", "0.71449775", "0.70722204", "0.70352197", "0.7033965", "0.70092535", "0.7000014", "0.6886164", "0.68610096", "0.67737836", "0.67183584", "0.6717381", "0.66985977", "0.6695734", "0.6598832", "0.6518...
0.7762729
1
Message schema: PEER_REQUEST. Initial request from other server to peer with us. PEER_OK. Other peer accepted us. Joy! We only handle base peering protocol at this level, everything else is handled by gameState
async handlePeerData(peer, data) { let gameStateHandled = await this.gameState.handleMessage(peer, data) switch (data.type) { case "PEER_REQUEST": peer.send({type: "PEER_OK"}); peer.acceptPeer(); this.gameState.game.handleNewPeer(peer) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendGameRequest(){\n if(conn === null){\n conn = peer.connect(otherIdTextBox.value, {\n reliable: true\n });\n }else{\n conn = peer.connect(conn.peer, {\n reliable: true\n });\n }\n myColor = \"white\";\n opponentColor = \"black\";\n connected();\n requestSent.style.di...
[ "0.64904696", "0.61670643", "0.6165418", "0.6088721", "0.60665613", "0.5999741", "0.59287256", "0.58795166", "0.58794343", "0.5810841", "0.5772978", "0.57181704", "0.5717427", "0.569555", "0.566929", "0.5630348", "0.5627052", "0.55351716", "0.55229336", "0.5503602", "0.547705...
0.62291723
1
convert to Event if the value is true
function TriggerEvent() { this.size = [60, 30]; this.addInput("if", ""); this.addOutput("true", LiteGraph.EVENT); this.addOutput("change", LiteGraph.EVENT); this.addOutput("false", LiteGraph.EVENT); this.properties = { only_on_change: true }; this.prev = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPromiEvent(value) {\n return !!value[promiEventBrand];\n}", "valid(event){if(this.eventList[event]){return!0}return!1}", "function cast(value) {\n return (value == \"True\") ? true :\n (value == \"False\") ? false :\n value\n}", "function make_event(event, target) {\n return s...
[ "0.5963051", "0.57637644", "0.57099634", "0.5648259", "0.55108815", "0.55108815", "0.55108815", "0.55108815", "0.55108815", "0.55108815", "0.55108815", "0.55108815", "0.55108815", "0.55108815", "0.5494771", "0.5489749", "0.54655725", "0.5457567", "0.5452938", "0.5420423", "0....
0.5961061
1
Map Redux actions to component props. We are returning two functions that our component can call to dispatch a change to the store
function mapDispatchToProps(dispatch){ //fires off the dispatch increase to the store return { increaseCount: function(){ return dispatch(increaseAction) }, //fires off the dispatch decrease to the store decreaseCount: function(){ return dispatch(decreaseActio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapDispathToProps(dispatch) {\n return {\n operationChoosed : function (operation) {\n dispatch(operationPressed(operation))\n }\n }\n}", "function mapdispatchtoprops(dispatch){\n //Whenever the selectBook is called the result should be passed to the booklist\n //contain...
[ "0.72122866", "0.7163919", "0.7140485", "0.71052957", "0.7093629", "0.70770043", "0.7075553", "0.7054736", "0.70410496", "0.70252997", "0.70122373", "0.6993551", "0.6958354", "0.695726", "0.6950924", "0.6950222", "0.69437885", "0.6939217", "0.69363654", "0.6933293", "0.693221...
0.7303693
0
Random size assigns height of element to random number between 10px400px
function randSize(elmt){ elmt.style.height = Math.floor((Math.random() * 300) + 10) + "px"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sizeGenerator()\n\t{\n\t\treturn Math.ceil(Math.random() * 350) + 50; \n\t}", "function generateRandomHeight() {\n const maxHeight = window.innerHeight * .8 - 10;\n\n return Math.floor(Math.random() * (maxHeight - 20) + 20);\n}", "function getRandSize() {\r\n return Math.random()*50+50;\r...
[ "0.7694324", "0.7663655", "0.7471026", "0.6973412", "0.6695039", "0.666455", "0.66273934", "0.64561176", "0.6355011", "0.62677795", "0.6255699", "0.6226838", "0.61458945", "0.6104763", "0.6095586", "0.60921943", "0.6058318", "0.60540944", "0.6035167", "0.6029523", "0.59842", ...
0.8640668
0
12) Always Hungry Create a function that accepts an array, and prints "yummy" each time one of the values is equal to "food". If no array elements are "food", then print "I'm hungry" once.
function alwaysHungry(arr){ var counter = 0; for (var i = 0 ; i < arr.length ; i++){ if (arr[i] == 'food'){ console.log('yummy'); counter += 1; } if (counter == 0){ console.log("I'm hungry"); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function alwaysHungry(arr){\n var count = 0;\n for(var i = 0; i < arr.length; i++){\n if(arr[i] == \"food\"){\n console.log(\"yummy\");\n }\n else {\n count++;\n }\n }\n if(count == arr.length){\n console.log(\"I'm hungry\");\n }\n}", "funct...
[ "0.82027876", "0.81498796", "0.8090798", "0.80847687", "0.8058406", "0.8051617", "0.8017053", "0.80075616", "0.7978952", "0.7945534", "0.7940451", "0.7923882", "0.7761813", "0.77486444", "0.7729401", "0.7728643", "0.77163446", "0.77105796", "0.7666837", "0.66905844", "0.65501...
0.81603587
1
plot.init(); plot.init().setStrokeStyle("dd").setFillStyle("sss"); console.log(2222); console.log(plot); plot.log();
function setPreference() { plot.init() //颜色 .setStrokeStyle("black") .setFillStyle('#666666') //阴影 .setShadowColor('#CCCCCC') .setShadowBlur(20) .setShadowOffsetX(10) .setShadowOffsetY(10) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n var selection = \"940\";\n createPlots(selection);\n}", "function plotInit() {\n if (!plotRef) {\n plotRef = $('#chart').plot(plotData.getProcessedPlotData(),\n {\n legend: {\n show: false\n },\n grid: {\n hoverable: true,\n ...
[ "0.6562304", "0.6406081", "0.62703353", "0.62703353", "0.626395", "0.61625564", "0.6142684", "0.61404914", "0.6101683", "0.60531366", "0.6042908", "0.6028662", "0.601791", "0.60089636", "0.60076576", "0.5966819", "0.596446", "0.5945434", "0.5933255", "0.589456", "0.5866652", ...
0.6794873
0
Create a new named collision group up to a max of 32.
static create(name, mask) { if (this._CURRENT_GROUP > this._MAX_GROUPS) { throw new Error(`Cannot have more than ${this._MAX_GROUPS} collision groups`); } if (this._GROUPS.get(name)) { throw new Error(`Collision group ${name} already exists`); } const grou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CollisionGroup(name, category, mask) {\r\n this._name = name;\r\n this._category = category;\r\n this._mask = mask;\r\n }", "function spawnZombieGroup(x, y, spread, size, health, damage, number) {\n\n\tvar i = 0;\n\n\twhile (i < number) {\n\n\t\tvar no = objects.push(new Zombie(x...
[ "0.63778955", "0.63189673", "0.6156544", "0.5901323", "0.5850319", "0.5784009", "0.57772523", "0.57582366", "0.57316107", "0.5716136", "0.57128525", "0.5682333", "0.5670754", "0.56702065", "0.56559426", "0.5655466", "0.5638771", "0.5568998", "0.54644835", "0.5423105", "0.5422...
0.6972826
0
setup Function that connect to spacebrew and creates a listener for clicks of the submit button.
function setup (){ var random_id = "0000" + Math.floor(Math.random() * 10000) ; app_name = app_name + ' ' + random_id.substring(random_id.length-4); // setup spacebrew sb = new Spacebrew.Client(); // create spacebrew client object sb.name(app_name); sb.description("This app sends text f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n var random_id = \"0000\" + Math.floor(Math.random() * 10000);\n\n app_name = app_name + ' ' + random_id.substring(random_id.length - 4);\n\n // setup spacebrew\n sb = new Spacebrew.Client(); // create spacebrew client object\n\n sb.name(app_name);\n sb.description(\"This app ...
[ "0.6740419", "0.66823053", "0.6483638", "0.63782096", "0.6368387", "0.6291602", "0.62860614", "0.6244989", "0.62385154", "0.6164279", "0.60193294", "0.59911776", "0.59811026", "0.59359634", "0.5915937", "0.588642", "0.5884204", "0.5884204", "0.58621246", "0.5792259", "0.57828...
0.7187489
0
Depricated Download via pandoc Download
function downloadWebInput() { //alert("Download Input File and Convert Source File to MarkDown"); var vPandoc_CMD = getValueDOM("pandocCMD"); var vShellHash = {}; var vInputFile = getValueDOM("downloadWebFILE"); vShellHash["inputFILE"] = vInputFile; write2innerHTML("inputFILE",vShellHash["inputFILE"]); co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DownloadTarget() { }", "function DownloadSource() { }", "function DownloadWikipediaExample()\n{\n downloadFileToDrive('https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png', 'MyDownloads', 'wikipedia.png', false);\n}", "static downlaodFile(url) {\n const file_name = ur...
[ "0.62127656", "0.6147595", "0.5876515", "0.57144296", "0.57106763", "0.5691128", "0.5685382", "0.5604738", "0.55970556", "0.5575848", "0.5575628", "0.5575587", "0.5550449", "0.5544912", "0.5501427", "0.5497299", "0.54671186", "0.5443953", "0.5440996", "0.54330516", "0.5384187...
0.67162895
0
This opens a tooltip url into a new tab
function openTooltip(url){ window.open(url, '_blank'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tiendaUrl(Url){\r\n\tz = Url\r\n\twindow.open(z,'_blank')\r\n}", "function NewTab(linkArtist) { \n window.open( \n linkArtist, \"_blank\"); \n}", "function myInterests() {\r\t\t window.open(\"http://www.w3schools.com\", \"_blank\", \"toolbar=no, scrollbars=yes, resizable=yes, top=500, lef...
[ "0.7251459", "0.6985915", "0.69527984", "0.6912177", "0.6904107", "0.6862536", "0.680718", "0.6718508", "0.66773903", "0.6670977", "0.6649541", "0.66440445", "0.66419953", "0.6639657", "0.6639657", "0.6628138", "0.6608958", "0.6577361", "0.65743285", "0.6559037", "0.6529571",...
0.87054884
0
Get Tier Level Details if the tier level is verified or PreVerified
function getTierDetails(tierLevel, tierStatus){ //if(tierStatus === 'Verified' || tierStatus === 'PreVerified'){ switch (tierLevel){ case 'Tier 1': getVerifiedService.getTier1Details() .success(function (depositTierLimit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTier(level) {\n\t\tswitch (level) {\n\t\t\tcase 1: case 2: case 3: case 4:\n\t\t\t\treturn 1;\n\t\t\tcase 5: case 6: case 7: case 8:\n\t\t\t\treturn 2;\n\t\t\tcase 9: case 10: case 11: case 12:\n\t\t\t\treturn 3;\n\t\t\tcase 13: case 14: case 15: case 16:\n\t\t\t\treturn 4;\n\t\t\tcase 17: case 18: cas...
[ "0.6340082", "0.6224361", "0.57376736", "0.5735994", "0.56358624", "0.55826145", "0.5495038", "0.5485963", "0.5435915", "0.5381866", "0.5265848", "0.522591", "0.5160136", "0.5102347", "0.5063325", "0.5052887", "0.50451857", "0.5042801", "0.5033566", "0.50142294", "0.49622285"...
0.72432005
0
count and display number of active items in the footer
function showNumberOfActive() { var numberOfCompleted = document.querySelectorAll('.completed').length; var numberOfActive = listItems.length - numberOfCompleted; var numberOfActiveText = document.getElementById("active"); numberOfActiveText.innerHTML = numberOfActive; if (numberOfActive == 1) { document.getElem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCountItems() {\n var count_items = document.getElementById('total_items');\n count_items.innerHTML = container.getElementsByTagName('li').length;\n }", "function StepCount(){\n\t\tvar numItems = $('.screen-step').length;\n\t\tvar activeItems = $('.active-step').attr( \"data-item\" ) + \" of \"...
[ "0.68303496", "0.6675229", "0.6661579", "0.65982217", "0.65475494", "0.65171003", "0.65146923", "0.65108067", "0.6487595", "0.6455078", "0.6412828", "0.6412502", "0.64042264", "0.639465", "0.6387342", "0.6378872", "0.6219395", "0.6205638", "0.6193484", "0.61323476", "0.613127...
0.74680513
0
Remove list items when clicking on destroy button
function removeListItems() { var destroy = document.getElementsByClassName("destroy"); for (var i = 0; i < destroy.length; i++) { destroy[i].onclick = function() { var destroyedLI = this.parentElement; destroyedLI.parentNode.removeChild(destroyedLI); saveTodos(); if (listItems.length == 0) { hideH...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeListItem(event){\r\n $(event.target).parent().remove();\r\n $(event.target).remove();\r\n }", "function List$destroy() {\n if (this.itemSample) this.itemSample.destroy(true);\n ComponentFacet.prototype.destroy.apply(this, arguments);\n}", "function remove(){\n\t\t$('.remove').click(...
[ "0.7658343", "0.7524187", "0.74318796", "0.73688805", "0.725503", "0.72454286", "0.72229975", "0.7217095", "0.71848404", "0.7110232", "0.70129836", "0.69977576", "0.69768023", "0.69693476", "0.69642866", "0.69584817", "0.6955588", "0.6909574", "0.6905654", "0.6901485", "0.688...
0.81934875
0
inits 'status' to pt to str 'debugging'
function logger() { // hoisted above the 'var status' def (w/i debugIt()) console.log(status); // logs the value of 'status' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function status (status) {\n console.info('Status:', status)\n textStatus.text(status)\n }", "function status (s) {\n log(s)\n}", "function status(s) {\n log(s);\n}", "function updateStatus(status) {\n detector_status_id.innerHTML = status.rec_status;\n if (status.device_name != \"\") {\n detec...
[ "0.65376884", "0.6418467", "0.62523556", "0.6236095", "0.6219008", "0.6200282", "0.6194602", "0.6182605", "0.61800295", "0.6148992", "0.6095398", "0.60770833", "0.60582024", "0.6055023", "0.6045639", "0.6028447", "0.60083383", "0.5988383", "0.59465235", "0.59047437", "0.58830...
0.6604568
0
Gets the details of the connected NFT, found within the url. A valid NFT collection address and tokenID are expected within the url in the format: Address)/(tokenID) Will fetch the data needed from the opensea API and update the page.
async function getDetails(){ let urlParts = window.location.pathname.split('/'); const [collectionAddr, tokenID] = urlParts.splice(-2); fetch(`${API_URL}/asset/${collectionAddr}/${tokenID}`, {method: "GET"}) .then((res) => res.json()) .then((json) => updateDetails(json)) .ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getDetails(){\n let urlParts = window.location.pathname.split('/');\n const [collectionAddr, tokenID] = urlParts.splice(-2);\n\n fetch(`${API_URL}/asset/${collectionAddr}/${tokenID}`, {method: \"GET\"})\n .then((res) => res.json())\n .then((json) => updateDetails(json))\n .ca...
[ "0.56079644", "0.5352905", "0.5209569", "0.5175078", "0.516639", "0.5122407", "0.51197445", "0.50952476", "0.50786155", "0.50477576", "0.5046839", "0.50325656", "0.5031055", "0.4984323", "0.49746385", "0.4961394", "0.4953523", "0.49514595", "0.49235204", "0.49098316", "0.4907...
0.55782294
1
return the average of all the numbers be sure to exclude the strings
function average(input){ /* if(isNaN(input)){ return input.replace(" "); }else{ return input.reduce((a,b) => a + b, 0)/input.length; }*/ const result = input.filter(num => typeof num == 'number'); return result.reduce((a,b) => a + b)/result.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function average(numbers) {\n var filtered = numbers.filter(function(x) {\n return typeof x !== \"string\";\n });\n var sum = 0;\n for (var i = 0; i < filtered.length; i++) {\n sum += filtered[i];\n }\n var avg = sum / filtered.length;\n return avg;\n}", "function average(average){\n var filtere...
[ "0.8050228", "0.785049", "0.77629334", "0.7535857", "0.7511543", "0.7498799", "0.7489187", "0.74382985", "0.7396273", "0.738532", "0.7367656", "0.73552656", "0.73474216", "0.73410606", "0.7333157", "0.7324586", "0.7318483", "0.72887284", "0.7281524", "0.72705203", "0.7268011"...
0.7932223
1
adjusts balance based on bet and displays messages based on values
function adjustBalance(){ if (currentBalance > 0 && currentBalance >= parseInt(enterbet.value)){ currentBalance -= parseInt(enterbet.value); if (currentBalance === 0){ statusmessage.style.color = 'gold'; statusmessage.style.backgroundColor = 'black' statusmessage....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function betMoney(betAmount) {\n if (playerMoney >= betAmount) {\n // calculate player's current money, betting money, jackpot money\n playerMoney -= betAmount;\n playerBet += betAmount;\n jackpot += betAmount * 100;\n betLabel.setText(playerBet.toStrin...
[ "0.74903333", "0.72210306", "0.719181", "0.71428216", "0.6967331", "0.693422", "0.69110155", "0.6899341", "0.68641067", "0.68562275", "0.6845859", "0.6838391", "0.68226516", "0.6816742", "0.6815831", "0.680615", "0.6767749", "0.66924006", "0.66792864", "0.6665531", "0.665579"...
0.7453601
1
c Find all leaders in an array. A leader is an element larger than all elements to the right of it. Example: leader([98, 20, 30, 5, 11, 27]) // output: [98, 30, 27] write your code here ....
function leader(arr){ var res = []; for (var i = 0; i < arr.length; i++) { var greater = true; for (var j = i+1; j < arr.length; j++) { if(arr[i]>arr[j]) greater = greater && true; else greater = greater && false; } if(greater) res.push(arr[i]); } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function leader(array){\n\tvar newArr=[];\n\tlarge=array[array.length-1]\n\tnewArr.push(large)\n\tfor (var i =0 ; i<array.length ; i++) {\n\t\tif(array[i] > large){\n\t\t\tnewArr.push(array[i])\n\t\t}\n\t}\n\treturn newArr.sort(function(a,b){return b-a});\n}", "function leaders(array){\n\tvar lead=[]\n\tvar l=ar...
[ "0.7446174", "0.74180317", "0.69917834", "0.6818291", "0.67925584", "0.6780588", "0.66349506", "0.65943456", "0.65253556", "0.6495889", "0.6202129", "0.61467403", "0.6111064", "0.6036612", "0.5756862", "0.5691961", "0.5627671", "0.5620237", "0.5573087", "0.5480252", "0.547828...
0.76753336
0
The LaunchpadBindingMap class encapsulates Launchpad binding data at a specific point in time. It is a readonly object and should not be modified.
function LaunchpadBindingMap( data ) { console.log(data, 'ndbcbvcbvvvdjv>>>'); // The map of bindings. this.data = null; // The total number of binding callbacks. this.bindCount = 0; // The number of binding names. this.nameCount = 0; this.setData( data ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Bindings(map) {\n if( map === undefined ) {\n this.map = {};\n } else {\n this.map = map;\n }\n}", "__init7() {\n\t\tthis.binding_groups = new Map();\n\t}", "function getInstanceBindingMap(content, delegate_) {\n var contentId = getContentUid(content);\n if (delegate_) {\n var map ...
[ "0.6436002", "0.574568", "0.5429629", "0.5349936", "0.5237783", "0.5169773", "0.5115989", "0.5099635", "0.5068095", "0.506551", "0.5004669", "0.50024146", "0.49887493", "0.49828193", "0.49132702", "0.49081457", "0.49081457", "0.49081457", "0.48563015", "0.48563015", "0.485630...
0.8343318
0
Add onclick function to day field
function addOnclick(){ var dayFields = document.getElementsByClassName('fc-daygrid-event'); var month = document.getElementsByClassName('fc-toolbar-title')[0]; month = month.textContent.split(' ')[0]; for(var i = 0; i < dayFields.length; i++){ dayFields[i].setAttribute('onclick', 'addForm(this)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dayClick(date, jsEvent, view) {\n $('#side-datetimepicker').data(\"DateTimePicker\").date(date);\n }", "onClickDay(date) {\n this.setState({selectedDate:date});\n // should open corresponding entry\n }", "function bindDayLinks() {\r\n\t\tvar days = body.getElementsByTagName('a');\r\n...
[ "0.71374315", "0.6549866", "0.6503262", "0.64574164", "0.64539295", "0.6418079", "0.6353752", "0.6327848", "0.63004655", "0.6281907", "0.62240016", "0.6180803", "0.61345124", "0.61312765", "0.6113161", "0.60955346", "0.6046475", "0.60431975", "0.6037457", "0.6036315", "0.6031...
0.7071505
1