Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Returns true if distance between consecutive points are all less than some delta, false otherwise.
function isAlmostZeroLength(ps, delta = DELTA) { for (let i = 1; i < ps.length; i++) { let p1 = ps[i - 1]; let p2 = ps[i]; if (flo_vector2d_1.manhattanDistanceBetween(p1, p2) > delta) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isBefore(point, another) {\n return Point.compare(point, another) === -1;\n }", "isBefore(point, another) {\n return Point.compare(point, another) === -1;\n }", "function diffByOne(arr) {\n // let sequential = true;\n for(let i=0; i<4; i++) {\n if (arr[i]-arr[i+1] != 1) {\n // s...
[ "0.5584764", "0.5584764", "0.5549733", "0.5455611", "0.5452338", "0.5452338", "0.54193085", "0.535136", "0.53062284", "0.52997625", "0.52864504", "0.528259", "0.5276394", "0.52730656", "0.524577", "0.5242356", "0.52204096", "0.52204096", "0.51972467", "0.518794", "0.5175548",...
0.58438313
0
Receives the current params and a dictionary of params and returns the query param string.
static updateQueryParams(currentQueryParams = '', newParams) { const processedParams = ParamsHelper.parseQueryParams(currentQueryParams); const mergedParams = { ...processedParams, ...newParams, }; const entries = Object.entries(mergedParams); if (!entries.length) { return ''; } return entries.reduce((acc, [key, value], index) => { const encodedKey = window.encodeURIComponent(key); const encodedValue = window.encodeURIComponent(value); const valueString = `${encodedKey}=${encodedValue}`; return `${acc}${index > 0 ? '&' : ''}${valueString}`; }, '?'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildQueryParameterString(params) {\n\treturn Object.keys(params).map( function(key) { return key+\"=\"+encodeURIComponent(params[key]); } ).join(\"&\");\n}", "function buildQueryString(params) {\n return Object.keys(params)\n .map(key => {\n return `${key}=${params[key]}`\n ...
[ "0.75682974", "0.73415893", "0.7264538", "0.7264538", "0.7263364", "0.71986496", "0.71976113", "0.7125438", "0.711929", "0.7028516", "0.7023456", "0.7007335", "0.6992996", "0.6935391", "0.6935391", "0.6927567", "0.6923544", "0.69161445", "0.68963796", "0.6877911", "0.68555844...
0.68961143
19
A = [1] A = [2] A = [2, 3] A = [1, 2]
function solution(A) { // write your code in JavaScript (Node.js 8.9.4) if (A.length === 1) { return A[0] === 1 ? 2 : 1; } A = A.sort((a, b) => a - b); let i = 0; while (i < A.length) { if (A[i] !== i + 1) { return i + 1; } i++; } return A.length + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solution(A) {\n var set = new Set(),\n arrayLength = A.length;\n for (var i =0; i < arrayLength; i++) {\n if (set.has(A[i])) {\n set.delete(A[i]);\n continue;\n }\n set.add(A[i]);\n }\n return (set.values()).next().value;\n}", "function solution(A) {\n // A = [2, 1, 1, 2, 3,...
[ "0.57948416", "0.5740844", "0.5716474", "0.5580641", "0.5573749", "0.55633795", "0.5522137", "0.54955983", "0.5460841", "0.5402694", "0.5396294", "0.5386738", "0.536927", "0.5342771", "0.5336807", "0.53357077", "0.53350246", "0.5320765", "0.53056675", "0.5290354", "0.52831966...
0.0
-1
Log de cada Fruta
function Dom(seletor) { this.element = document.querySelector(seletor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "esconder(){\n console.log(`${this._nombre} corre a ${this._velocidad}m/s y da un salto de ${this._salto}m y se esconde`)\n }", "function logitudRespuestas(){\n\t\tdatalong=[];\n\t\tfor(var _i=0;_i<longitudEncuesta.length;_i++){\n\t\t\tdatalong.push(\"\");\n\t\t}\n\t\tAlloy.Globals.respuestasUsuario=dat...
[ "0.6347968", "0.62592643", "0.6153935", "0.60775024", "0.6026047", "0.6006899", "0.5917157", "0.5885724", "0.5820361", "0.5745937", "0.57392883", "0.56878644", "0.56821615", "0.56429756", "0.5637112", "0.5635081", "0.5619604", "0.55677336", "0.5560298", "0.5560298", "0.554945...
0.0
-1
Honda acelerou 200 em 10
function imc(altura, peso) { return peso / (altura * altura); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function couleur()\n {\n\treturn 25000 * (0|pos_actuelle()/5 + 1);\n }", "function beratBadanWanita(tinggi){\r\n let ideal = (tinggi - 100) - (tinggi -100) * 0.15\r\n return `Wanita = ${ideal} Kg`; \r\n}", "function augmenter() {\n if (hauteur < 300) {\n hauteur = hauteur + 10;\n ...
[ "0.63199097", "0.6035585", "0.5979795", "0.5919712", "0.5871639", "0.5820914", "0.58107096", "0.5797754", "0.5788877", "0.57829195", "0.5756863", "0.5678423", "0.5674353", "0.56550956", "0.5646959", "0.562395", "0.56098527", "0.56070256", "0.55993307", "0.5594951", "0.5590854...
0.558912
22
synchronous version (default on CLI)
function matchGEOIDSync(options, callback) { var polyfile = resolve(options.polyfile); var pointfile = resolve(options.coordinatesfile); var polyGeoJSON = JSON.parse(fs.readFileSync(polyfile, { encoding: 'utf-8' })) var pointGeoJSON = JSON.parse(fs.readFileSync(pointfile, { encoding: 'utf-8' })); var newFile = doMatch(options,pointGeoJSON,polyGeoJSON); if (typeof callback === "function") { callback(null, newFile); } else { if (require.main == module) { //stdout console.log(JSON.stringify(newFile)) } else { //return return newFile; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function load_version_callback(filename, version) {\n $('#history-select-'+version.toString()).addClass('btn-striped');\n $('.history-select-btn').removeClass('active');\n $('#history-select-'+version.toString()).addClass('active');\n\n await load_writing(filename, version);\n $('#history-sele...
[ "0.614385", "0.6136589", "0.6134831", "0.6134398", "0.59967667", "0.5991162", "0.5991162", "0.5991162", "0.5991162", "0.59784216", "0.59418684", "0.59330857", "0.5783917", "0.5770161", "0.5713758", "0.57076526", "0.56963634", "0.56963634", "0.56963634", "0.5674736", "0.566921...
0.0
-1
async version for not blocking io (default when used as a library)
function matchGEOIDAsync(options, callback) { var polyfile = resolve(options.polyfile); var pointfile = resolve(options.coordinatesfile); fs.readFile(polyfile, { encoding: 'utf-8' }, function(err, file) { var polyGeoJSON = JSON.parse(file); fs.readFile(pointfile, { encoding: 'utf-8' }, function(err, file) { var pointGeoJSON = JSON.parse(file) var newFile = doMatch(options,pointGeoJSON,polyGeoJSON); if (!err.length) err = null; if (typeof callback === "undefined") { callback(err, newFile); } }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function async_io_normal(cb) {\n\n}", "async function fn(){ //This is the newer way of doing an async function\n return 'hello';\n}", "async function MyAsyncFn () {}", "async function asyncFn(){\n\n return 1;\n}", "async function test() {}", "async function f(){\n return something\n}", "async fu...
[ "0.81482756", "0.6809611", "0.6785625", "0.66495126", "0.6639949", "0.6356569", "0.6316795", "0.6235235", "0.6233542", "0.6232129", "0.6153512", "0.61474085", "0.6137231", "0.6137231", "0.6108803", "0.6037028", "0.5992996", "0.5992996", "0.5984419", "0.59554243", "0.59464103"...
0.0
-1
When user traverses the browser history
onHistory (event) { this.form.querySelector('input').value = event.state; this.form.submit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onHistoryChange(callback) {\n browser.runtime.onMessage.addListener(message => {\n if (message === 'hyper-gwent/history-changed') {\n callback();\n }\n });\n}", "function voltarHistory()\n\t{\n\t\twindow.history.back();\n\t}", "function BrowserHistory()\n{\n // see http...
[ "0.74079096", "0.7389471", "0.72213465", "0.69051784", "0.6809589", "0.6749059", "0.6731815", "0.6720827", "0.67161757", "0.66952145", "0.6691581", "0.666598", "0.665402", "0.66151273", "0.66030407", "0.6582217", "0.6569105", "0.65639913", "0.6555791", "0.6555498", "0.6525339...
0.63592446
35
execute graphiteapi /metrics/find query return array of metric last names ( func('test.cpu') returns ['cpu0','cpu1',..] )
function find_filter_values(query){ var search_url = window.location.protocol + '//' + window.location.hostname.replace(/^grafana/,"graphite") + (window.location.port ? ":" + window.location.port : "") + '/metrics/find/?query=' + query; var res = []; var req = new XMLHttpRequest(); req.open('GET', search_url, false); req.send(null); var obj = JSON.parse(req.responseText); for(var key in obj) { if (obj[key].hasOwnProperty("text")) { res.push(obj[key]["text"]); } } return res; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllMetrics () {\n const result = [];\n this.metrics.forEach((value, key) => {\n result.push({\n wallet: key,\n name: value.name,\n metrics: value.metrics,\n timestamp: value.timestamp\n });\n });\n\n // Return sorted result by node name\n return result.sort((...
[ "0.65955216", "0.6088871", "0.60112494", "0.6001626", "0.5608917", "0.55768204", "0.5478499", "0.54732513", "0.5458175", "0.53613883", "0.5308708", "0.53059214", "0.5274708", "0.52696663", "0.5231983", "0.52287227", "0.51579195", "0.5133157", "0.5112003", "0.5111609", "0.5102...
0.55019575
6
used to calculate aliasByNode index in panel template
function len(prefix){ return prefix.split('.').length - 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createAlias(node, name) {\n if (!node.anchor) {\n const prev = anchorNames(this);\n node.anchor =\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n !name || prev.has(name) ? findNewAnchor(name || 'a', prev) : name;\n ...
[ "0.5755308", "0.5643191", "0.5631388", "0.5628726", "0.5527372", "0.5395836", "0.53501755", "0.528938", "0.5227601", "0.521505", "0.51910424", "0.51842403", "0.51529884", "0.51529884", "0.51529884", "0.51448095", "0.5131651", "0.5121836", "0.5111292", "0.5111292", "0.5111292"...
0.0
-1
1. send deposit to smartcontract with name subscribe for smartcontrct game event
function _gameStartedCallback() { // 2. get peerIds from the smart-contract // 3. establish the connection with each peerId and subscribe for events function _getPeerRandomNumberCallback() { // save result // if all peers have provided a number: // calculate result and define the winner // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function send_contract() {\n console.log(\"Sending contract\");\n\n // get hash of contract to enable reopening later if needed\n previous_contract_hash = consumer.commitmentTx._getHash();\n previous_contract_hash = reverse_array(previous_contract_hash);\n console.log('previous_contract_hash: ');\n pri...
[ "0.6338796", "0.6174152", "0.6057741", "0.6027964", "0.6013215", "0.5977918", "0.5944917", "0.5924899", "0.58420706", "0.58114254", "0.58008087", "0.5792576", "0.57727045", "0.57699025", "0.57672447", "0.5766968", "0.57597774", "0.5755372", "0.5739491", "0.5730241", "0.571213...
0.0
-1
2. get peerIds from the smartcontract 3. establish the connection with each peerId and subscribe for events
function _getPeerRandomNumberCallback() { // save result // if all peers have provided a number: // calculate result and define the winner // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connectToPeers()\n\t{\t\n\t\t//for each peer adds the current connection to it.\n\t\tpeers.forEach(peer => {\n\t\t\t// ws://localhost:5001\n\t\t\tconst socket = new Websocket(peer);\n\n\t\t\tsocket.on('open', () => this.connectSocket(socket));\n\t\t});\n\t}", "async function setConnection(connid) //This function...
[ "0.66317827", "0.62725127", "0.61954117", "0.61917144", "0.6191026", "0.6144318", "0.61218613", "0.60786664", "0.6062244", "0.6048308", "0.60441095", "0.59841144", "0.59631765", "0.5956169", "0.5885928", "0.5863947", "0.5844432", "0.5833901", "0.58277595", "0.5789469", "0.577...
0.0
-1
Reference URLs Web ACL for getting device_index F7 help URL format
function getDevicePromise(device) { return fetch( `https://www-bd.fnal.gov/cgi-bin/acl.pl?acl=~kissel/acl/mshow.acl+${device}+/device_index` ) .then(res => res.text()) .then(text => { return text; }) .then(parseDeviceIndex); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getActionUrl(docViewId){\r\n\tif(docViewId == \"2906\" || docViewId == \"2901\" || docViewId == \"2904\") {\r\n\t\treturn \"colorlib.do\";\r\n\t} else if(docViewId == \"3501\" || docViewId == \"3502\" || docViewId == \"3511\" || docViewId == \"3509\") {\r\n\t\treturn \"colorpalette.do\";\r\n\t} else if(do...
[ "0.58099484", "0.5577386", "0.55226135", "0.5502674", "0.5477516", "0.5336274", "0.53239614", "0.5230858", "0.5151396", "0.51486623", "0.51182467", "0.51144964", "0.5060385", "0.504977", "0.5043409", "0.5038406", "0.5027026", "0.50209224", "0.5005255", "0.499571", "0.49894643...
0.49153832
24
List vue use optOrder.pagination
static optOrderPagination(){ return window.API_ROOT + 'rest/optOrder.pagination/v1'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function paginationRoomList() {\n $('#pagination-container').pagination({\n dataSource: loadedData,\n pageSize: 5,\n showPrevious: true,\n showNext: true,\n className: 'paginationjs-theme-blue',\n callback: function (data, pagination) {\n homeVue.roomList = d...
[ "0.6940945", "0.6683164", "0.6619253", "0.654658", "0.6438521", "0.6428637", "0.62610084", "0.6232341", "0.6166567", "0.6150591", "0.6146473", "0.6103501", "0.6065378", "0.6063757", "0.60519594", "0.60234815", "0.60009336", "0.59984887", "0.5996546", "0.59737384", "0.5948131"...
0.69815916
0
this.url=" v1.99 always change url to server url seems url&rest type both work in matching
function findAllUsers(){//https://developers.google.com/web/ilt/pwa/working-with-the-fetch-api return fetch(this.url).then(function(res){ if( !(res.ok) ){ throw Error(res.statusText) } return res }).then(function(response){ return response.json() }).catch(function(error){alert("error try refresh")}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_changeUrl(url) {\n this.rawUrl = url;\n }", "_changeUrl(url) {\n var self = this;\n self.endpoint = url;\n }", "get url () {\n\t\treturn this._url;\n\t}", "get url () {\n\t\treturn this._url;\n\t}", "get url () {\n\t\treturn this._url;\n\t}", "get url () {\n\t\tret...
[ "0.6631917", "0.62055516", "0.60710454", "0.60710454", "0.60710454", "0.60710454", "0.60710454", "0.60554135", "0.6050732", "0.6050732", "0.6050732", "0.6050732", "0.6034682", "0.602911", "0.60007983", "0.5996824", "0.59705675", "0.59663934", "0.5965207", "0.5964709", "0.5946...
0.0
-1
function for creating and apending the div
function generateRightChild(value = null) { const primaryWrapper = document.createElement("div"); const childElem = document.createElement("p"); primaryWrapper.classList.add(["parent"]) primaryWrapper.classList.add(['right']) childElem.classList.add(["child"]) childElem.innerText = value; primaryWrapper.appendChild(childElem) return primaryWrapper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fCreateDiv(title, counter, appendedTo) {\n this.divName = document.createElement(\"div\");\n this.divName.id = title + counter; //set id // title + \"Id_\" + counter;\n this.divName.className = title + \"Class\"; //set className\n //let divNameId = $ (\"#\" + title + \"Id_\" + counter); //g...
[ "0.7145517", "0.68820554", "0.68665564", "0.6852616", "0.6833229", "0.6792586", "0.66741574", "0.66673064", "0.6621873", "0.66083854", "0.65295583", "0.6523314", "0.65067977", "0.6501131", "0.6491733", "0.64873797", "0.6475537", "0.6453987", "0.6445544", "0.643631", "0.643454...
0.0
-1
Detecta cambios de estado
handleInput(e){ this.props.updateEjecucion(e.target.id, e.target.value) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cam() {\n snapBtn.addEventListener('click', enroll);\n // detectButton.addEventListener('click', detect);\n navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n width: 500,\n height: 500\n }\n })\n .then(st...
[ "0.6509969", "0.61600757", "0.60389954", "0.6005771", "0.59154654", "0.5908401", "0.5904824", "0.5891454", "0.5873339", "0.57808775", "0.5733185", "0.56380075", "0.56190604", "0.56162167", "0.56072295", "0.5596968", "0.55805564", "0.5560339", "0.5551428", "0.5546762", "0.5541...
0.0
-1
import UserForm from './pages/User/Form'; import UserList from './pages/User/List'; import Modal from './components/Modal/Modal';
function App() { return ( <div className="App"> <Input id="nome" initialValue="Miranda" label="Nome" /> <Selected label="Estado" list={["SP", "RJ"]} /> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n return(\n <div>\n <Navbar/>\n <Homepage/>\n <SignUp/>\n </div>\n );\n \n}", "function UtensilsMain() {\n return (\n <Fragment>\n <UtensilsForm />\n <UtensilsDisplay />\n </Fragment>\n )\n}", ...
[ "0.5526515", "0.55139977", "0.55093795", "0.54807067", "0.5452461", "0.5428294", "0.5386181", "0.5352447", "0.5284245", "0.5250582", "0.524714", "0.5201111", "0.5191092", "0.518789", "0.5177756", "0.51735866", "0.5155062", "0.51532644", "0.51447636", "0.5136124", "0.5126129",...
0.0
-1
Async getComponent is only invoked when route matches
getComponent (nextState, cb) { /* Webpack - use 'System.import' to create a split point and embed an async module loader (jsonp) when bundling */ Promise.all([ import(/* webpackChunkName: "thunk_demo" */ './containers') ]).then(([Containers]) => { const modules = require('./modules') const reducer = modules.default injectReducer(store, { key: 'thunk_demo', reducer }) /* Return getComponent */ cb(null, Containers.default) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getComponent (name) {\n let component = this.component\n\n if (component) {\n if (typeof component === 'function') {\n this.component = component = component.call(this)\n }\n \n const res = component[name]\n\n if (res) {\n if (res.async === true) {\n const factory ...
[ "0.60305166", "0.59005237", "0.5862956", "0.57398087", "0.57397795", "0.5672667", "0.55970037", "0.55970037", "0.55970037", "0.55926573", "0.5586291", "0.5513067", "0.5441422", "0.54242563", "0.54152656", "0.54056007", "0.5403759", "0.5395282", "0.53927124", "0.53902626", "0....
0.0
-1
update progressBar in real time
function updateProgressBar() { const percent = (video.currentTime / video.duration) * 100 progressBar.style.flexBasis =`${percent}%` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n }", "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((r.get...
[ "0.8248154", "0.80576843", "0.7995336", "0.7918452", "0.7884242", "0.78641546", "0.78281295", "0.77615505", "0.768671", "0.7612952", "0.7602019", "0.75803673", "0.7557348", "0.7527067", "0.7502955", "0.7415921", "0.74104244", "0.7375113", "0.73433226", "0.7330246", "0.7316584...
0.70120573
52
$log.debug(" finish disabling ...");
function vote(votID) { if ( ! VotingService.userCanVote(votID) ) { alert("user '" + ServerRequets.user() + "' can not vote\n" + "you already voted"); return ; } if ( $scope.votVal[votID] === undefined ){ alert("No option selected"); return ; } VotingService.vote(votID,$scope.votVal[votID]); drawChart(votID); disableList[votID]=true; let tmp=$scope.votVal[votID]; $scope.votVal[votID]= undefined; $scope.votVal[votID] = tmp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disable() { }", "onDisable() {}", "stop() { \r\n enabled = false;\r\n // TODO: hide PK block list\r\n }", "function disable(){\r\n\treturn;\r\n}", "disable () {\n this.hook.disable()\n }", "disable() {\n if (!this.isEnabled) return\n this.isEnabled = false\n }", "enable() { }", "dis...
[ "0.73030955", "0.70067966", "0.6919907", "0.691708", "0.6704007", "0.6628936", "0.6562697", "0.6426596", "0.6391643", "0.6376324", "0.6352046", "0.6352046", "0.6352046", "0.6352046", "0.6352046", "0.6352046", "0.6352046", "0.6352046", "0.6352046", "0.6352046", "0.6352046", ...
0.0
-1
function that gives random number between 0 and 50
function getRandomNumber() { return Math.floor(Math.random() * 50); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function random50to100() {\n return 50*Math.random() +50;\n}", "function getRandomNum() {\n let rnd;\n do {\n rnd = Math.floor(Math.random() * 100);\n } while (rnd < 50);\n return rnd;\n}", "function randomNumber() {\n return (Math.round(Math.random()*100)+1);\n }", "function getRandomInt() {\n...
[ "0.8428549", "0.8056022", "0.80477935", "0.8043537", "0.8035636", "0.8006766", "0.8001618", "0.79194033", "0.79070854", "0.78818965", "0.7877813", "0.78775024", "0.7877087", "0.78747207", "0.78605616", "0.7860019", "0.78560436", "0.7817283", "0.7814316", "0.7789985", "0.77644...
0.8626772
0
makes the HTTP GET request and registers on success callback function handleStarResult
function split_data(obj) { console.log("in split data" + obj); var after_split = obj.split(', '); var new_str = ""; for (var i = 0; i < after_split.length; i++) { if (i!=after_split.length-1) { console.log("newwwwwwwww"+after_split[i]); new_str += "<a href='./SingleStar?name=" + after_split[i] + "'>"+after_split[i]+"</a>," console.log("newwwwwwwww"+new_str); } else { new_str += "<a href='./SingleStar?name=" + after_split[i] + "'>"+after_split[i] +"</a>" console.log("newwwwwwwww"+new_str); } } return new_str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleGet() {\n\t// Retrieve data here and return results in JSON/other format \n\t$.response.status = $.net.http.OK;\n\t return {\"myResult\":\" GET success\"};\n}", "function handleGet() {\n\t// Retrieve data here and return results in JSON/other format \n\t$.response.status = $.net.http.OK;\n\treturn...
[ "0.6638837", "0.66250944", "0.65336764", "0.5860007", "0.5764048", "0.5663416", "0.5602075", "0.543764", "0.54316896", "0.54264814", "0.5421915", "0.5397663", "0.53922665", "0.53812116", "0.5333779", "0.533355", "0.53313863", "0.53255725", "0.53223825", "0.53206134", "0.53080...
0.0
-1
This function is the select suggestion hanlder function. When a suggestion is selected, this function is called by the library. You can redirect to the page you want using the suggestion data.
function handleSelectSuggestion(suggestion) { // TODO: jump to the specific result page based on the selected suggestion console.log("you select " + suggestion["value"]) if (suggestion["data"]["category"] == "movie") { var url = "/project2-login-example/SingleMovie?name=" + suggestion["value"] window.location.assign(url); console.log(url) } else { var url = "/project2-login-example/SingleStar?name=" + suggestion["value"] window.location.assign(url); console.log(url) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSelectSuggestion(suggestion) {\n\t// TODO: jump to the specific result page based on the selected suggestion\n\t\n\tconsole.log(\"you select \" + suggestion[\"data\"][\"title\"])\n\tvar url = \"single-movie.html\" + \"?id=\" + suggestion[\"data\"][\"id\"]\n\tconsole.log(url)\n\twindow.location.repla...
[ "0.8009147", "0.7029312", "0.70048803", "0.69940907", "0.667224", "0.63196945", "0.6252971", "0.62527895", "0.61737025", "0.61721486", "0.61687046", "0.61464715", "0.6104428", "0.6063457", "0.6044425", "0.5980744", "0.5955029", "0.5948732", "0.59223187", "0.5856015", "0.58559...
0.7878839
1
open menu, push content aside
function openNav() { document.getElementById("menu").style.width = "250px"; document.getElementsByTagName("main")[0].style.opacity = "0.4"; if ((document.getElementById("menu").style.width = "250px")) { var btn = document.getElementById("menubutton"); btn.style.display = "none"; } else { btn.style.display = "initial"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onOpen() {\n createMenu();\n}", "function onOpen() { CUSTOM_MENU.add(); }", "function openNav() {\n\t\n\tvar html=\"\";\n\n\n\tStore.treeIterate(function(node){\n\t\thtml+='<li class=\"list-group-item node-treeview4\" data-nodeid=\"0\" style=\"color:undefined;background-color:undefined;\" data-cell=\...
[ "0.6950443", "0.69094074", "0.6844606", "0.6499936", "0.635975", "0.6319771", "0.6285399", "0.6278791", "0.62535924", "0.624203", "0.6237728", "0.62319255", "0.6230225", "0.6227238", "0.61785823", "0.6169529", "0.6155906", "0.6122632", "0.6120921", "0.6104357", "0.6102202", ...
0.0
-1
close menu, return content to original position
function closeNav() { document.getElementById("menu").style.width = "0"; document.getElementsByTagName("main")[0].style.opacity = "1"; if ((document.getElementById("menu").style.width = "0")) { var btn = document.getElementById("menubutton"); btn.style.display = "block"; } else { btn.style.display = "none"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeMenu() {\n $('#menuContainer').css('right', '-300px');\n }", "function closeMenu() {\n g_IsMenuOpen = false;\n}", "function handleMenuClose() {\n setMenuOpen(null);\n }", "function closemenu(){\n\t\t\tif ( $menu && timer ){\n\t\t\t\t$menu.children('a').removeClass( settings...
[ "0.77829224", "0.7471685", "0.73638016", "0.7216626", "0.71876645", "0.71752053", "0.71119434", "0.70530224", "0.6967221", "0.69646436", "0.6961628", "0.69590545", "0.69151723", "0.6914164", "0.6912605", "0.6851065", "0.6836046", "0.6796046", "0.6778672", "0.67439973", "0.674...
0.0
-1
get unique MAC addresses from the JSON data
async function getMacAddresses() { const set = new Set(jsonData.map(row => row.mac_address)); const addresses = Array.from(set); addresses.sort(); console.log(addresses); return addresses; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomMacAddress() {\n let res = [];\n let hexNums = [\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n 'a',\n 'b',\n 'c',\n 'd',\n 'e',\n 'f',\n ];\n for (let i = 0; i <= 6; i++) {\n let x =\n hexNums[Math.floor(Math.rando...
[ "0.58880883", "0.5471797", "0.54121065", "0.5328791", "0.52521944", "0.5131139", "0.5028818", "0.50201285", "0.50084066", "0.48483402", "0.4839869", "0.48245263", "0.479807", "0.47760737", "0.47692823", "0.4732678", "0.47248036", "0.46719238", "0.46695033", "0.466827", "0.465...
0.6968533
0
EVENT LISTENERS END FUNCTIONS START Verify the user's login status
function checkLoginStatus() { firebase.auth().onAuthStateChanged(function (user) { if (!user) { // Take the user to the login page window.location.href = 'login.html'; } else { // Validate user is auth isUserAuth(user.uid); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loginStart() {\n\n }", "function onLogin() {}", "_eventLogin() {\n console.info('Successfully logged in! Initializing wiki listeners...');\n this._readLine();\n }", "ready(){super.ready();this.addEventListener(\"ajax-response\",e=>this._loginStatus(e))}", "function loginCompleted() {\n ...
[ "0.69637537", "0.6881813", "0.6852297", "0.6757179", "0.67043513", "0.66584235", "0.6625359", "0.65562135", "0.6472495", "0.64620435", "0.64099413", "0.64050364", "0.6384981", "0.63555324", "0.63302153", "0.631614", "0.6303135", "0.6278681", "0.6275238", "0.6269816", "0.62659...
0.61853325
21
Check if user is authorized to actually use the system Was added because anyone can signup using Google auth, but if they're not on the DB they can't do anything in the system
function isUserAuth(pUserUid) { // Query the DB database.ref('users') .orderByChild('uid') .equalTo(pUserUid) .once('value') .then(function(snapshot) { if(snapshot.val()) { // User exists, save the user name and continue snapshot.forEach(function(userSnapshot){ userName = userSnapshot.val().name; $('#user-name-log-out').text(userName); }) } else { // User not authorized, tell them, then take them to the login // Modify the texts in the modal $('#modal-user-auth-title').text('The user is not authorized!'); $('#modal-user-auth-body').html('<p>Make sure to login using the provided user</p>'); // Activate the modal $('.modal').addClass('is-active'); setTimeout(function(){ window.location.href = 'login.html'; }, 5000); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAuth() {\n gapi.auth.authorize({client_id: clientId, scope: scopes, immediate: true}, handleAuthResult);\n\t\t console.log(\"woop tjekker auth\")\n }", "function checkAuth() {\r\n\t\t gapi.auth.authorize(\r\n\t\t {\r\n\t\t 'client_id': CLIENT_ID,\r\n\t\t ...
[ "0.7328786", "0.7252924", "0.71270156", "0.70794785", "0.7058277", "0.70553833", "0.7022499", "0.6982395", "0.69717634", "0.69676244", "0.69596124", "0.6948146", "0.69070536", "0.6901753", "0.6873817", "0.6867963", "0.686112", "0.68558013", "0.6855599", "0.6855599", "0.685559...
0.0
-1
Build the actual rows in the table
function createRowWithTicket(pOneTicketData, pOrder) { var tableBody = $("#table-body"); var mainRow = $("#table-body-main-row"); var newRow = $("<tr>"); newRow.attr('data-ticket-DBID', pOneTicketData.ticketID); newRow.attr('data-ticket-custDBID', pOneTicketData.custID); newRow.addClass('ticket'); var tdTicketCompleted = $("<td>"); if (pOneTicketData.deliverCompleted ) { tdTicketCompleted.text('Yes'); } else { tdTicketCompleted.text('No'); } if(pOneTicketData.deliverCompleted != true) { numTickets = numTickets + 1; document.getElementById("search-text").textContent = numTickets + " Open Tickets in All Stores"; var tdTicketNum = $("<td>"); tdTicketNum.text(pOneTicketData.fullTicketNum); newRow.append(tdTicketNum); var tdTicketLoc = $("<td>"); tdTicketLoc.text(pOneTicketData.location); newRow.append(tdTicketLoc); var tdTicketDate= $("<td>"); var sliceDate = pOneTicketData.date; tdTicketDate.text(sliceDate.slice(0, sliceDate.lastIndexOf(""))); newRow.append(tdTicketDate); var fulloneCustomerName = pOneTicketData.custName + ' ' + (pOneTicketData.custLastName); var tdCustName = $("<td>"); tdCustName.text(fulloneCustomerName); newRow.append(tdCustName); var tdEqType = $("<td>"); tdEqType.text(pOneTicketData.eqType); newRow.append(tdEqType); var tdEqBrand = $("<td>"); tdEqBrand.text(pOneTicketData.eqBrand); newRow.append(tdEqBrand); var tdEqModel = $("<td>"); tdEqModel.text(pOneTicketData.eqModel); newRow.append(tdEqModel); //newRow.append(tdTicketCompleted); var tdIssues = $("<td>"); tdIssues.text(pOneTicketData.characteristics); newRow.append(tdIssues); } // Finally, append or prepend the whole row to the tablebody if (pOrder == 'prepend') { tableBody.prepend(newRow); } else if (pOrder == 'append') { tableBody.append(newRow); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function table_Build(data) {\n tableBody.html(\"\");\n data.forEach((row) => {\n const new_row = tableBody.append(\"tr\");\n \n Object.values(row).forEach((value) => {\n let dp = new_row.append(\"td\");\n dp.text(value);\n }\n );\n });\n}", ...
[ "0.7456544", "0.7399161", "0.72648346", "0.7262976", "0.72168994", "0.70886946", "0.7074566", "0.7067041", "0.7063661", "0.70556664", "0.70229536", "0.70073605", "0.69914335", "0.6989179", "0.6948273", "0.69387436", "0.69365937", "0.6934473", "0.6932918", "0.69278014", "0.691...
0.0
-1
Delegate the row building here, to make sure other functions do only their main purpose
function createRowWithTicketReport(pOneTicketData, pOrder) { //----------------- <REPORTS> //------- USE ONLY ONE FOR A SPECIFIC 'REPORT' //------- OR NONE FOR REGULAR USAGE //Activate for when I only want to see laptops //if(pOneTicketData.eqType != "Laptop") { // return; //} //Activate for when I only want to see equipments that have been paid for //if(!pOneTicketData.paymentCompleted) { // return; //} //Activate for when I only want to see equipments paid for with Card (debit or credit) // if(pOneTicketData.paymentMethod.indexOf("Tarjeta") == -1) { // return; // } //----------------- </REPORTS> var tableBody = $("#table-body"); var mainRow = $("#table-body-main-row"); var newRow = $("<tr>"); newRow.attr('data-ticket-DBID', pOneTicketData.ticketID); newRow.attr('data-ticket-custDBID', pOneTicketData.custID); newRow.addClass('ticket'); var tdTicketCompleted = $("<td>"); if (pOneTicketData.deliverCompleted ) { tdTicketCompleted.text('Yes'); } else { tdTicketCompleted.text('No'); } if(pOneTicketData.deliverCompleted != true){ newRow.css('color', 'Red'); } numTickets = numTickets + 1; document.getElementById("search-text").textContent = numTickets + " Total Tickets in All Stores"; var tdTicketNum = $("<td>"); tdTicketNum.text(pOneTicketData.fullTicketNum); newRow.append(tdTicketNum); var tdTicketLoc = $("<td>"); tdTicketLoc.text(pOneTicketData.location); newRow.append(tdTicketLoc); var tdTicketDate= $("<td>"); var sliceDate = pOneTicketData.date; tdTicketDate.text(sliceDate.slice(0, sliceDate.lastIndexOf(""))); newRow.append(tdTicketDate); var fulloneCustomerName = pOneTicketData.custName + ' ' + (pOneTicketData.custLastName); var tdCustName = $("<td>"); tdCustName.text(fulloneCustomerName); newRow.append(tdCustName); var tdEqType = $("<td>"); tdEqType.text(pOneTicketData.eqType); newRow.append(tdEqType); var tdEqBrand = $("<td>"); tdEqBrand.text(pOneTicketData.eqBrand); newRow.append(tdEqBrand); var tdEqModel = $("<td>"); tdEqModel.text(pOneTicketData.eqModel); newRow.append(tdEqModel); //newRow.append(tdTicketCompleted); var tdIssues = $("<td>"); tdIssues.text(pOneTicketData.characteristics); newRow.append(tdIssues); //Finally, append or prepend the whole row to the tablebody if (pOrder == 'prepend') { tableBody.prepend(newRow); } else if (pOrder == 'append') { tableBody.append(newRow); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RenderRow() {}", "function _BuildRowObject(row, theObject, index, master)\n\t{\n\t\t//create the new row\n\t\tvar newRow = {};\n\t\t//set data on it\n\t\tnewRow.Index = index;\n\t\tnewRow.UltraGrid = theObject;\n\t\tnewRow.Height = 0;\n\t\tnewRow.Width = 0;\n\t\tnewRow.Columns = [];\n\t\tnewRow.Panels =...
[ "0.70382285", "0.6689422", "0.6636066", "0.65724975", "0.65695494", "0.6433372", "0.64311266", "0.642925", "0.63792044", "0.63751817", "0.636368", "0.63598967", "0.63531893", "0.6351183", "0.632472", "0.6321796", "0.63083506", "0.62892824", "0.6285277", "0.6271942", "0.624914...
0.0
-1
Search the DB for the phone number
function searchNumber() { // HTML modifications to make it look like its loading searchNumberButton.addClass('is-loading'); var phoneNumberSearch = $('#search-number-input').val().trim(); searchTicketsContainer.hide(900); reloadButton.show(); // Calling the DB database.ref('customers') .orderByChild('cellNum') .equalTo(phoneNumberSearch) .once('value') .then(function(snapshot) { if(snapshot.val()) { // Customer exists in DB // Clear table $("#table-body").empty(); snapshot.forEach(function(snapshotChild) { customerTickets = snapshotChild.val().tickets; for (var key in customerTickets) { ticketsRef .child(key) .once("value") .then(function(oneTicketSnapshot) { var oneTicketData = oneTicketSnapshot.val(); createRowWithTicketReport(oneTicketData, 'prepend'); // We use prepend to make them show from the most recent to the oldest searchText.text('Folios más recientes de ' +oneTicketData.custName+ ' ' +oneTicketData.custLastName); }) } }) } else { // If customer was not found // Modify the texts in the modal $('.modal-card-title').text('Customer not found!'); $('.modal-card-body').html('<p>Make sure you have the correct number.</p>'); // Activate the modal $('.modal').addClass('is-active'); // Reload the page setTimeout(function(){ window.location.href = 'search.html'; }, 3000); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findUserByPhone(req, phone){\n var db = req.db;\n var User = db.get('usercollection');\n User.findOne({ phone: phone }, function(err, existingUser) {\n if (existingUser) {\n console.log(\"User found by phone\");\n return existingUser;\n }\n });\n}", "function ...
[ "0.67647237", "0.651251", "0.6421574", "0.6352699", "0.62664187", "0.62336016", "0.6203229", "0.6167549", "0.6047331", "0.6005089", "0.5948833", "0.59350204", "0.5922075", "0.58844084", "0.5879027", "0.58346254", "0.58303815", "0.5809936", "0.5804249", "0.58030427", "0.578953...
0.600211
10
Search the DB for a ticket number
function searchTicket() { // HTML modifications to make it look like its loading searchTicketButton.addClass('is-loading'); var ticketNumberSearch = ($('#search-ticket-input').val().trim()).toUpperCase(); searchTicketsContainer.hide(900); reloadButton.show(); // Calling the DB ticketsRef .orderByChild('searchTicketNum') .equalTo(ticketNumberSearch) .once("value") .then(function(snapshot) { if(snapshot.val()) { // Customer exists in DB snapshot.forEach(function(snapshotChild) { ticketDBID = snapshotChild.val().ticketID; custDBID = snapshotChild.val().custID; displayTicket(ticketDBID, custDBID); }) } else { // Modify the texts in the modal $('.modal-card-title').text('Ticket not found!'); $('.modal-card-body').html('<p>Remember the numbers you should use are the 1st letter of the location followed by the ticket number, for instance "A123".</p>'); // Activate the modal $('.modal').addClass('is-active'); // Reload the page setTimeout(function(){ window.location.href = 'search.html'; }, 3000); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchNumber() {\n\n // HTML modifications to make it look like its loading\n searchNumberButton.addClass('is-loading');\n var phoneNumberSearch = $('#search-number-input').val().trim();\n searchTicketsContainer.hide(900);\n reloadButton.show();\n\n // Calling the...
[ "0.63540727", "0.63316953", "0.6005561", "0.59110504", "0.5711287", "0.5449553", "0.5416507", "0.53817195", "0.5359254", "0.5354539", "0.53492796", "0.5333577", "0.52805203", "0.5250659", "0.5242313", "0.5208552", "0.52072054", "0.5197775", "0.5184742", "0.5182802", "0.518232...
0.6685504
0
Display individually selected ticket
function displayTicket(pTicketDBID, pCustDBID) { searchTicketsContainer.hide(); // Function variables var selectedTicketData; var selectedCustID; var selectedCustData; // Hide the recent-tickets-container and change the variable recentTicketsContainer.hide(); hideRecentTicketsContainer = true; // Show the selected-ticket-container selectedTicketContainer.show(); hideSelectedTicketContainer = false; // Hide the save-note-button until there's something to save (add-note) saveNewNoteButton.hide(); // Change the menu to show "results" as active and create a link in the menu back to search $('#search-tickets-list').removeClass('is-active'); $('#search-tickets-list>a').attr('href', 'search.html') $('#results-tickets-list').addClass('is-active'); // Get the customer data from firebase customersRef .child(pCustDBID) .once("value") .then(function(sCustSnapshot) { selectedCustData = sCustSnapshot.val(); custNameSelector.val(selectedCustData.custName); custLastNameSelector.val(selectedCustData.custLastName); cellNumSelector.val(selectedCustData.cellNum); emailSelector.val(selectedCustData.email); zipCodeSelector.val(selectedCustData.zipCode); if (selectedCustData.contactMethods.whats) { contactMetWhatsSelector.prop('checked', true); } else { contactMetWhatsSelector.prop('checked', false); } if (selectedCustData.contactMethods.call) { contactMetCallSelector.prop('checked', true); } else { contactMetCallSelector.prop('checked', false); } if (selectedCustData.contactMethods.email) { contactMetEmailSelector.prop('checked', true); } else { contactMetEmailSelector.prop('checked', false); } }) // Get the ticket data from firebase ticketsRef .child(pTicketDBID) .once("value") .then(function(sTicketSnapshot) { selectedTicketData = sTicketSnapshot.val(); // Populate the selected-ticket-container with the data from the ticket locationSelector.val(selectedTicketData.location); ticketNumSelector.val(selectedTicketData.fullTicketNum); ticketCreatedBySelector.val(selectedTicketData.ticketCreatedBy); dateSelector.val(selectedTicketData.date); eqTypeSelector.val(selectedTicketData.eqType); eqBrandSelector.val(selectedTicketData.eqBrand); eqModelSelector.val(selectedTicketData.eqModel); eqSerialNumSelector.val(selectedTicketData.eqSerialNum); characteristicsSelector.val(selectedTicketData.characteristics); accesoriesSelector.val(selectedTicketData.accesories); reasonToVisitSelector.val(selectedTicketData.reasonToVisit); // Handle internalNotes data ticketInternalNotesCounter = selectedTicketData.internalNotesCounter; // Loop to create the notes for (var key in selectedTicketData.notes) { var note = selectedTicketData.notes[key]; createNotesInTicket(note); } // Ticket closing info if(selectedTicketData.paymentCompleted) { // Show the section, hide the buttons paymentSectionSelector.show(); paymentButtons.hide(); // Put the data in the fields paymentCompletedCheckboxSelector.prop('checked', true); $('#user-name-payment').val(selectedTicketData.paymentUserBy); totalPaymentSelector.val(selectedTicketData.paymentTotal); formatToMXN(); paymentMethodSelector.val(selectedTicketData.paymentMethod); paymentCompletedDateSelector.val(selectedTicketData.paymentDate); // Disable the fields paymentCompletedCheckboxSelector.prop('disabled', true); totalPaymentSelector.prop('disabled', true); paymentMethodSelector.prop('disabled', true); } if(selectedTicketData.deliverCompleted) { // Show the section, hide the buttons deliverSectionSelector.show(); deliverButtons.hide(); // Put the data in the fields deliverCompletedCheckboxSelector.prop('checked', true); $('#user-name-deliver').val(selectedTicketData.deliverUserBy); deliverCompletedDateSelector.val(selectedTicketData.deliverDate); // Disable the field deliverCompletedCheckboxSelector.prop('disabled', true); } }) // Add the 'disabled' prop to the ticket fields locationSelector.prop('disabled', true); ticketNumSelector.prop('disabled', true); dateSelector.prop('disabled', true); // Add the 'disabled' prop to customer fields cellNumSelector.prop('disabled', true); emailSelector.prop('disabled', true); custNameSelector.prop('disabled', true); custLastNameSelector.prop('disabled', true); zipCodeSelector.prop('disabled', true); contactMetWhatsSelector.prop('disabled', true); contactMetCallSelector.prop('disabled', true); contactMetEmailSelector.prop('disabled', true); // Add the 'disabled' prop to the equpment fields eqTypeSelector.prop('disabled', true); eqBrandSelector.prop('disabled', true); eqModelSelector.prop('disabled', true); eqSerialNumSelector.prop('disabled', true); characteristicsSelector.prop('disabled', true); accesoriesSelector.prop('disabled', true); reasonToVisitSelector.prop('disabled', true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectTicket(ticket_number){\n manageStoredTicket(ticket_number)\n $.post( '/tickethub', { \"ticket_number\": ticket_number, } ).done(function(response) {\n //Fade out old ticket num and fade in new\n $('#selected_ticket_number').fadeOut(\"Fast\", function (){\n $('#selected_t...
[ "0.6575859", "0.65091383", "0.63961893", "0.62731224", "0.62311673", "0.6140248", "0.590772", "0.5849597", "0.58026564", "0.5756481", "0.5755652", "0.5649305", "0.5637491", "0.560924", "0.5592042", "0.5567212", "0.5553136", "0.55500877", "0.552811", "0.5527009", "0.5520302", ...
0.62190485
5
Add individual note to tickets
function saveNewNoteInTicket() { // Confirm a radio is selected if(!($('input[name="note-type-' + ticketInternalNotesCounter + '"]:checked')[0])) { $('#error-text-note').removeClass('is-invisible'); return; } $('#error-text-note').addClass('is-invisible'); // Get the values // Remove the '-x' before we can save it to the DB var newNoteTypeWithNumber = $('input[name="note-type-' + ticketInternalNotesCounter + '"]:checked')[0].id; var newNoteType = newNoteTypeWithNumber.slice(0, newNoteTypeWithNumber.lastIndexOf('-')); var newNoteBy = userName; var newNoteDate = $('#new-ticket-date-' + ticketInternalNotesCounter).val(); var newNoteText = $('#ticket-text-' + ticketInternalNotesCounter).val(); // Confirm text is written if (!newNoteText) { $('#error-text-note').removeClass('is-invisible'); return; } $('#error-text-note').addClass('is-invisible'); // Disable the fields once validation is done $('#new-ticket-date-' + ticketInternalNotesCounter).prop('disabled', true); $('#ticket-text-' + ticketInternalNotesCounter).prop('disabled', true); for(var i=0; i < radioOptions.length; i++) { //Disable all radios $('#' + radioIDs[i]+ '-' + ticketInternalNotesCounter).prop('disabled', true); } var newNoteID = ticketsRef.child(ticketDBID + '/notes').push().key; database.ref('/tickets/' + ticketDBID + '/notes') .child(newNoteID) .set({ noteType: newNoteType, noteDate: newNoteDate, noteText: newNoteText, noteBy: newNoteBy, noteID: newNoteID, internalNotesCounter: ticketInternalNotesCounter }) .then(function() { ticketInternalNotesCounter++; // Save the internalNotesCounter on the ticket database.ref('/tickets') .child(ticketDBID) .update({ internalNotesCounter: ticketInternalNotesCounter }) }) // Reenable the button to create a new note addNewNoteButton.show(); saveNewNoteButton.hide(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addNote() {\n // formatter, to render date in polish format\n const formatter = new Intl.DateTimeFormat('pl');\n // create note object\n const note = {\n body: noteBody.value,\n img: noteImg.value,\n alt: noteAlt.value,\n date: formatter.format(new Date)\n }\n\n // cr...
[ "0.7429589", "0.7266864", "0.7180415", "0.7155777", "0.7130714", "0.7111728", "0.70551646", "0.7043447", "0.7028237", "0.7005748", "0.6987451", "0.6981851", "0.6972895", "0.6891243", "0.6868924", "0.6862991", "0.6856951", "0.68536943", "0.68466324", "0.6839357", "0.68293196",...
0.6124094
69
Used when a payment is registered
function paymentDone() { if (hidePaymentSection) { paymentSectionSelector.show(); hidePaymentSection = false; paymentCompletedDateSelector.val(moment().format("YYYY-MM-DD")); $('#user-name-payment').val(userName); } else { paymentSectionSelector.hide(); hidePaymentSection = true; $('#error-text-payment').addClass('is-invisible'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onRegistrationInitiated(event) {\n this._assignFields(event);\n this._state = this.STATES.creatingCustomer;\n }", "addPayment(data) {\r\n\t\treturn null\r\n\t}", "function postSourcing_paymentmethod(type, name){\n if (name == 'paymentmethod') {\n setDefaultAccount();\n }\n}", "addpaymentDetails(...
[ "0.6400756", "0.6350313", "0.63106006", "0.621718", "0.6120474", "0.6104013", "0.60960186", "0.6064126", "0.59780896", "0.596774", "0.5919879", "0.59069294", "0.5904283", "0.58848894", "0.5868973", "0.58476245", "0.5847057", "0.5833995", "0.58136165", "0.5812416", "0.57916915...
0.56622034
32
Used to register a payment
function savePayment() { var paymentUserBy = userName; var paymentTotal = numeral(totalPaymentSelector.val())._value; //Make the payment total a number w/o format var paymentMethod = paymentMethodSelector.val(); var paymentDate = paymentCompletedDateSelector.val(); var paymentTimestamp = firebase.database.ServerValue.TIMESTAMP; // If some data is missing, show an error if (!paymentTotal || !paymentMethod) { $('#error-text-payment').removeClass('is-invisible'); return; } $('#error-text-payment').addClass('is-invisible'); // Save the payment ticketsRef .child(ticketDBID) .update({ paymentCompleted: true, paymentUserBy: paymentUserBy, paymentTotal: paymentTotal, paymentMethod: paymentMethod, paymentDate: paymentDate, paymentTimestamp: paymentTimestamp }) .then( // Save the payment on the customer as well customersRef .child(custDBID + '/tickets/' + ticketDBID) .update({ paymentCompleted: true, paymentUserBy: paymentUserBy, paymentTotal: paymentTotal, paymentMethod: paymentMethod, paymentDate: paymentDate, paymentTimestamp: paymentTimestamp })) .then(function(){ // Show payment as made paymentButtons.hide(); paymentCompletedCheckboxSelector.prop('disabled', true); totalPaymentSelector.prop('disabled', true); paymentMethodSelector.prop('disabled', true); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPayment(name, amount, ref, that) {\n that.waitForElement('#payment_type_POSTAL_ORDER', BARATConstants.fiveSecondWaitTime);\n that.click('#payment_type_POSTAL_ORDER');\n that.waitForElement('#payer-name', BARATConstants.tenSecondWaitTime);\n that.fillField('Payer name', name);\n that.fillField('...
[ "0.6823391", "0.68198574", "0.6760362", "0.6745574", "0.6689563", "0.6663903", "0.662301", "0.6566248", "0.6515528", "0.6491541", "0.6429206", "0.6355103", "0.6355103", "0.63189065", "0.62997216", "0.6221741", "0.6206885", "0.6205566", "0.61884665", "0.61678255", "0.61571103"...
0.56160533
71
If while registering a payment, you need to go back, this function will cancel the process
function cancelPayment() { paymentSectionSelector.hide(); hidePaymentSection = true; paymentCompletedCheckboxSelector.prop('checked', false); $('#error-text-payment').addClass('is-invisible'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancel() {\n gotoReturnState();\n }", "function stopPaymentCheck() {\n if (checkpaymentres != null) clearInterval(checkpaymentres);\n }", "function cancel() {\n history.goBack();\n }", "function cancelGoBack()\n{\n\tvar gobackUrl = nlapiResolveURL('RECORD', nlapiGetFieldValue('...
[ "0.6869613", "0.6821272", "0.66229564", "0.66226465", "0.63831276", "0.6273254", "0.618115", "0.61270434", "0.6125438", "0.61237556", "0.60985535", "0.60827494", "0.6049195", "0.60206616", "0.60182244", "0.6007678", "0.59790397", "0.5977521", "0.59662837", "0.5946437", "0.594...
0.6429885
4
Show the format of the currency in MXN (Mexican Pesos)
function formatToMXN() { var currencyMXN = numeral(totalPaymentSelector.val()).format('0,0.00'); totalPaymentSelector.val(currencyMXN); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static formatCurrency(x) {\n return \"₱\" + x.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n }", "function usCurrency$Format(num) {\n return '$' + num.toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, '$1,');\n }", "function formatCurrency(num) {\n return 'PKR ' ...
[ "0.6676382", "0.6530085", "0.64628506", "0.63086313", "0.62389106", "0.62042665", "0.61269647", "0.61013466", "0.6051026", "0.6051026", "0.6050486", "0.6029364", "0.60010093", "0.5983647", "0.5966205", "0.5959571", "0.59532946", "0.5951496", "0.59051627", "0.5880864", "0.5870...
0.75047696
0
Shows the delivery as made
function deliverDone() { if (hideDeliverSection) { deliverSectionSelector.show(); hideDeliverSection = false; deliverCompletedDateSelector.val(moment().format("YYYY-MM-DD")); $('#user-name-deliver').val(userName); } else { deliverSectionSelector.hide(); hideDeliverSection = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function delivery()\n {\n\n }", "function gotoDeliveryDetails(selectedDelivery) {\n delivery(selectedDelivery);\n }", "deliver() {\n return \"Deliver by land in a box.\";\n }", "orderDelivery({ time, address, starterIndex, mainIndex }) {\n console.log(`Order p...
[ "0.6685223", "0.63630116", "0.6267943", "0.6250868", "0.6196606", "0.6109943", "0.6074695", "0.59753484", "0.57462585", "0.574464", "0.5719144", "0.5674423", "0.5640932", "0.56259507", "0.55820227", "0.5569004", "0.55311406", "0.55244225", "0.5500586", "0.5471447", "0.5460189...
0.63028634
2
Register an equipment as delivered
function saveDeliver() { var deliverDate = deliverCompletedDateSelector.val(); var deliverUserBy = userName; var deliverTimestamp = firebase.database.ServerValue.TIMESTAMP; // Save it to the ticket ticketsRef .child(ticketDBID) .update({ deliverCompleted: true, deliverUserBy: deliverUserBy, deliverDate: deliverDate, deliverTimestamp: deliverTimestamp }) .then( // Save it on the customer's info customersRef .child(custDBID + '/tickets/' + ticketDBID) .update({ deliverCompleted: true, deliverUserBy: deliverUserBy, deliverDate: deliverDate, deliverTimestamp: deliverTimestamp })) .then(function(){ // Show it as delivered deliverButtons.hide(); deliverCompletedCheckboxSelector.prop('disabled', true); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buyEquipment(equipmentID) {\n socket.emit(\"buy\", equipmentID);\n}", "function delivery()\n {\n\n }", "bus_rx(data) { this.send('bus-rx', data); }", "addM16Weapon()\n {\n this.m16Weapon.available=true;\n }", "function register(bytes32 mySystemID) {\n ...
[ "0.68154097", "0.5480083", "0.5408006", "0.53825784", "0.5295576", "0.52473575", "0.51528996", "0.51070666", "0.5103225", "0.5103225", "0.5103225", "0.5103225", "0.5103225", "0.5103225", "0.50850964", "0.50614876", "0.504327", "0.50375247", "0.5036019", "0.5033022", "0.502316...
0.0
-1
Used when you're doing an equipment delivery, but you need to cancel it
function cancelDeliver() { deliverSectionSelector.hide(); hideDeliverSection = true;deliverCompletedCheckboxSelector.prop('disabled', false); deliverCompletedCheckboxSelector.prop('checked', false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canceled() {}", "function Cancellation() { }", "cancel() {}", "function cancelOffers () {\n}", "function cancelOrder(e) {\n e.preventDefault();\n const body = {\n cancelled: true,\n picked_up: false,\n completed: true,\n };\n axios.patch(url, body, config).catch((error) => consol...
[ "0.72671676", "0.71287864", "0.70735914", "0.70156884", "0.6885734", "0.68728364", "0.686886", "0.6820499", "0.67710423", "0.67621636", "0.6725439", "0.6669778", "0.6640116", "0.6635306", "0.66171855", "0.66169333", "0.66148865", "0.6606932", "0.65982646", "0.658514", "0.6543...
0.7108261
2
Minimize Customer Data Container
function minCustData() { if (!minimizeCustData) { $('.minimize-cust-data').hide(); $('#cust-data-svg').removeClass('fa-minus-circle'); $('#cust-data-svg').addClass('fa-plus-circle'); minimizeCustData = true; } else { $('.minimize-cust-data').show(); $('#cust-data-svg').removeClass('fa-plus-circle'); $('#cust-data-svg').addClass('fa-minus-circle'); minimizeCustData = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCustomerData() {\n const newCustomer = {\n id: $.uuid(),\n name: customerNameInput.val(),\n phone: customerPhoneInput.val(),\n address: customerAddressInput.val(),\n district: customerDistrictInput.val(),\n note: {\n note: c...
[ "0.6281837", "0.60368097", "0.5962972", "0.58655244", "0.58487815", "0.58471507", "0.57705975", "0.57176846", "0.56903076", "0.5683252", "0.56815904", "0.56702566", "0.5668536", "0.56389207", "0.5635604", "0.56162715", "0.5610551", "0.56053376", "0.5592927", "0.5574378", "0.5...
0.61122835
1
Minimize Equipment Data Container
function minEquipData() { if (!minimizeEquipData) { $('.minimize-equipment-data').hide(); $('#equipment-data-svg').removeClass('fa-minus-circle'); $('#equipment-data-svg').addClass('fa-plus-circle'); minimizeEquipData = true; } else { $('.minimize-equipment-data').show(); $('#equipment-data-svg').removeClass('fa-plus-circle'); $('#equipment-data-svg').addClass('fa-minus-circle'); minimizeEquipData = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minimizeAllExpandedBlocks(){\n\tinjector = [];\n\tattachedImages = [];\n\tfilledClusters = [];\n\texpandedImages = 0;\n}", "function minimize()\n\t{\n\t\t// minimize container\n\t\tif (_container != null)\n\t\t{\n\t\t\t_container.css({\"overflow\": \"hidden\",\n\t\t\t\t\"height\": _options.minimizedHeig...
[ "0.5965052", "0.5716151", "0.5635871", "0.56253743", "0.55791605", "0.5443314", "0.5429542", "0.5390474", "0.53887653", "0.5336804", "0.53019875", "0.52255017", "0.5208887", "0.5205813", "0.51972103", "0.519098", "0.5179872", "0.51487154", "0.51442254", "0.51358944", "0.50849...
0.6984465
0
Minimize Recent Tickets Container
function minRecentTickets() { if (!minimizeRecentTickets) { $('.minimize-recent-tickets').hide(); $('#recent-tickets-svg').removeClass('fa-minus-circle'); $('#recent-tickets-svg').addClass('fa-plus-circle'); minimizeRecentTickets = true; } else { $('.minimize-recent-tickets').show(); $('#recent-tickets-svg').removeClass('fa-plus-circle'); $('#recent-tickets-svg').addClass('fa-minus-circle'); minimizeRecentTickets = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minSearchTickets() {\n if (!minimizeSearchTickets) {\n $('.minimize-search-tickets').hide();\n $('#search-tickets-svg').removeClass('fa-minus-circle');\n $('#search-tickets-svg').addClass('fa-plus-circle');\n minimizeSearchTickets = true;\n } else ...
[ "0.66748476", "0.57097995", "0.55949897", "0.5527897", "0.5481251", "0.5472974", "0.542059", "0.53400385", "0.5178124", "0.5161461", "0.5144467", "0.51200044", "0.50911766", "0.5083929", "0.5046839", "0.49964103", "0.49922696", "0.49612126", "0.49542418", "0.49542418", "0.495...
0.7363535
0
Minimize Search Tickets Container
function minSearchTickets() { if (!minimizeSearchTickets) { $('.minimize-search-tickets').hide(); $('#search-tickets-svg').removeClass('fa-minus-circle'); $('#search-tickets-svg').addClass('fa-plus-circle'); minimizeSearchTickets = true; } else { $('.minimize-search-tickets').show(); $('#search-tickets-svg').removeClass('fa-plus-circle'); $('#search-tickets-svg').addClass('fa-minus-circle'); minimizeSearchTickets = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function minRecentTickets() {\n if (!minimizeRecentTickets) {\n $('.minimize-recent-tickets').hide();\n $('#recent-tickets-svg').removeClass('fa-minus-circle');\n $('#recent-tickets-svg').addClass('fa-plus-circle');\n minimizeRecentTickets = true;\n } else ...
[ "0.6309333", "0.58146113", "0.547703", "0.54728353", "0.53636235", "0.52599686", "0.52035767", "0.5189885", "0.51652265", "0.51561964", "0.5134778", "0.513251", "0.5130162", "0.5124648", "0.5111024", "0.51080114", "0.50911254", "0.5073876", "0.506442", "0.5063531", "0.5045039...
0.7213913
0
The display name of this Member. For users this should be their profile's display name or user ID if none set. For 3PIDs this should be the 3PID address (email).
get name(): string { throw new Error("Member class not implemented"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDisplayName() {\n if (_userInformation.DisplayName != null) {\n return _userInformation.DisplayName;\n }\n return null;\n }", "function getDisplayTextOfUser() {\n if (_userInformation.DisplayName != null) {\n return _use...
[ "0.7979881", "0.76804894", "0.76246965", "0.74505407", "0.74505407", "0.74505407", "0.74505407", "0.7376556", "0.71115744", "0.70544624", "0.69809455", "0.69325495", "0.6929185", "0.68974996", "0.6884941", "0.67167294", "0.67109305", "0.6675474", "0.66659546", "0.66603583", "...
0.0
-1
The ID of this Member. For users this should be their user ID. For 3PIDs this should be the 3PID address (email).
get userId(): string { throw new Error("Member class not implemented"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMemberId() {\n\n\t\tvar memberId = '';\n\t\tif (isB2BUser()) {\n\t\t\treturn getUserInfo().svocId;\n\t\t} else if (privateMethods.isGuestUser()) {\n\t\t\t//If guest user pass the member id for guest\n\t\t\tmemberId = sessionStorage.getItem(GUEST_MEMBER_ID) || '';\n\t\t} else {\n\t\t\tmemberId = cookieU...
[ "0.7868067", "0.6710413", "0.6624349", "0.64760375", "0.6217446", "0.6153955", "0.6112033", "0.6078257", "0.60372335", "0.6006976", "0.60068256", "0.600394", "0.600394", "0.5958905", "0.58445245", "0.58445245", "0.58305556", "0.5830312", "0.5812728", "0.58020204", "0.58020204...
0.0
-1
Gets the MXC URL of this Member's avatar. For users this should be their profile's avatar MXC URL or null if none set. For 3PIDs this should always be null.
getMxcAvatarUrl(): string { throw new Error("Member class not implemented"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get sourceAvatar() {}", "getAvatarUrl() {\n const { user } = this.state;\n return endpoint + '/core/avatar/' + user.id + '/' + user.avatar;\n }", "function AvatarURL( fn )\n{\n return 'https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/' + fn.substring( 0, 2 ) + '/' + fn + '.jpg';\n...
[ "0.66600657", "0.66519487", "0.65081096", "0.63812983", "0.62216437", "0.615918", "0.60640794", "0.60640794", "0.60640794", "0.60640794", "0.60640794", "0.60640794", "0.60640794", "0.60640794", "0.60640794", "0.6044898", "0.6036946", "0.6006791", "0.5929253", "0.58025503", "0...
0.66844165
0
These next class members are for the Member interface
get name(): string { return this._displayName || this._userId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(member: Member) {\n this._member = member;\n }", "get members() {\r\n return new Members(this);\r\n }", "get members() {\n return this._members;\n }", "_$kind() {\n super._$kind();\n this._value.kind = 'member';\n }", "constructor() { \n \n Member.in...
[ "0.69724596", "0.67823046", "0.6719573", "0.63997656", "0.63462925", "0.6254887", "0.6210741", "0.6166177", "0.6127539", "0.60007644", "0.5931292", "0.58666945", "0.579405", "0.5764758", "0.57410514", "0.5712545", "0.56902575", "0.5649664", "0.55666524", "0.5565295", "0.55451...
0.0
-1
This is a getter that would be falsey on all other implementations. Until we have better type support in the reactsdk we can use this trick to determine the kind of 3PID we're dealing with, if any.
get isEmail(): boolean { return this._id.includes('@'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get aidType() : number {\n return this._bitField.getInt(38,5,true);\n }", "getThreeObject()\n {\n return this.threeObject\n }", "getID () {\n return this._player.fbID || this._player.mobileID;\n }", "get kind() {\n\t\treturn this.__kind;\n\t}", "getType() {\n return this._data...
[ "0.5221966", "0.5094579", "0.50745", "0.50688064", "0.5042613", "0.49979153", "0.49759158", "0.49674815", "0.49674815", "0.49674815", "0.49562788", "0.49480832", "0.49211836", "0.49135056", "0.49099135", "0.4891074", "0.4891074", "0.48714402", "0.48459333", "0.48459333", "0.4...
0.0
-1
These next class members are for the Member interface
get name(): string { return this._id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(member: Member) {\n this._member = member;\n }", "get members() {\r\n return new Members(this);\r\n }", "get members() {\n return this._members;\n }", "_$kind() {\n super._$kind();\n this._value.kind = 'member';\n }", "constructor() { \n \n Member.in...
[ "0.69724596", "0.67823046", "0.6719573", "0.63997656", "0.63462925", "0.6254887", "0.6210741", "0.6166177", "0.6127539", "0.60007644", "0.5931292", "0.58666945", "0.579405", "0.5764758", "0.57410514", "0.5712545", "0.56902575", "0.5649664", "0.55666524", "0.5565295", "0.55451...
0.0
-1
Callback function for resistance value
function calculateResistanceCallback() { // get inputs from the DOM var current = document.getElementById("current").value; var voltage = document.getElementById("voltage").value; // sanitize inputs current = parseFloat(current); voltage = parseFloat(voltage); // verify inputs if (isNaN(current) === true || isNaN(voltage) === true) { alert("Hommie don't do that!"); return; } // use the worker function and get th output var resistance = calculateResistance(current, voltage); //do something "usefull" -i.e., display the answer document.getElementById("outputArea").innerHTML = "resistance =" + resistance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRChanged() {\n pll.R = parseFloat( document.getElementById(\"divR\").value );\n setFpfd(pll.fref/pll.R);\n setN(pll.fout/pll.fpfd);\n\n synthPll();\n}", "_updateValue () {\n let sliderWidth = this._sliderElement.offsetWidth;\n\n // Calculate the new value\n let { minValue, maxValue } = th...
[ "0.6012058", "0.58696616", "0.5709011", "0.5679993", "0.56755006", "0.5675092", "0.5650196", "0.5640912", "0.5620977", "0.5609157", "0.55904", "0.55787057", "0.5549413", "0.5548575", "0.5511347", "0.54888296", "0.5457217", "0.5444766", "0.5443057", "0.5437636", "0.54287094", ...
0.6678638
0
Calculate current value using resistance and voltage
function calculateCurrent(resistance, voltage ) { var current = voltage / resistance; return(current); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcVoltage(val){\n\n var factor = 1.211*8.4;\n return factor * val;\n}", "function calculateCurrentCallback() {\n \n // get inputs from the DOM\n \n var voltage = document.getElementById(\"voltage1\").value;\n var resistance = document.getElementById(\"resistance\").value;\n \n ...
[ "0.69841474", "0.6524677", "0.6366255", "0.6219174", "0.6171928", "0.61710405", "0.6106439", "0.6087541", "0.59663486", "0.593661", "0.59320897", "0.579946", "0.5793211", "0.5783745", "0.57810766", "0.5773184", "0.5759157", "0.57563096", "0.57447976", "0.56622136", "0.5655726...
0.8261193
0
Callback function for current value
function calculateCurrentCallback() { // get inputs from the DOM var voltage = document.getElementById("voltage1").value; var resistance = document.getElementById("resistance").value; // sanitize inputs resistance = parseFloat(resistance); voltage = parseFloat(voltage); // verify inputs if (isNaN(resistance) === true || isNaN(voltage) === true) { alert("Invalid inputs detected"); return; } // use the worker function and get th output var current = calculateCurrent(resistance, voltage); //do something "usefull" -i.e., display the answer document.getElementById("outputArea").innerHTML = "current =" + current; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCurrentValue() {\n \n }", "function generalCallback(data) {\n lastValue = data;\n }", "function value() { }", "handler(newVal, oldVal) {\n if(!TypeChecker.isUndefined(oldVal)) {\n this.getValue();\n }\n }", "function GetCurrentVal...
[ "0.69016725", "0.68414354", "0.67531693", "0.64131", "0.6323851", "0.62865376", "0.62601", "0.6235195", "0.61953604", "0.6183441", "0.6183441", "0.6183441", "0.6183441", "0.6183441", "0.6165486", "0.60525364", "0.60484743", "0.60315007", "0.6024254", "0.59743404", "0.5955428"...
0.0
-1
Do this last. You may have a better approach, but here's one way to do it. Also edit the html for better initial settings of class active on these elements. Find elements inside 's inside elements with class tabs and process them as follows: (there are four of them) add a click listener to the element. When a click happens, add class "active" to that element, and figure out this element's parent's (the parent is an ) position among its siblings. If it is the first child, the other is its next sibling, and the other is the first child of that . Similarly in the other case. Remove class active from that other tab. Now find the related tabContent element. It's the 's grandparent's next sibling, or sibling after that. Add class active to the newly active one and remove it from the other one.
function displaySizesToppingsOnOrderForm() { console.log("displaySizesToppingsOnOrderForm"); let $sizesSpot = $("#order-sizes"); sizes.forEach(function (size) { console.log('size = ', size); let $input = $("<input type='radio' name='pizza_size' required='required'>"); $input.attr("value", size['size']); let $label = $("<label>"); $label.text(size['size']); $sizesSpot.append($input); $sizesSpot.append($label); }); let $meatsSpot = $("#meats"); let $meatlessesSpot = $("#meatlesses"); toppings.forEach(function (topping) { console.log('topping = ', topping); var $input = $("<input type='checkbox' name='pizza_topping'>"); $input.attr("value", topping['topping']); var $label = $("<label>"); $label.text(topping['topping']); if (topping['is_meat'] === '1') { $meatsSpot.append($input); $meatsSpot.append($label); } else { $meatlessesSpot.append($input); $meatlessesSpot.append($label); } }); // find the element with id order-sizes, and loop through sizes, // setting up <input> elements for radio buttons for each size // and labels for them too // Then find the spot for meat toppings, and meatless ones // and for each create an <input> element for a checkbox // and a <label> for each }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupTabs() {\n console.log(\"starting setupTabs\");\n\n // document.getElementById(\"firstSection\").classList.remove(\"active\");\n\n document.getElementById(\"secondSection\").classList.remove(\"active\");\n document.querySelectorAll(\".tabs a span \").forEach(function (element)\n {\n ...
[ "0.693505", "0.65172297", "0.6504725", "0.6457019", "0.6329277", "0.6327239", "0.62891537", "0.62880254", "0.628308", "0.6272613", "0.6269195", "0.6256875", "0.6253763", "0.62504524", "0.6246155", "0.62303674", "0.62299246", "0.6227449", "0.61978817", "0.6194191", "0.61911786...
0.0
-1
Plain modern JS: use fetch, which returns a "promise" that we can combine with other promises and wait for all to finish
function getSizes() { let promise = fetch( baseUrl + "/sizes", {method: 'GET'} ) .then(response => response.json()) // successful fetch .then(json => { console.log("back from fetch: %O", json); sizes = json; }) .catch(error => console.error('error in getSizes:', error)); return promise; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrappedFetch() {\n var wrappedPromise = {};\n\n var promise = new Promise(function (resolve, reject) {\n wrappedPromise.resolve = resolve;\n wrappedPromise.reject = reject;\n });\n\n var args = new Array(arguments.length);\n\n for (var i = 0; i < args.length; i++) {\...
[ "0.71124", "0.69439155", "0.68050635", "0.6785579", "0.6752976", "0.6727437", "0.6655986", "0.6655986", "0.66462237", "0.6619604", "0.6527627", "0.64519566", "0.64146", "0.6373585", "0.6352411", "0.63323337", "0.63280654", "0.6313359", "0.62415475", "0.6236882", "0.62331194",...
0.0
-1
JQuery/Ajax: for use with $.when: return $.ajax object
function getSizes0() { return $.ajax({ url: baseUrl + "/sizes", type: "GET", dataType: "json", // headers: {"Content-type":"application/json"}, // needed success: function (result) { console.log("We did GET to /sizes"); console.log(result); sizes = result; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createAJAXObject(ajax) {\n //We want optionPromise to resolve asynchronously so we can use results from other promises in it\n var optionPromise = Promise.resolve({});\n return {\n get: function () { return ajax('get', optionPromise) },\n post: function () { return ajax('post', optionPr...
[ "0.65503985", "0.64434093", "0.64157164", "0.6350655", "0.6331723", "0.62948465", "0.62827617", "0.62775075", "0.62635076", "0.62454927", "0.62302965", "0.62253314", "0.62035346", "0.61850584", "0.6170365", "0.61685306", "0.6106118", "0.6106118", "0.61005026", "0.6031619", "0...
0.0
-1
handles any errors and gives an alert if there is one
function handleError(errStat){ alert("this isnt working" + errStat); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function error() {\r\n\t\t\t\talert(\"error\");\r\n\t\t\t}", "function handle_error(error)\n{\n alert('Error :(');\n}", "function handleError(error) {\n if (error) {\n alert(error.message);\n }\n}", "function handleError(error) {\n if (error) {\n alert(error.message);\n }\n }", "f...
[ "0.7669386", "0.74877805", "0.73424035", "0.732216", "0.732216", "0.7310634", "0.7286162", "0.7286162", "0.72532225", "0.72505486", "0.7247617", "0.7234373", "0.7228528", "0.7228528", "0.7228528", "0.7228528", "0.7228528", "0.7228528", "0.7228528", "0.7228528", "0.7216025", ...
0.69333726
32
Synchronously set initial state, so it will be ready before first render Ignore all consequent calls
setInitialState(initialState) { Object.assign(this.state, initialState); this.setInitialState = noop; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n if (!this.initialized) {\n this.init();\n }\n }", "render() {\n if (!this.initialized) this.init();\n }", "async componentDidMount(){\n if(!this.state.initialDataLoaded){ //initialDataLoaded is used to know if the data is loaded\n const initialData = await Home.initialData(...
[ "0.6836996", "0.67756605", "0.66610456", "0.66610456", "0.6574883", "0.65184706", "0.64812887", "0.64812887", "0.63957214", "0.6313586", "0.6229044", "0.621984", "0.620375", "0.6203431", "0.6169443", "0.61592895", "0.6147863", "0.6092726", "0.6088308", "0.6070799", "0.6065711...
0.6457023
8
Add item to combobox
function comboAddItem(sComboId, itemCd, itemNm){ var comboObj = document.getElementById(sComboId); var option = document.createElement("option"); option.text = itemNm; option.value = itemCd; comboObj.add(option); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addItem(cmb_id, cmb_text, option) {\n let opt = document.createElement(\"option\");\n document.getElementById(option).options.add(opt);\n opt.text = cmb_text;\n opt.value = cmb_id;\n}", "function addBuzzwordItem() {\n\t\t $('#buzzwords').append('<option> ' + $('#addBuzzword').val() + '</opti...
[ "0.78511107", "0.69751453", "0.6919906", "0.67894655", "0.67553204", "0.6650583", "0.6389361", "0.63836765", "0.6328179", "0.6307672", "0.6301818", "0.6239999", "0.62209904", "0.61586577", "0.6155933", "0.61285275", "0.60975873", "0.6092165", "0.6055593", "0.60320026", "0.600...
0.7502236
1
Warehouse search OnKeyDown 13 or onChange
function getLocInfo(obj){ var formObj=document.form; if(obj.value != ''){ ajaxSendPost(resultLocInfo, 'reqVal', '&goWhere=aj&bcKey=searchTlLocInfo&loc_cd='+obj.value+'&type=WH', './GateServlet.gsl'); }else{ $("#wh_nm").val(""); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emitSearch(event){ if (event.which == 13) {addSearch();}}", "searchHandler( event ) {\n const IntrokeyValue = \"Enter\"; \n \n if( event.key===IntrokeyValue ) {\n this.doSearch(event.target.value.trim());\n }\n }", "salesSearch(e){\n e.preventDefault();\n var _this = e....
[ "0.78385884", "0.7670042", "0.75952476", "0.75631887", "0.7547396", "0.750447", "0.74987304", "0.7466821", "0.74116755", "0.73722494", "0.7308102", "0.72868115", "0.728543", "0.72743464", "0.72608966", "0.7260646", "0.7260572", "0.7255567", "0.72302186", "0.7219484", "0.71748...
0.0
-1
Contract search OnKeyDown 13 or onChange
function getCtrtInfo(obj, RTP_NO_ONLY){ var formObj=document.form; var ord_tp_lvl1_cd="\'P\'"; if(obj.value != ''){ ajaxSendPost(resultCtrtInfo, 'reqVal', '&goWhere=aj&bcKey=searchTlCtrtInfo&ctrt_no='+obj.value+"&ord_tp_lvl1_cd="+ord_tp_lvl1_cd, './GateServlet.gsl'); }else{ formObj.ctrt_no.value=""; formObj.ctrt_nm.value=""; formObj.rtp_no.value=""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emitSearch(event){ if (event.which == 13) {addSearch();}}", "searchHandler( event ) {\n const IntrokeyValue = \"Enter\"; \n \n if( event.key===IntrokeyValue ) {\n this.doSearch(event.target.value.trim());\n }\n }", "handleKeyPress(e){\n\n if (e.charCode===13)//enter\n this.doSe...
[ "0.81959254", "0.7927789", "0.7882274", "0.7763118", "0.774713", "0.76571625", "0.75873554", "0.75266314", "0.7521098", "0.7507833", "0.7504621", "0.74921465", "0.7472147", "0.74643433", "0.7453742", "0.74392813", "0.7394165", "0.7389451", "0.73617744", "0.7360372", "0.735065...
0.0
-1
Returns a function, that, as long as it continues to be invoked, will not be triggered. The function will be called after it stops being called for N milliseconds. If `immediate` is passed, trigger the function on the leading edge, instead of the trailing.
function debounce(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var args = arguments,\n callNow = immediate && !timeout,\n later = function () {\n timeout = null;\n if (!immediate) {\n ...
[ "0.60060585", "0.60014296", "0.59885305", "0.5964166", "0.5930951", "0.5930951", "0.59272325", "0.5921593", "0.59137064", "0.5913146", "0.59020174", "0.58909225", "0.58892715", "0.5888541", "0.58812815", "0.58789235", "0.58772385", "0.58772385", "0.58772385", "0.58772385", "0...
0.58767945
21
Initialize world and set up other objects.
function setup() { // Configure the world. w = new p$.World("canvasContainer", draw, resize); // Configure box for displaying which variables are being plotted. labels.x = box.addLabel(55, 14, { name: "X:", labelWidth: 20 }); labels.y = box.addLabel(55, 14, { name: "Y:", labelWidth: 20 }); // Configure box for displaying regression results. labels.formula = regressionBox.addLabel(120, 14, { name: "f(x)", units: "", labelWidth: 40 }); labels.formula.setPosition(0, 0); labels.r2 = regressionBox.addLabel(120, 14, { name: "R²", units: "", decPlaces: 2, labelWidth: 40 }); labels.r2.setPosition(0, 25); regressionBox.calculateDimensions(); // Configure stats labels. labels.mean = statsBox.addLabel(55, 14, { name: "x̄:", labelWidth: 25, decPlaces: 3 }); labels.variance = statsBox.addLabel(55, 14, { name: "s²:", labelWidth: 25, decPlaces: 3 }); // Add plots to data cursor. dc.add(plot, regressionPlot); // Configure z-index. plot.setZ(1); regressionPlot.setZ(2); box.setZ(3); regressionBox.setZ(4); statsBox.setZ(5); dc.setZ(6); // Add objects to world. w.add(plot, box, regressionPlot, regressionBox, statsBox, dc); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_world() {\n // scene\n WORLD.scene = new THREE.Scene();\n WORLD.scene.fog = new THREE.FogExp2(0x000000, 0.0006);\n\n init_environment();\n\n //init_landscape();\n\n init_player();\n\n init_light();\n\n // bullets config\n WORLD.bullet_material = new THREE.MeshLambertMateria...
[ "0.77496123", "0.7514321", "0.7406761", "0.73351955", "0.71071184", "0.6776994", "0.6771299", "0.6749684", "0.664847", "0.66201127", "0.6521611", "0.6511648", "0.64983064", "0.64460444", "0.6423504", "0.64108783", "0.6407924", "0.6398812", "0.6372597", "0.636762", "0.63610905...
0.0
-1
Callback function for when the input changes value. Makes sure that the value is a number and is fixed to two decimal points. If it is not a number then it sets the input to 0.
function inputChanged() { parseInput(this); getDataFromTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "inputValueDidChange() {\n let value = parseInt(this.get('inputValue'), 10);\n this.set('value', isNaN(value) ? undefined : value);\n }", "_updateValue(value) {\n const that = this,\n enteredValue = that.$.input.value,\n newValue = value.toString(that._radixNumber, that._...
[ "0.7214956", "0.68855524", "0.66942674", "0.66651565", "0.66312987", "0.65999484", "0.65787566", "0.65671766", "0.6543866", "0.64790213", "0.6476737", "0.64471596", "0.64471596", "0.6423234", "0.64021975", "0.6360578", "0.63522464", "0.6344608", "0.63430274", "0.63243234", "0...
0.0
-1
Read the new min and max values for the range of the histogram.
function histogramRangeChanged() { // Read values. var min = parseInput('#min'); var max = parseInput('#max'); // Make sure that the values are valid. if (min > max) { userRangeSet = false; toggleAlert(true, 'El valor máximo debe ser mayor al valor mínimo.'); } else if (max === min) { userRangeSet = false; toggleAlert(min !== 0 && max !== 0, 'El valor mínimo no puede ser igual al valor máximo.') } else { userRangeSet = true; userHistMin = min; userHistMax = max; toggleAlert(false, ''); } reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateMinMax() {\n min = parseInt(minValueField.value);\n max = parseInt(maxValueField.value);\n}", "function changeMaxAndMin(minRange, maxRange) {\n var minStorage = document.querySelector('#post-min-range');\n var maxStorage = document.querySelector('#post-max-range');\n if (minRange > 10) {\n ...
[ "0.69009554", "0.666402", "0.65757376", "0.65463716", "0.6479652", "0.6464248", "0.6327384", "0.6321606", "0.62955356", "0.62849224", "0.62819856", "0.6199896", "0.61543113", "0.6138023", "0.61057115", "0.607156", "0.6062427", "0.60540533", "0.6051148", "0.6045654", "0.604073...
0.78275937
0
Callback function for when rows are added/deleted. Updates the id on the row so that they are allways in ascending order without gaps.
function calculateRowIds() { $("#varTable tbody tr").each(function() { var id = $(this).find("td").first(); var i = $(this).index(); id.html(i + 1); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function incrementSortIndex(entry){\n\n var d = $.Deferred();\n\n db.transaction(function (tx) {\n\n // fetch sortIndex of the current entry\n tx.executeSql('SELECT sortIndex FROM entries WHERE id = ? ', [entry.id], function (tx, entryResults) {\n if (...
[ "0.6187113", "0.612862", "0.6123025", "0.605153", "0.5889526", "0.5851479", "0.5835769", "0.5817371", "0.57655317", "0.5758998", "0.57380855", "0.5704789", "0.5685237", "0.5671531", "0.56691813", "0.5668466", "0.56552315", "0.5628561", "0.56134325", "0.55925816", "0.55808175"...
0.53999573
31
Appends a row to the end of the table.
function addRow() { rowCount += 1; if (rowCount >= MAX_ROWS) { controls.add.enabled(false); } toggleAlert(false); $(ROW_CODE).insertAfter("#varTable tbody tr:last"); feather.replace(); calculateRowIds(); $('input.var').on('focusout', inputChanged); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRow(table) {\n var row = table.insertRow(table.rows.length);\n var cell = null;\n for (var i = 0; i < 5; i++) {\n cell = row.insertCell(i);\n if (i == 0) {\n cell.innerHTML = table.rows.length - 1;\n } else {\n cell.setAttribute(\"contenteditable\", \"true\");\n ...
[ "0.71703285", "0.6852859", "0.67439884", "0.66661507", "0.64036274", "0.63557196", "0.62949467", "0.62871563", "0.6246752", "0.6183427", "0.6161939", "0.61607224", "0.61519533", "0.61473995", "0.6139387", "0.6139317", "0.612134", "0.6119289", "0.6014357", "0.60118306", "0.599...
0.6356102
5
Removes a row from the end of the table.
function removeRow() { if (rowCount >= MAX_ROWS) { controls.add.enabled(true); } rowCount -= 1; $("#varTable tbody tr:last").remove(); calculateRowIds(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteRow(){\r\n table.removeChild(table.lastChild);\r\n rows--;\r\n}", "Remove() {\n this.Table.RemoveRow(this);\n }", "function removeRow(table, rowNum) {\n table.deleteRow(rowNum);\n}", "function removeRow() {\n $schedule.find('tbody tr').last().remove();\n ...
[ "0.73150885", "0.7127738", "0.70223606", "0.69336706", "0.6851356", "0.67926854", "0.6733261", "0.66611725", "0.6632604", "0.660193", "0.65643364", "0.6550562", "0.65214175", "0.65186447", "0.6505236", "0.64881426", "0.6466484", "0.64623445", "0.64571965", "0.6454104", "0.644...
0.69293207
4
Calculate statistical parameters from the given data.
function calculateStatistics(values) { // Mean var mean = 0; for (var i = 0; i < values.length; i++) { mean += values[i]; } mean /= values.length; // Variance var varianceP = 0; var varianceS = 0; for (var i = 0; i < values.length; i++) { varianceP += Math.pow(values[i] - mean, 2); varianceS = varianceP; } varianceP /= values.length; varianceS /= values.length - 1; // Set labels labels.mean.set(mean); labels.variance.set(varianceS); labels.mean.font.toCtx(w.ctx); var labelMeanWidth = w.ctx.measureText(labels.mean.value).width; labels.variance.font.toCtx(w.ctx); var labelVarianceWidth = w.ctx.measureText(labels.variance.value).width; labels.mean.width = labels.mean.labelWidth + labelMeanWidth; labels.variance.setPosition(labels.mean.width + 15, 0); labels.variance.width = labels.variance.labelWidth + labelVarianceWidth; statsBox.calculateDimensions(); statsBox.setPosition(20, w.height - statsBox.height - 20); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcStats(data){\n //create empty array to store all data values\n var allValues = [];\n \n //loop through each state\n for(var state of data.features){\n //loop through each year\n for(var year = 2008; year <= 2018; year+=1){\n //get acres burned for current y...
[ "0.6012559", "0.5713447", "0.565727", "0.55815935", "0.53261757", "0.5306222", "0.5294167", "0.52865297", "0.526549", "0.52631307", "0.52217513", "0.5220327", "0.5204132", "0.5159587", "0.5143767", "0.51367116", "0.51197803", "0.5114107", "0.50835556", "0.50812227", "0.507538...
0.0
-1
Reads the data from the table and stores it in the variable data.
function getDataFromTable() { /** * Given a class name for a variable it reads all of its values. * In other words, it reads all column values. Returns this as an * array. */ function readVariable(name) { // Iterate through all values. var values = [] $(name).each(function() { // Get the floating point value from the cell. If it is not a float // then take it as 0. var val = parseFloat($(this).val()); if (isNaN(val)) { val = 0; } values.push(val); }) return values; } // Read all variables defined in VAR_NAMES and store them in data. for (var i = 0; i < VAR_NAMES.length; i++) { data[i] = readVariable(VAR_NAMES[i]); } // Reset to redraw everything. reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get data() {\n\t\treturn this._tableData;\n\t}", "getData(table) {\n return this.content.data[table];\n }", "function loadData() {\n const coordsData = table.getRows();\n length = table.getRowCount();\n\n for (let i = 0; i < length; i++) {\n let name = coordsData[i].getNum(\"array#\");\n let...
[ "0.67618614", "0.6461679", "0.6444337", "0.63157594", "0.60160464", "0.58708465", "0.5854888", "0.5741082", "0.56840414", "0.5639965", "0.5620241", "0.55784696", "0.5573805", "0.5538829", "0.5529347", "0.5509283", "0.55024105", "0.5484312", "0.5479434", "0.5476462", "0.547608...
0.69858545
0
Given a class name for a variable it reads all of its values. In other words, it reads all column values. Returns this as an array.
function readVariable(name) { // Iterate through all values. var values = [] $(name).each(function() { // Get the floating point value from the cell. If it is not a float // then take it as 0. var val = parseFloat($(this).val()); if (isNaN(val)) { val = 0; } values.push(val); }) return values; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDataFromTable() {\n\n /**\n * Given a class name for a variable it reads all of its values.\n * In other words, it reads all column values. Returns this as an\n * array.\n */\n function readVariable(name) {\n\n // Iterate through all values.\n var values = []\n $(name).each(function(...
[ "0.6881522", "0.5639106", "0.5581779", "0.5577705", "0.5421481", "0.5359836", "0.5183087", "0.51379603", "0.5120496", "0.50987685", "0.50842565", "0.50842565", "0.50666815", "0.50485814", "0.5015956", "0.49628726", "0.49628672", "0.49611223", "0.49565077", "0.49311122", "0.49...
0.6352872
1
Set the initial state of all variables.
function reset() { // Toggle regression display. regressionBox.display = mode !== "histogram" && regressionType !== "0"; regressionPlot.display = regressionBox.display; // Update box labels for displaying the currently selected variables. labels.x.set(limitTextLength(varLabels[xVariable], 10)); if (mode == "histogram") { labels.y.set("-"); } else { labels.y.set(limitTextLength(varLabels[yVariable], 10)); } // Calculate statistics. calculateStatistics(data[statsVariable]); // Calculate the width of the labels in pixels. labels.x.font.toCtx(w.ctx); var labelXWidth = w.ctx.measureText(labels.x.value).width; labels.y.font.toCtx(w.ctx); var labelYWidth = w.ctx.measureText(labels.y.value).width; // Position labels and resize box. labels.y.setPosition(labels.x.labelWidth + labelXWidth + 15, 0); labels.y.width = labels.y.labelWidth + labelYWidth; box.calculateDimensions(); if (w.width < 450 && regressionBox.display) { box.setPosition(20, 40 + regressionBox.height); } else { box.setPosition(w.width - 20 - box.width, 20); } // In order to scale the axis for fitting the data correctly, // the dimensions of the data must be calculated. These variables // store the min/max values in both axes. var xMax = -Infinity; var xMin = Infinity; var yMin = 0; var yMax = 0; // Current x and y values. var x = 0; var y = 0; /** * Takes a point and recalculates the min/max in both axes. */ function calcDimensions(x, y) { if (x > xMax) { xMax = x; } if (x < xMin) { xMin = x; } if (y > yMax) { yMax = y; } if (y < yMin) { yMin = y; } } // Reset the plot. plot.clear(); plot.style = "line"; if (mode == "scatter") { // Iterate through all points in the selected variables and put markers. var zip = []; for (var row = 0; row < rowCount; row++) { x = data[xVariable][row]; y = data[yVariable][row]; zip.push([x, y]); calcDimensions(x, y); plot.addMarker(x, y, { 'color': p$.COLORS.BLUE } ); } calculateRegression(zip, xMin, xMax); } else if (mode == "line") { // Iterate through all points in the selected variables, put markers and connect the markers by lines. var zip = []; for (var row = 0; row < rowCount; row++) { x = data[xVariable][row]; y = data[yVariable][row]; zip.push([x, y]); calcDimensions(x, y); plot.addMarker(x, y, { 'color': p$.COLORS.BLUE }); plot.addPoint(x, y); } calculateRegression(zip, xMin, xMax); } else if (mode == "histogram") { plot.style = "histogram"; // Get the data from the selected variable and sort it in ascending order. var sorted = []; for (var row = 0; row < rowCount; row++) sorted.push(data[xVariable][row]); sorted.sort(function(a, b){return a - b}); // Since the data is sorted, we already know the minimum and maximum values in the -x axis. // Also take into account the values set by the user. xMax = userRangeSet ? userHistMax : sorted[sorted.length - 1]; xMin = userRangeSet ? userHistMin : sorted[0]; yMin = 0; yMax = 0; // Calculate the bin with based on the range of the data. var range = xMax - xMin; var binWidth = range / controls.bins.value; // Iterate through all bins and count how many items fit on that bin. for (var i = 0; i < controls.bins.value; i++) { var amount = 0; // Count of values on the bin. // Stores the min and max values for the bin. If the value fits within this range then // increate the count. var min = xMin + i * binWidth; var max = xMin + (i + 1) * binWidth; // Iterate through all values. for (var j = 0; j < sorted.length; j++) { // Check if the value fits within the current bin, if so increase count. // Important is that the comparisson is min <= x < max. if (sorted[j] >= min && sorted[j] < max) { amount += 1; } } // Increase the y-max based on the current amount. if (amount > yMax) yMax = amount; // Add the bin to the plot. The bin is centered and the with of the bin is later calculated. plot.addPoint( xMin + i * binWidth + binWidth / 2, amount ); } // Match the width of the min label to the bin label. Since they are in separate tables // they do not initially match. $('#min-label').width($('#bins-label').width()); // Set min and max inputs. $('#min').val(xMin.toFixed(2)); $('#max').val(xMax.toFixed(2)); } // Fit the axes to the data with a margin of 110%. w.fit(xMin, xMax, yMin, yMax, 1.1); // Once the data is fitted the bin-width can be scaled. // Subtract 2 to leave a 2px gap between bins. if (mode == "histogram") { plot.binWidth = binWidth * w.scaleX.toPx - BIN_GAP; if (plot.binWidth < 0) { plot.binWidth = 1; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setInitialValues() {\n // you can decide on some initial values\n}", "function setInitials() {\n counter = 0;\n time = 0;\n}", "setInitialState(initialState) {\n\t\tObject.assign(this.state, initialState);\n\t\tthis.setInitialState = noop;\n\t}", "static resetInitialState () {\n if (!D...
[ "0.7129146", "0.6781776", "0.6700809", "0.65730745", "0.65490186", "0.65356123", "0.65340966", "0.64964825", "0.64857566", "0.6434991", "0.6416463", "0.6376007", "0.6352521", "0.6309002", "0.63005394", "0.6297804", "0.6291837", "0.62806624", "0.6272244", "0.62633353", "0.6262...
0.0
-1
Takes a point and recalculates the min/max in both axes.
function calcDimensions(x, y) { if (x > xMax) { xMax = x; } if (x < xMin) { xMin = x; } if (y > yMax) { yMax = y; } if (y < yMin) { yMin = y; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scaleBackPoint(point) {\n let newPoint = point.map((vs, i)=>{\n let v = this.rangeD[i]*vs + this.minD[i];\n return v;\n });\n return newPoint;\n }", "function getMinMaxs(points) {\n var xs = points.map(function (point) {\n return point[0];\n });\n var y...
[ "0.65989614", "0.6263733", "0.62230545", "0.61675143", "0.6124662", "0.6066328", "0.6059265", "0.6020057", "0.60027575", "0.60027575", "0.5960295", "0.5957013", "0.5926041", "0.5910912", "0.5903688", "0.5876803", "0.5870336", "0.5869339", "0.5861375", "0.5857125", "0.58511746...
0.5951487
12
Function gets called 60x per second.
function draw() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run() {\n update();\n setInterval(update, 3600000);\n}", "function updateEveryMinute() {\n var interval = setInterval(update, 1000 * 60)\n}", "function refreshGamesEachSec() {\n setInterval(refreshGameStatus, 1000);\n}", "function updateTimeEveryMinute() {\n time.increment();\n flipC...
[ "0.6917776", "0.6907683", "0.68004435", "0.670226", "0.668375", "0.66063946", "0.65821505", "0.6541531", "0.6475365", "0.6465797", "0.64090466", "0.6408517", "0.63829565", "0.63828707", "0.63641506", "0.63557345", "0.63540226", "0.63315696", "0.633097", "0.63293356", "0.63193...
0.0
-1
Every time the window gets resized this functions gets called.
function resize() { w.axis.setPosition(w.width / 2, w.height / 2); if (w.width < 350) { $('#filename').addClass('d-none'); } else { $('#filename').removeClass('d-none'); } regressionBox.setPosition(20, 20); reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onWindowResize() {\n updateSizes();\n }", "function onWindowResize() {\n\n\t\t\t}", "onWindowResize() {\n\t\tthis.windowHeight = this.getWindowHeight();\n\t\tthis.updatePosition();\n\t}", "onResize () {}", "function windowResized() {\n resize();\n redraw();\n}", "function onResize() {\...
[ "0.84978", "0.83871025", "0.81394815", "0.8131555", "0.80468446", "0.79627955", "0.7941792", "0.79020077", "0.7891577", "0.78590846", "0.78144956", "0.77540755", "0.7700704", "0.7686493", "0.7686055", "0.7680219", "0.7670703", "0.7615551", "0.7610898", "0.75661", "0.75445926"...
0.0
-1
default is 10 Image
function pictureShortcode(src, alt, css, sizes = "100vw", loading = "lazy", decoding = "async", fetchpriority = "auto") { let url = `./src/assets/images/${src}`; let options = { widths: [420, 770, 1280], formats: ["webp", "jpeg"], //formats: ["svg", "avif", "webp", "jpeg"], urlPath: "/img/opt/", outputDir: "./_site/img/opt/", }; Image(url, options); let imageAttributes = { alt, class: css, sizes, loading, decoding, fetchpriority }; let metadata = Image.statsSync(url, options); return Image.generateHTML(metadata, imageAttributes, { whitespaceMode: "inline", }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genImg(imgNum){\n // add alt image\n}", "static get tag(){return\"full-width-image\"}", "get image() {\n if (this.quantity < 3) {\n return 'sparse_wheat'\n } else {\n return 'wheat'\n }\n }", "function imgCounter(counter) {\n var imgType;\n\n if (counter == 1 || co...
[ "0.63846725", "0.63652873", "0.6308245", "0.6263998", "0.6259607", "0.6257517", "0.62291545", "0.622282", "0.6184371", "0.6177404", "0.61604905", "0.6160483", "0.61494946", "0.61369115", "0.6136444", "0.6055497", "0.6052316", "0.60464907", "0.60261244", "0.60255843", "0.60139...
0.0
-1
Funciones controladoras para componentes ======================================================================
function logo_click() { if (pasos.paso1.aseguradoraSeleccionada != null && pasos.paso1.aseguradoraSeleccionada.id == pasos.paso1.listaAseguradoras[$(this).index()].id) { componentes.progreso.porcentaje = 0; componentes.progreso.barra.css({width: '0px'}); pasos.paso1.aseguradoraSeleccionada = null; $(this).removeClass("seleccionada"); componentes.pasos.paso1.numero_siniestro.prop('readonly', true); } else { if (pasos.paso1.aseguradoraSeleccionada == null) { componentes.progreso.porcentaje = 5; componentes.progreso.barra.css({width: '5%'}); } pasos.paso1.aseguradoraSeleccionada = pasos.paso1.listaAseguradoras[$(this).index()]; $.get('http://localhost:8080/ReForms_Provider/wr/perito/buscarPeritoPorAseguradora/' + pasos.paso1.aseguradoraSeleccionada.id, respuesta_buscarPeritoPorAseguradora, 'json'); $(this).siblings(".seleccionada").removeClass("seleccionada"); $(this).addClass("seleccionada"); componentes.pasos.paso1.numero_siniestro.prop('readonly', false); } componentes.pasos.paso1.numero_siniestro.val('').focus(); componentes.pasos.paso1.numero_siniestro.keyup(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PratoDoDiaComponent() {\n }", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "function comportement (){\n\t }", "constructor() {\n // class (etiqueta html) (web-component)\n // Instanciar a la clase\n // Clase esta lista\n ...
[ "0.71984977", "0.6573375", "0.6573375", "0.6573375", "0.6573375", "0.646796", "0.61876065", "0.6167034", "0.6140529", "0.5978075", "0.5952733", "0.5910761", "0.5890741", "0.57949895", "0.57778406", "0.5768973", "0.57595146", "0.5750568", "0.5724937", "0.5724937", "0.5720291",...
0.0
-1
Funciones para cargar paginas y controlar respuestas del proveedor ======================================================================
function cargar_siniestro(responseTxt, statusTxt) { if (statusTxt != 'success') { alerta('Error 404', 'no se pudo cargar siniestro.html'); sessionStorage.removeItem('siniestro'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getPages(cb){\n this.api(this.pagesEndPoint).then((response)=>{\n this.getPosts(response, cb)\n });\n return true;\n }", "function fetchPaginated(qp, onResponse, onComplete, page, allResults) {\n page = page || 0;\n allResults = allResults || [];\n let _offset = page * WRAPP...
[ "0.6389756", "0.63438064", "0.62293184", "0.6200728", "0.6096826", "0.6078927", "0.6077282", "0.6077282", "0.596602", "0.59625703", "0.59327114", "0.5923082", "0.5909103", "0.58881235", "0.58843637", "0.5883668", "0.5875412", "0.586725", "0.586412", "0.58515203", "0.5851091",...
0.0
-1
Parse Table String into data table
parseTableString(tableString) { // split by line breaks. skip empty lines let lines = tableString .split(/\n/) .filter(value => (value.match(/\|/g) || []).length > 1) .map(value => value.trim().replace(/^\|/, "").replace(/\|$/, "").trim()); if (lines.length != 0) { // first row == header lines[0].split(/\|/).forEach(value => this._header.push(value.trim())); } lines.slice(1).map((row) => { // split again let object = {}; row.split(/\|/).map(((value, index) => { // parse each field as yaml string object[this._header[index]] = js_yaml_1.safeLoad(value); })); this._rows.push(object); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static parse(s) {\n const SPLIT_TOKEN = '--TableMeta--';\n const ELEMENT_TOKEN = '--TMElement--';\n\n if (!s) {\n return null;\n }\n var sAry = s.split(SPLIT_TOKEN, 7);\n let retval = new TableMeta();\n if (sAry.length === 7) {\n try {\n ...
[ "0.6140524", "0.5783122", "0.5696584", "0.5659953", "0.56517345", "0.5604652", "0.5590384", "0.5585953", "0.5557293", "0.5478289", "0.546958", "0.53857696", "0.53490365", "0.5325244", "0.5319351", "0.53178", "0.53157747", "0.52893746", "0.5270349", "0.52633965", "0.5237075", ...
0.7614134
0
PLAYER // //////////// Constructor
function Player() { // Player location and size this.x = 200; this.lastX = this.x; this.y = 200; this.d = new Date(); // Player state this.alive = true; this.health = 10; this.what = "Player"; this.id = 1; // Player image this.img = new Image(); this.img.src = "images/ship.png"; this.w = this.img.w; this.h = this.img.h; this.loaded = false; thatPlayer = this; this.img.onload = function() { thatPlayer.loaded = true; thatPlayer.w = thatPlayer.img.width; thatPlayer.h = thatPlayer.img.height; console.log("Player ship has been loaded."); } // Player velocity this.v = {x: 0, y: 0}; // Player thrust this.thrust = 5; // Weapons this.weapons = []; // Player bullets this.bullets = []; this.bulletSrc = "images/bullet.png" this.lastBulletTime = this.d.getTime(); this.bulletDelay = 100; this.currentBulletId = 0; //// NOTE: velocity and thrust are seperate, so movement can be //// quickly converted to momentum based if I decide to //// switch it in the future. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Player() {}", "constructor(player) {\n this.player = player;\n }", "constructor(player){\n this.player = player;\n }", "function Player() { }", "constructor(name, type){\n super(name,type)\n // en el scope del constructor \n // invocamos con super el name y el \n ...
[ "0.8394156", "0.8362489", "0.82849556", "0.8284912", "0.7794378", "0.7745337", "0.77248085", "0.76724637", "0.76312816", "0.7564528", "0.75233245", "0.75233245", "0.7497612", "0.74796575", "0.7451498", "0.7442736", "0.7410608", "0.74009913", "0.7398468", "0.7366413", "0.73650...
0.69238836
60
Se especifica que este comando recibe argumentos
execute(message, args) { //Parte donde se realiza la lógica y operaciones sobre cada argumento if (args[0] === 'foo') { return message.channel.send('bar'); } message.channel.send(`Arguments: ${args}\nArguments length: ${args.length}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getArgs() {return this.msg, this.command;}", "function args() {\n\n}", "procCmdLine() {\n this.command = process.argv[2];\n this.cmdArgs = process.argv.slice(3);\n\n return true;\n }", "function saludarArgumentos(referencia){\n console.log(arguments);\n}", "args(command) {\n let reply =...
[ "0.64417684", "0.6249967", "0.616966", "0.61541957", "0.6085986", "0.60247594", "0.5935319", "0.59136313", "0.5905266", "0.5856554", "0.58439887", "0.5838742", "0.5831516", "0.5809146", "0.5803615", "0.57862854", "0.57666105", "0.57578963", "0.57516176", "0.5703036", "0.56871...
0.6080148
5
Creates a WebGL context and initializes it with some common default state.
function createWebGLContext(glAttribs) { glAttribs = glAttribs || { alpha: false }; let webglCanvas = document.getElementById("xr-canvas"); let contextTypes = glAttribs.webgl2 ? ["webgl2"] : ["webgl", "experimental-webgl"]; let context = null; for (let contextType of contextTypes) { context = webglCanvas.getContext(contextType, glAttribs); if (context) { break; } } if (!context) { let webglType = glAttribs.webgl2 ? "WebGL 2" : "WebGL"; console.error("This browser does not support " + webglType + "."); return null; } return context; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_initWebGL() {\n\n // Default context attribute values\n\n if (!this.gl) {\n for (let i = 0; !this.gl && i < WEBGL_CONTEXT_NAMES.length; i++) {\n try {\n this.gl = this.canvas.getContext(WEBGL_CONTEXT_NAMES[i], this.contextAttr);\n } catch (...
[ "0.79313076", "0.78890985", "0.7348214", "0.7284111", "0.72655207", "0.722214", "0.7170442", "0.71511", "0.7147995", "0.71260273", "0.7099315", "0.7098219", "0.70788556", "0.70684063", "0.7031053", "0.70080745", "0.70029867", "0.69846106", "0.6965722", "0.69651467", "0.695987...
0.66133124
49
undefined means no restrictions
constructor(cases, transformations) { this.cases = cases; this.transformations = transformations; if (cases === undefined) { Support_1.assert(transformations.size === 0, "We can't have an unrestricted string that also allows transformations"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnUndefined() {}", "function allowAny() { }", "function verifUndefined(){\n if($scope.adress===undefined){\n $scope.adress=\"\";\n }\n if($scope.codeP===undefined){\n $scope.codeP=\"\";\n }\n if($scope.ville===und...
[ "0.64745647", "0.6161928", "0.6153301", "0.60107046", "0.6004433", "0.59668076", "0.5945076", "0.58966315", "0.5888969", "0.58271486", "0.5779297", "0.5763671", "0.57385546", "0.57352203", "0.5716557", "0.57130224", "0.5701102", "0.5701102", "0.5701102", "0.5701102", "0.57011...
0.0
-1
JSON inference calls this function to figure out whether a given string is to be transformed into a higher level type. Must return undefined if not, otherwise the type kind of the transformed string type.
function inferTransformedStringTypeKindForString(s, recognizer) { if (s.length === 0 || "0123456789-abcdefth".indexOf(s[0]) < 0) return undefined; if (recognizer.isDate(s)) { return "date"; } else if (recognizer.isTime(s)) { return "time"; } else if (recognizer.isDateTime(s)) { return "date-time"; } else if (isIntegerString(s)) { return "integer-string"; } else if (s === "false" || s === "true") { return "bool-string"; } else if (isUUID(s)) { return "uuid"; } else if (isURI(s)) { return "uri"; } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toType(str) {\n var type = typeof str;\n if (type !== 'string') {\n return str;\n }\n var nb = parseFloat(str);\n if (!isNaN(nb) && isFinite(str)) {\n return nb;\n }\n if (str === 'false') {\n return false;\n }\n ...
[ "0.6424945", "0.6252097", "0.62067336", "0.5798772", "0.5779958", "0.5777165", "0.57664305", "0.57664305", "0.5723081", "0.56925637", "0.5681202", "0.56483597", "0.5645942", "0.5633787", "0.5632321", "0.56241524", "0.5590461", "0.557054", "0.5538085", "0.55323684", "0.5531118...
0.68133056
0
Compara las clases para saber quien gana
function point() { if ($('#b1').hasClass('cruz') && $('#b2').hasClass('cruz') && $('#b3').hasClass('cruz') || $('#b4').hasClass('cruz') && $('#b5').hasClass('cruz') && $('#b6').hasClass('cruz') || $('#b7').hasClass('cruz') && $('#b8').hasClass('cruz') && $('#b9').hasClass('cruz') || $('#b1').hasClass('cruz') && $('#b4').hasClass('cruz') && $('#b7').hasClass('cruz') || $('#b2').hasClass('cruz') && $('#b5').hasClass('cruz') && $('#b8').hasClass('cruz') || $('#b3').hasClass('cruz') && $('#b6').hasClass('cruz') && $('#b9').hasClass('cruz') || $('#b1').hasClass('cruz') && $('#b5').hasClass('cruz') && $('#b9').hasClass('cruz') || $('#b3').hasClass('cruz') && $('#b5').hasClass('cruz') && $('#b7').hasClass('cruz')) { playX += 1; $('#wonX').html(playX); lock(); $('#win').fadeIn(100); $('#winner').html("X") $('#FX')[0].play(); } if ($('#b1').hasClass('zero') && $('#b2').hasClass('zero') && $('#b3').hasClass('zero') || $('#b4').hasClass('zero') && $('#b5').hasClass('zero') && $('#b6').hasClass('zero') || $('#b7').hasClass('zero') && $('#b8').hasClass('zero') && $('#b9').hasClass('zero') || $('#b1').hasClass('zero') && $('#b4').hasClass('zero') && $('#b7').hasClass('zero') || $('#b2').hasClass('zero') && $('#b5').hasClass('zero') && $('#b8').hasClass('zero') || $('#b3').hasClass('zero') && $('#b6').hasClass('zero') && $('#b9').hasClass('zero') || $('#b1').hasClass('zero') && $('#b5').hasClass('zero') && $('#b9').hasClass('zero') || $('#b3').hasClass('zero') && $('#b5').hasClass('zero') && $('#b7').hasClass('zero')) { playO += 1; $('#wonO').html(playO); lock(); $('#win').fadeIn(100); $('#winner').html("O") $('#FO')[0].play(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIfSameClasses(vnode, oldVnode) {\n\tif (!oldVnode || !vnode.data.class || !oldVnode.data.class) {\n\t\treturn false;\n\t}\n\n\tconst classes = vnode.data.class;\n\tconst oldClasses = oldVnode.data.class;\n\n\tif (!['string', 'object'].includes(typeof classes) || typeof classes !== typeof oldClasse...
[ "0.59257704", "0.5899101", "0.58508366", "0.57347673", "0.56565773", "0.56423664", "0.5598114", "0.55970013", "0.5563762", "0.55584174", "0.55331075", "0.55308676", "0.5529532", "0.5527465", "0.55041975", "0.55008894", "0.54963297", "0.548323", "0.54791325", "0.545691", "0.54...
0.0
-1
Desactivar los casilleros cuando se gana
function lock() { $('button').attr("disabled", "true"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inhabilitarOpcionYmostrar(){\n\n let cuadrados = document.querySelectorAll(\"div.fila-buscaminas div.cuadrado\");\n\n cuadrados.forEach( c => {\n c.removeEventListener(\"click\",Juego.buscarMina)\n c.classList.remove(\"sin-descubrir\");\n });\n\n}", "function resetActivite(){\n\tclesActivite = ...
[ "0.6374031", "0.62739617", "0.62590575", "0.6254646", "0.6182543", "0.615936", "0.6132508", "0.61011785", "0.6074632", "0.6072937", "0.6063087", "0.60507053", "0.6017111", "0.5935441", "0.590015", "0.58893", "0.58864784", "0.58764666", "0.5867343", "0.5860675", "0.58595234", ...
0.0
-1
New method, que consulte la API
async getValue(currency, cryptocurrency){ // cuando mandas varios parametros usas '&' const url = `https://min-api.cryptocompare.com/data/pricemultifull?fsyms=${cryptocurrency}&tsyms=${currency}&api_key=${this.apikey}`; console.log(url); // consultar en REST API const urlConvertir = await fetch(url); const resultado = await urlConvertir.json(); return{ resultado } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function API(){}", "function API(){}", "getList() { return this.api(); }", "constructor (api) { this.api = api }", "constructor (api) { this.api = api }", "constructor (api) { this.api = api }", "function DataApi() { }", "function DataApi() { }", "function ApiClient() {\n\n}", "GET() {\n }", ...
[ "0.7598584", "0.7598584", "0.6960761", "0.67123836", "0.67123836", "0.67123836", "0.66944224", "0.66944224", "0.6607655", "0.6525229", "0.6477177", "0.64516157", "0.6322159", "0.6261964", "0.62108546", "0.6201092", "0.62003976", "0.6161299", "0.6124116", "0.60531825", "0.6044...
0.0
-1
import NPC from 'Game/entities/players/npc'; import Other from 'Game/entities/players/other';
function getSpritesheet(entity) { if ( entity.settings.image.src ) { return entity.settings.image.src.split('/').pop().split('.')[0]; } return entity.settings.image.split('.')[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function importPlayer() {\n PlayerDao = require('../../app/player/PlayerDao');\n }", "import() {\n }", "get importTangents() {}", "async function importLabors() {\n\tconst module = game.modules.get(\"<module_name>\");\n\tlet scenes = null;\n\tlet actors = null;\n\n\tfor ( let p of module...
[ "0.63515335", "0.5704415", "0.5670393", "0.5457516", "0.5066519", "0.49820554", "0.4929302", "0.4919072", "0.4913177", "0.49018887", "0.48932296", "0.4884604", "0.48781103", "0.4871797", "0.48657858", "0.48561686", "0.48561686", "0.4806313", "0.478567", "0.47612107", "0.47557...
0.0
-1
Create a hash of start_indices mapped to referents Do the same for end_indices
handleHighlight(e){ let startIdx = window.getSelection().getRangeAt(0).startOffset; let endIdx = window.getSelection().getRangeAt(0).endOffset; if(startIdx!=endIdx){ this.props.history.push(`/songs/${this.props.match.params.songId}/create/${startIdx}/${endIdx}`); }else{ this.resetClicked(); this.props.history.push(`/songs/${this.props.match.params.songId}`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mapWithIndex(range,index){return{start:range.start,end:range.end,index:index};}", "function generateIndexMap(allUniqueColIndex, startDim, dimNum)\r\n {\r\n var map = {};\r\n for(var i = 0; i < allUniqueColIndex.length; ++i)\r\n {\r\n map[buildOneHeader(allUniqueColIndex[i], star...
[ "0.58416355", "0.5823089", "0.5783505", "0.5753827", "0.5560561", "0.54447997", "0.533067", "0.5309396", "0.52808577", "0.52808577", "0.52808577", "0.52808577", "0.52808577", "0.52808577", "0.52808577", "0.52808577", "0.52808577", "0.52808577", "0.52808577", "0.52808577", "0....
0.0
-1
methode de la classe Eleve
get nom() { return this._nom; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ea(){}", "function oe(){ee.apply(this,arguments)}", "constructor(name, type, evolutions){\n //This hace referencia al elemento que está por dentro.\n this.#name = name;\n this.#type = type;\n this.#evolutions = evolutions;\n }", "function Ve(t,e){return new E(t,e)}", ...
[ "0.6242611", "0.6193908", "0.61661613", "0.6148212", "0.6072603", "0.6062792", "0.5986409", "0.5907562", "0.5900058", "0.58980477", "0.58919", "0.58564997", "0.5811466", "0.5787096", "0.5713489", "0.5684043", "0.56762373", "0.567014", "0.5640417", "0.56253654", "0.56229186", ...
0.0
-1
methode de la classe Eleve
set nom(unNom) { this._nom = unNom; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ea(){}", "function oe(){ee.apply(this,arguments)}", "constructor(name, type, evolutions){\n //This hace referencia al elemento que está por dentro.\n this.#name = name;\n this.#type = type;\n this.#evolutions = evolutions;\n }", "function Ve(t,e){return new E(t,e)}", ...
[ "0.6241855", "0.6192452", "0.61668956", "0.6147879", "0.60737014", "0.60632956", "0.59876376", "0.5906201", "0.59002286", "0.58992153", "0.58935004", "0.58580035", "0.58116686", "0.5786382", "0.571386", "0.5685779", "0.5676319", "0.5669464", "0.56404567", "0.5625598", "0.5623...
0.0
-1
methode de la classe Eleve
get prenom() { return this._nom; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ea(){}", "function oe(){ee.apply(this,arguments)}", "constructor(name, type, evolutions){\n //This hace referencia al elemento que está por dentro.\n this.#name = name;\n this.#type = type;\n this.#evolutions = evolutions;\n }", "function Ve(t,e){return new E(t,e)}", ...
[ "0.6242611", "0.6193908", "0.61661613", "0.6148212", "0.6072603", "0.6062792", "0.5986409", "0.5907562", "0.5900058", "0.58980477", "0.58919", "0.58564997", "0.5811466", "0.5787096", "0.5713489", "0.5684043", "0.56762373", "0.567014", "0.5640417", "0.56253654", "0.56229186", ...
0.0
-1
The Tumblr API seems to throttle when using max number of simultaneous requests, even w/ a token that has the rate limit removed. This approach is slower but less prone to 429s
fetchPostsSerially(urls) { if (urls.length > 0 && !this.state.stopFetchingPosts) { const firstUrl = urls[0]; this.fetchPosts(firstUrl) .then(() => this.fetchPostsSerially(urls.slice(1))); } else { this.setState({loadingPosts: false}) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async rateLimiting() {\n await new Promise(resolve => setTimeout(resolve, 250))\n }", "get rateLimit() { return 2; }", "function rateLimiter(requestLimit, requestWindow){\n return _rateLimiter({\n windowMs: 1000 * 1000 * requestWindow,\n max: requestLimit,\n message: {er...
[ "0.68221474", "0.6560374", "0.62284106", "0.6097795", "0.60550076", "0.6050339", "0.60142785", "0.60142785", "0.59874713", "0.5922532", "0.5836896", "0.5835751", "0.5776858", "0.57721245", "0.57645136", "0.5732442", "0.5722337", "0.5712612", "0.5703151", "0.56798744", "0.5667...
0.0
-1
strip force atlas options from component props
_stripOptions(props) { return Object.assign({}, props, { sigma: undefined, children: undefined }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeProps(options,vm){\n let props = options.props\n if( !props ){\n return\n }\n console.log('我还没有写props')\n}", "function manipulateOptions(opts) {\n\t opts.blacklist.push(\"react\");\n\t}", "function manipulateOptions(opts) {\n\t opts.blacklist.push(\"react\");\n\t}", "fu...
[ "0.5673538", "0.5631757", "0.5631757", "0.54877627", "0.5394533", "0.5358065", "0.5358065", "0.5228253", "0.5228253", "0.51742935", "0.5149062", "0.51425767", "0.51200235", "0.51034266", "0.5090941", "0.5074634", "0.5074634", "0.5063335", "0.5061889", "0.5055744", "0.5052621"...
0.65063804
0
================================================================================================= /TARGETING COMMENTS SECTION Goal: Target UL of all comments class: XQXOT pxfy, Then in the UL, get all Mr508 elements, these are comments const commentsList = await (await driver.findElement(By.xpath('/html/body/div[4]/div[2]/div/article/div[3]/div[1]/ul'))).getAttribute('innerText') console.log(commentsList) / READ This function is called for each post, it targets and scrapes the comments Instagram loads 12 comments at a time > this function takes an argument specifying how many sets of comments to load and thus scrape Once the comments are scraped, they are pushed to the array 'arrayComments' and the array is returned from the function The array returned holds the comments from an individual post
async function scrapeCommentsFromPost (driver) { let arrayComments = new Array(); //array to hold date and comments from individual post //clicks '+' to load more another set of comments -> (driver,numOfCommentSets) await loadMore(driver,20); //!!!!!!!!!!!!!! *****&*&*&*&*&*&&&*&*** ADJUST NUM OF COMMENT SETS TO GET HERE!! !!!!!!!!!!!!!! *****&*&*&*&*&*&&&*&*** // //**targeting list of comments UL class: 'XQXOT pxf-y' , this returns a web element promise let commentListRootPromise = await driver.findElement(By.css('body > div._2dDPU.CkGkG > div.zZYga > div > article > div.eo2As > div.EtaWk > ul')); //** Returns an array of promises -specifically getting all elements that ar just Mr508, these are the comments */ let commentListChildren = await commentListRootPromise.findElements(By.className('Mr508')) /**Iterate each Mr508, find span, and extract inner text, this is the pure comment text, then push to arrayComments */ for(i=0;i<commentListChildren.length;i++){ //**get span section of 508 to then get text from span using 'innerText' NEED TO DO THIS FOR EACH 508 element let spanText508 = await commentListChildren[i].findElement(By.css('.C4VMK > span')) //**then get innerText let innerText = await spanText508.getAttribute('innerText').then((text)=>{ //console.log('this is just the text: '+ text) -FOR TESTING //innerText = text; FOR TESTING return text }) //console.log('this is innnerText: ' + innerText)- FOR TESTING arrayComments.push(innerText) } //console.log('m length is '+ arrayComments.length) //console.log('this is arrayComments contents: ' + arrayComments) //checking of of array contents return arrayComments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayComments () {\n let request = fetch(baseURL+queryShows+apiKey);\n let commentsArr = [];\n\n request.then((response) => {\n return response.json();\n }).then((data) => {\n\n //TAKE WHAT'S IN THE RESPONSE DATA AND STORE IN NEW ARRAY commentsArr\n commentsArr = data;\n ...
[ "0.73135114", "0.7079229", "0.7060624", "0.6817943", "0.6652233", "0.6596828", "0.65701234", "0.65656984", "0.6554394", "0.6550721", "0.6550156", "0.6547505", "0.6523583", "0.6521434", "0.64645404", "0.6439513", "0.6421379", "0.64119333", "0.6410888", "0.6407639", "0.64072907...
0.8740897
0
WRITE COMMENTS FROM ARRAYCOMMENTS TO FILE
function writeToFile(comments){ comments.forEach((element)=>{ elementSpace = element + ', ' fs.appendFile('comments.txt',elementSpace,(err)=>{ if(err){ console.log('error') } }) }) console.log(chalk.red(':::::COMMENTS WRITTEN TO FILE::::::')) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function M_Comment (){\n var arrayCopy = [...commnet];\n arrayCopy.unshift(write);\n Setcommnet( arrayCopy ); \n }", "function saveComments() {\n var comment_arr = new Array();\n for (i = 0; i < comments.length; i++) {\n comment_arr.push(comments[i].value);\n ...
[ "0.59940624", "0.5663524", "0.5626314", "0.55519307", "0.5416331", "0.5416331", "0.53058124", "0.5284471", "0.521639", "0.5212555", "0.50974876", "0.508571", "0.5077095", "0.5011033", "0.49883056", "0.49852812", "0.49235672", "0.49144834", "0.49113396", "0.49030462", "0.49001...
0.7649259
0
================================================================== function that clicks next arrow to get next post and begin scrape again
async function nextPost (driver){ let nextPostArrow = await driver.findElement(By.css('body > div._2dDPU.CkGkG > div.EfHg9 > div > div > a._65Bje.coreSpriteRightPaginationArrow')) await driver.sleep(2500) nextPostArrow.click(); console.log(chalk.red(':::::GOING TO NEXT POST::::::')) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clickNextPost() {\n $(\"#next_button\").on(\"click\", function(e) {\n e.preventDefault();\n var id = $(this).attr(\"data-id\");\n getNextPost(id); //passing in the id of current post\n\n });\n\n }", "function main() {\r\n jQ('.vbseo_like_link').each(function(){\r\n\t\tif((jQ(thi...
[ "0.7011041", "0.69555885", "0.685873", "0.68394053", "0.6774906", "0.6690339", "0.6674107", "0.6644338", "0.66133344", "0.6609151", "0.66056967", "0.660154", "0.6588643", "0.655399", "0.65537256", "0.6534382", "0.6520803", "0.65128267", "0.6511255", "0.6499814", "0.6490389", ...
0.77209866
0
================================================================= CORE APP FUNCTIONALITY
async function runScraper(UN,PW,celebChoice){ let returnedComments = await main_scrape_func(UN,PW,celebChoice) return returnedComments }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AppUtils() {}", "function main() {\n\n\t//======================================\n\t//THE FOLLOWING SHOULD ALL BE SINGLETONS\n\t//======================================\n\n\t//A service to get data and set data from localStorage API\n\tlet todoService = new TodoService();\n\t//The todoApp Data model\n\t...
[ "0.72650486", "0.6771651", "0.6717166", "0.6717166", "0.6717166", "0.65885884", "0.6587575", "0.65495896", "0.64904946", "0.6402698", "0.62554204", "0.6250142", "0.6225133", "0.62060827", "0.61973196", "0.61973196", "0.617181", "0.61483276", "0.61483276", "0.61221266", "0.602...
0.0
-1