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
excess handler, called when there is an excess of quantity, for shelf management
function handleExcess(origBalance,newBalance,id,qty){ if(origBalance<=200){ var shelfId = alasql('SELECT * FROM shelves WHERE warehouseid = ? AND productcode = ? ',[findValue('whouse',id),findValue('code',id)])[0].id; alasql('UPDATE shelves SET quantity = ? WHERE warehouseid = ? AND productcode = ? ',[ newBalan...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleQuantity() {\n // dummy function which will invoke inside created().\n }", "function handleDeficit(remaining,id){\r\n\tvar productCode = findValue('code',id);\r\n\tvar whouseId = parseInt(findValue('whouse',id));\r\n\tvar shelf_numbers = alasql('SELECT * FROM shelves WHERE warehouseid=? AND product...
[ "0.6053716", "0.6027514", "0.5792419", "0.57269025", "0.56767905", "0.55987203", "0.5597892", "0.5579063", "0.5541754", "0.5479109", "0.54555947", "0.5449453", "0.5412995", "0.5401564", "0.53693193", "0.536472", "0.5350453", "0.53496176", "0.53488606", "0.5335919", "0.5324154...
0.676623
0
deficit handler, called when there is a deficit of quantity, for shelf management
function handleDeficit(remaining,id){ var productCode = findValue('code',id); var whouseId = parseInt(findValue('whouse',id)); var shelf_numbers = alasql('SELECT * FROM shelves WHERE warehouseid=? AND productcode=?',[whouseId,productCode]); for(var i=0;i<shelf_numbers.length && remaining>0;i++){ var total = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleQuantity() {\n // dummy function which will invoke inside created().\n }", "function handleExcess(origBalance,newBalance,id,qty){\r\n\tif(origBalance<=200){\r\n\t\tvar shelfId = alasql('SELECT * FROM shelves WHERE warehouseid = ? AND productcode = ? ',[findValue('whouse',id),findValue('code',id)])[...
[ "0.6644176", "0.61506534", "0.5882763", "0.58703476", "0.58454007", "0.5733442", "0.57265484", "0.5719223", "0.5706065", "0.5672223", "0.56408304", "0.5588189", "0.5588028", "0.55820876", "0.55820876", "0.55820876", "0.55820876", "0.55820876", "0.55820876", "0.55758566", "0.5...
0.71923137
0
Updates the highlighting in the tree based on the selected team. Highlights the appropriate team nodes and labels.
updateTree(row) { // ******* TODO: PART VII ******* this.clearTree(); // Only highlights aggregate teams d3.select("g#tree") .selectAll("text." + row.key) .classed("selectedLabel", true); d3.select("g#tree") .selectAll("path." + row.key) .classed("selected", true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTree(row) {\n // ******* TODO: PART VII *******\n \n var allTeams = row.value[\"games\"];\n var links = d3.selectAll(\".link\");\n\n for(i=0; i< allTeams.length; i++){\n\tvar team = allTeams[i];\n\tvar contained = links.selectAll(team.key);\n\tcontained.classed(\"selected\",true);\n ...
[ "0.6361411", "0.6196702", "0.6052752", "0.59499097", "0.59277385", "0.5926147", "0.5880462", "0.5874391", "0.58630025", "0.58570534", "0.5839207", "0.5770908", "0.57646024", "0.57468104", "0.57059586", "0.5682187", "0.5632535", "0.56213206", "0.5608394", "0.55757046", "0.5568...
0.6407301
0
| | Check user info is locked (login failed over 5 times) |
checkUserLock(payload) { try { return payload.login_failed > 5 ? true : false } catch { return true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkLoginAttempts(data) {\n const { config } = this;\n const pipeline = this.redis.pipeline();\n const userId = data[USERS_ID_FIELD];\n const remoteipKey = this.remoteipKey = redisKey(userId, 'ip', this.remoteip);\n\n pipeline.incrby(remoteipKey, 1);\n\n if (config.keepLoginAttempts > 0) {\n pip...
[ "0.69331664", "0.66648525", "0.66408926", "0.64773446", "0.6331847", "0.6196023", "0.6148247", "0.6061856", "0.60563755", "0.60126", "0.60091656", "0.59918535", "0.59908867", "0.5935", "0.59343976", "0.59162384", "0.58610207", "0.5854507", "0.5837115", "0.5833803", "0.5800165...
0.7633426
0
This function will iterate through the letters and mark the approperiate one as typed
function markAsTyped(letter) { for (var i = 0; i < $scope.wordTypedTracker.length; i++) { if ($scope.wordTypedTracker[i].letter == letter && !$scope.wordTypedTracker[i].typed) { $scope.wordTypedTracker[i].typed = true; break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function correctLetter(letter) {\n for (let key of keyboard) {\n if (key.textContent == letter) {\n key.classList.add(\"chosen\");\n key.disabled = true;\n }\n }\n}", "updateTypedLetter(position, letter) {\n for (let i = 0, len = this.typedLetters.length; i < len; i++) {\n if ...
[ "0.7576443", "0.72344786", "0.72016037", "0.6849603", "0.66840756", "0.66840756", "0.66840756", "0.6582032", "0.6565034", "0.6517833", "0.6455741", "0.6379246", "0.6378098", "0.6368827", "0.634978", "0.63374734", "0.63295245", "0.6326365", "0.63178647", "0.6281283", "0.627832...
0.7546925
1
list of all sensors per device. Because the device contains values for both PM10 and pm 2.5 extracting out which sensor we want. Passing in the particulate level which is pm 10 or pm2.5 and looking for that in the sensor list
function getParticulateValue(sensorList, particulateLevel) { var value = 0 for (z = 0; z < sensorList.length; z++) { if (sensorList[z].name == particulateLevel) { value = sensorList[z].value; break; } } return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSensorMeasurementValues_sv(sensor, data) {\n var values = [];\n var value = \"\";\n\n switch(sensor) {\n case \"tachometer\":\n value = \"tachometer_rpm\";\n break;\n case \"wss\":\n value = \"wss_speed\";\n break;\n case \"poten...
[ "0.6285769", "0.6162425", "0.5999096", "0.5807681", "0.5483893", "0.54683024", "0.5434106", "0.5426823", "0.5385838", "0.5347985", "0.5331945", "0.5287973", "0.52582675", "0.52210504", "0.51974595", "0.51956075", "0.5178646", "0.5178362", "0.5093809", "0.5088087", "0.5074789"...
0.6185416
1
Clicks the email address and opens the default email app.
@api click() { const anchor = this.emailAnchor; if (anchor && anchor.click) { anchor.click(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emailIconClick() {\n\tlocation.href = \"mailto:mjdargen@gmail.com\";\n}", "function emailContact() {\n\n\t/**\n\t * Appcelerator Analytics Call\n\t */\n\tTi.Analytics.featureEvent(Ti.Platform.osname+\".profile.emailButton.clicked\");\n\t\n\t/**\n\t * Account for if the user is on iOS and using a simulat...
[ "0.73482066", "0.6781707", "0.6647164", "0.65737873", "0.6540864", "0.6407151", "0.64064515", "0.6335881", "0.62870115", "0.61982626", "0.61978745", "0.6160769", "0.6130863", "0.6109911", "0.6081918", "0.6064364", "0.60222304", "0.5992602", "0.59537715", "0.58969086", "0.5877...
0.70761824
1
global_xxxxxxxx: settings page coins
function getglobalsettings() { // get these/set from local storage when loading the any page coinpricearray = getitem('coinpricearray', []); // TES coinlist. refreshed on successful api call global_num = getitem('global_num', "100"); // how many in total to load? global_smallnum = getitem('globa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _settings_page() {\n}", "function additionalSettings(){\n\n\n}", "static _getSettings(page) {\n // Util.purgeSettings();\n const allValues = GM_listValues();\n if (MP.DEBUG) {\n console.log('_getSettings(', page, ')\\nStored GM keys:', allValues);\n }\n Ob...
[ "0.70879763", "0.6522361", "0.6282129", "0.6178913", "0.5932269", "0.5872137", "0.5826122", "0.58136547", "0.57961994", "0.5783711", "0.5726632", "0.57231396", "0.5722618", "0.5702535", "0.56993294", "0.56489265", "0.5620469", "0.5609261", "0.5608278", "0.5608221", "0.5588208...
0.6813748
1
get/set global item (or set default)
function getitem(item, defaultvalue) { // get the item frm localstorage var value = defaultvalue; try { value = JSON.parse(localStorage.getItem(item)); } catch (error) { // store the default value for next time value = defaultvalue; storeitem(item, default...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getOrSetObjectOnScope(item, valueToSet) {\n\t\tif (this.$scope[item] !== undefined) {\n\t\t\tif (valueToSet !== undefined) {\n\t\t\t\tthis.$scope[item] = valueToSet;\n\t\t\t}\n\t\t\treturn this.$scope[item];\n\t\t} else if (this.$scope.$root && this.$scope.$root[item] !== undefined) {\n\t\t\tif (valueToSet !== und...
[ "0.6537144", "0.6324467", "0.58067566", "0.5791066", "0.57212216", "0.5656497", "0.565267", "0.559783", "0.553954", "0.5537711", "0.5511504", "0.5509052", "0.5486897", "0.54804224", "0.5471937", "0.54180515", "0.54011494", "0.5394118", "0.53892684", "0.5358431", "0.533214", ...
0.65049183
1
Track data to Atom, this function returns a Promise which will be resolved only when data is tracked to backlog. The function rejects the promise in 3 cases: 1. Stream / Data are missing. 2. Tracker has been stopped. 3. Nonblocking mode and trackingTimeout has been reached.
track(stream, data) { return new Promise((resolve, reject) => { if (stream === undefined || stream.length === 0 || data === undefined || data.length === 0) { return reject(new Error('Stream name and data are required parameters')); } if (!this.isRunning) { return reject(new Error("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getItunesTrackPromise() {\n let state = await this.getItunesTrackState();\n return new Promise((resolve, reject) => {\n itunes.track((err, track) => {\n if (err || !track) {\n resolve(null);\n } else {\n let trackInfo = {\n id: \"\",\n name: \"...
[ "0.56237006", "0.5573264", "0.55132264", "0.5457911", "0.5298378", "0.52860385", "0.51709306", "0.50556123", "0.49952224", "0.49951234", "0.4946344", "0.49076492", "0.4820179", "0.48060042", "0.47788042", "0.47785777", "0.4762727", "0.47590184", "0.4748289", "0.47347975", "0....
0.71477556
0
Sends events to Atom using Atom Class. Case of 5xx: emits a 'retry' event and retries with exponential backoff. Case of error emits a 'error' event with (err, data) args.
_send(stream, data) { let payload = {stream: stream, data: data}; this.inFlight++; this.lastFlush = Tracker._getTimestamp(); return promiseRetry((retry, attempt) => { return this.atom.putEvents(payload) .then((response) => { this.logger.debug(`[${TAG}] inFlight #: ${this.inFlight...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function send () {\n Cute.get(\n // Send the event name and emission number as URL params.\n Beams.endpointUrl + '&m=' + Cute.escape(name) + '&n=' + Beams.emissionNumber,\n // Send the message data as POST body so we're not size-limited.\n 'd=' + Cute.escape(data),\n // On success, ther...
[ "0.5813856", "0.5364362", "0.5364362", "0.5311195", "0.52739704", "0.5264415", "0.51196873", "0.51196873", "0.51196873", "0.5099139", "0.5047001", "0.5015409", "0.4994479", "0.49801567", "0.4941632", "0.49294525", "0.49294525", "0.49294525", "0.49294525", "0.49294525", "0.492...
0.56707686
1
Build an object containing keys/values representing question ids and selected answers respectively POST it to the /quiz route on the server Show alert and redirect to the URL the server tells us to when response comes back
function submit() { let questions = document.getElementsByClassName("question_div"); let obj = {} for(let i = 0; i < questions.length; i++){ let id = questions[i].id; for(let answer = 0; answer < 4; answer++){ let radio = document.getElementById(id + "_" + answer); if(radio.checked){ obj[id] =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function surveySubmit() {\n var courseKey = $(\"#course-key\").val();\n var survey = {};\n survey[\"courseKey\"] = $('#select-course').find(\":selected\").val();\n survey[\"courseTitle\"] = $(\"#select-course\").find(\":selected\").text();\n\n survey[\"title\"] = $(\"#survey-title\").val();\n sur...
[ "0.70949954", "0.6714864", "0.67026055", "0.64635324", "0.6427952", "0.6368152", "0.6364554", "0.6313532", "0.6309857", "0.6279389", "0.6264957", "0.62315416", "0.62139875", "0.61976594", "0.6167318", "0.61641186", "0.61574125", "0.6136842", "0.61311585", "0.6128144", "0.6126...
0.7493116
0
private Checks if contract name is valid. Throws exception if not.
function checkContractName(contractName) { if (!contractName || (typeof contractName !== 'string') || contractName.trim() === '') { throw new Error('Contract: Contract name: "' + contractName + '" is invalid.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assertValidName(name) {\n\t (0, _invariant2.default)(NAME_RX.test(name), 'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.');\n\t}", "function assertValidName(name) {\n\t (0, _jsutilsInvariant2['default'])(NAME_RX.test(name), 'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \...
[ "0.6861167", "0.6761725", "0.6699121", "0.6671269", "0.6671269", "0.6671269", "0.6671269", "0.6671269", "0.66091627", "0.6588914", "0.63990283", "0.6385666", "0.6385666", "0.6380334", "0.6354115", "0.6306083", "0.6303338", "0.62643987", "0.62486446", "0.62335056", "0.62335056...
0.8240108
0
Checks if descriptor object is valid. Throws exception if not. Valid descriptor is object with fields 'pre' and 'post'. At least one must be present. If any of the fields is present is must be a function.
function checkDescriptor(contractName, descriptor) { if (typeof descriptor !== 'object') { throw new Error('Contract: Invalid descriptor for contract: "' + contractName + '". It is not an object'); } if (!descriptor.hasOwnProperty('pre') && !descriptor.hasOwnProperty(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertToDescriptor(desc) {\r\n\t\t\tfunction hasProperty(obj, prop) {\r\n\t\t\t\treturn Object.prototype.hasOwnProperty.call(obj, prop);\r\n\t\t\t}\r\n\r\n\t\t\tfunction isCallable(v) {\r\n\t\t\t\t// NB: modify as necessary if other values than functions are\r\n\t\t\t\t// callable.\r\n\t\t\t\treturn type...
[ "0.5346796", "0.52679795", "0.52197224", "0.52197224", "0.52197224", "0.52197224", "0.52197224", "0.52197224", "0.5175633", "0.517051", "0.5158056", "0.5147553", "0.5126169", "0.5124753", "0.5113132", "0.5083606", "0.50722677", "0.49322337", "0.49309346", "0.4929384", "0.4905...
0.73832303
0
Callback for any url change.
function _urlChangedCallback() { if (_oldHref == location.href) { return; } _oldHref = location.href var parsedUrl = {href: location.href}; if (urlParser) { parsedUrl = urlParser.parse(location.href); } /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _urlChangedCallback() {\n if (_oldHref == location.href) {\n return;\n }\n _oldHref = location.href\n var parsedUrl = {href: location.href};\n if (urlParser) {\n parsedUrl = urlParser.parse(location.href);\n }\n //var newLocation = par...
[ "0.82424", "0.72282004", "0.71178246", "0.7013498", "0.6987281", "0.6987281", "0.6987281", "0.6987281", "0.6987281", "0.669232", "0.65673226", "0.6433403", "0.63093245", "0.6306062", "0.62900597", "0.6287587", "0.62778825", "0.62113327", "0.6207835", "0.6133848", "0.61275977"...
0.8225099
1
create lines that define navbar and footer
function navbarLines () { var navBottomY = closest(9, yNumberArr); navBottomY = navBottomY[1] + "%"; var navBottomLine = s.line("0%", navBottomY, "100%", navBottomY); navBottomLine.attr({class : "darker"}); //navbar text - general variables var topY = closest(2, yNumberArr), bottomY = closest(6, yNu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLines() {\n var topline = document.getElementById(\"nav-separator\");\n var botline = document.getElementById(\"nav-separator-bottom\");\n topline.classList.remove(\"fade\");\n botline.classList.remove(\"fade\");\n topline.classList.add(\"active\");\n botline.classList.add(\"active\"); \n}", "...
[ "0.65264946", "0.5961836", "0.5898226", "0.58688414", "0.5829757", "0.5823726", "0.56607026", "0.55745405", "0.5571876", "0.55595464", "0.55399066", "0.55131483", "0.55103934", "0.54919994", "0.54858094", "0.5478708", "0.5452315", "0.53624636", "0.5351532", "0.5341745", "0.53...
0.807905
0
in an array and returns the result as an array. If there is more than one sequence with the same maximal length, print the rightmost one. Write JS program sequenceFinder.js that invokes your function with the sample input data below and prints the output at the console.
function findMaxSequence(array) { 'use strict'; var maxSequenceArray = [], currentSequenceArray = [], arrayLength = array.length; for (var i = 0; i < arrayLength; i++) { currentSequenceArray.push(array[i]); while(array[i] === array[i+1]){ currentSequenceArray.push(array[i+ 1]); i++; } if (curre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMaxSequence(array){\n var count=1;\n var longSequence=1;\n var maxElem = array[0];\n var result=[];\n for(var i=1; i<array.length; i++){\n if(array[i-1]===array[i]){\n count++;\n if(longSequence<=count){\n l...
[ "0.7328493", "0.7171068", "0.69949186", "0.693004", "0.6895294", "0.6868442", "0.6720402", "0.66917133", "0.66744465", "0.66603434", "0.6646805", "0.6526265", "0.64818704", "0.6403426", "0.635779", "0.63252336", "0.6277195", "0.62467337", "0.60705495", "0.60238105", "0.601835...
0.7369945
0
Summarize call and service level data by skill. Params should give start and end time for data.
async function getServiceLevelData(params) { return new Promise((resolve, reject) => { DataFeed.aggregate( [ // Filter for the selected date and skills { $match: { date: { $gte: moment(params.start, 'YYYY-MM-DD[T]HH:mm:ss').toDate(), ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function combineSkillData(skillExpData) {\n let combinedData = [];\n const skillNames = [\"Farming\", \"Fishing\", \"Foraging\", \"Mining\", \"Combat\"];\n // exp cutoff for each level\n const totalLevelExp = [100, 380, 770, 1300, 2150, 3300, 4800, 6900, 10000, 15000];\n const le...
[ "0.52897996", "0.51549953", "0.5106209", "0.50281644", "0.49824834", "0.49674168", "0.49618423", "0.49407962", "0.4892683", "0.48679963", "0.48535454", "0.48469737", "0.48386344", "0.48014602", "0.47828543", "0.47720665", "0.47680593", "0.474644", "0.47426933", "0.473597", "0...
0.6221685
0
Summarize data by zip code. Params should give start time, end time, and skills to filter for.
async function getZipCodeData(params) { // Filter for matching (case-insensitive) skill names let skillFilter = params.skills.split(',').map((skillName) => { return { 'skill': { '$regex': skillName.trim(), '$options': 'i' } }; }); return new Promise((resolve, reject) => { DataFeed.aggre...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchByTypeAndZip( country, type, zip, range ) {\n\n var results = [],\n distance = 0;\n\n // start the spinner\n\n loading( \"show\", \"Loading Search Results...\" );\n\n // get the coordinates of the zip code\n\n geocodeZip( country, zip, function( origin ) {\n\n // store the results of filt...
[ "0.6200711", "0.5778151", "0.5499097", "0.5440713", "0.5344762", "0.531882", "0.51849186", "0.5167107", "0.5160897", "0.51338", "0.5095544", "0.50938815", "0.5073219", "0.5068202", "0.5067804", "0.49905702", "0.49829808", "0.49736476", "0.49498117", "0.49469256", "0.4916173",...
0.7123722
0
Get all report data within timeFilter.start and timeFilter.stop
async function getData(timeFilter, reportModel) { const results = await reportModel.find({ date: { $gte: moment(timeFilter.start, 'YYYY-MM-DD[T]HH:mm:ss').toDate(), $lte: moment(timeFilter.end, 'YYYY-MM-DD[T]HH:mm:ss').toDate() } }); return results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDataTimes(){\n var startTime = $( \"#timeselection\" ).attr( \"data-start-time\" );\n var endTime = $( \"#timeselection\" ).attr( \"data-end-time\" );\n return {starttime: startTime, endtime: endTime};\n}", "function selectAllTime_WithProperty(filter, callback) {\n let sql = `select distin...
[ "0.583745", "0.58217466", "0.57836306", "0.5722127", "0.5658329", "0.56482613", "0.5642778", "0.55350024", "0.552568", "0.5431146", "0.5406762", "0.5397932", "0.53908706", "0.5375743", "0.5348886", "0.5345626", "0.5343255", "0.53357285", "0.5334533", "0.5331365", "0.53216195"...
0.75046945
0
20160614 from composition "certificate" in project "/mindful_share/Motion Graphics/Icon_animations/AE/icon_animations_v004.aep" aescripts.com/compCode compCode_20160614_154649();
function compCode_20160614_154649() { app.beginUndoGroup("certificate"); try { // Create Folder hierarchy var zcompcodescripts_folder = getItem("Z_Compcode_Scripts", FolderItem, app.project.rootFolder); if (zcompcodescripts_folder === null) { zcompcodescripts_folder = app.project.items.addFolder("Z_Compcode_Scri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compCode_20160721_103737() {\r\rapp.beginUndoGroup(\"CMI_Ian_Course_LowerThirds\");\r\rtry {\r\r// Create Folder hierarchy\r\tvar zcompcodescripts_folder = getItem(\"Z_Compcode_Scripts\", FolderItem, app.project.rootFolder);\r\tif (zcompcodescripts_folder === null) {\r\t\tzcompcodescripts_folder = app.pro...
[ "0.5772795", "0.57061243", "0.566348", "0.5552815", "0.5471135", "0.5452765", "0.5417121", "0.54002625", "0.5399336", "0.5347264", "0.53443676", "0.5344337", "0.5321913", "0.5279322", "0.5266909", "0.5246005", "0.5246005", "0.5240061", "0.5219232", "0.5202451", "0.5202451", ...
0.6583803
0
This function get TFT information about a summoner
async function getTftSummonerByName(name) { try{ const response = await tft.League.entriesByAccId(summonersId.get(name)) const summoner = response[0] const div = summoner.tier == "CHALLENGER" || summoner.tier == "GRANDMASTER" || summoner.tier == "MASTER" ? "" : ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "profile (region, summonerName) {\n region = RiotApi.getRegion(region);\n\n const summoner = RiotApi.get('https://{region}.api.pvp.net/api/lol/{region}/v1.4/summoner/by-name/{summonerNames}', {\n region,\n summonerNames: summonerName\n });\n\n if (!summoner)\n throw new Meteor.Error(403, ...
[ "0.6598028", "0.6500423", "0.61963594", "0.5982787", "0.58984053", "0.57768756", "0.5752553", "0.57046187", "0.5533742", "0.5510778", "0.54890484", "0.5430362", "0.5414109", "0.53932905", "0.5319892", "0.5316042", "0.530165", "0.5287888", "0.52869284", "0.5210011", "0.5193252...
0.70617443
0
This function will check if stream is online
async function isStreamLive() { const user = await apiClient.helix.users.getUserByName(STREAM_NAME) return !user ? false : await user.getStream() !== null }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function online() {\n var xhr;\n try {\n xhr = XHR();\n xhr.open('HEAD', '/$?' + [+new Date, Math.random()].join(''), false);\n xhr.send(null);\n } catch(e) {\n xhr = {};\n }\n return xhr.status == 200 || !!showResult('offline');\n}", "function checkLiveStream(){\n\tgetTwitchStreamStatus(functio...
[ "0.75042915", "0.71104157", "0.6968431", "0.6956766", "0.6869928", "0.66969556", "0.66466355", "0.66447073", "0.65600574", "0.65562224", "0.6438803", "0.6437067", "0.6414694", "0.6390696", "0.637839", "0.6334706", "0.6298999", "0.6287813", "0.6274443", "0.62707", "0.6260329",...
0.76019037
0
urlify Is used to go through text and change any url into clickable urls text String
function urlify(text) { var urlRegex = /(https?:\/\/[^\s]+)/g; return text.replace(urlRegex, function (url) { return '<a target="_blank" href="' + url + '">' + url + '</a>'; }) //Example of how urlify works /* var text = "Find me at http://www.example.com and also at http://...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function urlify(text){\n\tlet regex = /(ftp|http|https):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?/;\n\treturn text.replace(regex,function(url){\n\t\treturn '<a href=\"'+ url +'\" target = \"_blank\">'+ url + '</a>';\n\t});\n\n}", "function linkify(text) {\r\n if(!text) retu...
[ "0.7826311", "0.7056054", "0.6997704", "0.6916967", "0.68533725", "0.675956", "0.67118037", "0.6711645", "0.67063224", "0.66580707", "0.66469306", "0.66423976", "0.65551203", "0.6520556", "0.65121657", "0.64767444", "0.64396787", "0.6415679", "0.63793635", "0.63732636", "0.63...
0.7578734
1
Load Google Calendar client library. List upcoming events once client library is loaded.
function loadCalendarApi() { gapi.client.load('calendar', 'v3', listUpcomingEvents); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadCalendarApi() {\n gapi.client.load('calendar', 'v3', listUpcomingEvents);\n}", "function loadCalendarApi() {\n gapi.client.load('calendar', 'v3', listUpcomingEvents);\n}", "function loadCalendarApi() {\r\n gapi.client.load('calendar', 'v3', listUpcomingEvents);\r\n }", "function loadCale...
[ "0.8113465", "0.8113465", "0.80806226", "0.79848903", "0.7979351", "0.7948596", "0.79432386", "0.7936962", "0.7898872", "0.7450569", "0.74365336", "0.7194281", "0.71768963", "0.7120542", "0.7102723", "0.70848024", "0.70410794", "0.694934", "0.69379354", "0.677832", "0.6766042...
0.8158731
0
this function assigns a hidden data attribute to our crystals
function assignData() { $('#crystalButton1').attr('data-crystal-value', generateCrystalNumbers()); $('#crystalButton2').attr('data-crystal-value', generateCrystalNumbers()); $('#crystalButton3').attr('data-crystal-value', generateCrystalNumbers()); $('#crystalButton4').attr('data-crystal-value', generat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function crystalValues(){\n $(\".crystal-image\").each(function(index){\n $(this).attr(\"data-crystalvalue\", hiddenValues[index]);\n })\n}", "set data(val) {\n this.setAttribute(\"data\", val);\n }", "function setData(el, attr, val, prefix) {\n\t if (prefix === undefined) {\n...
[ "0.63597316", "0.6125013", "0.59252006", "0.59194696", "0.5894831", "0.58626205", "0.5855607", "0.5834695", "0.5809975", "0.5804204", "0.5797624", "0.5758614", "0.5746127", "0.5704027", "0.5699463", "0.5685735", "0.564089", "0.5635466", "0.56276065", "0.5620317", "0.56075853"...
0.6589389
0
this function generates a random computer score when called
function generateComputerScore() { computerScore = Math.floor(Math.random() * (120 - 19 + 1)) + 19; console.log(computerScore); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computerChoice() {\n const number = Math.random();\n if (number > 0.66) return \"rock\";\n else if (number > 0.33) return \"paper\";\n else return \"scissors\";\n}", "function rockPaperScissors(){\n let random = Math.random()\n if(random < .33){\n return \"rock\"\n }else if(random < .66){\n ...
[ "0.75013614", "0.7456978", "0.74244815", "0.7410953", "0.74085724", "0.7385976", "0.73630166", "0.7359498", "0.7352474", "0.7305338", "0.7291849", "0.7269094", "0.7240205", "0.72336835", "0.72288156", "0.72122", "0.7192068", "0.7180807", "0.71716756", "0.7169551", "0.71694237...
0.82652336
0
Function _reloadPage() Reload the page and load a new beer
function _reloadPage(){ location.reload(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pageReload() {\n location.reload()\n }", "function reloadPage() {\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tlocation.reload();\n\t\t\t\t},250);\n\t\t\t}", "function LoadPage() {\n location.reload();\n}", "function reloadPage() { return UiService_.reloadPage() }", "function reloadPage...
[ "0.7123438", "0.7122281", "0.70094204", "0.6998006", "0.6938957", "0.6932245", "0.6892749", "0.68839127", "0.68662786", "0.6841676", "0.6823505", "0.6823505", "0.6819029", "0.68140787", "0.6803528", "0.6801377", "0.6779764", "0.67646897", "0.6754929", "0.6727668", "0.67258114...
0.7257676
0
Get relay addresses from local storage and create element
function getRelayAddresses(){ return new Promise(resolve => { chrome.storage.local.get("relayAddresses", resolve); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFromLocal() {\n\n // checks if addresses object in local storage exists\n if (localStorage.getItem(\"addresses\") != undefined) {\n\n // if address object does exist this pulls the object and saves it as an array\n var addressArr = JSON.parse(localStorage.getItem(\"addresses\"));\n\...
[ "0.5421865", "0.537596", "0.5363315", "0.5342076", "0.5331825", "0.5259734", "0.5209661", "0.51457846", "0.5093458", "0.5074745", "0.50249326", "0.49773452", "0.49686524", "0.4943282", "0.4931094", "0.4904292", "0.49032676", "0.48983485", "0.4875517", "0.4874498", "0.48722482...
0.7002093
0
onJoin handles 'joingame' event Checks if the lobby already exists Checks if the user is the host or previously connected Creates the user in the saved object Notifies other players of new player
async onJoin(client, msg) { console.log(msg) const lobby = msg.lobbyId const uuid = msg.uuid // Make sure the game exists if (!this.exists(lobby)) { return client.emit('error', { description: 'That lobby does not exist' }) } // Check if the player is the host if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function joinedRoomListener() {\n if (User.lobby) {\n console.log('ROOMID ' + roomID + ' GAMEID ' + gameID);\n //\n $('#app-message').text('Avataan peliä...').removeClass(\"error text\").addClass(\"success\");\n //\n msgManager.s...
[ "0.7126663", "0.7121675", "0.70532614", "0.692587", "0.6787886", "0.6765842", "0.6757863", "0.6640604", "0.661933", "0.66124886", "0.65833354", "0.6546049", "0.6533854", "0.65198994", "0.64919037", "0.6444913", "0.6432942", "0.64327055", "0.63902694", "0.63773334", "0.6376746...
0.752659
0
format api path to be with trailing and leading '/'
function normalizeApiPath (apiPath) { if (!apiPath.startsWith('/')) { apiPath = '/' + apiPath } if (!apiPath.endsWith('/')) { apiPath = apiPath + '/' } return apiPath }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatUrl(path) {\n const adjustedPath = path[0] !== '/' ? '/' + path : path;\n\n const apiVersion = 'v1';\n const versionedApiPath = `/api/${apiVersion}${adjustedPath}`;\n\n let url;\n\n // This assumes they are served from the same place\n if (process.env.NODE_ENV === 'production') {\n url...
[ "0.74569595", "0.6648622", "0.6548122", "0.6400577", "0.6385906", "0.63769567", "0.6365508", "0.63517976", "0.63239944", "0.6299153", "0.62932944", "0.6292074", "0.6292074", "0.6292074", "0.6292074", "0.6292074", "0.62787926", "0.62787926", "0.6268056", "0.6264322", "0.625643...
0.7905618
0
Displays the message one word at a time
function displayMessage() { var wordCount = 0; // Uses the `setInterval()` method to call a function to be executed every 300 milliseconds var msgInterval = setInterval(function() { if (words[wordCount] === undefined) { clearInterval(msgInterval); } else { mainEl.textContent ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayMessage() {\n var wordCount = 2;\n\n // Uses the `setInterval()` method to call a function to be executed every 300 milliseconds\n var msgInterval = setInterval(function() {\n if (words[wordCount] === undefined) {\n clearInterval(msgInterval);\n } else {\n mainEl.textContent = wo...
[ "0.7486183", "0.6774062", "0.6716082", "0.6507926", "0.6478403", "0.6410703", "0.6300529", "0.62501454", "0.62499726", "0.62431306", "0.62260616", "0.6196172", "0.6133484", "0.61276364", "0.61116105", "0.61057127", "0.6082614", "0.6078891", "0.6078604", "0.6028354", "0.601041...
0.75301903
0
Gets data Xvalue assositated with callout layer
get xValue() { return this.i.c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getXValue(data,X_S){\r\n var obj = [];\r\n for(var index in data){\r\n obj.push(data[index][X_S]);\r\n }\r\n return obj;\r\n}", "function getXValue() {\n\t/* jshint validthis: true */ // TODO: eslint\n\treturn this._xValue;\n} // end FUNCTION getXValue()", "function getValue(name) {...
[ "0.6263605", "0.5905182", "0.58407104", "0.56966144", "0.5691049", "0.56548876", "0.5506141", "0.54439116", "0.5410982", "0.53240055", "0.5320789", "0.5315094", "0.5300794", "0.5300323", "0.5292737", "0.52630806", "0.5262499", "0.5251978", "0.52192783", "0.52192783", "0.52140...
0.5925326
1
Gets data Yvalue assositated with callout layer
get yValue() { return this.i.d; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getY(d) { return d.y}", "function get_line_data(layer) {\n show_alert([\"Distance: \" + layer.get('length'),\n \"Time: \" + layer.get('time'), \n \"Speed: \" + layer.get('speed'),\n \"Calories: \" + layer.get('calories')]);\n}", "function ApexYAxis() { }...
[ "0.6138374", "0.6001935", "0.58488244", "0.5745166", "0.57128733", "0.570175", "0.56707335", "0.56699353", "0.5633226", "0.5624996", "0.5618862", "0.5609035", "0.5573847", "0.5567978", "0.5548457", "0.55293787", "0.55255455", "0.5517716", "0.54916465", "0.54876", "0.5475432",...
0.6647803
0
Gets or sets series object assositated with callout layer
get series() { if (this.i.a == null) { return null; } if (!this.i.a.externalObject) { let e = IgxSeriesComponent._createFromInternal(this.i.a); if (e) { e._implementation = this.i.a; } this.i.a.externalObject = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get series() {\r\n if (this.i.series == null) {\r\n return null;\r\n }\r\n if (!this.i.series.externalObject) {\r\n let e = IgxSeriesComponent._createFromInternal(this.i.series);\r\n if (e) {\r\n e._implementation = this.i.series;\r\n ...
[ "0.68870485", "0.6539575", "0.6280191", "0.5868693", "0.5866507", "0.5633224", "0.5416389", "0.53559977", "0.53557754", "0.53178525", "0.5310668", "0.5275016", "0.52613384", "0.5209674", "0.51925814", "0.51841813", "0.51281154", "0.5117582", "0.50566083", "0.50076145", "0.498...
0.67288077
1
Gets or sets series name assositated with callout layer
get seriesName() { return this.i.e; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSeriesName(chartName) {\n return FCFCC.seriesName[chartName];\n }", "GetSeriesDetail (theName) {\n const seriesCount = this.SeriesData.series.length \n for (var counter = 0; counter < seriesCount; counter++) {\n const currentSeries = this.SeriesData.series[counter]\n ...
[ "0.68491656", "0.6449487", "0.63724625", "0.6189762", "0.6049603", "0.60175604", "0.58857054", "0.5764629", "0.5483861", "0.5472335", "0.54662055", "0.53726816", "0.5344361", "0.52521026", "0.5194412", "0.5160306", "0.5157365", "0.51272833", "0.51088", "0.5105521", "0.5105521...
0.72833174
0
Find the next sibling of the given element, count nodes ahead.
function recursiveNextSibling(element, count) { // If this element or the next one is null, return null // (there is no element count nodes ahead) if (element === null || element.nextSibling === null) { return null; } // If we are looking for the next sibling, return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getElementIndex(element) {\r\n var count = 1;\r\n for (var sib = element.previousSibling; sib ; sib = sib.previousSibling) {\r\n if(sib.nodeType == 1 && sib.tagName == element.tagName) {\r\n\t\t\tcount++\r\n\t\t}\r\n }\r\n return count;\r\n}", "function getElementIndex(node) {\n let ...
[ "0.6682297", "0.66181415", "0.6583459", "0.6531597", "0.6522348", "0.64825463", "0.64726776", "0.64627075", "0.6447226", "0.6410297", "0.6387974", "0.6359523", "0.62939894", "0.62629807", "0.62127864", "0.62063813", "0.61993045", "0.6197801", "0.61795616", "0.61795616", "0.61...
0.7481959
0
Find the previous sibling of the given element, count nodes back.
function recursivePreviousSibling(element, count) { // If this element or the previous one is null, return null // (there is no element count nodes back) if (element === null) { return null; } // If we are looking for the previous sibling, return it else if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPreviousElement(n) {\n var x = n.previousSibling;\n while (null != x && x.nodeType != 1) {\n x = x.previousSibling;\n Logger.debug(\"Previous sibling?: \" + typeof x);\n Logger.debug(\"Previous sibling: \" + x);\n }\n return x;\n}", "function previousElement(element) ...
[ "0.7698873", "0.76967204", "0.74737895", "0.7451366", "0.7348854", "0.73437953", "0.7316512", "0.7233914", "0.7107268", "0.7098868", "0.7053696", "0.7053696", "0.7053272", "0.7036092", "0.7036092", "0.7030833", "0.70216703", "0.70216703", "0.70216703", "0.70216703", "0.697596...
0.7969766
0
Adds the 3D card effect to the site collection
function addSkew3D() { skew3DController = new Skew3D(); skew3DController.create(siteCollection.activeSites()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add3DPageToApp(page){\n glScene.add(page.plane);\n cssScene.add(page.cssObject);\n billboardList.push(page.cssObject);\n billboardList.push(page.plane);\n glScene.add(page.line);\n }", "function init() {\n _width = window.innerWidth\n _height = window.innerHeight\n\n ...
[ "0.6102026", "0.6067974", "0.57680243", "0.5742369", "0.5704492", "0.5696594", "0.56513566", "0.5641445", "0.5618577", "0.5588315", "0.5577952", "0.5576339", "0.55642766", "0.5557932", "0.5542803", "0.5517278", "0.54982007", "0.54979265", "0.54919684", "0.54919684", "0.546994...
0.61296153
0
Gets the contents of storage. Initializes storage with all sites if storage is empty.
function getStorage(items) { // If this is the first time the extension has been enabled since being installed if (items.activeSites === undefined) { setStorage(siteCollection.allSites(), []); chrome.storage.sync.get(null, getStorage); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getStorages() {\n return Promise.resolve();\n }", "function getStorage() {\n return new Promise((resolve, reject) => {\n chrome.storage.local.get(null, (data) => {\n resolve(data);\n });\n })\n}", "getContent () {\n\t\treturn localStorage.getItem(STORAGE_KEY);\...
[ "0.69654757", "0.67190605", "0.6671829", "0.66604686", "0.6643519", "0.6643519", "0.6643519", "0.6594519", "0.6587054", "0.65802634", "0.65494275", "0.6485926", "0.63683945", "0.6323555", "0.63071454", "0.6230962", "0.6166302", "0.61136895", "0.6102961", "0.60698336", "0.6060...
0.70549625
0
Called when a site is edited. (Plus/minus is clicked)
function siteEditEvent(site) { var siteActive = site.active(); if (siteActive === true) { moveToInactive(site); site.setActive(false); } else { moveToActive(site); site.setActive(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editClick() {\n \n if (editing) {\n \n editing = !editing;\n \n editButton.innerHTML = \"Edit\";\n \n siteCollection.viewState(sitesParent);\n \n storageManager.updateStorage(siteCollection.activeSitesObj...
[ "0.662044", "0.6400555", "0.6292105", "0.62801576", "0.62721467", "0.6168807", "0.60177463", "0.60068065", "0.5951682", "0.5942221", "0.59210634", "0.5917445", "0.59148693", "0.5807773", "0.57825243", "0.5780604", "0.5753838", "0.5753439", "0.57440543", "0.57209647", "0.57125...
0.7360057
0
Moves the given site object from the inactive array to the active array.
function moveToInactive(site) { var parent = site.element().parentNode; parent.removeChild(site.element()); parent.appendChild(site.element()); var found = false; var i = 0; while (!found) { if (activeSites[i] === site) { activeSites.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveToActive(site) {\n var found = false;\n var i = 0;\n while (!found) {\n if (inactiveSites[i] === site) {\n inactiveSites.splice(i, 1);\n activeSites.push(site);\n found = true;\n }\n i++;\n };\n ...
[ "0.80851305", "0.5395269", "0.5395269", "0.53245723", "0.5312782", "0.5312782", "0.5312782", "0.5312782", "0.5278875", "0.52106255", "0.5136051", "0.50880605", "0.506931", "0.50572246", "0.503344", "0.50176466", "0.49577957", "0.49482366", "0.49349934", "0.49260855", "0.49031...
0.7945129
1
Moves the given site object from the active array to the inactive array.
function moveToActive(site) { var found = false; var i = 0; while (!found) { if (inactiveSites[i] === site) { inactiveSites.splice(i, 1); activeSites.push(site); found = true; } i++; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveToInactive(site) {\n var parent = site.element().parentNode;\n parent.removeChild(site.element());\n parent.appendChild(site.element());\n \n var found = false;\n var i = 0;\n while (!found) {\n if (activeSites[i] === site) {\n ...
[ "0.7871169", "0.5421924", "0.5421924", "0.5421924", "0.5421924", "0.541565", "0.541565", "0.531099", "0.52516264", "0.5232747", "0.51511216", "0.5109995", "0.50698566", "0.5058704", "0.50535303", "0.5042654", "0.5013579", "0.4996258", "0.49772462", "0.49533695", "0.49428964",...
0.80248713
0
Appends all site objects' elements to given parent element.
function appendSitesTo(parent) { for (i = 0; i < activeSites.length; i++) { parent.appendChild(activeSites[i].element()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendTo(el, parent) {\n parent.appendChild(el);\n }", "function appendTo(el, parent) {\n parent.appendChild(el);\n }", "function appendTo(el, parent){\n parent.appendChild(el);\n }", "function appendTo(el, parent){\n parent.appendChild(el);\n }", "function in...
[ "0.6324983", "0.62878615", "0.6283569", "0.6283569", "0.5802692", "0.57608324", "0.57608324", "0.5709855", "0.5695601", "0.5695601", "0.5693787", "0.56578207", "0.5646596", "0.56406534", "0.5636827", "0.5608642", "0.5606491", "0.56026906", "0.5568132", "0.55659163", "0.556587...
0.7314883
0
function to determine percent covered
function percentCovered (claim){ var pCovered = -1; switch (claim.visitType) { case 'Optical': pCovered = 0.0; break; case 'Specialist': pCovered = 0.10; break; case 'Emergency': pCovered = 1; break; case 'Primary Care': pCovered = 0.50; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function determinePercentCovered(object){\n\tswitch(object.visitType){\n\t\tcase (\"Optical\"):\n\t\t\treturn 0;\n\t\t\tbreak;\n\t\tcase (\"Specialist\"):\n\t\t\treturn 0.10;\n\t\t\tbreak;\n\t\tcase (\"Emergency\"):\n\t\t\treturn 1;\n\t\t\tbreak;\n\t\tcase (\"Primary Care\"):\n\t\t\treturn 0.50;\n\t\t\tbreak;\n\t\...
[ "0.7629742", "0.7389499", "0.73745507", "0.7223772", "0.71504325", "0.7147093", "0.7016954", "0.6966318", "0.67219615", "0.66330636", "0.6474977", "0.6402078", "0.6370963", "0.63546324", "0.6264907", "0.6248028", "0.62199664", "0.6219367", "0.61906326", "0.61833537", "0.61833...
0.7616704
1
function to determine amount covered
function ammountCovered(claim){ return ( claim.visitCost * percentCovered(claim)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcAmountCovered(claim) {\n\tvar claimCost = claim.visitCost;\n\tvar amountCovered = calcPercentCovered(claim) * claimCost / 100;\n\treturn amountCovered;\n}", "function amountCovered(i){\n\tvar totalCost = initialList[i].visitCost;\n\tvar percent = percentCovered(i);\n\tvar name = initialList[i].patie...
[ "0.7366431", "0.6947929", "0.69194853", "0.6915246", "0.69061005", "0.6846448", "0.6772062", "0.6746659", "0.66898096", "0.66616774", "0.6604148", "0.6341978", "0.6218484", "0.61840546", "0.61167467", "0.5981109", "0.595143", "0.5922009", "0.5822181", "0.5808086", "0.57313627...
0.7423219
0
HANDLEBARS At its most basic, Handlebars is just a place to put your clientside HTML Handlebars makes sure it's clean and safe need the path to the hbs file here
function renderHandlebars() { var html = HandlebarsTemplates['users/index'](); // place data in parens when you're sending data to hbs file // Use an ID to ensure only one, we don't want an array $('#map').append(html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HandlebarsWrapper() {\n this.handlebars = Handlebars;\n }", "function registerHandlebarsHelpers(handlebars){\n if(!('skin' in handlebars.helpers)){\n //helper to set a skin for a template\n handlebars.registerHelper('skin', function(skin, options) {\n this.__skin = ...
[ "0.71448445", "0.6691346", "0.6685627", "0.6504706", "0.6422352", "0.61667603", "0.61667603", "0.61667603", "0.61667603", "0.61157274", "0.61118686", "0.6050207", "0.5968994", "0.58869493", "0.58869493", "0.5885749", "0.5838043", "0.58101463", "0.58069915", "0.57953686", "0.5...
0.7202525
0
Natural sort is from:
function natural_sort(a, b) { function chunk(t) { var tz = [], x = 0, y = -1, n = 0, i, j; while (i = (j = t.charAt(x++)).charCodeAt(0)) { var m = (i == 46 || (i >=48 && i <= 57)); if (m !== n) { tz[++y] = ""; n = m; } tz[y] += j; } return tz; } var aa = chunk(a); var bb = chunk(b); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderNatural() {\n return order(crossfilter_identity);\n }", "function orderNatural() {\n return order(crossfilter_identity);\n }", "function orderNatural() {\n return order(crossfilter_identity);\n }", "function orderNatural() {\n return order(...
[ "0.7297648", "0.7269855", "0.7257706", "0.7257706", "0.7257706", "0.7257706", "0.7257706", "0.6875738", "0.67612845", "0.6716852", "0.66884506", "0.6591267", "0.65113074", "0.64723396", "0.6436777", "0.6393574", "0.6329426", "0.63084215", "0.6261868", "0.6224325", "0.61972374...
0.74783623
0
Show user links saved in cookies
function add_user_links_to_navbar() { var data = get_cookie(), user_links = data.links; d3.select("#user_data_navbar_item").style("visibility", user_links == null ? "hidden" : "visible"); if(user_links == null) return; // Each user_link = { name: ..., perma: ..., date: ... } d3.select("ul#user_data_list")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loggedUser() {\n $('#user-signed-link').show();\n $('#user-signout-link').show();\n $('#user-signin-link').hide();\n $('#user-signup-link').hide();\n }", "function loggedIn() {\n\n if (document.cookie != \"\") {\n\n var cookie_obj = document.cookie.split(\";\").map(cookie => cooki...
[ "0.6397381", "0.6169109", "0.6020408", "0.5913564", "0.5846439", "0.57785285", "0.57277817", "0.56406355", "0.56353515", "0.56274587", "0.562395", "0.5608519", "0.55980724", "0.5579561", "0.55792946", "0.5562891", "0.55620843", "0.55485386", "0.5494651", "0.54942954", "0.5489...
0.67571604
0
=========================================================================== == Load bed file ===========================================================================
function open_bedpe_file(event) { ga('send', 'event', "bedpe_file","load",this.files[0].name); if (this.files[0].size > 1000000) { user_message("Warning","Loading large file may take a while."); } var file_extension = /[^.]+$/.exec(this.files[0].name)[0]; if (file_extension == "bedpe") { var raw_data; var...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "load() {\n this.interpretFile();\n\n this.createGeneral();\n \n this.caseShip = this.createCaseShip();\n this.passingShip = this.createPassingShip();\n this.wind = this.createWindParams();\n\n this.hawserLimits = this.createhawserLimits();\n this.fenderLimits...
[ "0.5821475", "0.56323737", "0.56323737", "0.56323737", "0.55873895", "0.5564524", "0.5544448", "0.5540933", "0.5535466", "0.551692", "0.54736716", "0.54115105", "0.523398", "0.521373", "0.51918626", "0.5174669", "0.5164692", "0.51099074", "0.5086039", "0.5079347", "0.50614625...
0.624495
0
=========================================================================== == Load coords file ===========================================================================
function open_coords_file(event) { console.log("in open_coords_file"); ga('send', 'event', "coords_file","load",this.files[0].name); var raw_data; var reader = new FileReader(); if (this.files[0].size > 1000000) { user_message("Info","Loading large file may take a little while."); } reader.readAsText(this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function readCoordsFromFile(){\n coords_from_file = []; \n\n var oFrame = document.getElementById(\"frmFile\");\n var strRawContents = oFrame.contentWindow.document.body.childNodes[0].innerHTML;\n\n while (strRawContents.indexOf(\"\\r\") >= 0)\n strRawContents = strRawContents.replace(\"\\r\", \"\");\n\n v...
[ "0.6945493", "0.6466999", "0.63518935", "0.6333518", "0.6055012", "0.5943458", "0.5921438", "0.58129144", "0.5710074", "0.5684072", "0.55142134", "0.5441264", "0.54355097", "0.54070747", "0.53640187", "0.5299127", "0.52952504", "0.52634734", "0.5185654", "0.5184977", "0.51467...
0.7145299
0
=========================================================================== == Load bam file ===========================================================================
function open_bam_file(event) { create_bam(event.target.files); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async parse() {\n const data = { bai: true, maxBlockSize: 1 << 16 }\n const bytes = await this.filehandle.readFile()\n\n // check BAI magic numbers\n if (bytes.readUInt32LE(0) !== BAI_MAGIC) {\n throw new Error('Not a BAI file')\n }\n\n data.refCount = bytes.readInt32LE(4)\n const depth =...
[ "0.6546834", "0.62116694", "0.6044509", "0.54945403", "0.53034216", "0.5294079", "0.5293459", "0.509932", "0.49933788", "0.49594936", "0.4831681", "0.47353768", "0.47124475", "0.4705949", "0.4703913", "0.46745998", "0.46504462", "0.4645516", "0.46402806", "0.46275738", "0.462...
0.6213454
1
API calls to iobio
static iobio(endpoint, data) { return fetch(`https://backend.iobio.io/${endpoint}`, { // API expects text/plain content-type headers: { "Content-Type": "text/plain" }, method: "post", body: JSON.stringify(data) }).catch(d => { alert("Could not connect to iobio server. Please try again later."); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function call_api(apiFINISHED){\n request('https://cloud.iexapis.com/stable/stock/amzn/quote?token=pk_1623b44122704dd3aa29144bc5ed869d', {json: true}, (err, res, body) => {\n if (err) {return console.log(err);}\n if (res.statusCode === 200){\n //console.log(body);\n apiFINISHED(body);\n }...
[ "0.61804676", "0.6110867", "0.59974045", "0.5903712", "0.5899528", "0.5896951", "0.5877491", "0.5869835", "0.5867417", "0.5857538", "0.5848702", "0.5839206", "0.57968044", "0.5778252", "0.57600445", "0.57281893", "0.57269216", "0.5722165", "0.5718242", "0.5715176", "0.5698793...
0.69963926
0
set src of telling storry array, run function to fill tellingstory, run function to launch story grid
function switchGrids(thisarray) { storyarray = thisarray; switch (storyarray) { case "aliceStoryFirst": the_image.src = aliceFirstArray[0][0]; the_discription.innerHTML = aliceFirstArray[0][1]; for (let i = 1; i < aliceFirstArray.length; i++) { tellingStory.push(aliceFirstArray[i]); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function switchGrids(thisarray){\n storyarray= thisarray;\n switch(storyarray){\n case 'aliceStoryFirst': \n the_image.src=aliceFirstArray[0][0];\n the_discription.innerHTML=aliceFirstArray[0][1]; \n for(let i = 1; i < aliceFirstArray.length; i++){\n tellingStory.push(aliceFirstArra...
[ "0.70039785", "0.6120787", "0.57623655", "0.57574105", "0.57517785", "0.5715599", "0.5709193", "0.57019085", "0.56813437", "0.5678198", "0.5672482", "0.5667308", "0.56665164", "0.5665448", "0.5651163", "0.5651163", "0.5651163", "0.5651163", "0.5606875", "0.5602005", "0.560071...
0.69819635
1
set story vids to auto play
function playVideoStory() { the_video.autoplay = true; the_video.load(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function autoPlay() {\n autoplaySong[0].play();\n autoplaySnow[0].play();\n autoplaySnow.prop(\"volume\", 0.4);\n}", "function SwitchAutoPlay () { SetAutoPlay (!isAutoPlayOn); }", "function playVideoStory() { \n the_video.autoplay = true;\n the_video.load();\n}", "function autov(video, videoc){\n ...
[ "0.6616966", "0.6412857", "0.6256886", "0.61849177", "0.59898573", "0.5988045", "0.5969811", "0.5930279", "0.59054434", "0.582378", "0.5820455", "0.57087266", "0.56751347", "0.5668451", "0.5661412", "0.5641392", "0.55856466", "0.5577836", "0.5576642", "0.5571659", "0.55544984...
0.64504606
1
Open the dialog to provide notification of found words.
function reportWordsFound(count) { var url = RedactAddin.createUrlForDialog('dialogCount.html', {count: count}); Office.context.ui.displayDialogAsync(url, { height: 11, width: 12, requireHTTPS: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wordClick(event){\n var wordLookup = event.currentTarget.id.split('-').pop()\n var correctDefinition = definitionArray.filter(function(define){\n return define.id.split('-').pop() == wordLookup\n })\n $('#search-pane').text('')\n $('#search-pane').append(correctDefinition)\n $(correctDefinition)....
[ "0.57355326", "0.56121004", "0.5580492", "0.55268437", "0.5513848", "0.548266", "0.5471042", "0.54182965", "0.5352545", "0.53435665", "0.53429383", "0.53404695", "0.5333673", "0.53245854", "0.5311895", "0.5299645", "0.52903676", "0.52876204", "0.5285483", "0.52700555", "0.526...
0.6658687
0
Register a dynamic state reference.
function registerSref(stateName, toState, toParams) { $rootScope.srefs[stateName] = $state.href(toState, toParams); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addState (stateName, init, update, render) {\n \n jas.Event.addPublication(\"enter-state-\" + stateName);\n jas.Event.addPublication(\"exit-state-\" + stateName);\n \n states[stateName] = {\n stateName: stateName,\n init: init,\n update: update,\n render: render,\n ...
[ "0.576392", "0.5689329", "0.5562015", "0.55276996", "0.54525244", "0.5364762", "0.513787", "0.51054674", "0.504221", "0.49559104", "0.49319386", "0.4897183", "0.48532972", "0.4842909", "0.4842345", "0.4836344", "0.48155746", "0.48138997", "0.4784454", "0.47799006", "0.4775903...
0.61141384
0
Recalculates the computations submitted through the Offline Form Parameters: > taxDue = Tax Due amount > in_XXXX = Integration name of the fields
function reCompute(taxDue, in_surcharge, in_interest, in_compro, in_penalties, in_payable){ var balance=0, surcharge=0, interest=0, compromise=0, total_penalty=0, gracePd=0, add5Days=0, add15Days=0, willAdd15Days=false, willAdd5Days=false, isLeap=false; // *For negative tax dues, values will be set to ZERO(0) var da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupIntialValues() {\n \n let p = loanAmountInputField.value = 50000; //Amount of principle\n let y = termInYearsInputField.value = 5;\n let r = yearlyRateInputField.value = 5;\n calculateMonthlyPayment({ amount: p, years: y, rate: r })\n update();\n}", "function calculate(){\r\n\t\r\n\tif(depende...
[ "0.61620396", "0.6145936", "0.6109034", "0.5999227", "0.59656674", "0.58924896", "0.58602864", "0.58038145", "0.57847613", "0.5783467", "0.5777691", "0.5777537", "0.5763625", "0.5753025", "0.57227224", "0.56945395", "0.56919634", "0.56896025", "0.5672892", "0.5665505", "0.565...
0.690548
0
this function display editCompanyForm
function showEditCompanyModal() { var action = $("#editCompanyModal").attr("action"); if (action == 'create' || action == 'update') { $("#editCompanyModal").modal("show"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupModalPreFill(companyData) {\n var form = $scope.suggestCompanyEditForm;\n form.name = companyData.name;\n form.description = companyData.description;\n form.url = companyData.url;\n form.logo = companyData.logo;\n }", "function Edit(currentObj) {\n debugger;\n ...
[ "0.65706414", "0.64687", "0.6411048", "0.6348799", "0.6290744", "0.6224285", "0.61866134", "0.6181623", "0.6168419", "0.6137059", "0.6061985", "0.6045822", "0.60319805", "0.6030626", "0.59983724", "0.5980036", "0.59204143", "0.5905778", "0.5891333", "0.5888345", "0.58625454",...
0.7667831
0
this function display companyDetailsModal
function showCompanyDetailsModal() { var action = $("#companyDetailsModal").attr("action"); if (action == 'show Details of') { $("#companyDetailsModal").modal("show"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showEditCompanyModal() {\n\t\t\t\tvar action = $(\"#editCompanyModal\").attr(\"action\");\n\t\t\t\t\n\t\t\t\tif (action == 'create' || action == 'update') {\n\t\t\t\t\t$(\"#editCompanyModal\").modal(\"show\");\n\t\t\t\t}\n\t\t\t}", "function _addCompany() {\n var modalInstance = $uibModal.open({\...
[ "0.73705584", "0.68914294", "0.6704079", "0.6553408", "0.65522254", "0.6436301", "0.6428283", "0.64094615", "0.63979113", "0.63762754", "0.6298799", "0.6260947", "0.6247909", "0.62407106", "0.623576", "0.62295824", "0.62290984", "0.6223651", "0.6204292", "0.6200754", "0.61930...
0.8227977
0
show success alert when company has been successfully created or updated
function showManageCompanySuccessAlert() { var successMsg = $("#editCompanyModal").attr("saveCompanyWithSuccess"); if(successMsg !== undefined) { displaySuccessMsg(successMsg); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SaveSuccess(data, status) {\n debugger;\n var JsonResult = JSON.parse(data)\n switch (JsonResult.Result) {\n case \"OK\":\n BindAllCompanies();\n notyAlert('success', JsonResult.Message);\n\n if ($(\"#hdnCode\").val() != \"\") {\...
[ "0.6699657", "0.6500508", "0.64957184", "0.64907986", "0.63708407", "0.62819403", "0.62615097", "0.6234387", "0.61922026", "0.615077", "0.6100763", "0.60487866", "0.60487866", "0.59559417", "0.5915706", "0.59135586", "0.5877205", "0.58420885", "0.583843", "0.58326584", "0.583...
0.78614664
0
show confirm alert before delete X company
function displayConfirmDeleteCompanyAlert() { $(".deleteCompany").on("click", function() { var delBtn = $(this); swal({ title: "Are you sure?", text: "You will not be able to recover this company !", type: "warning", showCancelButton: true, c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirm () {\n alert('Are you sure you want to remove the selected companies?')\n}", "function alertDeleteSucess() {\n\t\t\t\t\t\tswal({\n\t\t\t\t\t\t\ttitle : \"\",\n\t\t\t\t\t\t\ttext : \"Delete successfully.\",\n\t\t\t\t\t\t\ttype : \"success\",\n\t\t\t\t\t\t\ttimer : alertDuration,\n\t\t\t\t\t\t\ts...
[ "0.8020403", "0.7100655", "0.7053494", "0.6978929", "0.6956344", "0.69409436", "0.6909823", "0.69084436", "0.6828372", "0.6783465", "0.6783147", "0.6726021", "0.67259175", "0.6698632", "0.6695705", "0.66688514", "0.6659399", "0.6648704", "0.6630767", "0.6603313", "0.65953034"...
0.7894976
1
search companies by ajax request
function ajaxSearch() { $("input[name='name']").keyup(function(event) { var companyName = event.target.value; $.ajax({ type: 'get', url: 'http://localhost:8080/search/companies', data: {name: companyName, page: 0, si...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async filterCompanies(search) {\n let res = await this.request('companies', { search });\n return res.companies\n }", "function search()\n{\n\t\t//llamada Ajax...\n\treturn ajaxCall(\n\t\t\t\n\t\thttpMethod=\"POST\", \n\t\turi=\"${def:actionroot}/search\", \n\t\tdivResponse=\"response\", \n\t\tdivP...
[ "0.7330714", "0.7272428", "0.7182551", "0.7141341", "0.7010798", "0.6959429", "0.68565726", "0.67933774", "0.6790802", "0.6732745", "0.6679234", "0.66358274", "0.6596384", "0.6575775", "0.6572992", "0.65605426", "0.65425116", "0.65319705", "0.65130705", "0.65026516", "0.64401...
0.78200275
0
Fetch the feeds from the server and call the create buttons method
async function fetchFeeds(){ console.log('Fetching the feeds and creating buttons'); let feeds = await fetch('/earthdatafeeds').then(response => response.json()).then(data => { return data; }); createButtons(feeds) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createButtons(feeds){ \n \n /**\n * Looping through all the feeds and creating a div for each element\n */\n feeds.urls.forEach(element => {\n \n let buttonfeedcontainer = `\n <div class=\"buttonbyfeed\">\n <div cl...
[ "0.7035748", "0.68487", "0.64134294", "0.63431877", "0.6334331", "0.62529796", "0.6232621", "0.62310207", "0.6184637", "0.61696917", "0.61618847", "0.61530393", "0.61477375", "0.6135354", "0.6070408", "0.6049858", "0.6035808", "0.6030655", "0.6014808", "0.59480816", "0.594673...
0.79533017
0
Dynamically create buttons based on all the available earthquake feeds provided from the server
function createButtons(feeds){ /** * Looping through all the feeds and creating a div for each element */ feeds.urls.forEach(element => { let buttonfeedcontainer = ` <div class="buttonbyfeed"> <div class="labelcontai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderButtons() {\n \n // Deleting the band buttons prior to adding new band buttons\n $(\"#buttons-go-here\").empty();\n\n // Looping through the array of bands\n for (var i = 0; i < topics.length; i++) {\n\n // Then dynamicaly generating buttons for each band/ar...
[ "0.6717603", "0.6677603", "0.6659702", "0.6625576", "0.66171724", "0.66054535", "0.65979683", "0.656959", "0.65578717", "0.6541855", "0.6534436", "0.65256727", "0.6520571", "0.6481626", "0.64733166", "0.64656305", "0.645317", "0.6453015", "0.6440884", "0.6435264", "0.64292914...
0.7801531
0
internal user only, resolve the promise
_resolve() { deferred.resolve() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resolvePromise(response,status,headers){// normalize internal statuses to 0\nstatus=Math.max(status,0);(isSuccess(status)?deferred.resolve:deferred.reject)({data:response,status:status,headers:headersGetter(headers),config:config});}", "resolve(parentValue, args) { // args is whatever is passed in the ...
[ "0.6697641", "0.6692648", "0.6652234", "0.66333735", "0.65335435", "0.6526633", "0.6452718", "0.64430577", "0.6441308", "0.64164376", "0.6405268", "0.63880855", "0.63491565", "0.6345812", "0.63294077", "0.6279111", "0.62790716", "0.62787527", "0.6262247", "0.6253809", "0.6232...
0.69701034
0
push the args into _czc, or _cache if the script is not loaded yet
_push(...args) { this.debug(args) if (window._hmt) { window._hmt.push(...args) } else { this._cache.push(...args) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cacheInit() {\n\t// ToDo: use somehow\n}", "function mixedCache(f,vt) {\n var c = {};\n var cf = function(s,k,a,RealArgsArray,otherArgsHere) {\n var otherArgs = Array.prototype.slice.call(arguments, 4);\n var GPfn;\n \n var stringedArgs = JSON.stringify(otherArgs);\n if (stringedArgs in...
[ "0.5453876", "0.5206323", "0.51923084", "0.51543367", "0.5107753", "0.5102551", "0.5091216", "0.49859813", "0.49457538", "0.4945137", "0.49314213", "0.48857614", "0.488396", "0.48627436", "0.4857319", "0.48452702", "0.48183593", "0.4787386", "0.47838748", "0.4765115", "0.4722...
0.53002465
1
Function to convert days to other time units
function convertDays(days) { const seconds = days * 24 * 60 * 60; const minutes = days * 24 * 60; const hours = days * 24; return { seconds, minutes, hours }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toDays() {\n let days = this.days;\n let monthsPerYear = DTCalc.dpm.length;\n // roll up the time part to days.\n let seconds = DTCalc.timeToSeconds({ hours: this.hours, minutes: this.minutes, seconds: this.seconds });\n let time = DTMod.fromSeconds(seconds);\n days += tim...
[ "0.59942114", "0.59714246", "0.59103847", "0.5888418", "0.5861538", "0.58464134", "0.5817206", "0.5744892", "0.57107687", "0.56617737", "0.5649423", "0.56480026", "0.56423324", "0.5637572", "0.5630927", "0.56236804", "0.5607615", "0.5599866", "0.5594596", "0.5591509", "0.5591...
0.61835617
0
This method performs below two tasks. Remove any special characters from input text field Prepend with '0.' for decimal values entered with '.' as starting character
inputCurrencyValueChanged(event) { let textInputValue = event.target.value; // converting input string to array of characters const inputArray = Array.from(textInputValue); // using lodash forEach method to iterate character array _.forEach(inputArray, function(value) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetupOnlyDecimal() {\n //$(\".onlydecimals\").on(\"keypress keyup blur\", function (event) {\n $(document).on('keypress keyup', '.onlydecimals', function (e) {\n e.stopImmediatePropagation();\n\n $(this).val($(this).val().replace(/[^0-9\\.]/g, ''));\n if ((event.which !== 46 || ...
[ "0.71535176", "0.71376866", "0.7102596", "0.7036358", "0.69906056", "0.6933744", "0.68004704", "0.6797305", "0.6790454", "0.6773209", "0.67110467", "0.67075485", "0.6692268", "0.6657623", "0.6646352", "0.6633725", "0.6611171", "0.6584979", "0.65793", "0.63946015", "0.637931",...
0.73939747
0
methods Initialise the tracking code and add any optional functionality
function setupTracking() { // Get the tracking code var pageTracker = _gat._getTracker(trackerCode); // Track visitor across subdomain if (settings.topLevelDomain) { pageTracker._setDomainName(settings.topLevelDomain); } // Set the sample rate - for very busy sites if (settings.sa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initTracker() {\n\t\t\t\t// initialize google ajax tracker\n\t\t\t\tif (_gaq && _gaq._createAsyncTracker) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif ($('body').hasClass('smb')) {\n\t\t\t\t\t\t\ttrackers.SMB = AL.Tracker.TRACKERS.SMB;\n\t\t\t\t\t\t\t_gaq._createAsyncTracker(GOOGLE_TRACKER_ID.SMB, trackers.SMB);\n\...
[ "0.7498728", "0.72397566", "0.6831436", "0.6690405", "0.6685884", "0.66249835", "0.65621084", "0.6546895", "0.6443815", "0.6439102", "0.6429301", "0.64223814", "0.6400211", "0.6326793", "0.6286715", "0.6270604", "0.624676", "0.621489", "0.6193963", "0.6185599", "0.6125008", ...
0.75417477
0
Preserve initial state for notyetloaded reducers Redux will toss away state for yetunknown reducers, so this creates a stub reducer to preserve data
function preserveState(reducers, initialState){ const reducerNames = Object.keys(reducers); Object.keys(initialState).forEach(item => { if (reducerNames.indexOf(item) === -1) { reducers[item] = (state = null) => state } }); return reducers; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preserveState(reducers, initialState) {\n var reducerNames = Object.keys(reducers);\n Object.keys(initialState).forEach(function (item) {\n if (reducerNames.indexOf(item) === -1) {\n reducers[item] = function () {\n var state = arguments.length > 0 && arguments[0] !== undefined ? argument...
[ "0.74057037", "0.6860172", "0.66524726", "0.6651107", "0.6639101", "0.6617584", "0.6522897", "0.64998436", "0.6450478", "0.6426072", "0.640544", "0.6404776", "0.63952005", "0.6380684", "0.6339766", "0.63113564", "0.63113564", "0.62979937", "0.6280568", "0.62467754", "0.623307...
0.75491744
0
get last sign in
getLastSignin() { return atob(Cookies.get("cLsi")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function last(input) {\n\n return input.charAt(input.length - 1);\n }", "function lastCharacter(s){return(s[s.length-1])}", "function last(input) {\n return input[input.length -1];\n}", "function last(input) {\n return input.slice(-1);\n}", "static _signY() { return this._s...
[ "0.6422181", "0.60994273", "0.6071975", "0.60234463", "0.6016787", "0.59849364", "0.5982186", "0.5950556", "0.58729786", "0.58729786", "0.5789918", "0.57829547", "0.5758882", "0.57386184", "0.5736074", "0.573125", "0.5721951", "0.5713188", "0.57063395", "0.5696394", "0.568400...
0.69715875
0
make another user an admin (admin only) search for user with givn username and then make their 'admin' attribute true
function add_Admin(req, res) { User.findOne({username:req.body.username},function(err,foundUser){ if(foundUser===null){ res.send(false); } else{ foundUser.admin = true; foundUser.save(function(err) { if (err) throw err; }); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAdminUser(){\n var email = Session.getEffectiveUser().getEmail();\n if( email == 'steven@itsnotthatkind.org' || email == 'analyticsintk@gmail.com' || email == 'quentin@itsnotthatkind.org'){\n return true;\n } else {\n return false;\n }\n}", "static async allowAdmin(req, res, next) {\n ...
[ "0.6758303", "0.6631514", "0.6502508", "0.6474218", "0.64386374", "0.6345807", "0.62954664", "0.6282608", "0.6272203", "0.61990917", "0.6175353", "0.6132311", "0.60955924", "0.60284436", "0.60242116", "0.5989391", "0.598858", "0.5985783", "0.59790015", "0.5976936", "0.5954308...
0.6910471
0
add a course based on given code, and with notes array initially empty
function add_Course(req, res) { Course.findOne({code:req.body.code},function(err,foundCourse){ if(foundCourse===null){ var newCourse = new Course({ code: req.body.code, notes:[] }); newCourse.save(function(err, newCourse) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCourse(){\n\ttry{\n\t\tvar ev;\n\t\tif(editstate) {deletestate=true;deleteEventitem(ev);}\n\t\t//alert(\"start addcourse \");\n\t\tcourseDetails[\"cname\"]=document.getElementById(\"cname\").value;\n\t\t\n\t\tcourseDetails[\"croom\"]=document.getElementById(\"clnum\").value;\n\t\tif(courseDetails.lab)\...
[ "0.65109444", "0.60301816", "0.6017852", "0.60083103", "0.5951596", "0.5942263", "0.5900239", "0.5826465", "0.57787305", "0.57752997", "0.5751447", "0.5740134", "0.57081056", "0.5697579", "0.567413", "0.5633515", "0.56125504", "0.56006324", "0.56001765", "0.55866313", "0.5571...
0.69684964
0
based of the session variable for code send a course document
function current_Code(req,res){ Course.findOne({code:req.session.code}, function(err,foundCourse){ res.send(foundCourse); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function seteditCourseInfo()\n {\n document.frmUser.action = \"edit_course_info.php\";\n document.frmUser.submit();\n }", "function sendRegistrationForm(studentUsername) {\n let courses_list = [];\n for (i = 0; i < crns.length; i++) {\n courses_list.pu...
[ "0.55257684", "0.54806775", "0.5442155", "0.5412808", "0.5409003", "0.5386936", "0.5371325", "0.53502285", "0.53140885", "0.530685", "0.53015", "0.52042943", "0.5174578", "0.51548886", "0.5149087", "0.5148439", "0.5146738", "0.51411504", "0.51339555", "0.51305366", "0.5107813...
0.57743096
0
based of the session variable for username send a user document
function current_User_Doc(req,res){ User.findOne({username:req.session.name}, function(err,foundUser){ res.send(foundUser); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function spreadUser(doc) {\n console.log(\"Spread was called with \" + JSON.stringify(doc));\n this_user = doc.name;\n var el = document.getElementsByClassName(\"username\");\n for (i = 0; i < el.length; i++) {\n el[i].innerHTML = doc.name;\n }\n}", "function sendUsers(req, res){\n if (req.query.name ...
[ "0.63203", "0.6106634", "0.60835975", "0.59530354", "0.5898757", "0.58521545", "0.5736917", "0.5689852", "0.5663675", "0.5657894", "0.5611273", "0.55934525", "0.55841863", "0.5578408", "0.55611694", "0.55543643", "0.5550907", "0.5529839", "0.55152947", "0.55063546", "0.550035...
0.6964909
0
based of the session variable for title send a note document
function current_Title(req,res){ Note.findOne({title:req.session.title}, function(err,foundNote){ if(foundNote !== null){ res.send(foundNote); } else{ res.send(false); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setSessionTitle(title) {\n sessionTitle = title\n }", "function getTitle(msg) {\n sendResponse({value: curFrame.top.document.title}, msg.json.command_id);\n}", "function getTitle (){\n \n userdata.title = (document.title);\n \n}", "handler(argv) {\n notes.readNote(argv.title...
[ "0.67174804", "0.62557274", "0.62228376", "0.6193889", "0.6174687", "0.6174687", "0.6162411", "0.61086065", "0.6037179", "0.6030417", "0.60165334", "0.59989935", "0.5945669", "0.5896008", "0.58054197", "0.57829213", "0.57668006", "0.5736858", "0.5716788", "0.5712995", "0.5701...
0.7143467
0
check the database to see if a note by that title already exists and then check to see if the course is valid
function noteCheck(Title,Uploader,Code,callback){ Note.findOne({title:Title}, function(err, foundNote) { if (foundNote!==null){ if (foundNote.uploader !== Uploader){ titleError=true; } } Course.findOne({code:req.body.code},...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkNotes(note) {\n return note.title === title;\n }", "function validateNote(note) {\n if (!note.title) {\n return false;\n }\n if (!note.text) {\n return false;\n }\n return true;\n}", "function validateNote(note) {\n if (!note.title || typeof note.title !== 'str...
[ "0.6726389", "0.5923644", "0.56577206", "0.55832094", "0.5578351", "0.55211866", "0.5452566", "0.54334605", "0.5414424", "0.54142153", "0.5396161", "0.53727955", "0.5357734", "0.53474945", "0.5318945", "0.5317584", "0.5315385", "0.5309953", "0.5302546", "0.5292159", "0.527210...
0.675689
0
return all the notes in json format
function all_Notes(req, res) { Note.find({}, function(err, allNotes) { if (err) throw err; res.send(allNotes); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNotes() {\n return notes;\n}", "async getNotes () {\n return this.notes\n }", "get notes () {\n return this._notes.all\n }", "function retrieveNotes() {\n fs.readFile(\"./db/db.json\", \"utf8\", function (error, savedData) {\n if (error) {\n return cons...
[ "0.7750904", "0.7384397", "0.73518306", "0.7247076", "0.7223424", "0.72067016", "0.7205566", "0.7050052", "0.7045968", "0.70307577", "0.7001379", "0.6970279", "0.69641584", "0.6960562", "0.6920196", "0.6908847", "0.6869684", "0.68400615", "0.681363", "0.6758695", "0.67187166"...
0.7431149
1
Pairing is unreliable while scanning, so cancel discovery
if (mLocalAdapter.isDiscovering()) { mLocalAdapter.cancelDiscovery(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scan () {\n // Reset found devices\n devices = [];\n console.log('Scanning...');\n ble.startScanning();\n noneFound = setTimeout(function () {\n ble.stopScanning();\n // Check for changes\n poll();\n }, timeout);\n}", "discoverUnpaired() {\n if (this.state.discovering) {\n return ...
[ "0.642003", "0.63430876", "0.6327556", "0.62563324", "0.6124193", "0.61212957", "0.59905356", "0.5968399", "0.58584577", "0.5823343", "0.5820285", "0.5720511", "0.56952035", "0.56603205", "0.56457275", "0.56103516", "0.5602692", "0.55666924", "0.5548265", "0.5540074", "0.5490...
0.65306324
0
Project feature detector, will detect bower, cex, etc and expose their configuration
function Project(projectDir) { var $ENV = process.env.ENV || argv.env; var loadJson = function(path) { try { return JSON.parse(fs.readFileSync(path)); } catch (e) { gutil.log(gutil.colors.red('[!] bad json file ' + path)); return null; } }; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function experimental(argv, {project}) {\n\n}", "configureBuildFlags() {\n // typescript flag\n if (this.rawConfig.hasOwnProperty('typescript') && typeof this.rawConfig.typescript === 'boolean') {\n this.typescript = this.rawConfig.typescript;\n }\n\n // less flag\n if (this.rawC...
[ "0.56838995", "0.56541276", "0.5530827", "0.5481184", "0.5481184", "0.5481184", "0.5481184", "0.5481184", "0.5481184", "0.5459625", "0.53915703", "0.53663355", "0.53192997", "0.5314955", "0.52940226", "0.52940226", "0.5278495", "0.5259695", "0.52577156", "0.5229406", "0.52290...
0.7196467
0
These functions below load the weather data and save it to the city variable. There is no need to edit these functions.
function loadCity(){ var url = 'http://api.openweathermap.org/data/2.5/weather?q='+cities.value()+ '&APPID=f02124924447c73bc1d1626b1bee5f45&units=imperial';//set units=metric if you prefer Celcius loadJSON(url,setCity); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cityDataSaver(city) {}", "function updateWeather() {\n weatherData = loadJSON(weatherURL, updateHeader);\n}", "function loadCity() {\n var savedCity = localStorage.getItem(\"cities\");\n\n console.log('saved city? ', savedCity)\n if (savedCity) {\n city = JSON.parse(savedCity);\n city.revers...
[ "0.77474743", "0.7360663", "0.7236595", "0.7212006", "0.7210438", "0.7128155", "0.71191466", "0.71090966", "0.7107334", "0.707808", "0.70643556", "0.70446604", "0.70403457", "0.70349735", "0.6923245", "0.68778574", "0.6850289", "0.6825612", "0.68140435", "0.68085134", "0.6802...
0.7395258
1
check current user to see if should show link for edit page
checkCurrentUser(){ fetchGetHelper('/current_user', user => { if (user.id === this.userId) { document.getElementById('edit-button').innerHTML = `<a href="/posts/${this.id}/edit" class = "orange-text darken-4">Edit Story</a>` }else{ clearChildren('edit-button') } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IsOwnerCanEdit() {\n username = window.localStorage.getItem(\"username\");\n\n if (username === projectData.owner) {\n return (\n <div id=\"owner-links\">\n {/* <p>username = owner</p> */}\n <Link to={`/projects/${id}/edit`}>\n <p>Edit</p>\n </Link>\...
[ "0.69073766", "0.67505115", "0.6638116", "0.64777184", "0.6453377", "0.64533633", "0.6390743", "0.6365711", "0.6292903", "0.6287774", "0.62503546", "0.61756474", "0.61334604", "0.60761374", "0.6063986", "0.602149", "0.6008099", "0.60053", "0.600315", "0.5997865", "0.59946835"...
0.7125747
0
search button on post index page
function searchButtonPressed(){ event.preventDefault() var selector = document.getElementById("genre_id") var genre = selector.options[selector.selectedIndex].value fetchGetHelper(`/posts?search_string=${document.getElementById('search_string').value}&genre_id=${genre}`,postIndexCallback) return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSearch(e) {\n setQuery(e.target.value);\n setPageNumber(1);\n }", "function handleSearch(e) {\n setQuery(e.target.value);\n setPageNumber(1);\n }", "searchButtonClicked() {}", "function handleSearch() {\t\r\n\t\t\r\n\t\t$('#custom-search-button').on(\"click\", function(e) {...
[ "0.6692639", "0.664974", "0.66421205", "0.65550995", "0.64272314", "0.63665444", "0.6362897", "0.6359007", "0.6347134", "0.63215005", "0.62871414", "0.6283415", "0.62730575", "0.6272073", "0.6270295", "0.6255595", "0.62403387", "0.6227897", "0.6226549", "0.6203122", "0.618906...
0.6806696
0
if true next post if false prev post
function nextPrevPost(next_bool){ fetch(`/posts/${$('h1')[0].dataset.id}/next/?next_bool=${JSON.stringify(next_bool)}`,{ method: "GET", headers:{ contentType: 'application/json; charset=utf-8', } }).then(resp => resp.json().then(jsonPost => { const post = new Post(jsonPost) // getCommentsF...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPrevNextPost(dispatch, post, direction) {\n dispatch(setPrevNextPost(post, direction));\n }", "_isNext() {\n return this.currentPage < this.totalPage;\n }", "prev() {\n if (!this.isFirstPage()) {\n this.page.current -= 1;\n this.lastItemShown();\n this.emit(PREV_EVENT, this.pageInf...
[ "0.72596383", "0.6657044", "0.6348595", "0.6284773", "0.6255298", "0.62507707", "0.6236043", "0.62257427", "0.6177005", "0.61769366", "0.6099606", "0.60811436", "0.6055947", "0.60188806", "0.60079557", "0.6003146", "0.5982718", "0.5969811", "0.59588665", "0.59255475", "0.5912...
0.7740685
0
function to create the initial landing page with the last searched city weather
function createInitialPage() { var tableData = $('td'); inputCity = tableData[tableData.length - 1].textContent; createCityWeather(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderLastSearch() {\r\n var lastSearch = storedCities[storedCities.length - 1];\r\n \r\n if (storedCities.length === 0) {\r\n var initialURL = \"https://api.openweathermap.org/data/2.5/weather?q=sydney&units=metric&appid=21cf2c282545a0fc1251a4061d71efec\";\r\n } else {\r\n var i...
[ "0.7008683", "0.66971254", "0.66373575", "0.6598746", "0.65935385", "0.6591635", "0.6556047", "0.65295315", "0.6528791", "0.6502817", "0.64975846", "0.64530206", "0.6446243", "0.6435772", "0.6434327", "0.64188427", "0.641038", "0.63786036", "0.6378333", "0.6376254", "0.637520...
0.7471657
0
function to create the city search history table
function createSearchHistoryTbl(startRow) { // start adding row/rows from the property "startRow"th row of the table cityHistory for(var i = startRow; i < cityHistory.length; i++) { var newCity = $("<td>").text(cityHistory[i]); var newRow = $("<tr>").append(newCity); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeHistory() {\n function makeRow(text) {\n $(\"#citiesNames\").prepend(\n $(\"<h5>\").attr(\"class\", \"searchHistory\").text(text)\n );\n }\n \n for (let i = 0; i < history.length; i++) {\n makeRow(history[i]);\n }\n }", "function createSearchHist...
[ "0.7250963", "0.6553697", "0.650876", "0.64623094", "0.6450865", "0.6371617", "0.63400805", "0.630573", "0.6287055", "0.6277513", "0.6262926", "0.62145627", "0.6206909", "0.6143608", "0.6124229", "0.60971385", "0.60510224", "0.6042092", "0.6029307", "0.5967966", "0.59239537",...
0.7514145
0
check if iframe can be accessed
function _canAccessIFrame(iframe){ var html=null; try{ var doc=iframe.contentDocument || iframe.contentWindow.document; html=doc.body.innerHTML; }catch(err){/* do nothing */} return(html!==nul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inIframe () {\n try {\n return window.self !== window.top;\n }\n catch (e) {\n return true;\n }\n}", "function inIframe () {\n try {\n return window.self !== window.top;\n } catch (e) {\n return true;\n }\n}", "function inIframe() {\n try {\n return window.self !...
[ "0.78981334", "0.7895753", "0.7893561", "0.7864651", "0.77976334", "0.7044565", "0.70441943", "0.6935492", "0.6923542", "0.6889914", "0.66348416", "0.6598992", "0.6497165", "0.6464483", "0.63324875", "0.62761056", "0.61801255", "0.6163391", "0.6085042", "0.6083905", "0.607767...
0.8069081
0
returns the total height and width sum of all elements matching the selector
function sizesSum(){ if(o.advanced.updateOnSelectorChange===true){o.advanced.updateOnSelectorChange="*";} var total=0,sel=mCSB_container.find(o.advanced.updateOnSelectorChange); if(o.advanced.updateOnSelectorChange && sel.length>0){sel.each(function(){total+=$...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sizesSum() {\n if (o.advanced.updateOnSelectorChange === true) {\n o.advanced.updateOnSelectorChange = \"*\";\n }\n\n var total = 0,\n sel = mCSB_container.find(o.advanced.updateOnSelectorChange);\n\n if (o.advanced.updateOnSelectorChange && sel.length > 0) ...
[ "0.775307", "0.75041765", "0.73525226", "0.73525226", "0.73525226", "0.73525226", "0.73525226", "0.73525226", "0.73525226", "0.73525226", "0.73525226", "0.73525226", "0.73525226", "0.73525226", "0.7328905", "0.7303446", "0.7303446", "0.6409858", "0.5948974", "0.5888262", "0.5...
0.75629747
1
checks if callback function exists
function _cb(cb){ return d && o.callbacks[cb] && typeof o.callbacks[cb]==="function"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _cb(cb) {\n return d && o.callbacks[cb] && typeof o.callbacks[cb] === \"function\";\n }", "function hasCallback(args) {\n\treturn typeof args[args.length - 1] === 'function';\n}", "function _cb(cb){\n\t\t\t\t\treturn d && o.callbacks[cb] && typeof o.callbacks[cb]===\"function\";\n\t\t\t\t}...
[ "0.74151886", "0.7402509", "0.73920757", "0.7363252", "0.7363252", "0.7363252", "0.7363252", "0.7363252", "0.7363252", "0.7363252", "0.7363252", "0.7363252", "0.7363252", "0.7363252", "0.7363252", "0.73533803", "0.73533803", "0.6964982", "0.6920492", "0.65669614", "0.6528456"...
0.74204564
1
Splits the string into an array of values, transforming each value. An empty array is returned for nulls or empty strings
function splitVal(string, separator, transform) { var val, i, l; if (string === null || string.length < 1) return []; val = string.split(separator); for (i = 0, l = val.length; i < l; i = i + 1) val[i] = transform(val[i]); return val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function valuesStrToArr(str, delimiter = ', ') {\n return str.split(delimiter)\n}", "function splitVal(string, separator, transform) {\n var val, i, l;\n if (string === null || string.length < 1) return [];\n val = string.split(separator);\n for (i = 0, l = val.length; i < l; i = i +...
[ "0.7510283", "0.7396181", "0.7396181", "0.7396181", "0.7396181", "0.676444", "0.6721187", "0.67034364", "0.6644691", "0.6634963", "0.6634963", "0.6634963", "0.6634963", "0.6634963", "0.6634963", "0.6634963", "0.6634963", "0.6634963", "0.6634963", "0.6634963", "0.6634963", "...
0.73992884
1
Returns true if Hardhat is installed locally or linked from its repository, by looking for it using the node module resolution logic. If a config file is provided, we start looking for it from it. Otherwise, we use the current working directory.
function isHardhatInstalledLocallyOrLinked(configPath) { try { const resolvedPackageJson = require.resolve("hardhat/package.json", { paths: [configPath !== null && configPath !== void 0 ? configPath : process.cwd()], }); const thisPackageJson = (0, packageInfo_1.getPackageJsonPat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function alternativeIsLocalInstallation() {\n let cwd = workingDirectoryOnLoad;\n while (true) {\n const nodeModules = find_up_1.default.sync(\"node_modules\", { cwd });\n if (nodeModules === null) {\n return false;\n }\n if (__dirname.startsWith(nodeModules)) {\n ...
[ "0.62659943", "0.557363", "0.5466843", "0.5406273", "0.53166693", "0.52461046", "0.5244225", "0.5217303", "0.50700605", "0.5043922", "0.5008935", "0.50017685", "0.49717027", "0.49551952", "0.49217233", "0.4898032", "0.48748466", "0.48748466", "0.48748466", "0.48732045", "0.48...
0.7813664
0
Checks whether we're using Hardhat in development mode (that is, we're working _on_ Hardhat).
function isLocalDev() { // TODO: This may give a false positive under yarn PnP return isRunningHardhatCoreTests() || !__filename.includes("node_modules"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isDevMode() {\n const ary = ['dds', 'rbg', 'goofy', 'test', 'zcy', 'iphonework1', 'iphonework2', 'spirit']\n return ary.includes(this.user.name) || __DEV__ || this.user.name.startsWith('test')\n }", "function isDev() {\n if (process.env[\"NODE_ENV\"] === undefined) {\n return false;\n }\n\n if (proc...
[ "0.6887784", "0.68817014", "0.6695215", "0.66658247", "0.66567564", "0.6650942", "0.65892595", "0.65443313", "0.65029734", "0.6472865", "0.6333661", "0.63009804", "0.62687236", "0.62653327", "0.62553424", "0.62553424", "0.62553424", "0.62553424", "0.62553424", "0.62553424", "...
0.694698
0
A Rectangle is a simple overlay that outlines a lat/lng bounds on the map. It has a border of the given weight and color and can optionally have a semitransparent background color.
function Rectangle(bounds, opt_weight, opt_color) { this.bounds_ = bounds; this.weight_ = opt_weight || 5; this.color_ = opt_color || '#EF2C2C'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRectangle() {\n var bounds = [[document.getElementById('squareSWCoordinatesX').value, document.getElementById('squareSWCoordinatesY').value],\n [document.getElementById('squareNECoordinatesX').value, document.getElementById('squareNECoordinatesY').value]];\n\n L.rectangle(bounds,...
[ "0.62712973", "0.6111896", "0.6097183", "0.6057083", "0.5996829", "0.5973787", "0.5973787", "0.59559685", "0.59489197", "0.5929579", "0.591242", "0.5904889", "0.5903486", "0.58859277", "0.58695096", "0.5864947", "0.5864947", "0.5857784", "0.5799977", "0.5792406", "0.57789654"...
0.765136
0
continually poll the dashboard counters
function loadDashboardCounters() { return http.get('DashboardCounters', function (err, data) { dashboardCounters = data unfilteredDashboardCounters = data dashboardCounters.simpleGrainStats = unfilteredDashboardCounters.simpleGrainStats.filter( getFilter(settings) ) events.emit('dashboard-co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadDashboardCounters(){\n http.get('/DashboardCounters', function(err, data){\n dashboardCounters = data;\n events.emit('dashboard-counters', data);\n });\n}", "function getCounters(){\n console.log('getCounters()')\n $('article').each(function() {\n var fin...
[ "0.7098704", "0.64293414", "0.62299645", "0.61834556", "0.61753315", "0.6129551", "0.6129551", "0.61260086", "0.6005071", "0.5970649", "0.5940819", "0.59255517", "0.59219337", "0.59150964", "0.58860636", "0.58826786", "0.58526", "0.5836622", "0.57981515", "0.5788073", "0.5782...
0.69030356
1
=> length property console.log(name.length); //=> convert to uppercase console.log(name.toUpperCase()); //=> convert to lower case console.log(name.toLowerCase()); //=> includes method let password = 'abc123' console.log(password.includes('password')); //=> trim method removes white space from both ends console.log(nam...
function isValidPassword (password) { if (password.length >= 8 && !password.includes('password')) { return true } else { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidPassword(str){\n return str.length >8 && !str.includes('password')\n}", "function isValidPassword(password, username) {\n\treturn password.length > 8 && password.indexOf(' ') === -1 && password.indexOf(username) === -1;\n}", "function pwChecker(name, password) {\n if (password.includes(nam...
[ "0.80849534", "0.77303386", "0.77260107", "0.76873416", "0.76388735", "0.7638535", "0.75988686", "0.75932384", "0.7592807", "0.7577261", "0.75441664", "0.75381666", "0.7478238", "0.7454371", "0.74396944", "0.7432598", "0.7430057", "0.7426957", "0.74269325", "0.7424585", "0.73...
0.77638084
1
Creates an Provider base on apnsArgs.
static _createProvider(apnsArgs) { // if using certificate, then topic must be defined if (!APNS._validateAPNArgs(apnsArgs)) { throw new Parse.Error(Parse.Error.PUSH_MISCONFIGURED, 'topic is mssing for %j', apnsArgs); } let provider = new apn.Provider(apnsArgs); // Sets the topic on this pro...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function instantiateProvider() {\n\n // Return the public API.\n return({\n dummy: dummy\n });\n\n // ---\n // PUBLIC METHODS.\n // ---\n\n // Return a greeting message for the given name.\n function dummy() {\n return 'Placeholder provider method';\n }\n\...
[ "0.5854649", "0.5466509", "0.54609174", "0.5410372", "0.53675246", "0.510145", "0.5067752", "0.50448847", "0.49711627", "0.49447587", "0.49303696", "0.49303696", "0.49218374", "0.4908223", "0.48195648", "0.48195648", "0.48192334", "0.47667736", "0.47667736", "0.4742126", "0.4...
0.8426001
0
method to combine words
function Combine() { $('.words').droppable({drop: function(event, ui) { var drop = $(this), drag = $(ui.draggable); var combined = drop.text() + drag.text(); //append combined word $('.wrap').append('<div class="words">' + combined + '</div>'); //remove both of the words $(this).remove(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function combineWords(word1, word2) {\n return word1 + word2;\n}", "function combineTwoConsecutive (post, i, word_1, word_2) {\n\tif (post[i] === word_1 && post[i+1].includes(word_2)) {\n\t\tpost[i] += \" \" + post[i+1];\n\t\tpost.splice(i+1, 1); // remove following index\n\t}\n\treturn post;\n}", "function a...
[ "0.8291726", "0.69846684", "0.68787533", "0.68427753", "0.65735185", "0.6469934", "0.6416297", "0.6396322", "0.63865477", "0.6337084", "0.6315699", "0.6206536", "0.6201747", "0.6185385", "0.61720395", "0.61160064", "0.60891825", "0.6031217", "0.60265756", "0.60212", "0.601505...
0.71734774
1
Clear all video thumbnails
function clear_all_video_thumbnails( nonce ) { var confimation_result = confirm(video_thumbnails_settings_language.clear_all_confirmation); if (confimation_result){ var data = { action: 'clear_all_video_thumbnails', nonce: nonce }; document.getElementById( 'clear-all-video-thumbnails-result' ).innerHTML =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearThumbnails(callback){\n\tvar url = host + '/get?CallMacro=clearVideoThumbnails';\n\trequest(url, function(err){\n\t\tif(err){\n\t\t\tlog.error('Could not connect to programmer at', url);\n\t\t}\n\t\treturn callback();\n\t});\n}", "clearTrackVideo () {\n this.trackVideo()\n clearTimeout(this.t...
[ "0.7874806", "0.6511641", "0.649472", "0.64922935", "0.64707243", "0.6439666", "0.63950825", "0.63551646", "0.63175404", "0.6255425", "0.62409496", "0.623202", "0.6224759", "0.6209317", "0.61896825", "0.6131745", "0.61125004", "0.6111117", "0.6103553", "0.6075668", "0.6051413...
0.7040003
1
console.log(airports) console.log(routes) Graph search scenario: implement and algorithm to figure out if there's a route between Pheonix and Bankok(decide to use DFS or BFS). Example using BFS.
function bfs(start) { const visited = new Set(); const queue = [start]; while (queue.length > 0) { const airport = queue.shift(); //mutates queue const destinations = adjacencyList.get(airport); for (const destination of destinations) { if (destination ===...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "traversal(source, destination, path, feasibleRoutes, cost, conditions){\n //find the neighbours and continue traversing from that node, keep exploring\n let neighbours = this.getAdjacentVertices(source);\n if(neighbours.length >= 1){\n if(conditions.maxStop && path.length <= conditions.maxStop){\n ...
[ "0.6824196", "0.65264636", "0.65021193", "0.6482054", "0.64562684", "0.6435081", "0.6384852", "0.62318414", "0.62163305", "0.6201715", "0.61976606", "0.6191271", "0.61791295", "0.61748666", "0.61657774", "0.60857606", "0.6074699", "0.605808", "0.6033035", "0.5994198", "0.5976...
0.6526524
1