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
Bind the search handler function to the search element.
function bindSearchHandler() { document.getElementById("search").addEventListener("input", searchHander); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchBinding(){\n var selector = thisInstance.constants.selector,\n $searchForm = $(selector.searchForm);\n $searchForm.on('submit', function(event){\n event.preventDefault();\n fetchAndLoadUserList({searchKey: $.trim($(selector.searchBox).val())});\n ...
[ "0.75486916", "0.7392349", "0.73411644", "0.7178711", "0.7177348", "0.71594834", "0.70945114", "0.7060106", "0.7003046", "0.6943377", "0.6926139", "0.6902265", "0.68957525", "0.6797893", "0.6794089", "0.6768801", "0.67645663", "0.6691853", "0.6634165", "0.6634165", "0.6626383...
0.8257948
0
Show data loaded text then hide it after one second.
function showDataIsLoaded() { let loadingIndicator = document.getElementById("loadingIndicator"); loadingIndicator.innerHTML = "Data loaded!"; setTimeout(() => loadingIndicator.style.display = "none", 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadAndDisplay() {\n $(\"#hideBox\").delay(800).fadeOut('fast', function() {\n $(\"#resultsByTime\").show();\n });\n }", "function showLoading() {\n loading.classList.add(\"show\");\n setTimeout(callData, 2000);\n }", "function infoFunc(txt) {\r\n info.style.display = \"blo...
[ "0.73404324", "0.69087374", "0.6868067", "0.67688966", "0.6656473", "0.6454247", "0.6433648", "0.6433648", "0.6414432", "0.64014715", "0.64014715", "0.6391693", "0.638427", "0.6366506", "0.6333692", "0.63213426", "0.63101715", "0.62784857", "0.62565607", "0.6250191", "0.62473...
0.7029414
1
Method to render individual criteria codes and their respective tooltip 'datastatus' attribute flags whether a criterion is met
renderCriteriaBar(key, evidence, interpretation) { let status = 'not-evaluated'; // Flag 'met' criteria via [data-status] let evalArray = interpretation.evaluations; if (evalArray) { if (evalArray.length) { evalArray.forEach(entry => { if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTestResults() {\n\n var trLength = testResults.length;\n if (trLength > 0 ) {\n\n // Get the labels for each of the system statuses\n var passed_label = getStatusLabel(\"passed\");\n var blocked_label = getStatusLabel(\"blocked\");\n var untested_label = getStatusLabel(\"untested\");\n...
[ "0.60921293", "0.59985125", "0.5935145", "0.57989573", "0.5769663", "0.5739767", "0.5723356", "0.57116985", "0.5633558", "0.5599243", "0.55275136", "0.55244064", "0.55243766", "0.5476842", "0.5465518", "0.54373485", "0.5413009", "0.5360616", "0.5341046", "0.5307232", "0.53007...
0.6939561
0
========================================================================= sendMail ========================================================================= Main function for recieving and validating the user's inputs. When finished, information will be sent to the email transfer php function to be prepared and sent to...
function sendMail(){ error = false; // Reset error to assume there's no errors // Fetch user's information var name = document.getElementById('name').value; var email = document.getElementById('email').value; var subject = document.getElementById('subject').value; var message = document.getElementById('messa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendMail(){ \n\tlogincontroller.logincheck(name,password,(err,data)=>{\n \tif(err) throw err;\n \telse{\n \t\tconsole.log(\"\\n------------------------------Compose Mail---------------------------------\\n\\n\")\n \t\tconsole.log(\"--------------------------------------------------------------------------...
[ "0.70699155", "0.6474504", "0.633365", "0.63208544", "0.6298", "0.62426984", "0.6143947", "0.6096317", "0.60901135", "0.60720444", "0.60468954", "0.6040679", "0.60349", "0.6030001", "0.6027417", "0.60139537", "0.6006004", "0.59976214", "0.595445", "0.595014", "0.5929794", "...
0.76435506
0
Rescale maze dimensions on density change
densityChanged(e, oldWidth, oldHeight, mazeWidth, mazeHeight) { const density = parseInt(e.target.value); const maxWidth = Math.floor(mazeWidth / density); const maxHeight = Math.floor(mazeHeight / density); let relWidth = Math.round((oldWidth.val / oldWidth.max) * maxWidth); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeMaze() {\n var jq = $(\"#maze\");\n jq[0].width = jq[0].clientWidth;\n jq[0].height = jq[0].clientHeight;\n}", "function resize() {\n width = parseInt(d3.select('#viz').style('width'));\n width = width - margin.left - margin.right;\n height = width * mapRatio;\n\n // update pr...
[ "0.7010467", "0.63734335", "0.63519555", "0.63437974", "0.63088465", "0.62070334", "0.6169253", "0.6115766", "0.61015874", "0.6095648", "0.60470426", "0.60360193", "0.60012406", "0.5950517", "0.59253323", "0.59253323", "0.5924455", "0.592156", "0.5919924", "0.59141785", "0.59...
0.73660415
0
Initializes the tablecheckbox wrapper.
_init() { this.$element.find('thead tr').each(function(index, el) { $(el).prepend('<th class="check table-checkbox-cell"><input type="checkbox" /></th>'); }); this.$element.find('tbody tr').each(function(index, el) { $(el).prepend('<td class="check table-checkbox-cell"><input type="checkbox" />...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function styleCheckbox(table) {\n\n }", "function styleCheckbox(table) {\r\n\r\n\t}", "build() {\n // this.element = this.ce('div', {\n // class: 'table-responsive'\n // });\n // this.createLabel(this.element);\n\n // var tableClass = 'table ';\n // ['striped', 'bordered', 'hover', '...
[ "0.6688414", "0.64977086", "0.6467641", "0.6416971", "0.6380863", "0.63686115", "0.63614565", "0.63245076", "0.6323659", "0.631772", "0.6316012", "0.6300938", "0.6299302", "0.6292558", "0.62875015", "0.6280745", "0.6267908", "0.6267908", "0.6239484", "0.6239484", "0.6155657",...
0.78201777
0
Updates active rows on changes.
_updateActiveRows() { if (!this.changeMultiple) { this.activeRows = this.$element.find('tbody tr.active'); this.$element.trigger('changed.zf.table.checkbox', [this.activeRows]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "commitChangedRows() {\n var d = new latte.DataSet();\n var old = new latte.DataSet();\n var indexes = [];\n this.endCellEdit();\n // Add dataset columns\n d.columns.addCollection(this.columns);\n old.columns.addCollection(this.columns);\n...
[ "0.6598424", "0.6539915", "0.6539915", "0.6319356", "0.6313995", "0.62199163", "0.6153227", "0.61383456", "0.6096986", "0.6073774", "0.60399884", "0.6036125", "0.6000784", "0.5969804", "0.5939618", "0.58777857", "0.58718956", "0.5846417", "0.58243895", "0.5819677", "0.5810749...
0.81905556
0
Destroys the tablecheckbox plugin.
_destroy() { this.$element.off('.zf.table.checkbox'); this.$element.find('th.table-checkbox-cell').remove(); this.$element.find('td.table-checkbox-cell').remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destroy() {\n // clear up our FieldChecker controller instance\n // ... this will dynamically remove itself from our parent FormChecker\n fieldChecker.destroy();\n }", "function destroy() {\n Y.log('Destroying table element: ' + element.getDomId(), 'debug', NAME);\n }...
[ "0.6524498", "0.6375102", "0.637256", "0.62806654", "0.616944", "0.61632246", "0.6157277", "0.6090114", "0.6052867", "0.6041596", "0.600461", "0.59902555", "0.5966329", "0.5955884", "0.5934785", "0.59227866", "0.59213597", "0.59186935", "0.59028304", "0.58918095", "0.5875409"...
0.8110313
0
form functions resolves with all forms
function getAllForms() { return new Promise((resolve, reject) => { if(!form) reject(new Error("forms is not found")); return resolve(form); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n Object.entries(formsAndHandlers).forEach(([formID, handler]) => {\n const form = document.getElementById(formID);\n form.onsubmit = (e) => {\n e.preventDefault();\n const data = {};\n (new FormData(form)).forEach((value, key) => {\n data[key] = value;\n });\n ...
[ "0.63619393", "0.62982017", "0.62664354", "0.6104025", "0.6090277", "0.6049145", "0.5967334", "0.59529597", "0.59292257", "0.5902281", "0.588008", "0.5880065", "0.5869194", "0.58580196", "0.5857524", "0.5855695", "0.5853861", "0.5847028", "0.5828548", "0.58064574", "0.5805229...
0.6515821
0
resolves with one form and form inputs by id
function getFormById(id) { return new Promise((resolve, reject) => { if(!form) reject(new Error("forms is not found")); let formData = {}; for(let i in form) { if(form[i].formid == id) { formData.form = form[i]; break; } } let form_field_data = []; for(let j in form...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addInputForm (id) {\n const formId = id + 1;\n const plusButton = document.querySelector(`#addInputForm${id}`);\n const form = document.querySelector(`#inputForm${formId}`);\n plusButton.addEventListener(\"click\", () => {\n form.style.display = \"inline\";\n });\n}", "getById(id) {\r\n c...
[ "0.6067841", "0.6062424", "0.6018778", "0.59484327", "0.578025", "0.572888", "0.57229555", "0.57105595", "0.5681465", "0.567825", "0.5660196", "0.56314117", "0.5585856", "0.55528146", "0.5527853", "0.5516726", "0.55071235", "0.55000216", "0.54956573", "0.54686064", "0.5458628...
0.6262314
0
resolve to new form created (should probably resolve to form id to send less data)
function createForm(formdata) { return new Promise((resolve, reject) => { if(!form || !formdata) reject(new Error("forms is not found")); // should probably return form that was created resolve(true); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newProjectForm() {\n\t\t$.get(\"/projects/new\", function(projectForm) {\n\t\t\tdocument.getElementById('js-new-project-form').innerHTML = projectForm;\n\t\t}).done(function() {\n\t\t\tlistenerSaveProject();\n\t\t})\n}", "function createFormForUser(newForm, userid) {\n var deferred = q.defer();\n...
[ "0.67756826", "0.6715408", "0.6676951", "0.66667616", "0.6656567", "0.6643752", "0.65391237", "0.64958495", "0.63840175", "0.6380023", "0.63715625", "0.63399535", "0.6316941", "0.62762165", "0.62506026", "0.6249293", "0.62392634", "0.6238345", "0.6236167", "0.623004", "0.6226...
0.6764775
1
resolves with all forms for one applicant by id of applicant
function getUserFormsById(id) { return new Promise((resolve, reject) => { if(!applicant) reject(new Error('applicants cannot be found')); let applicant_data = {}; for(let i in applicant) { console.log(id ,applicant[i]); if(applicant[i].applicantid == id) { applicant_data.applicant = ap...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserFormResponces(userid, formid) {\n return new Promise((resolve, reject) => {\n if(!applicant || !userid || !formid) reject(new Error('applicants cannot be found'));\n resolve([]);\n });\n}", "function getFormById(id) {\n return new Promise((resolve, reject) => {\n if(!form) reject(new ...
[ "0.6088951", "0.6052487", "0.59781617", "0.5920414", "0.57667005", "0.57484394", "0.5678767", "0.5611019", "0.55790794", "0.5572576", "0.5459195", "0.5406526", "0.53712595", "0.5366074", "0.5340986", "0.532006", "0.5296096", "0.5277418", "0.52678955", "0.5238447", "0.52285886...
0.7286602
0
START OF FPI Code / Template processing code START Creates a dictionary that has all PI fields mentioned in this template with information such as which one of them can be null and which ones are mandatory. Returns a tree of created template nodes.
function traverse_template_create_tree(fd, curr_node, site_pi_fields) { var all_kids = $(fd).children('div'); var last_kid = null; curr_node.children = []; curr_node.xml_node = fd; curr_node.name = $(fd).attr('name'); if (all_kids.length == 0) { //This is a leaf node .. represents actual valu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TemplateInfo() {\n\tthis.code = '';\n\tthis.type = '';\n\tthis.parent = '';\n\tthis.description = '';\n}", "async process_fields() {\n\n const fields_template = this._blockkit_conifg.block_kit.fields;\n\n const result = {};\n result.type = \"section\";\n result.fields = [];\n\n for (const...
[ "0.58117586", "0.57724404", "0.5176685", "0.5152908", "0.51514655", "0.49836132", "0.49600205", "0.49585125", "0.4946984", "0.4917042", "0.4888747", "0.4888747", "0.48701122", "0.4855201", "0.48429745", "0.48386312", "0.4812062", "0.48064396", "0.48003817", "0.4792527", "0.47...
0.69365865
0
Simulate a waiting queue. When someone calls to fetch url and if their slave tab is busy fetching another url, then put that node on waiting queue. Waiting on the slave tab occurs in a situation where parentnode's link has been fetched and all children now want to fetch their links.
function make_slavetab_do_work(action_type, curr_node, site_pi_fields, fetch_url, my_slave_tab, level) { if (!('gatekeeper_initialized' in my_slave_tab)) { my_slave_tab.gatekeeper_initialized = true; my_slave_tab.wait_queue = []; var event_name = "waiting_queue"; var wait_dummy_tab_id = sprintf('wait-queue-tab-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fill() {\n // Note:\n // - queue.running(): number of items that are currently running\n // - queue.length(): the number of items that are waiting to be run\n while (this.queue.running() + this.queue.length() < this.concurrency && this.path.peersToQuery.length > 0) {\n this.queue.push(this.path.pe...
[ "0.5778248", "0.56094426", "0.55767995", "0.550193", "0.54694515", "0.5414653", "0.53997904", "0.5398549", "0.53968996", "0.53924865", "0.53765005", "0.53718394", "0.5323947", "0.53234255", "0.5306173", "0.5286078", "0.5278313", "0.5249631", "0.5230891", "0.5230891", "0.52287...
0.5859284
0
This is supposed to consolidate common fields w/o revealing them. It takes care of multiple field values. For eg. if name on 3 sites is Joe and 2 others is John, it will create name1: ["site1", "site2", "site3"] name2: ["site4", "site5"]
function calculate_common_fields() { var r = get_all_pi_data(); var vpfvi = pii_vault.aggregate_data.pi_field_value_identifiers; var common_fields = {}; for (f in r) { for (v in r[f]) { var value_identifier = undefined; if (v in vpfvi) { value_identifier = vpfvi[v]; } else { va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_fields2request(includeEmpty) {\n let result = [];\n\n for (const name of this.uniqueFieldNames) {\n var newName = name;\n\n // send clonables as list (even if there's only one field) and other fields as plain values\n let potentialClones = this.fields.filter(f =>\n ...
[ "0.5619916", "0.5287326", "0.5254355", "0.518044", "0.5120531", "0.5117962", "0.5084541", "0.50548285", "0.50227296", "0.5005516", "0.5004088", "0.4993486", "0.4972472", "0.490241", "0.48945016", "0.4890567", "0.48803928", "0.4878614", "0.48611364", "0.4858207", "0.4847248", ...
0.5532337
1
This function is supposed to generate group names such as 'A', 'B', .., 'AA', 'AB', 'AC' ..
function new_group_name(pwd_groups) { //Start at 'A' var init_group = 65; var new_name_detected = false; var new_name_arr = []; new_name_arr.push(init_group); while (!new_name_detected) { var char_new_name_arr = []; for (var i = 0; i < new_name_arr.length; i++) { char_new_name_arr.push(S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateGroupID() {\n\t\treturn (Math.random() * 999).toString();\n\t}", "function prefixCategoryOptionGroups() {\n\tif (!metaData.categoryOptionGroups) return;\n\tfor (var group of metaData.categoryOptionGroups) {\n\t\tgroup.name = currentExport._prefix + \" \" + group.name;\n\t}\n}", "function generateAlphab...
[ "0.6382855", "0.6330292", "0.62532586", "0.6232897", "0.6190578", "0.61847055", "0.61847055", "0.61847055", "0.61847055", "0.6146121", "0.60857606", "0.60857606", "0.60857606", "0.60857606", "0.60857606", "0.60857606", "0.60857606", "0.60857606", "0.60857606", "0.60857606", "...
0.7753008
0
First gets a different salt from the last value. Then, Calculates the super short hashsum Only count last 12bits..so plenty of collisions for an attacker
function calculate_new_short_hash(pwd, prev_salt) { //First get a salt that is not equal to prev_salt var curr_salt = prev_salt; while (curr_salt == prev_salt) { var r = Math.floor((Math.random() * 1000)) % 1000; curr_salt = pii_vault.salt_table[r]; } //Now get the short hash using salt calculate...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculate_short_hash(pwd, salt) {\n //Now get the short hash using salt calculated\n var salted_pwd = salt + \":\" + pwd;\n var k = sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(salted_pwd));\n var hash_pwd = k.substring(k.length - 3, k.length);\n var rc = {\n\t'short_hash' : hash_pwd, \n ...
[ "0.70807123", "0.69053096", "0.6689671", "0.64896554", "0.64372206", "0.64352554", "0.6383274", "0.638033", "0.63542473", "0.6334163", "0.6296724", "0.62763786", "0.62681717", "0.6258082", "0.62338126", "0.6208083", "0.62007177", "0.6192447", "0.6171485", "0.6152615", "0.6145...
0.73278916
0
Calculates the super short hashsum given a salt Only count last 12bits..so plenty of collisions for an attacker
function calculate_short_hash(pwd, salt) { //Now get the short hash using salt calculated var salted_pwd = salt + ":" + pwd; var k = sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(salted_pwd)); var hash_pwd = k.substring(k.length - 3, k.length); var rc = { 'short_hash' : hash_pwd, } return ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculate_new_short_hash(pwd, prev_salt) {\n //First get a salt that is not equal to prev_salt\n var curr_salt = prev_salt;\n while (curr_salt == prev_salt) {\n\tvar r = Math.floor((Math.random() * 1000)) % 1000;\n\tcurr_salt = pii_vault.salt_table[r];\n }\n\n //Now get the short hash using...
[ "0.7265873", "0.6680175", "0.65515584", "0.64110565", "0.632748", "0.63217413", "0.6301112", "0.6293531", "0.62884015", "0.62826186", "0.627014", "0.62294567", "0.6227629", "0.6218043", "0.6198331", "0.6185951", "0.614623", "0.6134158", "0.610319", "0.60551685", "0.6049774", ...
0.74395984
0
END OF Blacklist Code START OF Misc Code Function to see if Appu server is up Also tells the server that this appu installation is still running
function pii_check_if_stats_server_up() { var stats_server_url = "http://woodland.gtnoise.net:5005/" try { var wr = {}; wr.guid = (sign_in_status == 'signed-in') ? pii_vault.guid : ''; wr.version = pii_vault.config.current_version; wr.deviceid = (sign_in_status == 'signed-in') ? pii_vault.confi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isRunning(req, res) {\n res.send(\"Its Alive!!!\");\n}", "function checkIfServerIsUp(server_ip_address)\n {\n \tvar is_server_up = false;\n \tconsole.log(\"Invoking a synchronous AJAX call to check for server's status ..\");\n \ttry {\n $.ajax({\n type: \"GET\",\n...
[ "0.6616564", "0.65891254", "0.65401095", "0.6455398", "0.6387666", "0.62745297", "0.6234303", "0.6193202", "0.6179587", "0.6148485", "0.6120712", "0.6115703", "0.6038705", "0.60366625", "0.602341", "0.6019539", "0.5993458", "0.59888405", "0.5969588", "0.5947656", "0.5941883",...
0.7513655
0
Aggregate data is gathered over the time unlike daily reports. Also aggregate data will contain sensitive data such as per_site_pi that is not sent to the server. Only user can view it from "My Footprint"
function initialize_aggregate_data() { var aggregate_data = {}; //When was this created? aggregate_data.initialized_time = new Date(); //Is user aware? How many times is he reviewing his own data? //This could be used as a feedback to the system about user's awareness //(hence an indirect metri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GetSummary() {\n var YearQuery = '';\n if (FilterList.DashboardFilterYear === '') {\n YearQuery =\n ' business_year = ' +\n \"'\" +\n moment().utcOffset('+08:00').format('YYYY') +\n \"'\";\n } else {\n YearQuery =\n ' business_year = ' + \"'\" + Filt...
[ "0.5974392", "0.594095", "0.5920378", "0.58689076", "0.57769215", "0.57223976", "0.57133436", "0.5699888", "0.5674575", "0.56137127", "0.5535037", "0.5526437", "0.55062884", "0.5472775", "0.5439763", "0.5424515", "0.5401869", "0.5391098", "0.53871936", "0.5373135", "0.5372979...
0.7445762
0
returns deleted max value (root) in heap TIME COMPLEXITY: O(log N), N = number of nodes in heap SPACE COMPLEXITY: O(N), 2N > O(N) (2N bec recursive call stack?)
deleteMax() { // recall that we have an empty position at the very front of the array, // so an array length of 2 means there is only 1 item in the heap if (this.array.length === 1) return null; // edge case- if no nodes in tree, exit if (this.array.length === 2) return this.array.po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove() {\n if (this.heap.length < 2) {\n return this.heap.pop(); //easy\n }\n\n const removed = this.heap[0]; // save to return later\n this.heap[0] = this.heap.pop(); // replace with last el\n\n let currentIdx = 0;\n let [left, right] = [currentIdx * 2 + 1, currentIdx * 2 + 2];\n let c...
[ "0.72349405", "0.71611047", "0.7118273", "0.7075563", "0.7045658", "0.70281285", "0.69180804", "0.6905783", "0.68910396", "0.6877944", "0.6812218", "0.6794426", "0.67901075", "0.6739307", "0.6712732", "0.6690238", "0.6684173", "0.6665397", "0.66553473", "0.66267765", "0.65978...
0.828122
0
sortByProcName: This function will sort Secondary Procedures by ascending only.
function sortByProcName(a, b) {//sort by name(display_as) ascending only if (a.DISPLAY_AS.toUpperCase() > b.DISPLAY_AS.toUpperCase()) { return 1; } if (a.DISPLAY_AS.toUpperCase() < b.DISPLAY_AS.toUpperCase()) { return -1; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortByProcedure(arr) {\n var procs = arr.map(getProcedure);\n for (var i = 1; i < arr.length; i++) {\n var procNew = procs[i];\n if (procNew < 0)\n continue;\n for (var j = i - 1; j >= 0 && procNew < procs[j]; j--) {\n var token = arr[j + 1];\n arr[j + 1] = arr[j];\n arr[j] = ...
[ "0.7111214", "0.7082964", "0.7069585", "0.7069585", "0.7069585", "0.7069585", "0.68992424", "0.60835826", "0.60537666", "0.5901711", "0.5901711", "0.5901711", "0.5762989", "0.57432014", "0.56889117", "0.56843835", "0.56165767", "0.558956", "0.5584798", "0.55671173", "0.556494...
0.7576404
0
ProcedureRequest function will initialize a JSON object needed for sending parameters for mp_exec_std_request script
function ProcedureRequest() { this.procedure_id = 0; this.encounter_id = 0; this.active_ind = 0; this.nomenclature_id = 0; this.procedure_date = ""; this.procedure_date_precision = 0; this.procedure_date_precision_cd = 0; this.free_text = ""; this.update_cnt = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeRequest() {\r\n // Get Parameter Values\r\n let requestString = [];\r\n\r\n // Make Request\r\n this.getPrologRequest(requestString, this.handleReply);\r\n }", "function _getParams(funcParamObj, onExecuteComplete) {\r\n\r\n /** default object content of an operation */\r\n va...
[ "0.58154833", "0.5806335", "0.54913676", "0.54202896", "0.52524227", "0.5242344", "0.5211276", "0.51933783", "0.5171736", "0.50880027", "0.5070031", "0.5050982", "0.50502527", "0.5007911", "0.49855408", "0.49679124", "0.4946332", "0.4934465", "0.4902039", "0.4890071", "0.4876...
0.6765716
0
The retrieveContributorSystemCds function will retrieve the codes from code set 89 and store them in the shared resource for future use Since the script call is asynchronous a call back function provided will be executed once the data is retrieved
function retrieveContributorSystemCds(component, callBackFunction) { // Get contributor system codes from shared resource var contributorSystemCdResource = MP_Resources.getSharedResource("contributorSystemCodes"); if (contributorSystemCdResource && contributorSystemCdResource.isResourceAvailable()) { //At this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pollSystemCodes() {\n\t\t// Note we need to return here to allow tests\n\t\t// to hook into the promise\n\t\treturn fetchSystemCodes(options.cmdbApiKey)\n\t\t\t.then(codes => {\n\t\t\t\tvalidSystemCodes = codes.concat(options.validationExceptions);\n\t\t\t})\n\t\t\t.catch(error => {\n\t\t\t\t// If the pol...
[ "0.52447075", "0.5077303", "0.49935552", "0.49673036", "0.49642342", "0.4940104", "0.4933119", "0.4868681", "0.48507965", "0.48246887", "0.4806166", "0.47330528", "0.47272414", "0.46921158", "0.46838936", "0.46752548", "0.46752185", "0.46715802", "0.46340084", "0.4632241", "0...
0.8683864
0
private static vis: Visual;
function Visual(options) { console.log('Visual constructor', options); Visual.host = options.host; this.selectionIdBuilder = options.host.createSelectionIdBuilder(); this.target = options.element; thi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Object_Visual(data) {\n Object_Visual.__super__.constructor.call(this);\n\n /**\n * Indiciates if the game object is visible on screen.\n * @property visible\n * @type boolean\n */\n this.visible = true;\n\n /**\n * The object's destination rectangle on screen.\n * @property...
[ "0.6412795", "0.63840026", "0.6101102", "0.59558827", "0.59144247", "0.5860045", "0.5819913", "0.58192855", "0.57873297", "0.5782663", "0.577427", "0.5762772", "0.5742079", "0.57368773", "0.5654134", "0.5634488", "0.5607981", "0.55945486", "0.55728716", "0.55708385", "0.55388...
0.6597097
0
returns array where position i is the product of all array items at position !== i
function products(arr){ let newArr = [] let p ; for (let i=0;i<arr.length;i++){ p=1 for (let j=0;j<arr.length;j++){ if (i !== j){ p = p * arr[j] } } newArr.push(p) } return newArr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function products(arr){\n let result = [];\n for (let i = 0 ; i < arr.length; i ++ ){\n let prod = 1\n for (let j = 0; j < arr.length; j++){\n if (i !== j){\n prod *= arr[j]\n }\n }\n result.push(prod);\n }\n return result;\n\n}", "function getProductsOfAllIntsExceptAtIndex...
[ "0.7924141", "0.75988436", "0.75666434", "0.7527754", "0.75120986", "0.74601114", "0.739436", "0.7383821", "0.73430246", "0.7331095", "0.72412246", "0.7159923", "0.7079049", "0.7061158", "0.7027686", "0.6867319", "0.6836262", "0.68275666", "0.67885095", "0.6773457", "0.677215...
0.775681
1
Find nearest cell to that coordinates via minimum of Euclidean distances.
function getNearestCell(x, y, cells) { var min = Infinity; var result; $.each(cells, function(index, cell) { var d = distance(x, y, cell.center_x, cell.center_y); // Update minimum. if (d < min) { min = d; result = cell; } }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nearest(from) {\n\tvar to = indexOfMin(distances[from]);\n\tif (distances[from][to] < infinDist) {\n\t\tdistances[from][to] = distances[to][from]= infinDist;\n\t\treturn to;\n\t}\n\treturn -1;\n}", "function getNeighbor(current, all) {\n 'use strict';\n var closest = -1,\n minDistance = Infinity,...
[ "0.685125", "0.67425996", "0.6669267", "0.6649439", "0.6381675", "0.63721305", "0.6362173", "0.6355284", "0.6316656", "0.6240928", "0.6228612", "0.62226576", "0.6206366", "0.6205011", "0.61719936", "0.61674714", "0.6155445", "0.6140501", "0.61386454", "0.61174345", "0.6116153...
0.82347417
0
toggling open and show class on clicked card
function toggleOpenShow(card) { card.addClass('open show disabled'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openCard() {\n\t\tevent.target.classList.toggle('open');\n\t\tevent.target.classList.toggle('show');\n\t}", "function showCard(clickedCard) {\n $(clickedCard).addClass('open show');\n}", "function clickedCards(card) {\n $(card).addClass('show open');\n}", "function toggleCard() {\n\tthis.classList...
[ "0.8499252", "0.8365504", "0.83585036", "0.82536286", "0.8201574", "0.81460655", "0.8103942", "0.8103942", "0.8098911", "0.809776", "0.80665207", "0.80101484", "0.7970789", "0.7960427", "0.79336786", "0.7920794", "0.78743166", "0.78577405", "0.78483397", "0.78322405", "0.7817...
0.8375648
1
reset move count back to zero
function resetMoveCount() { moveCount = 0; $('.moves').text(moveCount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetMoves() {\n debug(\"resetMoves\");\n count = document.querySelector('.moves');\n\n count.innerHTML = \"0\";\n }", "resetState() {\n this._movements = 0;\n }", "function resetCounter() {\n numberOfMoves = 0;\n moveCounter.innerHTML = numberOfMoves;\n}", "funct...
[ "0.7635513", "0.7538035", "0.7435507", "0.74042773", "0.7306319", "0.7157502", "0.71389836", "0.7016031", "0.7010484", "0.6892859", "0.685494", "0.67444164", "0.67438745", "0.67438745", "0.67194545", "0.6632518", "0.65582544", "0.65319884", "0.6526455", "0.65249395", "0.64984...
0.7834286
0
TODO: OBJECT FOR MAPPING OWNERS TO TEAM
mapTeamData(team, ownersList) { const owners = ownersList.filter(owner => owner.team.id == team.id).map(ownerObj => { const owner = Object.assign({}, ownerObj); const name = owner.name.split(' '); owner.isLeagueManager = owner.commissioner == 1; owner.displayName ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get owners() {\r\n return new Owners(this);\r\n }", "function getProjectMembersOrTenderers() {\n $scope.membersList = $rootScope.getProjectMembers(people);\n $scope.tags = [];\n _.each($rootScope.currentTeam.fileTags, function(tag) {\n $scope.tags.push({name: tag, select...
[ "0.6072791", "0.60671264", "0.5977277", "0.58441657", "0.5806571", "0.572325", "0.57117057", "0.57033056", "0.57033056", "0.56819993", "0.56730604", "0.5668324", "0.5668324", "0.5668324", "0.5668324", "0.5668324", "0.5668324", "0.5668324", "0.5668324", "0.5668324", "0.5668324...
0.6414082
0
Function plots Spherical coordiate system
function plotSpherical(r, theta, phi, target){ let hoverlabel = ["R: "+r[0]+", Θ: "+theta[0]+", Φ: "+phi[0],"R: "+r[1]+", Θ: "+theta[1]+", Φ: "+phi[1]]; var data = [{ type: 'scatter3d', mode: 'lines', x: r, y: theta, z: phi, hoverinfo: 'text', hovertext: hoverlabel, opacity: 1, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawSphere(gl) {\n\tdrawCircle(gl);\n\tdrawMarks(gl);\n}", "function drawSphere() {\n setMV();\n Sphere.draw();\n}", "function drawSphere() {\n setMV();\n Sphere.draw();\n}", "function spherical(cartesian) {\n return [Object(__WEBPACK_IMPORTED_MODULE_1__math__[\"g\" /* atan2 */])(cartes...
[ "0.64300853", "0.631371", "0.631371", "0.6163995", "0.60776424", "0.6008311", "0.59189767", "0.58383954", "0.58289444", "0.5808101", "0.5748349", "0.5744434", "0.56139386", "0.56059897", "0.5590826", "0.5570486", "0.55594295", "0.5548546", "0.5505314", "0.54518604", "0.544912...
0.6640652
0
Getter for quantity If _value is an instance of Quantity, will return object with properties number and unit Otherwise return null;
get quantity() { if (this._observation.dataValue && this._observation.dataValue.value instanceof Quantity) { return { number: this._observation.dataValue.value.number.decimal, unit: this._observation.dataValue.value.units.coding.codeValue.value, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get valueQuantity () {\r\n\t\treturn this._valueQuantity;\r\n\t}", "get valueQuantity () {\r\n\t\treturn this.__valueQuantity;\r\n\t}", "get quantity() {\n\t\treturn this.__quantity;\n\t}", "get quantity() {\n\t\treturn this.__quantity;\n\t}", "get quantity() {\n\t\treturn this.__quantity;\n\t}", "functi...
[ "0.73006326", "0.7286378", "0.70620376", "0.70620376", "0.70620376", "0.6507041", "0.64678663", "0.6447228", "0.64377165", "0.6419223", "0.6379325", "0.63425386", "0.6100222", "0.6005071", "0.58844334", "0.5869871", "0.5835774", "0.583076", "0.58057064", "0.57182", "0.5714805...
0.8323964
0
Perform analysis (obtain locked fingers data from ISF file)
function Analyze() { // Assume failure var RC = false; var Txt = ""; Txt = "Loading ISF file:\n" + ISFAbsolutePath; WScript.StdOut.WriteLine( Txt ); // Load the item store file var Handle = IISF.LoadItemStore( ISFAbsolutePath ); if (Handle == 0xFFFFFFFF) { Txt = "Unable to load ISF:\...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Execute()\n{\n // Parse out arguments\n var RC = ParseArguments();\n if (RC == false)\n {\n return;\n }\n\n // Initialize ISF automation interface\n RC = Initialize();\n if (RC == false)\n {\n return;\n }\n\n // Obtain locked fingers data from ISF file\n RC = Analyze();\n...
[ "0.5383484", "0.5293031", "0.5265998", "0.5205388", "0.5131746", "0.5112181", "0.5105427", "0.50269777", "0.49450845", "0.4923091", "0.49006742", "0.48756954", "0.4822329", "0.48097256", "0.4806594", "0.4760821", "0.472762", "0.4721916", "0.4721916", "0.472061", "0.46977198",...
0.53028893
1
Funcion que permite cargar la informacion de los controles de la ventana winFrmCgg_res_tipo_tramite.
function cargarCgg_res_tipo_tramiteCtrls(){ if(inRecordCgg_res_tipo_tramite){ txtCrtpt_codigo.setValue(inRecordCgg_res_tipo_tramite.get('CRTPT_CODIGO')); txtCrtpt_nombre.setValue(inRecordCgg_res_tipo_tramite.get('CRTPT_NOMBRE')); txtCrtpt_abreviatura.setValue(inRecordCgg_res_tipo_tramite.get('CRTPT_ABREVIATU...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cargarCgg_res_beneficiarioCtrls(){\n if(inInfoPersona.CRPER_CODIGO_AUSPICIANTE != undefined && inInfoPersona.CRPER_CODIGO_AUSPICIANTE.length>0){\n if(inInfoPersona.CRPJR_CODIGO.length>0)\n {\n txtCrper_codigo.setValue(inInfoPersona.CRPJR_RAZON_SOCIAL);\n ...
[ "0.70468134", "0.6995546", "0.6770277", "0.67004454", "0.66322136", "0.652097", "0.64441854", "0.6369144", "0.6304318", "0.6212062", "0.6144936", "0.61073387", "0.6054101", "0.60518086", "0.5889436", "0.5856644", "0.58169246", "0.5762397", "0.5759952", "0.57533777", "0.565848...
0.80802685
0
The bookstore example uses a simple, inmemory database for illustrative purposes only.
function inMemoryDatabase() { this.shelves = {}; this.id = 0; var db = this; db.createShelf('Fiction', function(err, fiction) { db.createBook(fiction.id, 'Neal Stephenson', 'REAMDE', function(){}); }); db.createShelf('Fantasy', function(err, fantasy) { db.createBook...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function booksInBookshelf(id) {\n// var db = ScriptDb.getMyDb();\n var dbShelf = ParseDb.getMyDb(applicationId, restApiKey, \"bookshelf\");\n var dbGen = ParseDb.getMyDb(applicationId, restApiKey, \"book_generic\");\n var books = []; \n var bookshelf = dbShelf.load(id);\n \n for (var i = 0 ; i < bookshelf....
[ "0.65561855", "0.64541733", "0.6342942", "0.6342942", "0.62446105", "0.6206391", "0.6196477", "0.6141604", "0.6138874", "0.6064659", "0.6064659", "0.603558", "0.6026368", "0.6025438", "0.60168475", "0.6015919", "0.6014612", "0.6013844", "0.601143", "0.5985367", "0.59779066", ...
0.74283147
0
Turn the ``cols`` object into a CSV string
function toString() { // If there are any results if(module.exports.cols instanceof Object) { // Get the list of columns var columns = Object.keys(module.exports.cols); // And determine how many rows exist with a map-reduce of each column's length var rows = columns.map(function(column) { return module.exp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static tableToCsv(columns, data) {\n let csv = '';\n let i;\n\n for (i = 0; i < columns.length; i++) {\n csv += ExperimentView.csvEscape(columns[i]);\n if (i < columns.length - 1) {\n csv += ',';\n }\n }\n csv += '\\n';\n\n for (i = 0; i < data.length; i++) {\n for (let...
[ "0.7343767", "0.6465807", "0.64262605", "0.63624156", "0.6087266", "0.606725", "0.5989563", "0.59763926", "0.59590274", "0.5917005", "0.5848988", "0.58420706", "0.58368874", "0.5815534", "0.5803173", "0.578276", "0.578276", "0.5758503", "0.5710925", "0.5710925", "0.5680611", ...
0.7055212
1
Draw ship on canvas
function drawShip() { ctx.beginPath(); ctx.arc(ship.x, ship.y, ship.size, 0, Math.PI * 2); ctx.fillStyle = "#0095dd"; ctx.fill(); ctx.closePath(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawShip(x, y, a, color = \"#fff\") {\n\tcontext.strokeStyle = color;\n\tcontext.lineWidth = shipSize / 20;\n\tcontext.beginPath();\n\tcontext.moveTo(\n\t\tx + 5 / 3 * ship.r * Math.cos(a),\n\t\ty - 5 / 3 * ship.r * Math.sin(a)\n\t);\n\tcontext.lineTo(\n\t\tx - ship.r * (2 / 3 * Math.cos(a) + Math.sin(a))...
[ "0.73307246", "0.7292945", "0.7240514", "0.70968914", "0.70679927", "0.70678055", "0.69460505", "0.69313395", "0.6819617", "0.68084806", "0.6673084", "0.66211444", "0.6565242", "0.6541813", "0.6518426", "0.6476916", "0.646885", "0.6449862", "0.6442341", "0.64351207", "0.64258...
0.7736465
0
Draw missile on canvas
function drawMissile() { ctx.beginPath(); ctx.arc(missile.x, missile.y, missile.size, 0, Math.PI * 2); ctx.fillStyle = "#0095dd"; ctx.fill(); ctx.closePath(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Missile( options ){\n \tthis.startX = options.startX;\n \tthis.startY = options.startY;\n \tthis.endX = options.endX;\n \tthis.endY = options.endY;\n \tthis.color = options.color;\n \tthis.trailColor = options.trailColor;\n \tthis.x = options.startX;\n \tthis.y = options.startY;\n \tthis.state = ...
[ "0.6862109", "0.6411843", "0.6185355", "0.6176331", "0.61517423", "0.6122696", "0.6122202", "0.61017275", "0.6084033", "0.6066001", "0.6053716", "0.6047882", "0.6027432", "0.6023979", "0.60232294", "0.6017285", "0.6011078", "0.60078675", "0.59658724", "0.59592927", "0.5908518...
0.7736583
0
Move missile on canvas
function moveMissile() { missile.y += missile.dy; requestAnimationFrame(moveMissile); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move_missiles()\n{\t\t\t\n\tmissile_timer -= 1;\n\tfor(var i = 0;i<missiles.length;i++)\n\t{\n\t\tif (missiles[i]['direction'] == 'right')\n\t\t{\n\t\t\tmissiles[i]['position'][0] += 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'left')\n\t\t{\n\t\t\tmissiles[i]['position'][0] -= 10;\n\t\t}\n\t\tel...
[ "0.7381109", "0.6911517", "0.68255615", "0.6734111", "0.6728306", "0.66694015", "0.65017676", "0.648861", "0.64335585", "0.6285051", "0.628246", "0.62708956", "0.6267049", "0.6234154", "0.62236005", "0.6216867", "0.6204717", "0.61236006", "0.61117524", "0.6107199", "0.6106169...
0.76470906
0
Move ship on canvas
function moveShip() { ship.x += ship.dx; // Wall collision (right/left) if (ship.x + ship.size > canvas.width) { ship.x = canvas.width - ship.size; } if (ship.x < 0) { ship.x = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateShip() {\n\tif (shipX <= 0) {\n\t\tshipX = 0;\n\t}\n\tif (shipX + ship.width >= canvas.width) {\n\t\tshipX = canvas.width - ship.width;\n\t}\n\tshipX = shipX + shipDx;\n\tif (shipY <= 0) {\n\t\tshipY = 0;\n\t}\n\tif (shipY + ship.height >= canvas.height) {\n\t\tshipY = canvas.height - ship.height;\n...
[ "0.7938656", "0.7266769", "0.7181889", "0.7178855", "0.715526", "0.7044651", "0.7015255", "0.70127255", "0.70070595", "0.69112563", "0.6906098", "0.68490624", "0.6842384", "0.68394476", "0.6830848", "0.68249065", "0.6810121", "0.67809856", "0.67587775", "0.6752165", "0.674693...
0.78305084
1
from my representation of block to pathery's 'mapid,x,y' representation
function id_from_block(mapid, block) { var x = block[0]; var y = block[1]; var id = mapid + '\\,' + x + '\\,' + y; return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "convertCoords(regionId, x, y) {\n let xcoord = mapArray[regionId - 3].center[1] - (w / 2) + (w * x);\n let ycoord = mapArray[regionId - 3].center[0] + (k / 2) - (k * y);\n return { xcoord, ycoord };\n }", "geoLayout() {\n this.pieces.forEach((row, i) => row.forEach((piece, j) => {\n let x, y;\n...
[ "0.634676", "0.6181108", "0.61058617", "0.59699154", "0.5957187", "0.5860765", "0.5838135", "0.5838135", "0.58280843", "0.579826", "0.5790928", "0.5756872", "0.5732404", "0.5718984", "0.57145745", "0.5673929", "0.5673929", "0.5659219", "0.56401825", "0.5637809", "0.5630849", ...
0.65771323
0
BLOCK PLACEMENT HISTORY ////////////////////////////////////////// ////////////////////////////////////////// SINGLE BLOCK MOVE
function BlocksDiffMove(mapid, blocks) { // click (add or remove) the block this.mapid = mapid; this.blocks = blocks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "moveBlock(block) {\n block.state.pos.add(block.state.spe);\n }", "function moveBlock() {\n //check if block can move down\n if (canMove()) {\n clearGrid();\n\n var pos = curBlock.pos;\n var num = blockNames.indexOf(curBlock.name) + 1;\n var shape = curBlock.type;\n fo...
[ "0.67173564", "0.6515419", "0.6442989", "0.63859284", "0.6370058", "0.6278556", "0.62516564", "0.6248915", "0.6209492", "0.6167708", "0.61214566", "0.6110167", "0.6105487", "0.6103156", "0.60723543", "0.6056209", "0.6019085", "0.60071355", "0.6006816", "0.59972024", "0.597256...
0.65394604
1
logic for determining what squares to consider for paint_line_to returns array of blocks to consider
function line_candidates(from_block, to_block) { var x_diff = to_block[0] - from_block[0]; var y_diff = to_block[1] - from_block[1]; var candidates = []; var niters = Math.max(Math.abs(x_diff), Math.abs(y_diff)) var xinc = Math.min(Math.abs(x_diff / y_diff), 1) * (x_diff > 0 ? 1 : -1); var yinc = Math.min...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlightSquare(evt) {\n var id = evt.target.getAttribute(\"id\");\n id = id.replace(\"square_aux_\", \"\");\n var idSplited = id.split('.');\n var i = parseInt(idSplited[0]);\n var j = parseInt(idSplited[1]);\n if (i < width && j < height) {\n var verticalLine = document.getEleme...
[ "0.59378713", "0.5858817", "0.57538754", "0.5723327", "0.57110673", "0.5702433", "0.5671079", "0.5641562", "0.56382596", "0.56337255", "0.5617977", "0.5607673", "0.5596192", "0.5584646", "0.5545794", "0.55362993", "0.5531646", "0.5503764", "0.5500345", "0.54985636", "0.547320...
0.64591575
0
compile the viewerspecific LESS into CSS and inject it into the viewer iframe's style element
injectStyle() { const lessFile = path.join( atom.packages.getLoadedPackage('pdfjs-viewer').path, 'pdfjs', 'web', 'viewer.less') var css = atom.themes.loadLessStylesheet(lessFile) const invertColors = atom.config.get('pdfjs-viewer.invertColors') if (invertColors) { css += '.page, .thumb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _loadStyles() {\n var request = new XMLHttpRequest();\n request.open(\"GET\", \"LiveDevelopment/main.less\", true);\n request.onload = function onLoad(event) {\n var parser = new less.Parser();\n parser.parse(request.responseText, function onParse(err, tree) {\n ...
[ "0.63505733", "0.6074779", "0.60326767", "0.5979328", "0.5803666", "0.5728204", "0.56845677", "0.56368285", "0.56267446", "0.5598583", "0.5589148", "0.55604345", "0.5513008", "0.5513008", "0.55022913", "0.55022913", "0.5498674", "0.5455775", "0.54467833", "0.54233986", "0.540...
0.7658661
0
determine page position of mouse click, and call SyncTeX to obtain (La)TeX source line number
handleSynctex(event) { // get enclosing page div const page = event.target.closest('div.page') if (!page) { return } // get page number const pageNo = parseInt(page.getAttribute('data-page-number'), 10) if (isNaN(pageNo)) { return } // compute mouse coordinates relative t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reportClick2(output, event) {\n event = event || window.event;\n var target = event.target || event.srcElement;\n var pageX = event.pageX, pageY = event.pageY;\n if (pageX == undefined) {\n pageX = event.clientX + document.body.scrollLeft;\n pageY = event.clientY + document.body.scrollTop;\n }\...
[ "0.59780824", "0.59627783", "0.5914543", "0.59109586", "0.5907357", "0.58666945", "0.5854666", "0.58488786", "0.58023095", "0.57441294", "0.56991583", "0.56912565", "0.5659724", "0.56488675", "0.5641135", "0.56135595", "0.56122005", "0.5597734", "0.5592026", "0.55906373", "0....
0.6215773
0
parse SyncTeX output for values
synctexStdout (output, synctex){ // split buffered lines lines = output.split(/\r?\n/g) for (let line of lines) { if (line.startsWith('Input:')) { synctex.input = line.substr(6) // if (process.platform == 'win32') { // // attempt to fix issue #6 // synctex.input = s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getS() {\r\n let unparseS = this.#rawtext[4];\r\n let unparseMatrix = [];\r\n let s = [];\r\n\r\n for(let line of unparseS.split('\\n')) {\r\n unparseMatrix.push(line.split('\\t'));\r\n }\r\n\r\n for(let i in unparseMatrix) {\r\n if(i > 2) {\r\n s.push(unparseMatrix[i].slice(1).m...
[ "0.5583674", "0.5481091", "0.546047", "0.54369694", "0.53631705", "0.5265229", "0.5221531", "0.5221531", "0.5220149", "0.5220149", "0.5165086", "0.51272595", "0.510016", "0.5081256", "0.5077846", "0.50710964", "0.50604916", "0.50460374", "0.50460374", "0.50460374", "0.5021681...
0.5483062
1
upon SyncTeX exit, open source file at line number
synctexExit(code, synctex) { if (code == 0) { console.log('PdfjsViewerView: Opening SyncTeX result: line ' + synctex.line + ' of ' + synctex.input) atom.workspace.open(synctex.input, { initialLine: synctex.line - 1, searchAllPanes: true }) } else { console.log('Pd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function go_to(line_number) {\r\n\tPC = line_number;\r\n}", "function openMark(c_index) {\n saveLastOpenedMark(true);\n updateMarksOnPage(c_index);\n //If it's already open, then openClose() will close it\n if (findCurrentOpenedMark() !== c_index) {\n openClose(c_index);\n }\n let page =...
[ "0.5987039", "0.5235687", "0.5198589", "0.5099201", "0.5098465", "0.5062345", "0.50511545", "0.50328106", "0.5024142", "0.5022267", "0.5010141", "0.5007535", "0.49936023", "0.49933314", "0.49846554", "0.4977844", "0.4977844", "0.4977844", "0.4977844", "0.4977844", "0.49366385...
0.6738871
0
handle changes to PDF file
handleFilechange(event, path) { console.log('PdfjsViewerView: file', event, path) this.reloadPdf() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCorsiPDF(pdf) {\n\twaitingDialog.show(\"Salvataggio in corso...\", {progressType: \"primary\"}); // Show waiting dialog\n\n\t// FormData Object to pass to XMLHTTP request\n\tvar formData = new FormData();\n\tformData.append(\"corsi_pdf\", pdf);\n\n\tvar link = server + \"php/upload.php\";\n\tvar req...
[ "0.6356933", "0.62800014", "0.6055446", "0.6046855", "0.60111886", "0.60051256", "0.59805006", "0.5924107", "0.58593285", "0.5762046", "0.57152253", "0.5710921", "0.5679001", "0.56706864", "0.5608449", "0.55970854", "0.5580664", "0.5548116", "0.55222666", "0.55112606", "0.550...
0.79413074
0
After click the play again button, the hidden html "overlay" will appear on the window.
function playAgain(){ document.getElementsByClassName("overlay")[0].style.visibility="hidden"; startGame(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playAgain(){\n popupCongratulation.classList.remove(\"show-overlay\");\n loadGame();\n}", "function playAgain() {\n\n\tpopup.classList.remove('show')\n\tpairs = 0;\n\tremoveDeck();\n\tstartGame();\n}", "function playAgain() {\n modal.classList.remove(\"show\");\n restartGame();\n}", "fun...
[ "0.7780991", "0.72885054", "0.72417444", "0.7235191", "0.71318823", "0.71163476", "0.7110868", "0.70990336", "0.709509", "0.70827276", "0.70741004", "0.70714086", "0.70578796", "0.7020413", "0.6933276", "0.6924758", "0.68858945", "0.68850267", "0.68788856", "0.6858991", "0.68...
0.75544494
1
Rotation Matrix about zaxis
function rotationZ(angle) { var matrix = [[Math.cos(angle), -Math.sin(angle), 0], [Math.sin(angle), Math.cos(angle), 0], [0, 0 ,1]]; return matrix; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotate_z() {\n curr_sin = Math.sin(map.degree);\n curr_cos = Math.cos(map.degree);\n var x = (this.x * curr_cos) + (this.y * (-curr_sin));\n this.y = (this.x * curr_sin) + (this.y * (curr_cos));\n this.x = x;\n }", "function rotation (x, y, z) {\n let so = [[0, -z...
[ "0.79612166", "0.75073725", "0.7394705", "0.7359525", "0.73549765", "0.7288484", "0.7208845", "0.7128654", "0.7094069", "0.7092742", "0.70920163", "0.702741", "0.70166767", "0.6990136", "0.68694955", "0.68568695", "0.685571", "0.6805478", "0.6793507", "0.6783463", "0.6750606"...
0.76899934
1
Scalation Matrix in zdirection
function scaleZ(factor) { var matrix = [[1, 0, 0], [0, 1, 0], [0, 0 ,factor]]; return matrix; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateMatrix() {\n this.matrix.set(\n 1 - 2 * (Math.pow(this.y, 2) + Math.pow(this.z, 2)),\n 2 * (this.x * this.y - this.s * this.z),\n 2 * (this.x * this.z + this.s * this.y),\n 0,\n 2 * (this.x * this.y + this.s * this.z),\n 1 - 2 * (Math.p...
[ "0.61650944", "0.60390526", "0.58922094", "0.5815004", "0.57519245", "0.57320184", "0.5657857", "0.5637643", "0.56170356", "0.5615397", "0.5559777", "0.55528843", "0.5524574", "0.54968387", "0.54952127", "0.5494612", "0.54929566", "0.548553", "0.5477501", "0.54729635", "0.541...
0.6909256
0
It enable undo and reset buttons.
function enableUndoReset() { $("#undo").prop("disabled",false); $("#reset").prop("disabled",false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetUndoButtons () {\n\t\tdocument.getElementById(\"undoButton\").disabled = true;\n\t\tdocument.getElementById(\"redoButton\").disabled = true;\n\t}", "function resetUndoButtons () {\n\t\tdocument.getElementById(\"undoButton\").disabled = true;\n\t\tdocument.getElementById(\"redoButton\").disabled = t...
[ "0.8175881", "0.7975978", "0.757982", "0.745943", "0.74001974", "0.73060656", "0.72660065", "0.6706293", "0.65928704", "0.6587759", "0.63854676", "0.63271576", "0.63237226", "0.6306348", "0.6244115", "0.6238874", "0.62248594", "0.6220936", "0.62166125", "0.6208905", "0.617193...
0.8133119
1
Creates context menu item
function addMenu(title, options) { var createProperties = { contexts: ["all"], title: adguard.i18n.getMessage(title) }; if (options) { if (options.id) { createProperties.id = options.id; } if (options.parentId) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMainMenu() {\n chrome.contextMenus.create({\n id: 'parentMenu',\n title: 'Search \"%s\" on:',\n contexts: ['selection']\n });\n}", "function createContextMenuItem(label,onclick,divider) {\n\n\tif (onclick == \"\")\n\t\tvar menuHTML = '<div class=\"contextMenuDivInactive\...
[ "0.71566486", "0.7150466", "0.7148318", "0.71336246", "0.7126788", "0.7009224", "0.6952768", "0.6941859", "0.6928714", "0.69089675", "0.6906397", "0.68632203", "0.6828996", "0.6810401", "0.6771755", "0.6626699", "0.6550772", "0.65260047", "0.65224373", "0.64886695", "0.644197...
0.7236928
0
Update context menu for tab
function updateTabContextMenu(tab) { // Isn't supported by Android WebExt if (!adguard.contextMenus) { return; } adguard.contextMenus.removeAll(); if (adguard.settings.showContextMenu()) { if (adguard.prefs.mobile) { customizeMobileContextM...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useContextMenu(tab) {\n if (addOnPrefs.useContextMenu) {\n var url = tab.url;\n var tabId = tab.id;\n destroyPreviousContextMenu(tabId);\n var datawakeInfo = storage.getDatawakeInfo(tabId);\n contextMenus[tabId] = contextMenu.Menu({\n label: \"Datawake Menu...
[ "0.70212114", "0.6927158", "0.6924702", "0.6906198", "0.6843413", "0.67981917", "0.67857164", "0.6707404", "0.6699512", "0.6699512", "0.6597538", "0.65107584", "0.6501404", "0.6436692", "0.6435966", "0.6433753", "0.64157784", "0.6403758", "0.6296309", "0.6295183", "0.6206347"...
0.76073915
0
Load Drive API client library.
loadDriveApi() { window.gapi.client.load('drive', 'v3'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadDriveApi() {\n\tgapi.client.load('drive', 'v3', buscarArquivoHoje);\n}", "function apiClientLoad() {\n\n //gapi.client.load('oauth2', 'v2', apiClientLoaded);\n gapi.client.load('plus', 'v1', apiClientLoaded);\n}", "loadDriveApi() {\n var event = new CustomEvent(\"startloaddrive\");\n ...
[ "0.78346795", "0.6759061", "0.6677482", "0.66763383", "0.6563972", "0.6477016", "0.63805455", "0.63769317", "0.6372109", "0.6365058", "0.6361253", "0.6345905", "0.6345905", "0.6345905", "0.63422436", "0.6339838", "0.6326001", "0.6326001", "0.6326001", "0.6326001", "0.6326001"...
0.77509207
1
Creates a function overload resolution table to the given method 'methodName' in the given prototype, if the overload table doesn't yet exist.
function ensureOverloadTable(proto, methodName, humanName) { if (undefined === proto[methodName].overloadTable) { var prevFunc = proto[methodName]; // Inject an overload resolver function that routes to the appropriate overload based on the number of arguments. proto[methodName] = function()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMethod(methodName){\n return function(){\n throw new Error('The \"'+methodName+'\" method is not available on the playback technology\\'s API');\n };\n}", "function createXNodeMethod(methodName) {\n\t\tXNode.prototype[methodName] = function() {\n\t\t\treturn this.node[methodName].apply(this.n...
[ "0.5103538", "0.50628316", "0.48640546", "0.48640546", "0.4862484", "0.47813582", "0.46100906", "0.45749334", "0.4536829", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.45298368", "0.4504423", "0.4499308", "...
0.6609852
0
Registers a symbol (function, class, enum, ...) as part of the Module JS object so that handwritten code is able to access that symbol via 'Module.name'. name: The name of the symbol that's being exposed. value: The object itself to expose (function, class, ...) numArguments: For functions, specifies the number of argu...
function exposePublicSymbol(name, value, numArguments) { if (Module.hasOwnProperty(name)) { if (undefined === numArguments || (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])) { throwBindingError("Cannot register public name '" + name + "' twic...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function define(name, value) {\n Object.defineProperty(exports, name, {\n value: value,\n enumerable: true\n });\n}", "define(name, value) {\n if (Object.prototype.hasOwnProperty.call(this.values, name)) {\n throw new ReferenceError(`Variable ${name} has already been declared.`);...
[ "0.6065042", "0.5907688", "0.5880901", "0.5671248", "0.55329335", "0.54931086", "0.54931086", "0.54931086", "0.54931086", "0.54931086", "0.54931086", "0.54931086", "0.54393893", "0.5393519", "0.53900003", "0.5375349", "0.5366473", "0.5320763", "0.5289489", "0.52333635", "0.51...
0.7113097
0
The path to interop from JS code to C++ code: (handwritten JS code) > (autogenerated JS invoker) > (templategenerated C++ invoker) > (target C++ function) craftInvokerFunction generates the JS invoker function for each function exposed to JS through embind.
function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc) { // humanName: a human-readable string name for the function to be generated. // argTypes: An array that contains the embind type objects for all types in the function signature. // argTypes[0] is the type objec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function JavaInvoke() {\r\n}", "function helloFunctionInvoker(hello){\n hello('function args');\n}", "function CFunc(name, args, retVal) {\n function makeArgument(a) {\n if (!a) return null;\n const arg = MOBridgeSupportArgument.alloc().init();\n setKeys(arg, {\n type64: a.type\n });\n ...
[ "0.56310254", "0.5310954", "0.52002484", "0.515308", "0.48963365", "0.48963365", "0.48963365", "0.48963365", "0.48963365", "0.4860841", "0.48409113", "0.47932884", "0.47932884", "0.47722", "0.47722", "0.47722", "0.47703397", "0.4751401", "0.47258136", "0.47156188", "0.471286"...
0.79830444
0
URL Template (RFC 6570) Transform.
function template (options) { var variables = [], url = expand(options.url, options.params, variables); variables.forEach(function (key) { delete options.params[key]; }); return url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUrl(tpl, variables) {\r\n return tpl.replace(/\\{([^\\}]+)\\}/g, function (variable, key) {\r\n return key in variables ? variables[key] : variable;\r\n });\r\n }", "function template (options) {\n\n var variables = [], url = expand(options.url, options.params, varia...
[ "0.6925154", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.6760309", "0.67563975", "0.67365557", "0.67365557", "0.63542056", "0.6199783", "0.6060413", "0.6001007", "0.59438264", "0.5925711", "0.58712894", "0.584286"...
0.6883055
1
Draws a crease line, updates on Crease Point input change
function drawCrease(input) { if (line) { scene.remove(line); } var points = getCreaseInputs(input); if(isValidCrease(input) === false){ return; } line_geometry = new THREE.Geometry(); line_geometry.vertices.push(points[0], points[1]); line = new THREE.Line(line_geometry,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawline() {\n\n if (isDrawing) {\n linePoint2 = d3.mouse(this);\n gContainer.select('line').remove();\n gContainer.append('line')\n .attr(\"x1\", linePoint1.x)\n .attr(\"y1\", linePoint1.y)\n ...
[ "0.70853513", "0.6902469", "0.6782946", "0.67382157", "0.67174864", "0.66203725", "0.65801877", "0.6574689", "0.654762", "0.65370244", "0.65017253", "0.6487955", "0.64847493", "0.6475334", "0.64677876", "0.6440193", "0.64362234", "0.6399584", "0.63889146", "0.6384229", "0.638...
0.7938718
0
Initialize function, receives a DomElementId string and assigns the Dom Element to el for future use.
function init(domElementId){ el = document.getElementById(domElementId) //Returns Todo List to simplify Jquery Style Chaining API return TodoList; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(el) {\n this.el = el || {};\n }", "constructor(element) {\r\n this.element = document.getElementById(element)\r\n }", "constructor(el) {\n this.el = el;\n }", "function init(domElementId, callback){\n\tel = document.getElementById(domElementId);\n\n\t//Render the Layout in...
[ "0.70317376", "0.6889506", "0.68314624", "0.65673274", "0.6381667", "0.62948316", "0.6263454", "0.6225174", "0.6225174", "0.61670923", "0.61555934", "0.60781264", "0.6073943", "0.59388554", "0.59275556", "0.5924387", "0.58971554", "0.58817357", "0.58442557", "0.5840062", "0.5...
0.7514261
0
Renders all objects in TodoList.items using Item Template
function render(){ var src = "" for(i in TodoList.items) src += ItemTemplate(TodoList.items[i]); el.innerHTML = src; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(todoItems) {\n // const sortedData = todoItems.sortby(['id'])\n const container = document.querySelector('.js-todolist');\n container.innerHTML = '';\n const todoItemsReverse = todoItems.reverse();\n // for (const todoItem of sortedData) {\n for (const todo...
[ "0.7524637", "0.74975294", "0.7435264", "0.7344821", "0.7159357", "0.7054646", "0.6973523", "0.6955017", "0.6851485", "0.6840535", "0.6798981", "0.67904633", "0.6770597", "0.6713732", "0.67127234", "0.6710842", "0.6650769", "0.6641668", "0.6633112", "0.66037863", "0.6591429",...
0.7950711
0
reset active classes for nav items
function resetNavBarActiveItems(){ $("#navDashboardLinkItem").removeClass("active"); $("#navPlayersLinkItem").removeClass("active"); $("#navAdminsLinkItem").removeClass("active"); $("#navGroupsLinkItem").removeClass("active"); $("#navEventsLinkItem").removeClass("active"); $("#navCoursesLinkItem").rem...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetActiveLink() {\n menuLinks.forEach((li) => {\n li.classList.remove(\"active\");\n });\n}", "function setNavActive() {\n $('.nav-a.active').toggleClass('active');\n $(this).toggleClass('active');\n }", "function setActiveNavigation(activeTab) {\n $(\".nav li\").removeClass(\"active\...
[ "0.76830125", "0.76333964", "0.74146444", "0.74146444", "0.7364739", "0.7302722", "0.7281692", "0.7209341", "0.71823895", "0.71705705", "0.7168519", "0.71427476", "0.71349293", "0.7110896", "0.7065239", "0.70497906", "0.703111", "0.70099914", "0.7008698", "0.69799906", "0.697...
0.8037945
0
See if sprite can move one more step at the given (x,y) facing the given direction
function canMove (x,y,dir) {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canBeMoved(direction) {\n return block.every(function(blockCell) {\n var p = direction(blockCell); // next state\n // check for boundaries and elements of the same type\n return p.y >= 0 && p.x >= 0 && p.y < dimention[1] && p.x < dimention[0] && field[p.y][p.x] !== ...
[ "0.6591468", "0.6576128", "0.65548956", "0.64943117", "0.64802504", "0.64373124", "0.6394775", "0.6350045", "0.6287304", "0.6284429", "0.6237724", "0.6174555", "0.61623216", "0.61610013", "0.61583424", "0.61456686", "0.61368805", "0.61067516", "0.60915834", "0.6060695", "0.60...
0.7259557
0
welcome screen animation OPTIONAL
function updateWelcomeScreen () {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayWelcome() {\n\t$(\"#welcome\").css('opacity', 0).show().animate({ opacity: 1 }, 750, function() {\n\t \t$(\"#welcome\").animate({ top: \"15%\" }, 1000, function() {\n\t \t\t$(\"#welcomemessage\").fadeIn(function () {\n\t \t\t\tsetTimeout(function() {\n\t \t\t\t\t$(\"#welcomebutton\").fadeIn(functio...
[ "0.7529636", "0.7381515", "0.71753395", "0.7049929", "0.69621754", "0.6757623", "0.6699554", "0.6625824", "0.66090506", "0.6583265", "0.6532268", "0.65173364", "0.6432347", "0.64083445", "0.6354284", "0.63259906", "0.6321166", "0.63039553", "0.6279336", "0.62790334", "0.62763...
0.753405
0
Binary search in a sorted array with timestamps : [[t1, ...], [t2, ...], ...] Return the index of the first element with a timestamp > t, or null if the array does not contain anything newer.
function bsearchT(t, arr) { var first = 0; var last = arr.length - 1; if (last < 0 || arr[last][0] <= t) { return null; } if (arr[first][0] > t) { return first; } while (first < last) { var mid = Math.floor((first + last) / 2); if (arr[mid][0] <= t) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binarySearch(t) {\n\t\tlet low = 0;\n\t\tlet high = records.length - 1;\n\t\tlet curr = Math.floor((high + low) / 2);\n\t\twhile(low < high) {\n\t\t\tif(t < records[curr]['to']) {\n\t\t\t\thigh = curr;\n\t\t\t}\n\t\t\telse if(t > records[curr]['to']) {\n\t\t\t\tlow = curr + 1;\n\t\t\t}\n\t\t\telse {\n\t\t...
[ "0.6692026", "0.603222", "0.58841443", "0.5838607", "0.5710833", "0.5693896", "0.56424975", "0.56329405", "0.56132275", "0.560815", "0.55794936", "0.5572304", "0.55640244", "0.55564404", "0.55507666", "0.55328894", "0.551211", "0.5504179", "0.55022097", "0.5498574", "0.549204...
0.71609294
0
Requests to the vappcontroller AJAX server. The option parameter 'nodes_params' will be added to the query string. The list of nodes to be monitored is in 'nodes_monitored'. Each element of that list is a node_id, optionally followed by a commaseparated list of VMs to monitor for that node. Prepending '&' to a node mea...
function queryServer(nodes_params) { //consoleLog("XXX nodes_params = ", nodes_params); if (! nodes_params) { nodes_params = ""; } if (! nodes_owner) { consoleAddMessage("#console1", CONSOLE_ERROR, "Missing operator name, cannot query server"); return; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doGetNodes() {\r\n\tvar req = new XMLHttpRequest();\r\n\treq.open('GET', httpNodesUri, true);\r\n\treq.setRequestHeader('Cache-Control', 'no-cache');\r\n\r\n\treq.onreadystatechange = function () {\r\n\t\tif (this.readyState == 4 && this.status == 200) {\r\n\t\t\tnodesPayload = JSON.parse(req.responseText...
[ "0.5795913", "0.5479802", "0.5242063", "0.5240739", "0.5190827", "0.5136627", "0.5118279", "0.50525594", "0.50485504", "0.5048341", "0.49593544", "0.49365163", "0.49307957", "0.49262488", "0.49098712", "0.49049285", "0.48844138", "0.48787758", "0.48362127", "0.4832406", "0.48...
0.716084
0
Shares the Etherpad name with other participants.
function shareEtherpad() { connection.emuc.addEtherpadToPresence(etherpadName); connection.emuc.sendPresence(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shareEtherpad() {\n APP.xmpp.addToPresence(\"etherpad\", etherpadName);\n}", "assignGuestName (socket, guestNumber, nickNames, namesUsed) {\n const name = `Guest_${guestNumber}`;\n nickNames[socket.id] = name;\n socket.emit('nameResult', {\n success: true,\n name\n });\n name...
[ "0.7512528", "0.5725569", "0.5453142", "0.53935593", "0.5236883", "0.51516825", "0.5109399", "0.5108649", "0.5088656", "0.5067909", "0.5035694", "0.50278795", "0.4972351", "0.49517295", "0.4935706", "0.49336493", "0.49251348", "0.49026814", "0.48963198", "0.4892752", "0.48908...
0.77199477
0
Creates the Etherpad button and adds it to the toolbar.
function enableEtherpadButton() { if (!$('#etherpadButton').is(":visible")) $('#etherpadButton').css({display: 'inline-block'}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderToolbarButton() {\n const toolbars = this.instance.getChildByClass(this.instance.root, 'gm-toolbar');\n if (!toolbars) {\n return; // if we don't have toolbar, we can't spawn the widget\n }\n\n const toolbar = toolbars.children[0];\n this.toolbarBtn = document.cr...
[ "0.6851485", "0.66250414", "0.64830184", "0.6451737", "0.642687", "0.6409139", "0.63990515", "0.6396914", "0.6383983", "0.63486415", "0.6343713", "0.6335535", "0.6272856", "0.6271495", "0.62020123", "0.6180282", "0.61585486", "0.61349076", "0.61278486", "0.61225927", "0.61106...
0.67477375
1
Creates the IFrame for the etherpad.
function createIFrame() { etherpadIFrame = document.createElement('iframe'); etherpadIFrame.src = domain + etherpadName + options; etherpadIFrame.frameBorder = 0; etherpadIFrame.scrolling = "no"; etherpadIFrame.width = $('#largeVideoContainer').width() || 640; etherpadIFr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createIFrame() {\n etherpadIFrame = document.createElement('iframe');\n etherpadIFrame.src = domain + etherpadName + options;\n etherpadIFrame.frameBorder = 0;\n etherpadIFrame.scrolling = \"no\";\n etherpadIFrame.width = $('#largeVideoContainer').width() || 640;\n etherpadIFrame.height ...
[ "0.6959947", "0.62934476", "0.5976476", "0.5947101", "0.5905134", "0.58901954", "0.58202726", "0.5731176", "0.5726435", "0.5583179", "0.5579358", "0.5578177", "0.5576883", "0.55499953", "0.552492", "0.54762864", "0.5454121", "0.54252005", "0.5406613", "0.5370379", "0.5299502"...
0.7749555
0
Check if the current addon intends to be hinted. Typically this is for hinting/linting libraries such as eslint or jshint
hintingEnabled() { let isProduction = process.env.EMBER_ENV === 'production'; let testsEnabledDefault = process.env.EMBER_CLI_TEST_COMMAND === 'true' || !isProduction; let explicitlyDisabled = this.app && this.app.options && this.app.options.hinting === false; return testsEnabledDefault && !explicitlyD...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasHint (hints) {\n\tfor (var i in hints) {\n\t\tif (hints[i]) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function check_hint()\n{\n\t\n\t// Did we already show hint? Or are there no ongoing drags/animations?\n\tif (showing_hint){\n\t\tconsole.log(\"Checking hint...\");\n\t\t\n\t\t//Get th...
[ "0.6574414", "0.6193216", "0.5987149", "0.5922055", "0.57744765", "0.56574875", "0.55860376", "0.55728495", "0.55728495", "0.55127203", "0.54249", "0.53932047", "0.5368473", "0.53547674", "0.5346847", "0.53449714", "0.5342256", "0.53201014", "0.5317996", "0.5314137", "0.53121...
0.6407347
1
Discovers all child addons of this addon and an AddonInfo about each addon in this.addonPackages (keyed on addon name). Child addons include those from 'dependencies' (not devDependencies) and inrepo addons Any packageInfos that we find that are marked as not valid are excluded.
discoverAddons() { // prefer `packageRoot`, fallback to `root`; this is to maintain backwards compatibility for // consumers who create a new instance of the base addon model class directly and don't set // `packageRoot` let pkgInfo = this.packageInfoCache.getEntry(this.packageRoot || this.root); i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async updateAddonRepositoryData() {\n let addons = await this.getVisibleAddons(null);\n logger.debug(\"updateAddonRepositoryData found \" + addons.length + \" visible add-ons\");\n\n await Promise.all(addons.map(addon =>\n AddonRepository.getCachedAddonByID(addon.id).then(aRepoAddon => {\n if ...
[ "0.61474013", "0.5913503", "0.58219624", "0.55046535", "0.5239861", "0.5029384", "0.4901486", "0.48491442", "0.4828232", "0.4789205", "0.47610164", "0.4704393", "0.46947834", "0.4628979", "0.45738834", "0.45402002", "0.44923258", "0.4471209", "0.44631553", "0.44427586", "0.44...
0.73463976
0
Send everyone in the playerlist their name as well as everyone in the que
static sendQue(socket) { var playerNames = Player.updateNames() for(var i in Player.list){ var socket = SOCKET_LIST[i]; //socket.emit('Players', socket.name, playerNames) console.log(playerNames) socket.emit('Players', socket.name, playerNames) } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendAllMembers(name, data) {\n\t\tlet member = Array.from(this.members).filter((user) => user.name === name);\n\t\tconst memNames = [];\n\t\tfor (let member of this.members) {\n\t\t\tmember.name === name ? memNames.push(\"you\") : memNames.push(member.name);\n\t\t}\n\t\tdata.text = \"In room: \".concat(memNames.jo...
[ "0.68723124", "0.6763342", "0.6680726", "0.6528784", "0.6374334", "0.6221974", "0.6218211", "0.6205564", "0.6189486", "0.599907", "0.5945769", "0.58558273", "0.5853555", "0.5852155", "0.5834324", "0.58187205", "0.58121324", "0.57838976", "0.5770352", "0.5768452", "0.57546073"...
0.7443067
0
Get the current playernames
static updateNames() { var playerNames = []; for (var i in Player.list) { playerNames.push(SOCKET_LIST[i].name); } ; return playerNames; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllNamesPlayers()\n {\n return this.players.map(player => player.getName());\n }", "function getPlayerName(player) {\r\n return player.PLAYER;\r\n}", "function loadPlayerNames() {\n var player_names = [\n\t\t\"Aaron Ramsey\",\n\t\t\"Abdul Rahman Baba\",\n\t\t\"Adam Lallana\",\n\t\t\"Adem Ljajic\"...
[ "0.8027108", "0.6836199", "0.6812035", "0.67015815", "0.6587808", "0.65266365", "0.65075004", "0.6490363", "0.6465564", "0.64560485", "0.6404803", "0.6327427", "0.63038665", "0.62832254", "0.6272092", "0.62528354", "0.6205687", "0.6183072", "0.6177864", "0.6103091", "0.606273...
0.7790094
1
Label an image with unary and pairwise terms. TODO: alphaexpansion
function imageCRFLabel(imageData, unary, lambda) { var contrast = imageCRFContrast(imageData); // constract maxflow graph var g = maxFlowInit(); maxFlowAddNodes(g, imageData.width * imageData.height); // add unary terms for (var y = 0; y < imageData.height; y++) { for (var x = 0; x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Label() { // Labels (-1 means empty, -2 means undefined)\r\n this.even = undefined; // Even label: alternating path of even distance from root to vertex\r\n this.odd = []; // Odd label: base nodes of blossoms can have two\r\n}", "function encodeLabels(segmentation, ...
[ "0.5486794", "0.52453023", "0.52082735", "0.5136994", "0.5084835", "0.5065959", "0.50365865", "0.50061095", "0.50000393", "0.50000393", "0.49778184", "0.49637198", "0.4962145", "0.49583852", "0.4952433", "0.4942034", "0.49257052", "0.4917245", "0.49123636", "0.490611", "0.490...
0.68044794
0
Compare two arrays (commonly extracted from buffer.getChannelData()) with constraints: options.thresholdSNR: Minimum allowed SNR between the actual and expected signal. The default value is 10000. options.thresholdDiffULP: Maximum allowed difference between the actual and expected signal in ULP(Unit in the last place)....
function compareBuffersWithConstraints(actual, expected, options) { if (!options) options = {}; if (actual.length !== expected.length) testFailed('Buffer length mismatches.'); var maxError = -1; var diffCount = 0; var errorPosition = -1; var thresholdSNR = (options.thresholdSNR...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareArrays (oldArray, newArray, options) {\n // For backward compatibility, if the third arg is actually a bool, interpret\n // it as the old parameter 'dontLimitMoves'. Newer code should use { dontLimitMoves: true }.\n options = (typeof options === 'boolean') ? { dontLimitMoves: options }...
[ "0.57749796", "0.57412165", "0.57281893", "0.5727517", "0.5727517", "0.5711899", "0.5681763", "0.5681763", "0.5679594", "0.5679594", "0.5679594", "0.5679594", "0.5679594", "0.5679594", "0.5452367", "0.5409068", "0.5376733", "0.5356096", "0.5356096", "0.5355672", "0.533136", ...
0.760667
0
Create an impulse in a buffer of length sampleFrameLength
function createImpulseBuffer(context, sampleFrameLength) { var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate); var n = audioBuffer.length; var dataL = audioBuffer.getChannelData(0); for (var k = 0; k < n; ++k) { dataL[k] = 0; } dataL[0] = 1; return aud...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createStereoImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(2, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n var dataR = audioBuffer.getChannelData(1);\n\n for (var k = 0; k < n; ++k)...
[ "0.75263226", "0.75263226", "0.68920356", "0.68920356", "0.632705", "0.6150853", "0.612429", "0.5902425", "0.5783863", "0.5628275", "0.55517095", "0.5447707", "0.54432946", "0.5438855", "0.54174745", "0.5412393", "0.5383046", "0.53300166", "0.5281003", "0.52799463", "0.525962...
0.8437261
1
Create a buffer of the given length with a linear ramp having values 0 <= x < 1.
function createLinearRampBuffer(context, sampleFrameLength) { var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate); var n = audioBuffer.length; var dataL = audioBuffer.getChannelData(0); for (var i = 0; i < n; ++i) dataL[i] = i / n; return audioBuffer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sliding(n) {\n return new SlidingBuffer(ring(n), n);\n}", "function fixed(n) {\n return new FixedBuffer(ring(n), n);\n}", "function SlowBuffer(length) {\n // eslint-disable-next-line eqeqeq\n if (+length != length) length = 0;\n assertSize(+length);\n return createUnsafeBuffer(+length);\n}", "...
[ "0.5695793", "0.54018956", "0.5358065", "0.5158307", "0.5144002", "0.5065776", "0.50528586", "0.5041037", "0.5034923", "0.4898186", "0.48834822", "0.48834822", "0.48834822", "0.48610315", "0.48610315", "0.48556194", "0.48531333", "0.48531333", "0.4846901", "0.4845676", "0.481...
0.66798407
1
Create an AudioBuffer of length |sampleFrameLength| having a constant value |constantValue|. If |constantValue| is a number, the buffer has one channel filled with that value. If |constantValue| is an array, the buffer is created wit a number of channels equal to the length of the array, and channel k is filled with th...
function createConstantBuffer(context, sampleFrameLength, constantValue) { var channels; var values; if (typeof constantValue === "number") { channels = 1; values = [constantValue]; } else { channels = constantValue.length; values = constantValue; } var audioBuf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createConstantBuffer(context, sampleFrameLength, constantValue) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var i = 0; i < n; ++i)\n dataL[i] = constantValue;\n\...
[ "0.8232728", "0.55788535", "0.55788535", "0.5341614", "0.5341614", "0.52795666", "0.49277818", "0.49277818", "0.48611498", "0.4792038", "0.4518094", "0.44687134", "0.4428806", "0.43605888", "0.4307192", "0.42561933", "0.42232248", "0.42006865", "0.41688406", "0.41628414", "0....
0.8294203
0
Create a stereo impulse in a buffer of length sampleFrameLength
function createStereoImpulseBuffer(context, sampleFrameLength) { var audioBuffer = context.createBuffer(2, sampleFrameLength, context.sampleRate); var n = audioBuffer.length; var dataL = audioBuffer.getChannelData(0); var dataR = audioBuffer.getChannelData(1); for (var k = 0; k < n; ++k) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createImpulseBuffer(context, sampleFrameLength) {\n var audioBuffer = context.createBuffer(1, sampleFrameLength, context.sampleRate);\n var n = audioBuffer.length;\n var dataL = audioBuffer.getChannelData(0);\n\n for (var k = 0; k < n; ++k) {\n dataL[k] = 0;\n }\n dataL[0] = 1;\n\...
[ "0.78334713", "0.78334713", "0.63576996", "0.63576996", "0.61745924", "0.577996", "0.5691106", "0.5647514", "0.5561082", "0.55510974", "0.5547345", "0.5529315", "0.5519007", "0.54949784", "0.5476185", "0.54661536", "0.5402161", "0.5346005", "0.5278198", "0.5256365", "0.524782...
0.8593268
1
Convert time (in seconds) to sample frames.
function timeToSampleFrame(time, sampleRate) { return Math.floor(0.5 + time * sampleRate); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_frame(time, rate) {\n // time, modulo 1000\n var tm = time % 1000;\n\n return FRAMES.find(function(row) {\n return in_range(tm, row.t) && in_range(rate, row.p);\n }) || FRAMES[0];\n }", "function convertFBXTimeToSeconds( time ) {\n \n return time / 46186158000;\n \...
[ "0.6350146", "0.59681106", "0.57764506", "0.57042986", "0.55744076", "0.5537533", "0.55334747", "0.53582275", "0.53066754", "0.5302927", "0.52929574", "0.526894", "0.52566713", "0.52218205", "0.51708126", "0.5166514", "0.5132372", "0.5121376", "0.50552726", "0.50326866", "0.5...
0.76305866
1
Compute the number of sample frames consumed by noteGrainOn with the specified |grainOffset|, |duration|, and |sampleRate|.
function grainLengthInSampleFrames(grainOffset, duration, sampleRate) { var startFrame = timeToSampleFrame(grainOffset, sampleRate); var endFrame = timeToSampleFrame(grainOffset + duration, sampleRate); return endFrame - startFrame; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countSamples() {\r\n\treturn samplesPayload.length;\r\n}", "function timeGetNoteDuration(frameCount, framerate) {\r\n // multiply and devide by 100 to get around floating precision issues\r\n return ((frameCount * 100) * (1 / framerate)) / 100;\r\n }", "function extractRegions(peaks, ...
[ "0.54483503", "0.5200871", "0.49365148", "0.48975325", "0.48564744", "0.48074478", "0.47971657", "0.47572035", "0.4742263", "0.4742263", "0.47342214", "0.47128752", "0.46815202", "0.46801907", "0.46679893", "0.46470097", "0.46269438", "0.46092045", "0.459472", "0.45821646", "...
0.80002797
1
Compute the (linear) signaltonoise ratio between |actual| and |expected|. The result is NOT in dB! If the |actual| and |expected| have different lengths, the shorter length is used.
function computeSNR(actual, expected) { var signalPower = 0; var noisePower = 0; var length = Math.min(actual.length, expected.length); for (var k = 0; k < length; ++k) { var diff = actual[k] - expected[k]; signalPower += expected[k] * expected[k]; noisePower += diff * diff; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getExpectedBandwidthValue() {\n var expectedBandwithValue;\n if (config.carreraHistoricalPercentileToUse === 20) {\n expectedBandwithValue = _expectedBandwidth.bandwidth20Percentile;\n } else if (config.carreraHistoricalPercentileToUse === 90) {\n expectedBandwi...
[ "0.5154946", "0.5017675", "0.499605", "0.49512017", "0.4935788", "0.49323398", "0.49150115", "0.4839564", "0.48385224", "0.48289174", "0.48261806", "0.480619", "0.47847325", "0.4780171", "0.47348353", "0.47194365", "0.47194365", "0.46878043", "0.46868166", "0.4670587", "0.466...
0.64634144
0
select event from event list that is nearest today's date
function selectNearestEvent(list) { const today = dateToIsoDate(); for (let i = 0; i < list.length; ++i) { if (list[i].getAttribute('aria-label') >= today) { list[i].click(); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchClosestEvent(context) {\n return new Promise((resolve, reject) => {\n HTTP.get('events/', {\n headers: {\n 'Authorization': 'Token ' + context.state.token\n }\n })\n .then((response) => {\n // date ...
[ "0.64623785", "0.64091116", "0.59861034", "0.55447406", "0.5431274", "0.5422294", "0.54206127", "0.5412271", "0.54041237", "0.5300801", "0.52712387", "0.52607554", "0.5256995", "0.5256774", "0.5238601", "0.5238382", "0.51978445", "0.5188055", "0.5185487", "0.5174478", "0.5173...
0.74301726
0
convert array of classes to hash
function loadClasses(input) { const ret = {}; for (const myClass in input) { if ({}.hasOwnProperty.call(input, myClass)) { ret[myClass] = new InspectorClass(input[myClass]); } } return ret; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hashClasses() {\n for (i in classes) {\n nodeHash[classes[i].class] = classes[i]\n }\n for (i in relations) {\n relations[i].source = nodeHash[relations[i].source]\n relations[i].target = nodeHash[relations[i].target]\n }\n }", "function classes() {\n var classes = [];\n ...
[ "0.680082", "0.5882", "0.5829021", "0.5792205", "0.5789032", "0.572261", "0.5675641", "0.5665474", "0.5665474", "0.564708", "0.5580964", "0.5520635", "0.5488449", "0.5424676", "0.54057187", "0.53751403", "0.5369497", "0.53503144", "0.534026", "0.5339771", "0.52531725", "0.5...
0.592439
1
Make dashes for letters in hangman
function makeIntoDashes(word) { var dashes = ""; for (i = 0; i < word.length - 1; i++) { dashes += "_ "; } dashes += "_"; return dashes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeToDashes(letters){\n var dashes = \"\";\n for (var i = 0; i < letters.length; i++) {\n dashesCurrentWord.push(\" _ \");\n }\n}", "function createDash(wordToGuess) {\n document.getElementById(\"dash\").innerHTML = \"\";\n for (let i = 0; i < wordToGuess.length; i++) {\n ...
[ "0.7827454", "0.73348576", "0.7325446", "0.7227364", "0.7215377", "0.7123555", "0.7057904", "0.6910219", "0.6860875", "0.6654698", "0.6592856", "0.6485853", "0.6482179", "0.6470948", "0.6465376", "0.6458367", "0.64555854", "0.6375918", "0.63634163", "0.63607246", "0.6331427",...
0.7393224
1
Validates the provided argument is an array and has as least the expected number of elements.
function validateNamedArrayAtLeastNumberOfElements(functionName,value,name,minNumberOfElements){if(!(value instanceof Array)||value.length<minNumberOfElements){throw new index_esm_FirestoreError(Code.INVALID_ARGUMENT,"Function "+functionName+"() requires its "+name+" argument to be an "+'array with at least '+(formatPl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateNamedArrayAtLeastNumberOfElements(functionName, value, name, minNumberOfElements) {\n if (!(value instanceof Array) || value.length < minNumberOfElements) {\n throw new FirestoreError(Code.INVALID_ARGUMENT, \"Function \" + functionName + \"() requires its \" + name + \" argument to be ...
[ "0.724494", "0.7112797", "0.71082884", "0.71082884", "0.7086457", "0.7086457", "0.7086457", "0.7058282", "0.70570356", "0.70570356", "0.70570356", "0.7048037", "0.7048037", "0.68446654", "0.68446654", "0.6841751", "0.68364954", "0.6823918", "0.6787488", "0.67826134", "0.67704...
0.7423331
0
Validates the provided positional argument has the native JavaScript type using typeof checks.
function validateArgType(functionName,type,position,argument){validateType(functionName,type,ordinal(position)+" argument",argument);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateArgType(functionName, type, position, argument) {\n validateType(functionName, type, ordinal(position) + \" argument\", argument);\n }", "function validateArgType(functionName, type, position, argument) {\r\n validateType(functionName, type, ordinal(position) + \" argument\", argument...
[ "0.6249961", "0.62223715", "0.62223715", "0.62223715", "0.61980295", "0.61980295", "0.61980295", "0.61980295", "0.61980295", "0.61980295", "0.6161284", "0.6084415", "0.5762431", "0.57334834", "0.57107604", "0.5643761", "0.5629433", "0.5609814", "0.55449045", "0.5538697", "0.5...
0.64657027
0
Validates the provided named option has the native JavaScript type using typeof checks.
function validateNamedType(functionName,type,optionName,argument){validateType(functionName,type,optionName+" option",argument);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateNamedType(functionName, type, optionName, argument) {\n validateType(functionName, type, optionName + \" option\", argument);\n }", "function validateNamedType(functionName, type, optionName, argument) {\r\n validateType(functionName, type, optionName + \" option\", argument);\r\n}", ...
[ "0.59438556", "0.59080034", "0.59080034", "0.59080034", "0.59051704", "0.58616436", "0.58616436", "0.58616436", "0.58616436", "0.58616436", "0.58616436", "0.5826456", "0.5689854", "0.5563775", "0.54354936", "0.54079735", "0.5402815", "0.53677917", "0.53677917", "0.53677917", ...
0.62361896
0
Validates the provided named option has the native JavaScript type using typeof checks or is undefined.
function validateNamedOptionalType(functionName,type,optionName,argument){if(argument!==undefined){validateNamedType(functionName,type,optionName,argument);}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateNamedType(functionName,type,optionName,argument){validateType(functionName,type,optionName+\" option\",argument);}", "function validateNamedType(functionName, type, optionName, argument) {\n validateType(functionName, type, optionName + \" option\", argument);\n }", "function validateN...
[ "0.6216687", "0.5895453", "0.5845024", "0.5845024", "0.5845024", "0.5832246", "0.5788133", "0.5788133", "0.5788133", "0.5788133", "0.5788133", "0.5788133", "0.5773505", "0.57698154", "0.57698154", "0.57698154", "0.5757949", "0.5757949", "0.5757949", "0.5757949", "0.5757949", ...
0.6173635
1
Validates that the provided named option equals one of the expected values or is undefined.
function validateNamedOptionalPropertyEquals(functionName,inputName,optionName,input,expected){if(input!==undefined){validateNamedPropertyEquals(functionName,inputName,optionName,input,expected);}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateNamedOptionalPropertyEquals(functionName, inputName, optionName, input, expected) {\n if (input !== undefined) {\n validateNamedPropertyEquals(functionName, inputName, optionName, input, expected);\n }\n }", "function validateNamedOptionalPropertyEquals(functionName, inputNam...
[ "0.6772076", "0.6757881", "0.6734659", "0.6734659", "0.6734659", "0.6731869", "0.6731869", "0.6731869", "0.6607187", "0.655746", "0.6544361", "0.6544361", "0.65225357", "0.6517619", "0.6517619", "0.6517619", "0.6503045", "0.6468524", "0.6457104", "0.6457104", "0.64264554", ...
0.6841093
0
Utility function to check numbers for equality using Firestore semantics (NaN === NaN, 0.0 !== 0.0).
function numericEquals(left,right){// Implemented based on Object.is() polyfill from // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is if(left===right){// +0 != -0 return left!==0||1/left===1/right;}else{// NaN == NaN return left!==left&&right!==right;}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numericEquals(left, right) {\n // Implemented based on Object.is() polyfill from\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n if (left === right) {\n // +0 != -0\n return left !== 0 || 1 / left === 1 / right;\n } else {...
[ "0.659099", "0.65570164", "0.65569055", "0.65233856", "0.65233856", "0.65233856", "0.65233856", "0.65233856", "0.65233856", "0.65127695", "0.65127695", "0.65127695", "0.63850826", "0.63850826", "0.63850826", "0.63850826", "0.63850826", "0.63850826", "0.63850826", "0.63850826", ...
0.6858948
0
Returns whether a value is an integer and in the safe integer range
function isSafeInteger(value){return isInteger(value)&&value<=MAX_SAFE_INTEGER&&value>=MIN_SAFE_INTEGER;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInt() {\n\treturn (Number(value) === parseInt(value, 10));\n}", "function isInt(value) {\n return !isNaN(value) && parseInt(Number(value)) == value && !isNaN(parseInt(value, 10));\n }", "function isInt(value)\r\n{\r\n return !isNaN(value) && parseInt(Number(value)) == value && !isNaN(parse...
[ "0.81474674", "0.79034317", "0.7890967", "0.7890802", "0.7865139", "0.7865139", "0.7865139", "0.7847501", "0.78456104", "0.78456104", "0.78456104", "0.78456104", "0.78456104", "0.78456104", "0.78395355", "0.7799111", "0.77818316", "0.77603483", "0.7753971", "0.7749543", "0.77...
0.81046134
1
Encodes a resource path into a IndexedDbcompatible string form.
function encode(path){var result='';for(var i=0;i<path.length;i++){if(result.length>0){result=encodeSeparator(result);}result=encodeSegment(path.get(i),result);}return encodeSeparator(result);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encode(path) { return encodeURIComponent(path) }", "function encode(path) { return encodeURIComponent(path); }", "function encode(path) {\r\n var result = '';\r\n for (var i = 0; i < path.length; i++) {\r\n if (result.length > 0) {\r\n result = encodeSeparator(result);\r\n ...
[ "0.66030896", "0.65620214", "0.62843513", "0.62843513", "0.62843513", "0.62385696", "0.6229867", "0.6229867", "0.6229867", "0.6229867", "0.6229867", "0.6229867", "0.62187856", "0.57748324", "0.57748324", "0.5745083", "0.5548475", "0.5384502", "0.52170795", "0.5203726", "0.518...
0.6624666
0
Encodes a single segment of a resource path into the given result
function encodeSegment(segment,resultBuf){var result=resultBuf;var length=segment.length;for(var i=0;i<length;i++){var c=segment.charAt(i);switch(c){case'\0':result+=escapeChar+encodedNul;break;case escapeChar:result+=escapeChar+encodedEscape;break;default:result+=c;}}return result;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encode(path){var result='';for(var i=0;i<path.length;i++){if(result.length>0){result=encodeSeparator(result);}result=encodeSegment(path.get(i),result);}return encodeSeparator(result);}", "function encodeSegment(segment, resultBuf) {\r\n var result = resultBuf;\r\n var length = segment.length;\r\n ...
[ "0.6545016", "0.6511343", "0.6511343", "0.6511343", "0.64955485", "0.6472346", "0.6472346", "0.6472346", "0.6472346", "0.6472346", "0.6472346", "0.64658237", "0.6234521", "0.61268014", "0.611432", "0.61082727", "0.6083156", "0.60538757", "0.60538757", "0.60538757", "0.6036894...
0.6738832
0
Encodes a path separator into the given result
function encodeSeparator(result){return result+escapeChar+encodedSeparatorChar;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encodeSeparator(result) {\n return result + escapeChar + encodedSeparatorChar;\n }", "function encodeSeparator(result) {\n return result + escapeChar + encodedSeparatorChar;\n}", "function encodeSeparator(result) {\n return result + escapeChar + encodedSeparatorChar;\n}", "function enc...
[ "0.763443", "0.76262575", "0.76262575", "0.76262575", "0.76262575", "0.76262575", "0.76262575", "0.76194006", "0.7601404", "0.7601404", "0.7601404", "0.75986487", "0.7220876", "0.70907485", "0.70796216", "0.70796216", "0.70796216", "0.70796216", "0.70796216", "0.70796216", "0...
0.7704302
0
Performs database creation and schema upgrades. Note that in production, this method is only ever used to upgrade the schema to SCHEMA_VERSION. Different values of toVersion are only used for testing and local feature development.
function createOrUpgradeDb(db,txn,fromVersion,toVersion){index_esm_assert(fromVersion<toVersion&&fromVersion>=0&&toVersion<=SCHEMA_VERSION,'Unexpected schema upgrade from v${fromVersion} to v{toVersion}.');if(fromVersion<1&&toVersion>=1){createOwnerStore(db);createMutationQueue(db);createQueryCache(db);createRemoteDocu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init(database: SQLite.SQLiteDatabase): Promise<void> {\n let dbVersion: number = 1;\n console.log('Beginning database updates...');\n\n // First: create tables if they do not already exist\n return database\n .transaction(this._createTables)\n .then(() => {\n // Get the current databas...
[ "0.58368415", "0.5795141", "0.5636012", "0.5633977", "0.5633977", "0.55971134", "0.55341333", "0.55263", "0.5472958", "0.53752124", "0.5313832", "0.52930707", "0.5251488", "0.52407974", "0.5237372", "0.521745", "0.5183013", "0.5059713", "0.504434", "0.5013345", "0.49978563", ...
0.66962194
0
Wraps an IDBRequest in a PersistencePromise, using the onsuccess / onerror handlers to resolve / reject the PersistencePromise as appropriate.
function wrapRequest(request){return new PersistencePromise(function(resolve,reject){request.onsuccess=function(event){var result=event.target.result;resolve(result);};request.onerror=function(event){reject(event.target.error);};});}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrapRequest(request) {\n return new __WEBPACK_IMPORTED_MODULE_2__persistence_promise__[\"a\" /* PersistencePromise */](function (resolve, reject) {\n request.onsuccess = function (event) {\n var result = event.target.result;\n resolve(result);\n };\n request.o...
[ "0.7094169", "0.7094169", "0.7094169", "0.70420825", "0.70091957", "0.70091957", "0.70091957", "0.694663", "0.69094634", "0.69094634", "0.6599156", "0.5721129", "0.55928385", "0.5543858", "0.5541489", "0.5522081", "0.5433046", "0.54326516", "0.54326516", "0.54237807", "0.5259...
0.749298
0
Helper to get a typed SimpleDbStore for the mutationQueues object store.
function mutationQueuesStore(txn){return SimpleDb.getStore(txn,DbMutationQueue.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mutationQueuesStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbMutationQueue.store);\n }", "function mutationQueuesStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbMutationQueue.store);\n}", "function mutationQueuesStore(txn) {\n return IndexedDbPersistence.getStore(txn...
[ "0.7988988", "0.79106045", "0.790254", "0.790254", "0.7896655", "0.7845955", "0.7845955", "0.7845955", "0.75671995", "0.7545005", "0.7545005", "0.6665019", "0.648099", "0.6426391", "0.6396744", "0.63719195", "0.63719195", "0.63608813", "0.634689", "0.634689", "0.634689", "0...
0.7953138
1
Helper to get a typed SimpleDbStore for the target globals object store.
function globalTargetStore(txn){return SimpleDb.getStore(txn,DbTargetGlobal.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function globalTargetStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbTargetGlobal.store);\n}", "function globalTargetStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbTargetGlobal.store);\n}", "function globalTargetStore(txn) {\n return getStore$1(txn, DbTargetGlobal.store);\n}", ...
[ "0.69850075", "0.69850075", "0.6980083", "0.6976426", "0.6976426", "0.6976426", "0.69383746", "0.68707025", "0.65998733", "0.6578231", "0.6578231", "0.63839406", "0.6356714", "0.6229351", "0.62149465", "0.61830366", "0.6102292", "0.6063662", "0.59995806", "0.5984562", "0.5961...
0.72722685
0