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
TODO: Create a function to initialize app
function init() { promptUser(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initApp() {\n var router = new App.Router();\n var dispatcher = new App.Dispatcher();\n\n router.once('route', function() {\n dispatcher.runAction(router.getCurrent(), router.getParams());\n });\n\n // Start!\n router.startHistory();\n}", "function initApp() {\n\tinitSounds();\n\tinitSensors();...
[ "0.79483765", "0.77004915", "0.75859904", "0.7392242", "0.73389673", "0.7337566", "0.7098709", "0.7094714", "0.70335907", "0.70264256", "0.70233685", "0.69898516", "0.6983825", "0.6980272", "0.69399434", "0.6926202", "0.69252443", "0.69087744", "0.68747747", "0.6861737", "0.6...
0.0
-1
add a node at the end of the linked list
append(value) { let node = new Node(value) // if list is empty, add the element and make it head if(this.head === null) { this.head = node } else { let current = this.head // iterate to the end of the list and append node while(current.next) { current = current.next } current.next = node } this.size++ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addToEnd(newNode) {\n\n // check if empty\n if (head == null) {\n head = newNode;\n tail = newNode;\n } else {\n tail.next = newNode;\n tail = newNode;\n\n }\n }", "appendNode(node) {\n if(!this.getL...
[ "0.7882263", "0.7794062", "0.76836634", "0.76361555", "0.7563977", "0.7499833", "0.7472396", "0.74472404", "0.73862857", "0.7371578", "0.7261185", "0.7227437", "0.7202137", "0.71464866", "0.71114504", "0.7091297", "0.7082687", "0.707473", "0.7063289", "0.70525056", "0.7036103...
0.66096115
69
print all the value form head to tail
printList() { let curr = this.head, str = "" while(curr) { str += curr.value + (curr.next && " -> ") curr = curr.next } console.log(str) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "printHeadToTail() {\n if(!this.length) return\n\n let curr = this.head, str = \"\"\n while(curr) {\n str += (curr.value + (curr.next && \" <-> \"))\n curr = curr.next\n }\n console.log(str)\n }", "printTailToHead() {\n if(!this.length) return\n\n...
[ "0.802325", "0.80127275", "0.7258001", "0.7215462", "0.71758175", "0.7095735", "0.70412534", "0.7026612", "0.6998431", "0.6995226", "0.6991426", "0.6954334", "0.69536316", "0.69283694", "0.6902882", "0.6873582", "0.6843101", "0.6821668", "0.6793423", "0.67441916", "0.67263794...
0.6865843
16
Adapted from convertsourcemap (MIT)
function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractSourceMap(fs, logger, file) {\n var inline = convert_source_map_1.commentRegex.test(file.text);\n var external = convert_source_map_1.mapFileCommentRegex.exec(file.text);\n if (inline) {\n var inlineSourceMap = convert_source_map_1.fromSource(file.text);\n ...
[ "0.69679236", "0.69377637", "0.67660517", "0.644171", "0.63287604", "0.62983114", "0.6256009", "0.6210124", "0.61941147", "0.61812603", "0.6174446", "0.6158444", "0.6158444", "0.6158444", "0.6154958", "0.60953784", "0.6039884", "0.5989862", "0.5980611", "0.5979347", "0.597915...
0.0
-1
TESTER for all gauge types
function testGood (level, spotMeta=streetsville) { let value = 'bad'; spotMeta.levels .some( function (d) { if ( (d[0] < level) && ( level < d[1]) ) { // console.log(d); value = d[2]; return; } }); //console.log(value) return value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GaugeChartsTest() {\n \n return (\n <ApplicationProvider mapping={mapping} theme={lightTheme}>\n <WidgetGauge graphType={\"thermometer\"} title={\"TEST\"} max={\"100\"} min={\"10\"} unit={\"1\"} color={[]} value={'65'} target={[]} />\n </ApplicationProvider>\n )\n}", "f...
[ "0.6679624", "0.66052204", "0.64913577", "0.64172804", "0.6097033", "0.59254885", "0.5911811", "0.57202566", "0.5657047", "0.5610527", "0.5512909", "0.5429407", "0.53891844", "0.53369075", "0.5314558", "0.5246025", "0.5242088", "0.52318966", "0.52155524", "0.52080446", "0.519...
0.0
-1
WISKI/KIWISbased gauges (currently grca & cvc) see notes for individual discrapncies for parsing grand river json data, see ~line 65 of accessed 20191204 also cf variable definitions in doesn't appear to accept a date parameter suggests that historical data is available elsewhere
async function getGrandJSON (stationData, needCors=true) { let id = stationData.gaugeID, url = `https://apps.grandriver.ca/waterdata/kiwischarts/wiskiData/RF_Charts_UpperGrand/${id}.json`, headers={'Spot-ID': stationData.slug}; if (needCors) {url = `${cors}${url}`;} return await fetch(url, {headers: headers}) .then ( async (res) => { console.log(res.headers.get('Content-Type')) return res.json() }) .then ( (json) => { console.log(json); return json[0].data} ) .catch(function(error){console.log(error);}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRelevantData(region, active, mapDate){\n var relevantData;\n switch(active){\n case \"Cumulative Fatalities\":\n relevantData = {\"English\": [region.properties.coronadata[mapDate].fatalities], \"Deutsch\": [region.properties.coronadata[mapDate].fatalities]};\n ...
[ "0.61022866", "0.59508175", "0.5526327", "0.54803264", "0.5478957", "0.544301", "0.5369032", "0.5362187", "0.5360116", "0.535883", "0.53563094", "0.535387", "0.53366286", "0.5332826", "0.5293811", "0.5281835", "0.5275786", "0.5235472", "0.52349657", "0.5229971", "0.5223127", ...
0.4918813
83
let proxy = '
async function getWOJSON (stationData, needCors = true) { let start = moment().subtract(4, 'days').format('YYYY-MM-DD'), end = moment().format('YYYY-MM-DD'), headers = {'Origin': "localhost", 'X-Spot-ID': stationData.slug} params = `?param1=47&start_date=${start}&end_date=${end}&station=${stationData["gaugeID"]}`; let url = `https://wateroffice.ec.gc.ca/services/real_time_graph/json/inline${params}`; if (needCors) {url = `${cors}${url}`;} // console.log(url); // let target = `${url}${params}`; return await fetch(url, {headers: headers}) .then ( async (res) => { // console.log(res.headers.get('Content-Type')) return res.json() }) .then ( (json) => { // console.log(json); return json["47"].provisional} ) .catch(function(error){console.log(error);}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get(){return proxy;}", "function get(){return proxy;}", "function FindProxyForURLByAutoProxy(url, host) {\n\nreturn \"DIRECT\";\n}", "function cProxy(\n)\n{\n\n\n}", "function Proxy(){}", "function Proxy(){}", "function get() {\n return proxy;\n }", "function get() {\n return proxy;\n...
[ "0.7247983", "0.7247983", "0.7098122", "0.7023845", "0.6945621", "0.6945621", "0.6484944", "0.6484944", "0.6484944", "0.6484944", "0.6484944", "0.6484944", "0.6484944", "0.6484944", "0.64196134", "0.639069", "0.63671565", "0.6364022", "0.62437576", "0.62437576", "0.6135823", ...
0.0
-1
Handle insert of a new document.
handleInsert() { if (!this.props.error) { const doc = this.props.docs[this.props.docs.length - 1]; for (const element of doc.elements) { this.addGridColumn(null, element.currentKey, element.currentType, []); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insert_doc(doc) {\n\tif (cloudant) {\n\t\tlogger.info(\"insert_doc() doc.id_str:\", doc.id_str);\n\t db.insert(doc, function (error, http_body, http_headers) {\n\t if(error) return logger.error(error);\n\t });\n // logger.debug(\"insert_doc() http_body:\", http_body);\n\t\t}\n}", "function...
[ "0.69414127", "0.6929364", "0.6872966", "0.66930574", "0.656246", "0.6424797", "0.64042634", "0.6333291", "0.62218034", "0.61909056", "0.6152626", "0.6147623", "0.61099786", "0.60916394", "0.6008806", "0.59175307", "0.59063315", "0.58923393", "0.5890585", "0.5887075", "0.5880...
0.59198755
15
When the component is updated, handle any changes to the paths.
handleBreadcrumbChange() { // the state may get an intermediate // update before data are ready. if (!this.gridApi) { return; } const params = this.props.table; if (params.path.length === 0) { this.topLevel = true; const headers = this.createColumnHeaders(this.hadronDocs, [], []); this.gridApi.gridOptionsWrapper.gridOptions.context.path = []; this.gridApi.setColumnDefs(headers); this.gridApi.setRowData(this.createRowData(this.hadronDocs, this.props.start)); } else if (params.types[params.types.length - 1] === 'Object' || params.types[params.types.length - 1] === 'Array') { this.topLevel = false; const headers = this.createColumnHeaders(this.hadronDocs, params.path, params.types); headers.push(this.createObjectIdHeader()); if (headers.length <= 3) { headers.push(this.createPlaceholderHeader( params.types[params.types.length - 1] === 'Array', params.path) ); } this.gridApi.gridOptionsWrapper.gridOptions.context.path = params.path; this.gridApi.setRowData(this.createRowData(this.hadronDocs, 1)); this.gridApi.setColumnDefs(headers); } this.gridApi.refreshCells({force: true}); if (this.gridApi) { this.addFooters(); } /* Use this call to open cell for editing so that we're guaranteed the cell has already been created before we start editing it. */ if (params.editParams) { const strColId = '' + params.editParams.colId; this.gridApi.ensureColumnVisible(strColId); this.gridApi.setFocusedCell(params.editParams.rowIndex, strColId); this.gridApi.startEditingCell({rowIndex: params.editParams.rowIndex, colKey: strColId}); } else if (params.path.length && params.types[params.types.length - 1] === 'Array') { this.gridApi.ensureColumnVisible('0'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updatePath(newPath) {\n return this.props.convertPathToUrl(newPath)\n .then(\n url => this.setState({path: url})\n )\n .catch(\n e => this.setState({path: null})\n )\n ;\n }", "_updateCurrentPath() {\n let current =...
[ "0.67468685", "0.66294944", "0.6516461", "0.6516461", "0.6440059", "0.63836426", "0.6234323", "0.61810935", "0.613412", "0.61297524", "0.6126395", "0.6029177", "0.6004393", "0.5979135", "0.59620965", "0.59508556", "0.5931601", "0.59315395", "0.5927795", "0.59016824", "0.58461...
0.0
-1
Go through and add modified footers to documents that are edited.
addFooters() { /* Add footers for modified rows */ this.gridApi.forEachNodeAfterFilterAndSort((node) => { if (node.data.hadronDocument.isModified()) { this.addFooter(node, node.data, 'editing'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupFooter(docname, docver, docstage, docrev, docdate) {\n var footer = doc.getFooter();\n var paragraphs = footer.getParagraphs();\n var doctrack = convertStageToTrack(docstage);\n \n // Build the filename based on provided data\n var docfilename = \"\";\n \n // The passed in docname will be s...
[ "0.61070263", "0.5891777", "0.57783645", "0.55601573", "0.5443705", "0.54333746", "0.5428693", "0.5251889", "0.5247858", "0.5243702", "0.51936513", "0.5155064", "0.51381797", "0.5113296", "0.51047283", "0.50937366", "0.50905514", "0.5075639", "0.5064649", "0.5064649", "0.5043...
0.72144055
0
format: NQXX XXXX XXXX ...
function getNimDepositLink(address) { const safeUrl = NIMIQ_NETWORK === 'main' ? 'https://safe.nimiq.com/' : 'https://safe.nimiq-testnet.com/'; return `${safeUrl}#_request/${address.replace(/ /g, '-')}_`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "asString_n(n) {\nreturn RQ.qStr(this.xyzw, n);\n}", "static qStr(qv, n) {\nvar t, w, x, y, z;\n//----\n[x, y, z, w] = (function() {\nvar j, len, results;\nresults = [];\nfor (j = 0, len = qv.length; j < len; j++) {\nt = qv[j];\nresults.push(this.fStr(t, n));\n}\nreturn results;\n}).call(this);\nreturn `<${x} ${y...
[ "0.66940546", "0.6036612", "0.5939234", "0.57420963", "0.5603289", "0.5554034", "0.5554034", "0.5554034", "0.55520684", "0.55107087", "0.55107087", "0.55107087", "0.55107087", "0.55107087", "0.55107087", "0.55107087", "0.55107087", "0.55107087", "0.55107087", "0.5505026", "0....
0.0
-1
when a message comes into NimiqTipbot inbox it should be handled depending on the topic
async handleInboxMessage(message, $) { const { subject, authorName, body } = message; // console.log('handleInboxMessage', message); const { replyMessage, replySubject, sourceAuthor, sourceAddress, destinationAuthor, destinationAddress, sourceBalance, nimAmount, privateKey } = subject === REDDIT.TOPICS.DEPOSIT ? await this.getReplyMessageForDeposit(authorName, $) : subject === REDDIT.TOPICS.WITHDRAW ? await this.getReplyMessageForWithdraw(authorName, body, $) : subject === REDDIT.TOPICS.BALANCE ? await this.getReplyMessageForBalance(authorName, $) : {}; if (replyMessage && replySubject) { await this.postMessage(authorName, replySubject, replyMessage); } if (subject === REDDIT.TOPICS.WITHDRAW && typeof privateKey !== 'undefined' && typeof destinationAddress !== 'undefined' && typeof nimAmount !== 'undefined') { // log the withdrawal, it will be picked up later by a separate tip polling process console.log(`Recording reddit withdrawal from ${sourceAuthor} for the amount ${nimAmount} to ${destinationAddress}`); await dynamo.putTransaction(message.id, { sourceAuthor, sourceAddress, sourceBalance, destinationAuthor, destinationAddress, privateKey, nimAmount, replyMetadata: { // when the transaction later gets sent, this info is used to send the reply message back to user reddit: { authorName, subject: replySubject } }, heightRecorded: $.getHeight($) }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onMessageArrived(message) {\n var msg = message.payloadString;\n var topic = message.destinationName;\n console.log(\"onMessageArrived(\" + topic + \"):\"+msg);\n\n // response according to topic\n var topicHie = topic.split(\"/\");\n var topicType = topicHie[topicHie.length-...
[ "0.70958245", "0.70470303", "0.6819762", "0.6777956", "0.67053133", "0.65790987", "0.655018", "0.64549387", "0.639533", "0.6356727", "0.6309846", "0.6304678", "0.6277479", "0.6267934", "0.62505186", "0.6247735", "0.6242691", "0.62367207", "0.62294394", "0.61922187", "0.618728...
0.57930505
58
serviceAuth = 'Basic ' + Base64.encode(serviceUser + ':' + servicePassword); serviceAuth = 'Basic ' + serviceUser + ':' + servicePassword;
function make_base_auth(user, password) { var tok = user + ':' + password; var hash = btoa(tok); return 'Basic ' + hash; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildBasicAuth(username, password) {\n\tvar tok = username + ':' + password;\n\tvar hash = btoa(tok);\n\treturn \"Basic \" + hash;\n}", "createBasicAuthToken(username, password) {\n return 'Basic ' + window.btoa(username + \":\" + password)\n }", "function createBasicAuth(username, password)...
[ "0.7088766", "0.7082009", "0.7030507", "0.7011721", "0.68047553", "0.6800512", "0.67953736", "0.66620916", "0.66473603", "0.66141343", "0.64408183", "0.6409638", "0.6395443", "0.63856685", "0.63182425", "0.6290841", "0.622527", "0.6103436", "0.6092256", "0.6029161", "0.60215"...
0.68925077
4
\\ Get Temperatura e humidade
function getTemperatureHumidity(){ $.ajax({ url: ipURL+'/HouseTempHumid', type: 'GET', cache: false, headers: { "Authorization": serviceAuth }, success:function(data){ temperatura = data.temperature; if(temperatura <= 0 || temperatura >=60){ temperatura = '-'; } $("#TemperatureContainer").text(temperatura+" ºC") }, error:function(data){ $("#TemperatureContainer").text("? ºC") console.log("Erro na leitura de temperatura e humidade") } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get temperature() {\n // convertimos los grados F a C\n this.temperature_F = 5 / 9 * (this.temperature_F - 32)\n return this.temperature_F;\n }", "function getTiempo() {\n\tvar date = new Date();\n\tvar time = date.getHours()+':'+\n\t\t\t date.getMinutes()+':'+\n\t\t\t date.getSeconds...
[ "0.67847294", "0.6759858", "0.65702516", "0.64672446", "0.6334757", "0.62835115", "0.6277494", "0.6275334", "0.6227557", "0.62077695", "0.6153436", "0.61393934", "0.61361945", "0.61347866", "0.60935813", "0.6065664", "0.60532993", "0.60480034", "0.60210997", "0.60024166", "0....
0.6735801
2
\\ Get Status do sistema
function getSystemStatus(isDisplayMachinesDown){ $.ajax({ url: ipURL+'/systemStatus', type: 'GET', cache: false, headers: { "Authorization": serviceAuth }, success:function(data){ isSystemAlive = data.isSystemAllAlive; if(isSystemAlive == true){ $("#SystemNOKIcon").hide() $("#SystemOKIcon").show() }else{ $("#SystemOKIcon").hide() $("#SystemNOKIcon").show() $("#systemsDownNumber").text(data.systemsDown) machinesDownText = ""; machinesUpText = ""; if(isDisplayMachinesDown == true){ for (i = 0; i < data.Machines.length; i++) { if(data.Machines[i].Machine.isAlive == false){ machinesDownText += data.Machines[i].Machine.IP+ "\n"; }else{ machinesUpText += data.Machines[i].Machine.IP+ "\n"; } } if(machinesDownText != ""){ machinesDownText = "Máquinas em baixo:\n"+machinesDownText; } if(machinesUpText != ""){ machinesUpText = "Máquinas OK:\n"+machinesUpText; } alert(machinesDownText+"\n"+machinesUpText) } } }, error:function(data){ $("#SystemOKIcon").hide() $("#SystemNOKIcon").show() console.log("Erro na leitura de status de sistema") } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStatus() {\n\tapi({ data: \"cmd=getstatus\" },syncStatus);\n}", "function get_system_status() {\n page = 'operator';\n var dataObj = {\n \"content\" : [ {\n \"session_id\" : get_cookie()\n } ]\n };\n call_server('get_system_status', dataObj);\n}", "function getS...
[ "0.7500388", "0.7364927", "0.7245807", "0.72031385", "0.71700656", "0.70622385", "0.6947817", "0.692985", "0.68494654", "0.67975104", "0.6795094", "0.67863744", "0.6756428", "0.6754721", "0.67516047", "0.6673024", "0.64515346", "0.6401707", "0.6373129", "0.63307744", "0.63129...
0.6427209
17
\\ Get imagem da camera
function getCameraPicture(imageContainerID, imageSize, isClearImage){ if(isClearImage == true){ $(imageContainerID).attr("src", ""); } //$.ajaxSetup({ cache: false }); $.ajax({ url: ipURL+'/getGateCameraImage?Resolution='+imageSize, type: 'GET', cache: false, headers: { "Authorization": serviceAuth }, beforeSend: function (xhr) { xhr.overrideMimeType('text/plain; charset=x-user-defined'); }, success:function(data,textStatus, jqXHR){ //$(imageContainerID).attr("src", "data:image/jpeg;base64"); var binary = ""; var responseText = jqXHR.responseText; var responseTextLen = responseText.length; for ( i = 0; i < responseTextLen; i++ ) { binary += String.fromCharCode(responseText.charCodeAt(i) & 255) } $(imageContainerID).attr("src", "data:image/jpeg;base64,"+btoa(binary)); var dt = new Date(); $("#GateImageTimeStamp").text( (dt.getHours()<10?'0':'') + dt.getHours() + ":" + (dt.getMinutes()<10?'0':'') + dt.getMinutes() + ":" + (dt.getSeconds()<10?'0':'') + dt.getSeconds()); }, error:function(data){ console.log("Erro a carregar imagem") } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get camera() {return this._p.camera;}", "get camera () {return this._p.camera;}", "function cameraGetPicture() {\n\t navigator.device.capture.captureImage(captureSuccess, captureError, {limit: 1});\n\t}", "get worldCamera() {}", "function getPicture() {\n ...
[ "0.71363646", "0.70856506", "0.6644587", "0.66222286", "0.6549515", "0.6488358", "0.64038366", "0.636859", "0.63017297", "0.6299966", "0.62418777", "0.62418777", "0.62076735", "0.6155746", "0.613556", "0.6132741", "0.611746", "0.6099124", "0.60692906", "0.6048769", "0.6040696...
0.0
-1
the loop defined by the union of segments between the crossing of the start segment (s, s+ 1) and the end segment (e, e + 1) note that some calculations are inaccurate as we assume the loop starts at point s and ends at point e. These inaccuracy is neglectable
function Loop(s,e){ var i, vel = 0; var minA = 1000000000, maxA = 0; var locs = []; this.entry = s; this.exit = e; this.altDiff = 0; this.avgSpeed = 0; this.length = 0; for (i = s; i < e + 1; i++){ vel += pointarray[i].vel; if (pointarray[i].ele < minA){ minA = pointarray[i].ele; } if (pointarray[i].ele > maxA){ maxA = pointarray[i].ele; } locs[i - s] = pointarray[i].LatLng; } // get the intersection between starting and closing segment and augment the resulting // path by this point to get a circle. Note that the first element of the path gets // replaced by this intersection point var crossing = getIntersection(s,e); locs[0] = google.maps.geometry.spherical.interpolate(pointarray[s].LatLng, pointarray[s+1].LatLng, crossing); locs[e - s + 1] = locs[0]; this.locs = locs; this.avgSpeed = vel / (e - s + 1); this.altDiff = maxA - minA; this.area = google.maps.geometry.spherical.computeSignedArea(locs); this.length = google.maps.geometry.spherical.computeLength(locs); // this is somewhat inaccurate, see the introductory comment this.timeEntry = pointarray[this.entry].time; this.timeExit = pointarray[this.exit].time; var duration = (this.timeExit - this.timeEntry)/1000; this.bankAngle = Math.atan((K_factor * this.avgSpeed) / duration) * 180 / 3.14; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function segments_union(segment_1, segment_2){\n var max_segment_1, min_segment_1, max_segment_2, min_segment_2, absolute_max, absolute_min;\n //Case 1: vertical segments\n var vertical = is_vertical_or_quasi_vertical(segment_1); //equivalently is_vertical_or_quasi_vertical(segment_2)\n if(vertical){\n\n if...
[ "0.5828836", "0.58039796", "0.5770281", "0.57188535", "0.5711386", "0.56746256", "0.5576355", "0.55449784", "0.55337733", "0.5526796", "0.55220765", "0.5513046", "0.5456952", "0.5441841", "0.5438785", "0.5362485", "0.5356646", "0.53422916", "0.5335512", "0.5333205", "0.531184...
0.57162195
4
set the planes marker in the map using the selected position in the chart view
function setPlanePosition( i ){ var k = i + offset; // offset is adjusted to the first index in the currently filtered // segment when this segment is displayed if (planePosition != null && k >= 0 && k < pointarray.length){ planePosition.setPosition(pointarray[k].LatLng); $("#heading").text(new String(pointarray[k].heading.toFixed()) + " °"); $("#groundspeed").text(new String(pointarray[k].vel.toFixed()) + " kts"); $("#altitude").text(new String(pointarray[k].ele.toFixed()) + " ft"); $("#climbrate").text(new String(pointarray[k].feetPerMinute.toFixed()) + "\tft/min"); planePositionIndex = k; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function panblanPark(){\n map.setView(new ol.View({\n center: blancoParkMercator,\n zoom: 19\n }));\n}", "function panAquSpCen(){\n map.setView(new ol.View({\n center: aquSpMercator,\n zoom: 19\n }));\n}", "function setMarker(){\n\n \tif (current_marker!...
[ "0.6529476", "0.6505528", "0.6450405", "0.6436074", "0.63727903", "0.6346302", "0.6320233", "0.62810385", "0.6136053", "0.61084455", "0.6055648", "0.60529345", "0.60199285", "0.60024774", "0.5979785", "0.59593457", "0.5913965", "0.59015435", "0.5888769", "0.5874749", "0.58346...
0.6765788
0
get the bounds of any segment in the track
function getBounds(firstIndex, lastIndex) { var maxlat = 0; var maxlng = 0; var minlat = 10000; var minlng = 10000; var bounds; for (var i = firstIndex; i < lastIndex; i++) { var lat = pointarray[i].LatLng.lat(); var lng = pointarray[i].LatLng.lng(); if (lat > maxlat) { maxlat = lat; } if (lat < minlat) { minlat = lat; } if (lng > maxlng) { maxlng = lng; } if (lng < minlng) { minlng = lng; } } bounds = new google.maps.LatLngBounds(new google.maps.LatLng(minlat, minlng), new google.maps.LatLng(maxlat, maxlng)); return bounds;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get bounds() {}", "get localBounds() {}", "get boundsValue() {}", "function bounds() {\n return {\n start: conductor.displayStart(),\n end: conductor.displayEnd(),\n domain: conductor.domain().key\n };\n }", "...
[ "0.778627", "0.7188192", "0.71379304", "0.6851803", "0.6806722", "0.6705719", "0.6702594", "0.6664514", "0.6460486", "0.6445773", "0.6420555", "0.6400514", "0.633647", "0.62954897", "0.6283144", "0.6263674", "0.6257252", "0.6253886", "0.6192765", "0.612273", "0.61054575", "...
0.57873607
53
get the bounds of any segment in the track
function getBoundsForArray(a) { var maxlat = 0; var maxlng = 0; var minlat = 10000; var minlng = 10000; var bounds; for (var i = 0; i < a.length; i++) { var lat = a[i].lat(); var lng = a[i].lng(); if (lat > maxlat) { maxlat = lat; } if (lat < minlat) { minlat = lat; } if (lng > maxlng) { maxlng = lng; } if (lng < minlng) { minlng = lng; } } bounds = new google.maps.LatLngBounds(new google.maps.LatLng(minlat, minlng), new google.maps.LatLng(maxlat, maxlng)); return bounds; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get bounds() {}", "get localBounds() {}", "get boundsValue() {}", "function bounds() {\n return {\n start: conductor.displayStart(),\n end: conductor.displayEnd(),\n domain: conductor.domain().key\n };\n }", "...
[ "0.778627", "0.7188192", "0.71379304", "0.6851803", "0.6806722", "0.6705719", "0.6702594", "0.6664514", "0.6460486", "0.6445773", "0.6420555", "0.6400514", "0.633647", "0.62954897", "0.6283144", "0.6263674", "0.6257252", "0.6253886", "0.6192765", "0.612273", "0.61054575", "...
0.57349813
61
return true if (i,i+1) crosses (k,k+1)
function isCrossing(i, k){ if ( i == k || i == k + 1 || i == k - 1){ return false; } var path1 = [pointarray[i].LatLng, pointarray[i + 1].LatLng, pointarray[k].LatLng]; var path2 = [pointarray[i].LatLng, pointarray[i + 1].LatLng, pointarray[k + 1].LatLng]; var path3 = [pointarray[k].LatLng, pointarray[k + 1].LatLng, pointarray[i].LatLng]; var path4 = [pointarray[k].LatLng, pointarray[k + 1].LatLng, pointarray[i + 1].LatLng]; var area1 = google.maps.geometry.spherical.computeSignedArea(path1); var area2 = google.maps.geometry.spherical.computeSignedArea(path2); var area3 = google.maps.geometry.spherical.computeSignedArea(path3); var area4 = google.maps.geometry.spherical.computeSignedArea(path4); var s1 = area1 * area2; var s2 = area3 * area4; if ((s1 < 0) && (s2 < 0)) { // exclude some pathological cases // otherwise rounding errors in computeSignedArea can lead // two wrong results if (s1 < -1 && s2 < -1){ return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function containsCloseNums(nums, k) {\n for (let i = 0; i < nums.length; i++) {\n for (let j = 0; j < nums.length; j++) {\n if (i !== j && nums[i] === nums[j]) {\n return Math.abs(i - j) <= k\n }\n }\n }\n return false\n}", "function containDuplication(arr,k){\n if(arr.length===0)\n r...
[ "0.62931365", "0.62828517", "0.62527996", "0.62113714", "0.6109504", "0.5946809", "0.59088993", "0.587759", "0.5803817", "0.5799639", "0.5791983", "0.5776205", "0.57043606", "0.565883", "0.5657893", "0.56131077", "0.56079686", "0.5554067", "0.5546994", "0.5545171", "0.5530581...
0.705261
0
when segments (i,i+1) and (k,k+1) cross each other, return the intersection point as the interpolation on the first segment (i,i+1) determine the intersection point by the Cramerrule
function getIntersection (i, k) { var det = dx(i,i + 1) * dy(k,k + 1) - dx(k, k +1 ) * dy(i, i + 1); var s = dx(i,k) * dy (k,k + 1) - dx(k,k + 1) * dy(i, k); s = s / det; var t = dy(i,k) * dx (i,i + 1) - dy(i,i + 1) * dx(i, k); t = t / det; return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cubicSegmentIntersections(px1, py1, px2, py2, px3, py3, px4, py4, x1, y1, x2, y2) {\n var intersections = [];\n // Find line equation coefficients.\n var A = y1 - y2;\n var B = x2 - x1;\n var C = x1 * (y2 - y1) - y1 * (x2 - x1);\n // Find cubic Bezier curve equation coefficients from con...
[ "0.6423302", "0.6368426", "0.62815225", "0.6260365", "0.6254019", "0.6101914", "0.6070711", "0.59512794", "0.59469426", "0.59067935", "0.583224", "0.5796831", "0.5796831", "0.57700837", "0.57184213", "0.56974655", "0.56851524", "0.5668007", "0.5667565", "0.55917317", "0.55894...
0.6872056
0
the longitudinal distance between points i and k
function dx(i, k){ var latlng = new google.maps.LatLng(pointarray[i].LatLng.lat(), pointarray[k].LatLng.lng()); var sign = (pointarray[k].LatLng.lng() > pointarray[i].LatLng.lng()) ? 1 : -1; return sign * google.maps.geometry.spherical.computeDistanceBetween(pointarray[i].LatLng, latlng); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dy(i, k){\n\tvar latlng = new google.maps.LatLng(pointarray[k].LatLng.lat(), pointarray[i].LatLng.lng());\n\tvar sign = (pointarray[k].LatLng.lat() > pointarray[i].LatLng.lat()) ? 1 : -1;\n\treturn sign * google.maps.geometry.spherical.computeDistanceBetween(latlng, pointarray[i].LatLng);\n}", "function...
[ "0.67786604", "0.62765473", "0.6053718", "0.59932667", "0.5943284", "0.57277036", "0.57270545", "0.57172847", "0.56388736", "0.5634655", "0.56286424", "0.56047046", "0.5599009", "0.5593887", "0.5580052", "0.55335015", "0.55155176", "0.54399455", "0.5432419", "0.54315674", "0....
0.6682368
1
the lateral distance between points i and k
function dy(i, k){ var latlng = new google.maps.LatLng(pointarray[k].LatLng.lat(), pointarray[i].LatLng.lng()); var sign = (pointarray[k].LatLng.lat() > pointarray[i].LatLng.lat()) ? 1 : -1; return sign * google.maps.geometry.spherical.computeDistanceBetween(latlng, pointarray[i].LatLng); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dx(i, k){\n\tvar latlng = new google.maps.LatLng(pointarray[i].LatLng.lat(), pointarray[k].LatLng.lng());\n\tvar sign = (pointarray[k].LatLng.lng() > pointarray[i].LatLng.lng()) ? 1 : -1;\n\treturn sign * google.maps.geometry.spherical.computeDistanceBetween(pointarray[i].LatLng, latlng);\n}", "function...
[ "0.702653", "0.6447083", "0.63794065", "0.62759477", "0.6182576", "0.6167447", "0.61447847", "0.60284674", "0.5956133", "0.59430903", "0.5916947", "0.5865775", "0.5865561", "0.5706482", "0.57038635", "0.5680996", "0.5658824", "0.56480646", "0.56450343", "0.56025165", "0.55994...
0.7116098
0
get the value from selected radio buttons
function getRadioValue(){ let redioValue; radioInputs.forEach((radioInput) => { if(radioInput.checked){ radioValue = radioInput.value ; } }); return radioValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSelectedValue() {\n for(var i = 0; i < radioButtons.length; i++) {\n if(radioButtons[i].checked) {\n //Store the value of the selected rb in the selectedValue var\n selectedValue = radioButtons[i].value;\n\n // return selectedValue;\n }\n }\n}", "fu...
[ "0.8111806", "0.79798925", "0.78177446", "0.78147954", "0.7809307", "0.7805381", "0.7796166", "0.77905595", "0.77691585", "0.77616173", "0.77355486", "0.7708302", "0.7684945", "0.7684945", "0.7667638", "0.76627886", "0.76585346", "0.7574681", "0.7519006", "0.75168407", "0.751...
0.7687428
12
from that deside the amount of questions
function selectQuestionAmount(e){ e.preventDefault(); questionAmount = getRadioValue(); //alert(questionAmount); console.log("Question amount value=",questionAmount); if(questionAmount){ showCountDown(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberOfQuestions () {\n return quiz.questions.length\n}", "function numberOfQuestions () {\n return quiz.questions.length\n}", "function numberOfQuestions () {\n return quiz.questions.length\n}", "function getTotalQuestions() {\n var totalQuestions = questions.length;\n return totalQuestio...
[ "0.7181995", "0.7181995", "0.7181995", "0.70489967", "0.6776236", "0.6776236", "0.6768875", "0.6768064", "0.6578214", "0.65611786", "0.65390265", "0.6503893", "0.6412783", "0.63999283", "0.6396519", "0.6343734", "0.6315477", "0.6310545", "0.63101614", "0.6252874", "0.6245445"...
0.0
-1
display 123 and Go
function countDownStart(){ countdown.textContent = "3"; setTimeout(() => { countdown.textContent = "2"; },1000); setTimeout(() => { countdown.textContent = "1"; },2000); setTimeout(() => { countdown.textContent = "Go!"; },3000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayHelper (num) {\n if (num < 10) {\n return '0' + num.toString()\n } else {\n return num.toString()\n }\n }", "function takeANumber(katzDeliLine, people){\n return 'Welcome, '+ people +'. You are number '+ katzDeliLine + ' in li...
[ "0.6328718", "0.60593873", "0.5880683", "0.5852765", "0.58036596", "0.57587314", "0.57530093", "0.57446986", "0.57367396", "0.5729991", "0.5727309", "0.569266", "0.56899035", "0.56603974", "0.5646761", "0.56391466", "0.56357706", "0.56338966", "0.56225425", "0.5617587", "0.56...
0.0
-1
random number upto max
function getRandomInt(max){ return Math.floor(Math.random() * Math.floor(max)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RandomNumber( max ){\n return (Math.floor( Math.random()*max));\n }", "function randomNum(max) {\n \n return (Math.floor( Math.random()*max));\n}", "function generatoreNumeri(max){\n return Math.ceil(Math.random() * max);\n}", "function getRandomNum(max) {\n retur...
[ "0.8994615", "0.88398767", "0.880315", "0.8762975", "0.87626743", "0.8744438", "0.87420714", "0.87004036", "0.8697208", "0.8695106", "0.8680173", "0.8665245", "0.8661347", "0.8656695", "0.8640513", "0.8638246", "0.8628963", "0.8619376", "0.86190116", "0.8611718", "0.86085486"...
0.8375434
58
random equestion create correct / incorrect
function createEquations(){ //ranodm choose how many correct equations. const correctEquations = getRandomInt(questionAmount); const wrongEquations =questionAmount - correctEquations; //loop create equestions for(let i=0;i<correctEquations;i++){ firstNumber = getRandomInt(9); secondNumber = getRandomInt(9); const equationValue = firstNumber * secondNumber; const equation = `${firstNumber} X ${secondNumber} = ${equationValue}`; equationObject ={value: equation, evaluated: 'true'}; equationsArray.push(equationObject); } //loop create wrong equation and push into array for(let i=0;i<wrongEquations;i++){ firstNumber = getRandomInt(9); secondNumber = getRandomInt(9); const equationValue = firstNumber * secondNumber; wrongFormat[0] = `${firstNumber} X ${secondNumber+1} = ${equationValue}`; wrongFormat[1] = `${firstNumber+1} X ${secondNumber} = ${equationValue}`; wrongFormat[2] = `${firstNumber} X ${secondNumber+1} = ${equationValue+2}`; const formatChoice = getRandomInt(3); const equation = wrongFormat[formatChoice]; equationObject ={value: equation, evaluated: 'false'}; equationsArray.push(equationObject); } shuffleArray(equationsArray); //console.log("Equestion = ",equationsArray); //equationsToDOM(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateQA(){\n var x = Math.round(Math.random()*14)+1;\n var y = Math.round(Math.random()*9)+1;\n answer = x * y;\n document.getElementById(\"question\").innerHTML = x + \"x\" + y;\n \n //for positioning the correct answer in the random box:\n var position = 1+Math.round(3*Math.rando...
[ "0.7221694", "0.7201865", "0.7160253", "0.71464235", "0.71188885", "0.7106067", "0.7101595", "0.70957786", "0.7049869", "0.70456904", "0.70220155", "0.69543093", "0.6868389", "0.68553853", "0.6846937", "0.68428344", "0.68218726", "0.6817824", "0.6813044", "0.68067133", "0.680...
0.68784636
12
dynamically added correct/incorrect equations..
function populateGamePage(){ //Reset Dom,set Blank space above itemContainer.textContent = ''; //spacer const topSpacer =document.createElement("div"); topSpacer.classList.add("height-240"); //selected items const selectedItem = document.createElement("div"); selectedItem.classList.add("selected-item"); //append itemContainer.append(topSpacer,selectedItem); createEquations(); equationsToDOM(); const bottomSpacer =document.createElement("div"); bottomSpacer.classList.add("height-500"); itemContainer.append(bottomSpacer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createEquations() {\n // Randomly choose how many correct equations there should be\n // const correctEquations = \n // Set amount of wrong equations\n // const wrongEquations = \n // Loop through, multiply random numbers up to 9, push to array\n // for (let i = 0; i < correctEquations; i++) {\n //...
[ "0.6916964", "0.67190486", "0.6631508", "0.6616764", "0.6508894", "0.6444627", "0.64336175", "0.6404153", "0.63975066", "0.6380154", "0.63615566", "0.63269603", "0.62299097", "0.6201372", "0.6198595", "0.61376363", "0.60938096", "0.6073839", "0.6067977", "0.60320926", "0.6031...
0.0
-1
stop timer prcess result
function checkTime(){ //console.log(timePlayed); if(playerGuessArray.length == questionAmount){ console.log("guess array",playerGuessArray) clearInterval(timer); //check for the wrong guess and add penalty time equationsArray.forEach((equation,index) => { if(equation.evaluated === playerGuessArray[index]){ //no penalty } else{ penaltyTime +=0.5; } }); finalTime = timePlayed + penaltyTime; console.log("Time :",timePlayed); console.log("Penalty :",penaltyTime); console.log("finalTime :",finalTime); scoresToDOM(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_stopTimer() {\n this._tock.end();\n }", "function stopTimer() {clearTimeout(startTimer)}", "function stop() {\n timer.stop();\n}", "stop() {\n\t if (this.iObj != null) {\n\t\tclearTimeout(this.iObj);\n\t\tthis.iObj = null;\n\t }\n\t else {\n\t\tconsole.log(\"lTimer: \" + this.n...
[ "0.76767725", "0.7482853", "0.7459706", "0.7428949", "0.7360145", "0.7357664", "0.733257", "0.73029613", "0.7276386", "0.7260394", "0.72554463", "0.7245807", "0.7194946", "0.7187756", "0.7178941", "0.7165328", "0.71628785", "0.71498036", "0.71453375", "0.7144782", "0.7140687"...
0.0
-1
add a tenth of a second to timeplayed
function addTime(){ timePlayed += 0.1; checkTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateTime() {\n scorePanel.playTime = Math.trunc((performance.now() - scorePanel.startTime) / 1000);\n $(\".time\").text(scorePanel.playTime.toString().padStart(3, \"0\").concat(\" seconds\"));\n}", "increaseTime(t) {\n this.currentTime += t;\n this.timeElement.textContent = this.currentTime;\n...
[ "0.6950761", "0.68150246", "0.67656493", "0.65703493", "0.6562626", "0.65467334", "0.65063256", "0.64813876", "0.6477621", "0.64759576", "0.6474559", "0.64367175", "0.6428651", "0.64158666", "0.64085037", "0.6401229", "0.6379555", "0.63769436", "0.63725543", "0.63715714", "0....
0.6912446
1
start the timer when game page is clicked
function startTimer(){ timePlayed = 0; penaltyTime = 0; finalTime = 0 ; timer = setInterval(addTime,100); gamePage.removeEventListener('click',startTimer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleStartGame() {\n console.log(\"Start Game clicked...!\");\n\n //------- Timer ------- //\n\n // Start Timer\n startTimer(0);\n}", "function startGame(){\n hideContent();\n unhideContent();\n assignButtonColours();\n generateDiffuseOrder();\n clearInterval(interval);\n setlevel();\n count...
[ "0.77113634", "0.75670224", "0.7457882", "0.73968923", "0.7395782", "0.7374492", "0.73582786", "0.7290571", "0.7227283", "0.70469564", "0.7036212", "0.69891083", "0.69758266", "0.6941174", "0.693677", "0.69026834", "0.6897432", "0.6844699", "0.6830083", "0.6826668", "0.682523...
0.6494668
82
update the best score array
function updateBestScore(){ //select correct best score to update bestScoreArray.forEach((score,index) => { if(questionAmount == score.questions){ //return bast score as a number with one decimal const savedBestScore = Number(bestScoreArray[index].bestScore); //update new final score is less or replace zero if(savedBestScore ===0 || savedBestScore > finalTime){ bestScoreArray[index].bestScore = finalTimeDisplay; } } }); //update Splash Page bestScoreToDOM(); //saved to local storage localStorage.setItem('bestScores',JSON.stringify(bestScoreArray)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateScores(){\n currentScore = currentGame.length;\n if (bestScore <= 0){\n //update best score from storage.\n var prevScore = scorestorage.getRecord(KEY_BEST_SCORE); \n if (prevScore){\n bestScore = prevScore;\n }\n ...
[ "0.78118235", "0.7089091", "0.7076697", "0.7059087", "0.70383704", "0.6911687", "0.6772529", "0.67457175", "0.6727227", "0.67117745", "0.66908455", "0.66661996", "0.6647496", "0.66472286", "0.6575841", "0.6544597", "0.6530948", "0.6524539", "0.65065426", "0.63613486", "0.6352...
0.7466263
1
Retrieve the user's profile
function retrieve() { // Get the user's uid let uid = $rootScope.account.authData.uid; // Get the profile $rootScope.db.users.child(uid).once('value', function (snapshot) { let profile = snapshot.val(); BroadcastService.send(EVENTS.PROFILE_LOADED, profile); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userProfile() {\n return baseUser().get();\n }", "get userProfile() {\r\n return this.clone(ProfileLoader_1, \"getuserprofile\").postCore();\r\n }", "function getUserProfile() {\n return $http.get('/api/user-profile').then(function (response) {\n return re...
[ "0.8579845", "0.7990188", "0.79420537", "0.78705734", "0.7765", "0.77425575", "0.7731952", "0.772613", "0.76890296", "0.76627886", "0.7590929", "0.7519263", "0.7489081", "0.7489075", "0.74612564", "0.7446453", "0.7442968", "0.73856777", "0.7366988", "0.7359126", "0.73516834",...
0.7514947
12
Initialize a new user in the database
function create(){ // PREPARE let uid = $rootScope.account.authData.uid; let profile = instance.extract($rootScope.account.authData); // INITIALIZE $rootScope.db.users.child(uid).set(profile); $rootScope.account.profile = profile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n \n newUser()\n\n}", "function createUser(newUser){\n\n UserService\n .createUser(newUser)\n .then(\n function (doc) {\n vm.user = null;\n init();\n });\n }"...
[ "0.81090844", "0.71840864", "0.7165727", "0.6888099", "0.6875888", "0.6873677", "0.6802641", "0.6789374", "0.6772745", "0.6749422", "0.67420423", "0.6737575", "0.67326695", "0.67095613", "0.66683203", "0.66493297", "0.6609279", "0.65891176", "0.6581858", "0.65636426", "0.6562...
0.6206654
62
Update the user profile in the database
function update() { // PREPARE let uid = $rootScope.account.authData.uid; let profile = $rootScope.account.profile; // NEW USER ACTION if (profile.newUser) { instance.addAchievement(profile, ACHIEVEMENTS.PROFILE_COMPLETED); profile.newUser = false; } // UPDATE $rootScope.db.users.child(uid).update(profile); // NOTIFY BroadcastService.send(EVENTS.PROFILE_UPDATED, profile); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateProfile(profile) {\n checkUser();\n UserId = userId;\n $.ajax({\n method: \"PUT\",\n url: \"/api/profile_data\",\n data: profile\n })\n .then(function () {\n window.location.href = \"/members\";\n });\n }", "updateProfile() {}", "function updateUserPr...
[ "0.7807826", "0.7778466", "0.7765767", "0.77542657", "0.7745856", "0.7446681", "0.7410113", "0.7356065", "0.7341599", "0.7287491", "0.7237825", "0.72129244", "0.71763974", "0.7146402", "0.7118101", "0.7116507", "0.7106716", "0.7081433", "0.7080873", "0.7080873", "0.70777625",...
0.7960154
0
Remove the user profile in the database
function remove() { // REMOVE FROM DB let uid = $rootScope.account.authData.uid; $rootScope.db.users.child(uid).remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deleteProfile() {}", "deleteProfile() {\n // console.log(\"deleteProfile()\");\n return store.delete('CURRENT_PROFILE');\n }", "function deleteUserProfile(){\n\tconsole.log(\"deleteUserProfile ran \" + userProfileId);\n\tconst settings = {\n\turl: DATABASE_URL + 'userprofile/' + userProfileId,...
[ "0.75565994", "0.70803505", "0.7065429", "0.70616907", "0.6964795", "0.6938524", "0.68980575", "0.6887883", "0.6860602", "0.68469507", "0.68426275", "0.6790303", "0.67643714", "0.6751246", "0.6741149", "0.6636863", "0.6632147", "0.6563877", "0.6535319", "0.65207636", "0.65140...
0.7704827
0
Extract the initial user profile from the provider authData
function extract(authData) { let name = {first: "", last: "", display: ""}; let profile = { // The private bits uid: authData.uid, provider: authData.providerData[0].providerId, newUser: true, email: authData.email, // Publicly readable info expose: { name: name, bio: "", image: "", achievements: [] } }; let provider = authData.providerData[0]; let fullName = provider.displayName; profile.expose.name.first = fullName.split(' ').slice(0, -1).join(' ') || ""; profile.expose.name.last = fullName.split(' ').slice(-1).join(' ') || ""; profile.expose.name.display = provider.displayName || ""; profile.expose.image = provider.photoURL || null; return profile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserInfo(authData) {\n var fbData = authData.providerData[0];\n var fbCachedUserProfile = fbData.cachedUserProfile || {};\n return {\n name: fbData.displayName,\n email: fbData.email || null,\n avatar: fbData.photoURL || null,\n gender: fbCachedU...
[ "0.7119658", "0.6738343", "0.66323805", "0.6538854", "0.65366083", "0.6403593", "0.6363583", "0.6363583", "0.63276255", "0.6311589", "0.62563896", "0.62213933", "0.6190144", "0.6171722", "0.6138962", "0.61311245", "0.61270314", "0.61220217", "0.6119551", "0.6092727", "0.60694...
0.72407746
0
Add an achievement to the user's profile
function addAchievement( profile, achievement ) { if (!profile.expose.achievements) profile.expose.achievements = []; profile.expose.achievements.push( achievement ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function NewAchievement( appid, achievement )\n{\n\tvar parentDiv = document.getElementById( \"appAchievementDisplay\" );\n\tvar sourceDiv = document.getElementById( \"achievementTableSource\" );\n\ttheTable = parentDiv.firstChild;\n\n\tvar newRow = theTable.tBodies[ 0 ].insertRow( -1 );\n\tnewRow.vAlign = \"top\"...
[ "0.6708486", "0.66089743", "0.6458496", "0.60735923", "0.60678715", "0.6029028", "0.60103714", "0.58658814", "0.5839668", "0.58071905", "0.5729417", "0.5568488", "0.5523191", "0.551997", "0.55024505", "0.54988754", "0.5480935", "0.5477365", "0.5455532", "0.5448211", "0.542440...
0.81612325
0
create the data source of the list of techniologies
componentWillMount() { const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); this.dataSource = ds.cloneWithRows(this.props.dataToShow); //ends }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dataSource(data, widgetConfig) {\n let config = widgetConfig.split(' ')[1],\n random = config.split('_')[1],\n source = {\n id: widgetConfig,\n type: 'Componentsmdx_mondrianJndi',\n typeDesc: 'mondrianJndi',\n parent: 'UnIqEiD',\n properties: [],\n meta: 'CDA'...
[ "0.6194345", "0.56481934", "0.56305754", "0.55950165", "0.55836886", "0.55239123", "0.55239123", "0.55233616", "0.55027115", "0.54727805", "0.5444461", "0.54188615", "0.5408274", "0.5348297", "0.5304993", "0.52904654", "0.5282035", "0.52758574", "0.52586293", "0.5255935", "0....
0.0
-1
render each item of the list
renderRow(library) { return <ListItem library={library} />; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(){\n\tvar src = \"\"\n\tfor(i in TodoList.items) src += ItemTemplate(TodoList.items[i]);\n\tel.innerHTML = src;\n}", "function RENDER_items(items) {\n\n }", "render() {\n this.list.innerHTML = '';\n\n startingData.forEach(item => {\n this.createDomElements(item.id);\n this.li.i...
[ "0.7597431", "0.7404374", "0.7206154", "0.7074272", "0.6993032", "0.686644", "0.6822903", "0.6785409", "0.67713", "0.67653006", "0.6751877", "0.6747998", "0.6741834", "0.67129725", "0.6702518", "0.6686796", "0.6661745", "0.66526586", "0.6647235", "0.66272837", "0.6626742", ...
0.0
-1
heart of the code detects slider clicks and mouseovers, and updates the map accordingly
function brushed() { // get click location var value = brush.extent()[0]; if (d3.event.sourceEvent) { // not a programmatic event value = x.invert(d3.mouse(this)[0]); brush.extent([value, value]); } // set slider location handle.attr("cx", x(value)); // update the date in the legend svg.selectAll(".date-label").text(dateLabel(value)); // get the north and south totals var north=svg .selectAll(".unit") .data(states.features) .filter(function(d) { return d.properties.ID=="ak_state";})[0][0].__data__; var south=svg .selectAll(".unit") .data(states.features) .filter(function(d) { return d.properties.ID=="hi_state";})[0][0].__data__; var snorth=students(north,value); var ssouth=students(south,value); // do the update svg.selectAll(".n-label").text("North: "+snorth+" ("+(snorth/(snorth+ssouth)*100).toFixed(2)+"%)"); svg.selectAll(".s-label").text("South: "+ssouth+" ("+(ssouth/(snorth+ssouth)*100).toFixed(2)+"%)"); // connect svg elements to their data svg.selectAll(".unit") .data(states.features) // determine if state should be active now .classed("active", function(d) { return (new Date(d.properties.START_DATE)) <= value && value <= (new Date(d.properties.END_DATE)); }) // determine the color to make a state based on the number of students // only adds and removes the legend colors .attr("class",function(d) { var ns=students(d,value); var curheat=Math.ceil(students(d,value)*legendScaleStep); if (ns==0) { curheat=0; } var curclasses=d3.select(this).attr("class").replace(/heatLevel[0-9]*/g,''); var newclasses=curclasses+" heatLevel"+curheat; return newclasses; }) // shows and hides tooltip based on mouse movement .on("mousemove", function(d, i) { var mouse = d3.mouse(d3.select("body").node()); tooltip.classed("hidden", false) .attr("style", "left:" + (mouse[0] + 10) +"px; top:" + (mouse[1] - 100) + "px") .html( "<h4>" + d.properties.FULL_NAME + "</h4><p><strong>Students:</strong> " + students(d,value) + "</p><p><strong>Cumulative:</strong> " + cstudents(d,value)+"</p>" ); }) .on("mouseout", function(d, i) { tooltip.classed("hidden", true); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function placeMapButtons() {\n var baseLayerDiv = $(\"#\" + mapTools.baseLayer.div);\n var baseLayerImg = $(\"#\" + mapTools.baseLayer.idimg);\n var regionsDiv = $(\"#\" + mapTools.regions.div);\n var uploadedmapDiv = $(\"#\" + mapTools.uploadedmap.div);\n baseLayerDiv.click(function () {\n if (bas...
[ "0.67183304", "0.66139746", "0.6606271", "0.64502835", "0.63984793", "0.63540715", "0.63458467", "0.6335029", "0.63268363", "0.6315137", "0.63049525", "0.630314", "0.63001895", "0.6298992", "0.6297705", "0.6282006", "0.62523997", "0.62441564", "0.62262225", "0.6190531", "0.61...
0.0
-1
utilty functions insert new classes into the stylesheet
function createClass(name,rules){ var style = document.createElement('style'); style.type = 'text/css'; document.getElementsByTagName('head')[0].appendChild(style); if(!(style.sheet||{}).insertRule) (style.styleSheet || style.sheet).addRule(name, rules); else style.sheet.insertRule(name+"{"+rules+"}",0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateSpryCSSClasses()\n{\n var dom = dw.getDocumentDOM();\n\tvar allClasses = dom.getSelectorsDefinedInStylesheet('class');\n\tfor (i = 0; i < allClasses.length; i++)\n\t{\n\t\tif (allClasses[i][0] == '.')\n\t\t{\n\t\t\tallClasses[i] = allClasses[i].slice(1);\n\t\t}\n\t}\n\t_LIST_SPRY_HOVER_CLASSES.se...
[ "0.69386965", "0.6909671", "0.69048554", "0.635301", "0.62114275", "0.62052315", "0.61946356", "0.6148107", "0.61036515", "0.6102438", "0.6059425", "0.60481244", "0.6035947", "0.60336137", "0.60330087", "0.60144967", "0.5971051", "0.59632194", "0.59470534", "0.59456784", "0.5...
0.61105055
8
dynamically create classes with fill property interpolated from given starting colors
function genlegendScaleLevels(start, end, num) { var incr=(end[0]-start[0])/num; var incg=(end[1]-start[1])/num; var incb=(end[2]-start[2])/num; for(k = 1; k <= num; k++) { cur=[Math.round(start[0]+k*incr),Math.round(start[1]+k*incg),Math.round(start[2]+k*incb)]; createClass(".heatLevel"+k.toString(),"fill: rgb("+cur.toString()+");"); legendScaleLevels[k]=cur; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "generateFillStyle(grd, ...colors) {\n switch (colors.length) {\n case 2:\n grd.addColorStop(0, colors[0]);\n grd.addColorStop(1, colors[1]);\n break;\n case 3:\n grd.addColorStop(0, colors[0]);\n grd.addColorStop(0.5, colors[1]);\n grd.addColorStop(1, colors[2...
[ "0.65028733", "0.646131", "0.6299367", "0.62711954", "0.6214113", "0.61833346", "0.61480886", "0.61161965", "0.6045618", "0.603745", "0.60260814", "0.60173506", "0.6010783", "0.59957993", "0.59751594", "0.590659", "0.5905914", "0.58942556", "0.58899057", "0.5887788", "0.58851...
0.0
-1
turn note on and off depending on the date
function dateLabel(year) { if (year<sliderNote) { svg.selectAll(".exp-label").classed("hidden",false); return "Class of "+niceDate(year)+"*"; } else { svg.selectAll(".exp-label").classed("hidden",true); return "Class of "+niceDate(year); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function autoStatus(note, isInView) {\r\n\t\t\t//stop if note is not in the view\r\n\t\t\tif(!isInView){ return; }\r\n\r\n\t\t\t//stop if the note is already unread\r\n\t\t\tif(!note.unread){ return; }\r\n\r\n\t\t\t//if auto marking read AND note is not excluded\r\n\t\t\tif(settingsService.load().readOnView && !ex...
[ "0.5974877", "0.5926578", "0.5919073", "0.59049875", "0.5815867", "0.5793834", "0.57916176", "0.5775055", "0.5774281", "0.5747004", "0.57154095", "0.5695511", "0.56715196", "0.5624724", "0.5616657", "0.56114113", "0.55757326", "0.5500368", "0.54903036", "0.54580116", "0.54442...
0.0
-1
format the date to be displayed in the legend
function niceDate(date) { return legendDateFormat(new Date(date)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "formatDates() {\n for (let i = 0; i < this.results.length; i++) {\n const g = this.results[i];\n g.label = g.name;\n if (g.label instanceof Date) {\n g.label = g.label.toLocaleDateString();\n }\n if (g.series) {\n for (let ...
[ "0.6819712", "0.6819712", "0.66999257", "0.6654725", "0.6452557", "0.6452557", "0.6452557", "0.64485043", "0.64357054", "0.63821864", "0.637969", "0.63708043", "0.63325256", "0.6323073", "0.62836605", "0.62768424", "0.6266034", "0.626415", "0.6263533", "0.6251099", "0.6247347...
0.7079235
0
retrieve the number of students for the current year from the specified state data string
function students(d,curdate) { if (d.properties.students) { var dateloc=d.properties.students.search(niceDate(curdate)); if (dateloc > -1) { return Number(d.properties.students.substr(dateloc+5,3)); } else { return "0";} } else {return "0";} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStudentYears(studentName) {\n /*\n * Filter the transcriptList for the specfied student\n */\n let transcriptList = database_data.getTranscripts();\n let findStudentTrans = transcriptList.filter(function (obj) {\n return (obj.studentName===studentName);\n });\n\n /*\n * Using the records ...
[ "0.59928185", "0.5751827", "0.56746644", "0.55173886", "0.54779744", "0.54779744", "0.544003", "0.53880924", "0.5353189", "0.5349633", "0.5332062", "0.531892", "0.5275218", "0.52262175", "0.5222822", "0.5198719", "0.5192834", "0.51871246", "0.51866966", "0.51818204", "0.51739...
0.6153663
0
adds numbers in a string
function addbits(s){ var total= 0, s= s.match(/[+\-]*(\.\d+|\d+(\.\d+)?)/g) || []; while(s.length){ total+= parseFloat(s.shift()); } return total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addDigit(str) {\n return str.split('').map(str => parseInt(str)).reduce((acc, el)=> acc+el, 0);\n}", "function add(input) {\n const [a, b] = input.split(' ');\n return Number(a) + Number(b);\n}", "function add(a,b) {\r\n let [a_str, b_str] = [a, b].map((e) => e.split('').reverse().join(''))\...
[ "0.7885849", "0.71828693", "0.706001", "0.7054806", "0.69809556", "0.69771135", "0.69563305", "0.6905896", "0.68593454", "0.68509257", "0.6759812", "0.67418545", "0.66835576", "0.6678926", "0.6630407", "0.6595433", "0.65815294", "0.6552585", "0.6532543", "0.6506907", "0.65038...
0.6078606
58
retrieve the cummulative number of students for the current year from the specified state data string
function cstudents(d,curdate) { if (d.properties.students) { var dateloc=d.properties.students.search(niceDate(curdate)); var cstudent= d.properties.students; var csmatch=cstudent.match(/[0-9]{4}/g); var breakdate="0"; for (k=0;k<csmatch.length;k++) { if (csmatch[k]>niceDate(curdate) && k==0) { return "0"; } if (csmatch[k]>niceDate(curdate) && k>0) { breakdate=csmatch[k-1]; break; } if (k==csmatch.length-1) { breakdate="all"; break; } } if (breakdate=="0") { return "0"; } if (breakdate!="all") { var repstr="("+breakdate+":[0-9]*).*"; cstudent=cstudent.replace(new RegExp(repstr),"$1"); } cstudent=cstudent.replace(/[^,]?[0-9]*:/g,"+"); cstudent=cstudent.replace(/,/g,""); return addbits("0"+cstudent); } else {return "0";} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSeniority(dateString) {\n var today = new Date();\n var startDate = new Date(dateString);\n var years = today.getFullYear() - startDate.getFullYear();\n var m = today.getMonth() - startDate.getMonth();\n if (m < 0 || (m === 0 && today.getDate() < startDate.getDate())) {\n years--;...
[ "0.5795936", "0.5732486", "0.56506515", "0.5545493", "0.5542618", "0.54862535", "0.5450072", "0.54258454", "0.541889", "0.5409576", "0.54052836", "0.5378007", "0.5343427", "0.5323088", "0.52799714", "0.5271085", "0.52570367", "0.5251613", "0.5236614", "0.52238524", "0.5206901...
0.5600465
3
adjust the thickness of lines when zooming
function zoomed() { var scale = Math.min(5, d3.event.scale); svg.selectAll(".unit").style("stroke-width", 1.0 / d3.event.scale + "px"); svg.selectAll(".coast").style("stroke-width", 0.9 / d3.event.scale + "px"); svg.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLinezoomWidth() {\n let strokeW = [\n 15, 8.5, 8, 7.5, 7, 6.5, 6, 5.5, 5, 4.5, 4, 3.5, 3, 4, 2, 1.9, 1.8, 1.1\n ];\n let zoom = map.getZoom();\n let width = strokeW[zoom - 1];\n return width;\n}", "function getLineWidth(d) {\n //The min value of how thin the lines can become ...
[ "0.7376246", "0.7234858", "0.7234858", "0.6784313", "0.6778145", "0.6720486", "0.6601283", "0.65776503", "0.6557231", "0.6552513", "0.64704573", "0.646643", "0.64166343", "0.6410832", "0.6406606", "0.6386942", "0.63588965", "0.63342446", "0.6314451", "0.6284003", "0.61899793"...
0.62184566
20
vuex v3.1.3 (c) 2020 Evan You
function n(t){var e=Number(t.version.split(".")[0]);if(e>=2)t.mixin({beforeCreate:i});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[i].concat(t.init):i,n.call(this,t)}}function i(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.parent.$store;}}", "function U(He){Le&&(He._devtoolHook=Le,Le.emit('v...
[ "0.711758", "0.6952523", "0.67182934", "0.6706392", "0.6582922", "0.6582922", "0.6582922", "0.65800726", "0.6554717", "0.6455266", "0.6320404", "0.63193226", "0.6311852", "0.6311852", "0.6311852", "0.6311852", "0.6311852", "0.6307827", "0.6299624", "0.6255294", "0.6249346", ...
0.0
-1
! vuerouter v3.1.6 (c) 2020 Evan You
function i(t,e){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "func...
[ "0.60304916", "0.59034866", "0.5846233", "0.57243824", "0.571982", "0.56857914", "0.5651773", "0.5592403", "0.55827314", "0.557127", "0.55548024", "0.55528164", "0.55521166", "0.5507836", "0.55053294", "0.54622334", "0.5425695", "0.5423413", "0.54185784", "0.5409354", "0.5386...
0.0
-1
given restrictions provided, make a reduced list of products prices should be included in this list, as well as a sort based on price
function restrictListProducts(prods, restriction, organic) { var product_information = []; if (organic){ for (let i=0; i<prods.length; i+=1) { if ((restriction == "lactosenutfree") && (prods[i].lactosefree) && (prods[i].nutfree) && (prods[i].organic)){ product_information.push([prods[i].price, prods[i].name]); } else if ((restriction == "lactosefree") && (prods[i].lactosefree) && (prods[i].organic)){ product_information.push([prods[i].price, prods[i].name]); } else if ((restriction == "nutfree") && (prods[i].nutfree) && (prods[i].organic)){ product_information.push([prods[i].price, prods[i].name]); } else if ((restriction == "None") && (prods[i].organic)){ product_information.push([prods[i].price, prods[i].name]); } } return product_information.sort(function sortListProducts(valA, valB) { return valA[0] - valB[0]; }); }else{ for (let i=0; i<prods.length; i+=1) { if ((restriction == "lactosenutfree") && (prods[i].lactosefree) && (prods[i].nutfree)){ product_information.push([prods[i].price, prods[i].name]); } else if ((restriction == "lactosefree") && (prods[i].lactosefree)){ product_information.push([prods[i].price, prods[i].name]); } else if ((restriction == "nutfree") && (prods[i].nutfree)){ product_information.push([prods[i].price, prods[i].name]); } else if (restriction == "None"){ product_information.push([prods[i].price, prods[i].name]); } } return product_information.sort(function sortListProducts(valA, valB) { return valA[0] - valB[0]; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif ((restriction == \"lactose\") &&(prods[i].LactoseFree == true)){\n\t\t\tproduct_names.push(prods[i]);\n\t\t}\n\t\telse if ((restriction == \"noix\") && (prods[i].noixfree == true)){\n\t\t...
[ "0.74831665", "0.74503493", "0.73820394", "0.7317847", "0.7304312", "0.7155821", "0.6997339", "0.6922627", "0.69088805", "0.687862", "0.68585145", "0.6805897", "0.6664231", "0.66454655", "0.6577675", "0.6494552", "0.6344502", "0.6343082", "0.6342061", "0.62489545", "0.6230538...
0.7156894
5
Calculate the total price of items, with received parameter being a list of products
function getTotalPrice(chosenProducts) { totalPrice = 0; for (let i=0; i<products.length; i+=1) { if (chosenProducts.indexOf(products[i].name) > -1){ var productName = totalPrice += products[i].price; } } return totalPrice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateTotalPrice(orderedItems) {\n let totalPrice = 0;\n // Пиши код ниже этой строки\n\n \n\n orderedItems.forEach(function( orderedItems, index,){\n \ttotalPrice += orderedItems;\n }); \n // Пиши код выше этой строки\n return totalPrice;\n}", "function calcTotalPrice(products) {\n\t// YOUR CODE...
[ "0.7825455", "0.78026843", "0.7787457", "0.7775041", "0.77605176", "0.7616255", "0.7599534", "0.7494437", "0.74280393", "0.74280393", "0.74280393", "0.74280393", "0.74280393", "0.74280393", "0.74280393", "0.74280393", "0.74280393", "0.74280393", "0.74079514", "0.7370472", "0....
0.7339509
26
git foreachref format="%(if)%(upstream)%(then)%(refname:short)=====%(upstream:short)%(else)%(refname:short)%(end)" refs/heads Output: brancha conflictbranch=====origin/conflictbranch master=====origin/master orangebranch1=====origin/orangebranch1 origin/testbranch3=====origin/origin/testbranch3 test1=====origin/test1 test2=====origin/test2 test3 test7 testbranch2=====origin/testbranch2
function getLocalAndRemoteBranches(repo) { const child = spawnGitProcess(repo, ['for-each-ref', '--format="%(refname:short)===XXX===%(if)%(upstream)%(then)%(upstream:short)%(end)===XXX===%(if)%(HEAD)%(then)HEAD%(end)"', 'refs/heads']); return redirectIO(child, null, null).then(function (res) { if (!res.errorCode) { let localAndRemoteBranches = res.output.join('\n').trim().split('\n'); let allBranches = []; localAndRemoteBranches.forEach((b) => { b = b.substring(1, b.length - 1); // because they are enclosed in double quotes // console.log(b); let branchSplit = b.split(/===XXX===/g); let branchInfo = {}; if(branchSplit[0]) { branchInfo.local = branchSplit[0]; } if(branchSplit[1]) { branchInfo.remote = branchSplit[1]; } if(branchSplit[2]) { branchInfo.isCurrent = true; } allBranches.push(branchInfo); }); return allBranches; } // TODO: handle error here. }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function print_with_commit(base_body){\r\n var msg = \"Issue co maju commit: \";\r\n for(var i in base_body) {\r\n if (base_body[i].pull_request != undefined) {\r\n msg += \" \" + i;\r\n }\r\n }\r\n console.log(msg);\r\n}", "function talk_to_git (refs) {\n process.stdin.setE...
[ "0.54114103", "0.5204545", "0.50449944", "0.49945587", "0.49767423", "0.49517336", "0.49473965", "0.49467558", "0.49040538", "0.48349437", "0.48229373", "0.48080593", "0.47618443", "0.4715491", "0.47031298", "0.467832", "0.46716523", "0.46553308", "0.46229312", "0.46035722", ...
0.5440312
0
Checks if rebase, interactive rebase, merge or revert are in progress.
function getLocalProgressStatus(repo) { let rebaseHeadPromise = utils.progressFileExists(utils.getRebaseHeadPath(repo)); let interactiveRebaseHeadPromise = utils.progressFileExists(utils.interactiveRebaseHeadPath(repo)); let mergeHeadPromise = utils.progressFileExists(utils.getMergeHeadPath(repo)); let revertHeadPromise = utils.progressFileExists(utils.getRevertHeadPath(repo)); // no way yet to see stash in progress. // we'll detect these by checking UU on file status. return Promise.all([rebaseHeadPromise, mergeHeadPromise, revertHeadPromise, interactiveRebaseHeadPromise]).then((heads) => { if (heads[0] || heads[1] || heads[2]) { // there is something in progress! if (heads[0]) { return 'rebase-progress'; } if (heads[1]) { return 'merge-progress'; } if (heads[2]) { return 'revert-progress'; } if (heads[3]) { return 'interactive-rebase-progress'; } } return; }).catch((err) => { console.log(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shouldContinued(){\n // Check one : Any pending setTimeout,setInterval,setImmediate?\n // Check two : Any pending Os tasks? (Like server listening port)\n // Check tree: Any pending long running operations? (Like fs module)\n\n return pendingTimers.length || pendingOSTask.length ||\n pe...
[ "0.5947662", "0.58700025", "0.5604672", "0.5598895", "0.5570141", "0.553819", "0.54924464", "0.53769654", "0.5329995", "0.5329995", "0.5321498", "0.53044164", "0.5281371", "0.52276486", "0.52276486", "0.52276486", "0.5204006", "0.517064", "0.5136094", "0.51291984", "0.5114911...
0.0
-1
return; / Identify the cluster and the client/server container: Figure out if the host has a parent lookup the most recent entry in hosts table. Maybe not the most recent... just overwrite them as new relationships are made If yes, figure out parent chain from container to cluster Insert into TIME MAP database using the current timestamp. Insert all parents up to and including cluster Insert rest of config using simple loop. Or maybe insert the whole JSON for the host as one line to save time If NOT: the host doesn't have a parent. Need to determine the cluster how? Step 0: Identify IPs (done above) and subnets of the host Step 1 worst: lookup subnets each cluster is responsible for. If found use that cluster What if several subnets are found belonging to different clusters? Step 2 better: lookup "unknown peers" IPs created when sockets are recorded, and remote is not found. If found, Use cluster of known peer This is bad idea. Sockets could be very remote... strike step 2 Step 3 best: lookup "unknown peers" WWNs created when disk (FC/IB) I/O is recored. If found, use cluster of known peer Only works for storage devices Step 4: If not found use default cluster
function retrieveClusters(currentId){ function data(currentId){//Define closure function to pass current variables to callback. Don't ask how //debugger; return currentId; } var params = []; for (var a = 0; a<hostAttrs[currentId].subnets.length; a++){params.push('?')}; var params = params.join(); var subnetClusterQuery = 'select subnet,cluster_id,parent from subnets where subnet in (' + params + ')'; db.execute(subnetClusterQuery,hostAttrs[currentId].subnets,function(err,result){ var id = data(currentId); //debugger; //currentData.originalString = JSON.parse(currentData.originalString); var cluster = ''; var parent; //debugger; if(err){console.log('Could not select clusters; Error: ',err);debugger} else{ //console.log(clusters); var clusters = result.rows; //debugger; if (clusters.length == 0) { //cluster = 'defaut'; //insertConfig() } else{ for (var z = 0; z < clusters.length; z++){ if (hostAttrs[id].subnets.indexOf(clusters[z]['subnet']) == -1) { var error = new Error('DB result is not in list of subnets...'); //debugger; console.log(error); //console.log(currentData); console.log(result); } else if (clusters[z]['cluster_id'] == null) { //cluster = 'id_default_cluster'; } else{ cluster = clusters[z]['cluster_id']; parent = clusters[z]['parent']; } } } } if (cluster == '') { cluster = defaultClusterId;//'id_cluster_default'; parent = mapRoot;//'viewport' } hostAttrs[id].cluster = {'id':cluster,'parent':parent}; retrieveContainers(id); //debugger; }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test_cluster_graph_by_host_tag_vsphere65() {}", "function main(user, hostname, hostAndPort)\n{\n\n var result = {};\n if (user.toString() == \"\" || user.toString() == \"#N/A\" ||\n user.empty())\n {\n result[\"error_msg\"] = \"Argument 'user' not specified\"; \n print(resu...
[ "0.59436774", "0.57877105", "0.5773753", "0.57273227", "0.57084966", "0.57065123", "0.56778544", "0.56060505", "0.55737275", "0.55737275", "0.55671185", "0.55547965", "0.55064", "0.54834527", "0.5422067", "0.541295", "0.5358403", "0.53452945", "0.5304326", "0.5261183", "0.521...
0.6155328
0
In some versions of JavaScript subnet calculators they use bitwise operations to shift the values left. Unfortunately JavaScript converts to a 32bit signed integer when you mess with bits, which leaves you with the sign + 31 bits. For the first byte this means converting back to an integer results in a negative value for values 128 and higher since the leftmost bit, the sign, becomes 1. Using the 64bit float allows us to display the integer value to the user. / dottedquad IP to integer
function IPv4_dotquadA_to_intA( strbits ) { var split = strbits.split( '.', 4 ); var myInt = ( parseFloat( split[0] * 16777216 ) /* 2^24 */ + parseFloat( split[1] * 65536 ) /* 2^16 */ + parseFloat( split[2] * 256 ) /* 2^8 */ + parseFloat( split[3] ) ); return myInt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IPToNumber(s) {\n\n var arr = s.split('.');\n var n = 0;\n for (var i = 0; i < 4; i++) {\n\n n = n * 256;\n n += parseInt(arr[i], 10);\n\n }\n\n return n;\n }", "function ipToInt32(ip) {\n const givenArr = ip.sp...
[ "0.7144108", "0.6971148", "0.67631763", "0.6753766", "0.66046524", "0.6519572", "0.6381058", "0.63735265", "0.62802345", "0.62318075", "0.62083477", "0.6166805", "0.607505", "0.59041", "0.5902165", "0.588857", "0.5886315", "0.5871601", "0.5856926", "0.5831653", "0.5779503", ...
0.588534
17
integer IP to dottedquad
function IPv4_intA_to_dotquadA( strnum ) { var byte1 = ( strnum >>> 24 ); var byte2 = ( strnum >>> 16 ) & 255; var byte3 = ( strnum >>> 8 ) & 255; var byte4 = strnum & 255; return ( byte1 + '.' + byte2 + '.' + byte3 + '.' + byte4 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IPAddress$dottedQuadNotation(ipv4part) {\n var ipv4 = IPAddress$IPv4ToInt(ipv4part);\n\n // convert to unsigned int\n var bits = ipv4 >>> 0;\n\n // take IPv4 bits and stuff them in two hextets\n var hextets = [];\n hextets.push(((bits >>> 16) & 0xffff).toString(16));\n hextets.push((b...
[ "0.66691685", "0.6656301", "0.65467286", "0.6528585", "0.6415432", "0.64053726", "0.63745654", "0.6355883", "0.6326696", "0.62906796", "0.62012213", "0.6025194", "0.60071456", "0.59007293", "0.5771361", "0.56877965", "0.5649471", "0.56186336", "0.55782306", "0.55221874", "0.5...
0.71540564
0
integer IP to binary string representation
function IPv4_intA_to_binstrA( strnum ) { var numStr = strnum.toString( 2 ); /* Initialize return value as string */ var numZeros = 32 - numStr.length; /* Calculate no. of zeros */ if (numZeros > 0) { for (var i = 1; i <= numZeros; i++) { numStr = "0" + numStr } } return numStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function int2ip(ipInt) {\n return ((ipInt >>> 24) + '.' + (ipInt >> 16 & 255) + '.' + (ipInt >> 8 & 255) + '.' + (ipInt & 255));\n }", "function intToIP(int) {\n var part1 = int & 255;\n var part2 = ((int >> 8) & 255);\n var part3 = ((int >> 16) & 255);\n var part4 = ((int >> 24) & 255);\n\n return part...
[ "0.720971", "0.6954008", "0.6925673", "0.6919331", "0.6758537", "0.67022055", "0.6317694", "0.61956024", "0.6191963", "0.61403567", "0.607433", "0.58968896", "0.58968896", "0.58130854", "0.57628435", "0.5753533", "0.5681489", "0.56513435", "0.5624836", "0.560719", "0.558211",...
0.60560924
11
binary string IP to integer representation
function IPv4_binstrA_to_intA( binstr ) { return parseInt( binstr, 2 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ipToInt32(ip) {\n const givenArr = ip.split('.');\n console.log({ givenArr });\n\n const binaryArr = givenArr.map(elm => {\n let stage1 = Number.parseInt(elm, 10).toString(2);\n\n if (stage1.length < 8) {\n while (stage1.length < 8) {\n stage1 = `0${stage1}`;\n }\n }\n\n re...
[ "0.8008878", "0.7915412", "0.7426816", "0.73700917", "0.7018979", "0.6864039", "0.6843921", "0.68012166", "0.68005884", "0.67612255", "0.6714375", "0.6517607", "0.6449379", "0.63932", "0.6374356", "0.62983423", "0.6271007", "0.62106454", "0.62102085", "0.60810375", "0.6079408...
0.6796587
9
convert of bits to a string representation of the binary value
function IPv4_bitsNM_to_binstrNM( bitsNM ) { var bitString = ''; var numberOfOnes = bitsNM; while( numberOfOnes-- ) bitString += '1'; /* fill in ones */ numberOfZeros = 32 - bitsNM; while( numberOfZeros-- ) bitString += '0'; /* pad remaining with zeros */ return bitString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toBinStr_old(bits){\n\t\tvar data = '';\n\t\tvar pad = (bits.length % 8) ? (new Array(1 + 8 - (bits.length % 8))).join('0') : '';\n\t\tbits = pad + bits;\n\t\tfor(var i = 0; i < bits.length; i+= 8){\n\t\t\tdata += String.fromCharCode(parseInt(bits.substr(i,8),2))\n\t\t}\n\t\treturn data;\n\t}", "functio...
[ "0.77219754", "0.7598411", "0.7060089", "0.7016584", "0.7003877", "0.692534", "0.6918987", "0.6915354", "0.6894471", "0.6865475", "0.6865475", "0.6865475", "0.6865475", "0.6865475", "0.68610656", "0.6859688", "0.6854282", "0.68462634", "0.68333507", "0.6833349", "0.68287325",...
0.0
-1
The IPv4_Calc_ functions operate on string representations of the binary value because I don't trust JavaScript's sign + 31bit bitwise functions. / logical AND between address & netmask
function IPv4_Calc_netaddrBinStr( addressBinStr, netmaskBinStr ) { var netaddressBinStr = ''; var aBit = 0; var nmBit = 0; for( pos = 0; pos < 32; pos ++ ) { aBit = addressBinStr.substr( pos, 1 ); nmBit = netmaskBinStr.substr( pos, 1 ); if( aBit == nmBit ) { netaddressBinStr += aBit.toString(); } else{ netaddressBinStr += '0'; } } return netaddressBinStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maskAnd(ip, mask) {\n /* The following line adjusts the ip address to match the first address in the subnet (filtering all non-subnet mask bits in the ip */\n /* Not that this is done for the left 16 bits and the right 16 bits separately since the bitwise operator works on 32 bit signed integers yie...
[ "0.6851703", "0.6516667", "0.6452689", "0.6411952", "0.6330019", "0.6179437", "0.6168678", "0.615925", "0.611519", "0.61085916", "0.6059655", "0.6057545", "0.6039801", "0.6007558", "0.5983626", "0.59814966", "0.59600306", "0.5897673", "0.584507", "0.57592183", "0.5719682", ...
0.68596375
0
logical OR between address & NOT netmask
function IPv4_Calc_netbcastBinStr( addressBinStr, netmaskBinStr ) { var netbcastBinStr = ''; var aBit = 0; var nmBit = 0; for( pos = 0; pos < 32; pos ++ ) { aBit = parseInt( addressBinStr.substr( pos, 1 )); nmBit = parseInt( netmaskBinStr.substr( pos, 1 )); if( nmBit ) { nmBit = 0; } /* flip netmask bits */ else{ nmBit = 1; } if( aBit || nmBit ) { netbcastBinStr += '1' } else{ netbcastBinStr += '0'; } } return netbcastBinStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maskOr(ip, mask) {\n /* The following line adjusts the ip address to match the first address in the subnet (filtering all non-subnet mask bits in the ip */\n /* Not that this is done for the left 16 bits and the right 16 bits separately since the bitwise operator works on 32 bit signed integers yiel...
[ "0.680771", "0.6219385", "0.6219385", "0.5997755", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0.5931759", "0...
0.0
-1
included as an example alternative for converting 8bit bytes to an integer in IPv4_dotquadA_to_intA
function IPv4_BitShiftLeft( mask, bits ) { return ( mask * Math.pow( 2, bits ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IPv4_dotquadA_to_intA( strbits ) {\r\n\tvar split = strbits.split( '.', 4 );\r\n\tvar myInt = (\r\n\t\tparseFloat( split[0] * 16777216 )\t/* 2^24 */\r\n\t + parseFloat( split[1] * 65536 )\t\t/* 2^16 */\r\n\t + parseFloat( split[2] * 256 )\t\t/* 2^8 */\r\n\t + parseFloat( split[3] )\r\n\t);\r\n\treturn...
[ "0.7918755", "0.7236304", "0.70203555", "0.68247277", "0.67811215", "0.6688464", "0.6524969", "0.65107256", "0.6499168", "0.64725983", "0.63687384", "0.636617", "0.63246757", "0.63173294", "0.6210596", "0.62101173", "0.6203542", "0.61952233", "0.6150341", "0.6128387", "0.6043...
0.0
-1
used for display purposes
function IPv4_BinaryDotQuad( binaryString ) { return ( binaryString.substr( 0, 8 ) +'.'+ binaryString.substr( 8, 8 ) +'.'+ binaryString.substr( 16, 8 ) +'.'+ binaryString.substr( 24, 8 ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get formattedDisplay() { \n if(this.props.display.length >= 7) { return this.props.display.substring(0, 7); }\n \n return this.props.display;\n }", "_replaceDisplay(value) {}", "get formattedText() {\n return this.i.b;\n }", "function IpadicFormatter() {\n}", "displayInfo() {\n\t\t\tlet...
[ "0.6131478", "0.60869", "0.60769486", "0.59830856", "0.5966366", "0.59269834", "0.5898427", "0.5895316", "0.5881601", "0.5856703", "0.5841988", "0.58286303", "0.5799822", "0.5780264", "0.57791615", "0.5778942", "0.57748216", "0.5769433", "0.57661957", "0.57633346", "0.5754308...
0.0
-1
It should return YES if they reach the same position at the same time, or NO if they don't. kangaroo has the following parameter(s): x1, v1: integers, starting position and jump distance for kangaroo 1 x2, v2: integers, starting position and jump distance for kangaroo 2 Output Format Print YES if they can land on the same location at the same time; otherwise, print NO. Note: The two kangaroos must land at the same location after making the same number of jumps. Sample Input 0 0 3 4 2 Sample Output 0 YES
function kangaroo(x1, v1, x2, v2) { if(v1 < v2) return 'NO'; if(((x2 - x1) % (v1 - v2)) == 0) return "YES" return "NO" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function kangaroo(x1, v1, x2, v2) {\n //while loop to run that will keep a track of wether the fastest kangaroo is in the front, if it is, it will break.\n while (true) {\n // if condition is met\n if(x1 < x2 && v1 <= v2 || x1 > x2 && v1 >= v2){\n // break the loop\n break\n }\...
[ "0.7940926", "0.74936295", "0.7074402", "0.6178513", "0.61657846", "0.6160895", "0.614676", "0.611185", "0.6065985", "0.6028716", "0.59783024", "0.5953841", "0.5896727", "0.5822159", "0.58109325", "0.5800604", "0.579731", "0.5784387", "0.5780059", "0.5774632", "0.574037", "...
0.57884353
17
Clamps a value n between min and max values.
function clampValue(min, n, max) { return Math.min(Math.max(min, n), max); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clamp(min, n, max) {\n\t return Math.max(min, Math.min(n, max));\n\t}", "function clamp(min, n, max) {\n return Math.max(min, Math.min(n, max));\n}", "function clamp(n, min, max) {\n if (n > max) { n = max; }\n if (n < min) { n = min; }\n\n return n;\n }", "function cla...
[ "0.7785194", "0.7721507", "0.7696209", "0.7658065", "0.756306", "0.7496826", "0.72142243", "0.7176106", "0.6973683", "0.6969374", "0.68676674", "0.6848788", "0.6822472", "0.6794801", "0.6776545", "0.6768619", "0.6762097", "0.6760018", "0.67585105", "0.6755517", "0.67548186", ...
0.78985715
1
get formatted address based on current position and set it to input
function setCurrentPosition(pos) { var geocoder = new google.maps.Geocoder(); var latlng = {lat: parseFloat(pos.coords.latitude), lng: parseFloat(pos.coords.longitude)}; geocoder.geocode({ 'location' :latlng }, function (responses) { console.log(responses); if (responses && responses.length > 0) { $("#to").val(responses[1].formatted_address); $("#origin").val(responses[1].formatted_address); // console.log(responses[1].formatted_address); } else { alert("Cannot determine address at this location.") } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFormattedAddress() {\n\n }", "function formatAddress(address) {\n\treturn address;\n}", "fillInAddress() {\n const place = this.autocomplete.getPlace();\n console.log(\"fill\",place);\n let str = place.formatted_address;\n console.log(\"str\", str);\n this.entered_address = str;\...
[ "0.69287354", "0.6755671", "0.6567135", "0.65388316", "0.6373146", "0.6230345", "0.62207747", "0.61034846", "0.6046665", "0.60404474", "0.5932829", "0.59213233", "0.5913287", "0.589963", "0.58830035", "0.58764935", "0.58323574", "0.58228993", "0.5789428", "0.57707477", "0.576...
0.5741885
23
AS PER COOPER > optionChanged, then "getElement" ById not class
function optionChanged(passdata) { table(passdata); charts(passdata); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function optionChanged(id) {\n getData(id);\n}", "function optionChanged(id) {\n\n getData(id);\n}", "function optionChanged(){\n init();\n}", "function optionChanged(id) {\n charting(id);\n meta(id);\n}// change(id)", "function optionChanged(id) {\n display_data(id);\n dyna_demos(id);\n...
[ "0.6837175", "0.6836005", "0.68077844", "0.67821676", "0.67299134", "0.66542745", "0.6618144", "0.65580136", "0.6507251", "0.6471823", "0.6433838", "0.6367044", "0.6342445", "0.6284793", "0.62757593", "0.6263431", "0.62594545", "0.6253683", "0.6240902", "0.6238548", "0.622419...
0.0
-1
For documentation, see updateOptions below
function updateOptions() { var type, i; // Update all-checked status if ($scope.ngModel.checkAll) { for (type in $scope.ngModel.checked) { if ($scope.ngModel.checked[type]) { $scope.ngModel.checkAll = false; } } } // Update the current filters string $scope.ngModel.filtersString = ''; if (!$scope.ngModel.checkAll) { for (i = 0; i < $scope.ngModel.types.length; i += 1) { // If the type key corresponds to a checked option... if ($scope.ngModel.checked[$scope.ngModel.types[i].key]) { // ... add it to the string list of current filter options if ($scope.ngModel.filtersString === '') { $scope.ngModel.filtersString += $scope.ngModel.types[i].name; } else { $scope.ngModel.filtersString += ', ' + $scope.ngModel.types[i].name; } } } // If there's still nothing in the filters string, there are no // filters selected if ($scope.ngModel.filtersString === '') { $scope.ngModel.checkAll = true; } } // Re-filter results $scope.ngModel.filter(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "optionsUpdateHook() { }", "function updateOptions(options)\n\t{\n\t\t_options = jQuery.extend(true, {}, _options, options);\n\t}", "updateOptions(options, ...args) { return args; }", "updateOptions (options) {\n this.options = _extend({}, this.options, options);\n\n for (let block of this.blocks) {...
[ "0.77665013", "0.7427309", "0.7236019", "0.716939", "0.7058448", "0.7055208", "0.6913157", "0.6900687", "0.6801161", "0.67821443", "0.67190325", "0.6703122", "0.67009795", "0.6641766", "0.6618978", "0.6543863", "0.65289295", "0.64959806", "0.6463441", "0.64504987", "0.6449319...
0.6032672
63
For documentation, see checkAll below
function checkAll() { // Reset all the other options to original/default position Object.keys($scope.ngModel.checked).forEach(function (type) { $scope.ngModel.checked[type] = false; }); // This setting will make the filters display hidden $scope.ngModel.filtersString = ''; // Do not let checkAll become unchecked when it is the only checked filter if (!$scope.ngModel.checkAll) { $scope.ngModel.checkAll = true; } // Re-filter results $scope.ngModel.filter(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkAll() {\n this.checkEnyo(this.props.example.resultEnyo)\n ? this.setEnyoCheckState('OK')\n : this.setEnyoCheckState('KO');\n this.checkCSS(this.props.example.resultCSS)\n ? this.setCssCheckState('OK')\n : this.setCssCheckState('KO');\n }", "function checkAllHelper(){\n\tcheckAll(s...
[ "0.73139626", "0.7157105", "0.71000874", "0.7014745", "0.685499", "0.685499", "0.685499", "0.6822014", "0.6777876", "0.67584294", "0.6613201", "0.6580736", "0.651293", "0.648199", "0.6352774", "0.63065636", "0.62550265", "0.62134784", "0.6195519", "0.6179318", "0.6166899", ...
0.61127836
23
1) definition of class property 2) definition of class method 3) link method to external function 4) constructor doesnt return object 5) exernal function
function Person(firstName, lastName){ this.firstName=firstName; //1)this.property this.lastName=lastName; this.sayHello = function(){ //2)this.method console.log('Hello '+this.firstName); } this.anotherMethod=externalFunction; //3)this.method=function //4) no return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constructor() {\n // Private members\n var privateVar1 = \"Nishant\";\n var privateVar2 = [1,2,3,4,5];\n\n function privateMethod1() {\n // code stuff\n }\n\n function privateMethod1() {\n // code stuff\n }\n\n return {\n attribute1 : \"Nishant\",\n publicMethod...
[ "0.6355889", "0.6313863", "0.6313863", "0.6313863", "0.6235644", "0.61712515", "0.61492634", "0.6117808", "0.6101189", "0.6101189", "0.6101189", "0.6096892", "0.6078937", "0.605987", "0.60179394", "0.60070187", "0.59815913", "0.59646124", "0.59252024", "0.59252024", "0.592520...
0.67150396
0
5)Not recommended but possible
function externalFunction(){ console.log(this.lastName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "static transient private protected internal function m55() {}", "static private internal function m121() {}", "protected internal function m252() {}", "transient private internal function m185() {}", "transient private protecte...
[ "0.720994", "0.71367985", "0.6876539", "0.6830809", "0.6814598", "0.67249227", "0.67030543", "0.6684032", "0.66240966", "0.65675277", "0.656446", "0.6525953", "0.64829737", "0.64069176", "0.63816625", "0.6378103", "0.63487446", "0.62759686", "0.6212764", "0.62018466", "0.6198...
0.0
-1
delete restaurants from the db that there are not in YELP
function showNumRestDeleted(results){ $("#restaurants-deleted").html("Congratulations! the database has been updated: " + results + " restaurants deleted.") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static clearRestaurants() {\n self.idb.open(dbName, dbVersion).then(function (db) {\n const tx = db.transaction(JSONStore, \"readwrite\");\n tx.objectStore(JSONStore).delete('restaurants');\n return tx.complete;\n });\n }", "function removeRestaurants(allRestaurants) {\n allRestaurants([])...
[ "0.7799481", "0.7284794", "0.6301324", "0.62953794", "0.6201827", "0.6109633", "0.6054848", "0.6042456", "0.6013336", "0.600633", "0.5987839", "0.5960524", "0.5944601", "0.5902572", "0.58777505", "0.5820541", "0.57928795", "0.5774862", "0.57592136", "0.5756183", "0.5738729", ...
0.0
-1
un pur component n'a pas de state mais d props
render() { return <h1>{this.props.content}</h1> }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() { \n return ( \n <div>\n<h1>Componente de tipo Clase</h1>\n\n{/* Accedemos al estado \"texto\" del objeto state */}\n<h2 style={{color:this.props.colorText}}>{this.state.texto}</h2>\n<h3>Hola, {this.props.name}</h3>\n<ExampleProps nombre={this.props.name}/>\n</div>\n );\n }", "construc...
[ "0.6774401", "0.67603576", "0.6578185", "0.65611166", "0.6533979", "0.65072185", "0.65048987", "0.6502264", "0.6499764", "0.64822215", "0.64707124", "0.6457622", "0.6457137", "0.64544165", "0.64483273", "0.6421727", "0.6421727", "0.6410014", "0.6403737", "0.63944256", "0.6394...
0.0
-1
/ PART 1: INTERFACE / Checks if FileSaver.js is compatible. If it isn't, show alert.
function checkBrowser() { try { var isFileSaverSupported = !!new Blob; } catch (e) { window.alert("This browser is not supported!\nPlease, use a recent version of Chrome or Firefox instead."); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function file_save_check() {\n\tif (!fs || !schedule_path || !schedule.autosave) {\n\t\t// Show the holy button of justice.\n\t\timg.save.style.opacity = 1;\n\t\timg.save.style.pointerEvents = \"auto\";\n\t} else\n\t\t// The user is no fun. Just auto-save it.\n\t\tfile_save();\n}", "function browserSupportFileUp...
[ "0.6255532", "0.57877773", "0.57870805", "0.57688266", "0.5761578", "0.5759723", "0.57472", "0.57296425", "0.57270783", "0.572517", "0.56940734", "0.56857806", "0.56829935", "0.5672152", "0.5658792", "0.5650534", "0.5635586", "0.563379", "0.55685383", "0.5513384", "0.5413848"...
0.7640485
0
Grabs and sets number of lines from slider
function setL(value) { document.getElementById("valueL").innerHTML = value; lines = parseInt(value); adjustMines(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setNumPoints() {\n runcavas.setupSlider(0, thePoints.length, 0.05);\n }", "function setNumPoints() {\n runcavas.setupSlider(0, thePoints.length, 0.05);\n }", "function setLineWidth() {\r\n\t\tlineWidth = $(this).attr('data-size');\t//choix d'une épaisseur prédéfinie\r\n\t\t$range.val(lin...
[ "0.7211066", "0.71712977", "0.6696254", "0.66229796", "0.61967367", "0.6099544", "0.6077078", "0.60576355", "0.60437775", "0.6004449", "0.5996762", "0.59542954", "0.5937302", "0.58901674", "0.5865264", "0.5851411", "0.58456063", "0.5828269", "0.58202004", "0.5789066", "0.5757...
0.5972167
11
Grabs and sets number of collumns from slider
function setC(value) { document.getElementById("valueC").innerHTML = value; collumns = parseInt(value); adjustMines(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setNumPoints() {\n runcavas.setupSlider(0, thePoints.length, 0.05);\n }", "function setNumPoints() {\n runcavas.setupSlider(0, thePoints.length, 0.05);\n }", "function changeGridSize(){\n gridContainer.innerHTML = ''; //clear grid Container before adding new divs\n let gridSize = p...
[ "0.6257656", "0.6211999", "0.6132718", "0.61283904", "0.6106927", "0.59924054", "0.5921225", "0.5911456", "0.58831394", "0.5853252", "0.581245", "0.5793267", "0.5771251", "0.57558894", "0.5731719", "0.5720783", "0.5717159", "0.5711466", "0.56949794", "0.5630843", "0.5623277",...
0.57347536
14
Grabs and sets number of mines from slider
function setM(value) { document.getElementById("valueM").innerHTML = value; mines = parseInt(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustMines() {\n maxMines = (lines*collumns) - 1;\n \n document.getElementById(\"mineSlider\").setAttribute(\"max\", maxMines);\n document.getElementById(\"valueMax\").innerHTML = maxMines;\n \n if (mines > maxMines) {\n document.getElementById(\"valueM\").innerHTML = maxMines;\n...
[ "0.77145463", "0.6774809", "0.67229176", "0.64684594", "0.6364416", "0.6331966", "0.6316435", "0.6271405", "0.62451714", "0.6229473", "0.6142502", "0.6108918", "0.6108454", "0.6106363", "0.60675997", "0.6048922", "0.60485196", "0.6005878", "0.5990862", "0.59832495", "0.594770...
0.6116944
11
Adjusts number of mines (max and current) according to lines and collumns
function adjustMines() { maxMines = (lines*collumns) - 1; document.getElementById("mineSlider").setAttribute("max", maxMines); document.getElementById("valueMax").innerHTML = maxMines; if (mines > maxMines) { document.getElementById("valueM").innerHTML = maxMines; mines = parseInt(maxMines); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function increaseMinMax() {\n min -= 10;\n max += 10;\n }", "function createMinMaxRangeLines(lines){\n // console.log(\"Entering createMinMaxRangelines function with lines\")\n //console.log(lines.length)\n //\n //console.log(\"\\n\\n Value 0,0:\")\n //console.dir(lines)\n //console.log(lines[0][0]....
[ "0.6695079", "0.66375417", "0.6620301", "0.6238601", "0.6237543", "0.616682", "0.61139566", "0.6091268", "0.6032945", "0.59048116", "0.5900105", "0.5896101", "0.589425", "0.5871503", "0.58661646", "0.5858506", "0.58562315", "0.58234906", "0.5817086", "0.581665", "0.57899624",...
0.7379214
0
Function called by button press at the end of the page
function generate() { // Last time validation, in case user ends up messing with vars adjustMines(); generateBoard(); generateJSON(); board = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endEarlyButton() {\n endEarlyDetails();\n}", "function handleFinalPage() {\r\n $(`main`).on(`click`, `#restart`, function () {\r\n store.quizStarted = false;\r\n store.questionNumber = 0;\r\n store.score = 0;\r\n render();\r\n });\r\n}", "function ExitPage() {\n\t\talert('Are you sure yo...
[ "0.74576116", "0.6984215", "0.6777922", "0.6712419", "0.66500884", "0.66295224", "0.65920985", "0.6582092", "0.65505075", "0.6525036", "0.65183365", "0.6516215", "0.64776665", "0.6453434", "0.6441214", "0.6437451", "0.6409301", "0.64030117", "0.6390213", "0.63438606", "0.6327...
0.0
-1
Resets sliders to given values
function reset(l, c, m) { document.getElementById("lineSlider").value = l; setL(l); document.getElementById("collumnSlider").value = c; setC(c); document.getElementById("mineSlider").value = m; setM(m); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetSlider(bins){\n document.getElementById(\"theSlider\").value = bins;\n }", "function resetSlider() {\r\n slider.value = 0;\r\n}", "function resetGraph(){\n d3.select(\"#handle-one\").style(\"left\",\"0%\");\n d3.select(\"#handle-two\").style(\"left\",\"100%\");\n d3.select(\".d3-slid...
[ "0.7601607", "0.7571234", "0.69490063", "0.68924135", "0.6855094", "0.683257", "0.6808523", "0.6806798", "0.68061703", "0.6789691", "0.6769028", "0.6762554", "0.67313516", "0.6697319", "0.666806", "0.666462", "0.6632596", "0.6629029", "0.66231334", "0.6618713", "0.6607569", ...
0.7158393
2
/ PART 2: BOARD GENERATION / Generate a Minesweeper array and place it in a board
function generateBoard() { var array = [], // 1-d array, with LxC, which will be ported to the main board at the end i, max = lines*collumns; // Put all mines in the beginning for (i = 0; i < max; i++) { if (i < mines) { array[i] = 1; } else { array[i] = 0; } } fisherYates(array); // Randomizes mine position makeBoard(array); // Passes 1-d array to 2-d board }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function boardGenerator() {\n for (var i = 0; i < boardSize; i++) {\n for (var j = 0; j < boardSize; j++) {\n board.cells.push({\n row: i,\n col: j,\n isMine: randomMines(),\n hidden: true,\n });\n }\n }\n}", "function makeBoard() {\n //Make an empty array for board...
[ "0.7574005", "0.7389867", "0.7277623", "0.71575075", "0.7149459", "0.71318465", "0.7103886", "0.7102805", "0.709265", "0.7091244", "0.70705867", "0.70338184", "0.7013336", "0.7012744", "0.7009111", "0.69877744", "0.6975426", "0.6965226", "0.696433", "0.69549036", "0.6931066",...
0.7624286
0
Shuffle array, so it's like pulling out of a "hat" Credit:
function fisherYates (myArray) { var i = myArray.length, j, tempi, tempj; if (i === 0) { return; } while (--i) { j = Math.floor(Math.random() * (i + 1)); tempi = myArray[i]; tempj = myArray[j]; myArray[i] = tempj; myArray[j] = tempi; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shuffle (array) {\r\n var i = 0\r\n , j = 0\r\n , temp = null\r\n\r\n for (i = array.length - 1; i > 0; i -= 1) {\r\n j = Math.floor(Math.random() * (i + 1))\r\n temp = array[i]\r\n array[i] = array[j]\r\n...
[ "0.7850486", "0.7824968", "0.78068966", "0.77906704", "0.77783275", "0.7754589", "0.7752481", "0.77511865", "0.7737907", "0.77328783", "0.77244127", "0.7723962", "0.77229434", "0.77190626", "0.77164876", "0.77100706", "0.7707687", "0.7700004", "0.76967853", "0.7683549", "0.76...
0.0
-1
Add array's data to the board Here I use a (lines+2)x(collumns+2) board with valid entries [1..lines][1..collumns]. This makes it easier to use tilebased functions without corner verifications.
function makeBoard(myArray) { var l, c, count; // Empty board board = []; for (l = 0; l < lines+2; l++) { board[l] = []; for (c = 0; c < collumns+2; c++) { board[l][c] = 0; } } // Place mines in board (only valid positions) count = 0; for (l = 1; l <= lines; l++) { for (c = 1; c <= collumns; c++) { if (myArray[count] === 1) { // Places bomb (-1) in given position, and increases count on neighboring cells board[l][c] = -1; increaseTile(l-1, c-1); increaseTile(l-1, c ); increaseTile(l-1, c+1); increaseTile(l, c-1); increaseTile(l, c+1); increaseTile(l+1, c-1); increaseTile(l+1, c ); increaseTile(l+1, c+1); } count++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayBuild(){\n\t/*\n\t * evtl moechte man in einer spaeteren Version manuell ein Array definieren, welches eine groessere Map\n\t * beherbergen kann als das canvas, deswegen gibt es diese beiden Variablen, welche in erster Version\n\t * lediglich mit der Dimension des Standard Arrays belegt werden.\n\t *...
[ "0.63479364", "0.6178666", "0.59382224", "0.5932542", "0.5924977", "0.59157664", "0.5865979", "0.5833621", "0.579286", "0.57713133", "0.5712914", "0.5702255", "0.5696323", "0.56898004", "0.5666034", "0.5652696", "0.5640959", "0.56289196", "0.561524", "0.56107754", "0.5602725"...
0.56500983
16
Increase count in cell if it doesn't hold a bomb
function increaseTile(x, y) { if (board[x][y] === -1) return; board[x][y] += 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pre_detect()\n{\n for (var i = 0; i < $cell.length; i++)\n {\n \tvar bombAround = 0;\n // There's nothing around\n if (i + 1 <= $cell.length-1) \t\tif ($cell[i + 1].classList.contains('cell-bomb')) bombAround++;\n if (i - 1 >= 0 ) \t\t\t \t\tif ($cell[i - 1].classList.contains('cell-bomb')) bo...
[ "0.6969766", "0.6847151", "0.6770352", "0.6756747", "0.6754687", "0.6672098", "0.6627683", "0.66135097", "0.6579581", "0.65109485", "0.6497079", "0.6478597", "0.64785534", "0.64456975", "0.64448273", "0.64311904", "0.6346996", "0.6339653", "0.6329239", "0.6319604", "0.6315657...
0.5582657
95
/ PART 3: FILE CREATION
function generateJSON() { var saveFile = new Object(), /* Centralizes cards by discovering the position of the top-left card */ posX = ((-collumns) + !(collumns%2)), posZ = (lines - !(lines%2)); /* Start save-file object */ saveFile.SaveName = "Minesweeper " + lines + "x" + collumns + " (" + mines + " mines)"; saveFile.GameMode = "Minesweeper"; saveFile.Date = "11/7/2015 7:16:23 PM"; // TO-DO saveFile.Table = "Table_RPG"; saveFile.Sky = "Sky_Field"; saveFile.Note = "MINESWEEPER\n\n" + lines + " lines\n" + collumns + " collumns\n" + mines + " mines (" + Math.floor(100*mines/(lines*collumns)) + "%)"; saveFile.Rules = ""; saveFile.PlayerTurn = ""; saveFile.Grid = new Object(); saveFile.Grid.Type = 0; saveFile.Grid.Lines = false; saveFile.Grid.Snapping = false; saveFile.Grid.Offset = true; saveFile.Grid.BothSnapping = false; saveFile.Grid.xSize = 2.0; saveFile.Grid.ySize = 2.0; saveFile.Grid.PosOffset = new Object(); saveFile.Grid.PosOffset.x = 0.0 saveFile.Grid.PosOffset.y = 1.0 saveFile.Grid.PosOffset.z = 0.0 saveFile.Hands = new Object(); saveFile.Hands.Enable = false; saveFile.Hands. DisableUnused = false; saveFile.Hands.Hidding = 0; saveFile.DrawImage = "iVBORw0KGgoAAAANSUhEUgAAAWAAAADQCAYAAAA53LuNAAAFFElEQVR4Ae3QgQAAAADDoPlTH+SFUGHAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgwYMGDAgAEDBgy8DQx5DAABHyNK3wAAAABJRU5ErkJggg==" saveFile.VectorLines = []; saveFile.ObjectStates = []; // Flags deck var flagsDeck = new Object(); flagsDeck.Name = "Deck"; flagsDeck.Transform = new Object(); flagsDeck.Transform.posX = 10.9998751; flagsDeck.Transform.posY = 3.76623344; flagsDeck.Transform.posZ = -18.99992; flagsDeck.Transform.rotX = 0; flagsDeck.Transform.rotY = 180.013916; flagsDeck.Transform.rotZ = 180.000015; flagsDeck.Transform.scaleX = 0.625; flagsDeck.Transform.scaleY = 0.625; flagsDeck.Transform.scaleZ = 0.625; flagsDeck.Nickname = ""; flagsDeck.Description = ""; flagsDeck.ColorDiffuse = new Object(); flagsDeck.ColorDiffuse.r = 0.713266432; flagsDeck.ColorDiffuse.g = 0.713266432; flagsDeck.ColorDiffuse.b = 0.713266432; flagsDeck.Locked = false; flagsDeck.Grid = true; flagsDeck.Snap = true; flagsDeck.Autoraise = true; flagsDeck.Sticky = true; flagsDeck.SidewaysCard = false; flagsDeck.DeckIDs = []; for (var i = 0; i < mines; i++) { // Adds one flag for each mine flagsDeck.DeckIDs.push(110); } flagsDeck.CustomDeck = { 1: { FaceURL: "http://i.imgur.com/aHiVv66.jpg", BackURL: "http://i.imgur.com/xL8AXmY.jpg{Unique}" } } saveFile.ObjectStates.push(flagsDeck); // Interrogation mark deck var interrogationDeck = new Object(); interrogationDeck.Name = "Deck"; interrogationDeck.Transform = new Object(); interrogationDeck.Transform.posX = 16.9999142; interrogationDeck.Transform.posY = 3.76623344; interrogationDeck.Transform.posZ = -18.99992; interrogationDeck.Transform.rotX = 0; interrogationDeck.Transform.rotY = 180.013916; interrogationDeck.Transform.rotZ = 180.000015; interrogationDeck.Transform.scaleX = 0.625; interrogationDeck.Transform.scaleY = 0.625; interrogationDeck.Transform.scaleZ = 0.625; interrogationDeck.Nickname = ""; interrogationDeck.Description = ""; interrogationDeck.ColorDiffuse = new Object(); interrogationDeck.ColorDiffuse.r = 0.713266432; interrogationDeck.ColorDiffuse.g = 0.713266432; interrogationDeck.ColorDiffuse.b = 0.713266432; interrogationDeck.Locked = false; interrogationDeck.Grid = true; interrogationDeck.Snap = true; interrogationDeck.Autoraise = true; interrogationDeck.Sticky = true; interrogationDeck.SidewaysCard = false; interrogationDeck.DeckIDs = []; for (var i = 0; i < mines; i++) { // Adds one ? for each mine interrogationDeck.DeckIDs.push(111); } interrogationDeck.CustomDeck = { 1: { FaceURL: "http://i.imgur.com/aHiVv66.jpg", BackURL: "http://i.imgur.com/xL8AXmY.jpg{Unique}" } } saveFile.ObjectStates.push(interrogationDeck); // Regular game cards for (var i = 1; i <= lines; i++) { for (var j = 1; j <= collumns; j++) { var card = addCard(i, j, posX, posZ) saveFile.ObjectStates.push(card); } } /* End save-file object */ var json = JSON.stringify(saveFile, null, '\t'); saveTextAs(json, "Minesweeper.json"); // FileSaver.js by Eli Grey, modified by Brian Chen }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFile(){\n if (projectType == \"Basic\") {\n internalReference = idAgency + \"-\" + padToFour(orderNumber) + \"-\" + padToTwo(version) + \"-\" + padToTwo(revision);\n updateListItem(fileId,internalReference,documentType,description,dateCreated,diffusionDate,externalRefere...
[ "0.7006033", "0.6826074", "0.6825213", "0.6450591", "0.6441167", "0.6438422", "0.64316", "0.6416728", "0.6395184", "0.63768137", "0.63693815", "0.6320899", "0.630623", "0.6193851", "0.6161416", "0.6145348", "0.61449903", "0.61437964", "0.6135374", "0.6104618", "0.6039327", ...
0.0
-1
Add each card on the board
function addCard(line, collumn, posX, posZ) { var card = new Object(); // For each card, modify posX [1], posZ [2] and ID [3] card.Name = "Card"; card.Transform = new Object(); card.Transform.posX = (posX + 2.0*(collumn-1)); /* [1] */ card.Transform.posY = 3.76623344; card.Transform.posZ = (posZ - 2.0*(line-1)); /* [2] */ card.Transform.rotX = 0; card.Transform.rotY = 180.013916; card.Transform.rotZ = 180.000015; card.Transform.scaleX = 0.625; card.Transform.scaleY = 0.625; card.Transform.scaleZ = 0.625; card.Nickname = ""; card.Description = ""; card.ColorDiffuse = new Object(); card.ColorDiffuse.r = 0.713266432; card.ColorDiffuse.g = 0.713266432; card.ColorDiffuse.b = 0.713266432; card.Locked = false; card.Grid = true; card.Snap = true; card.Autoraise = true; card.Sticky = true; card.SidewaysCard = false; if (board[line][collumn] == -1) { /* [3] */ card.CardID = 109; // Mine cards } else { card.CardID = 100 + board[line][collumn]; // Cards 0 to 8 use IDs 100 to 108 respectively } card.CustomDeck = { 1: { FaceURL: "http://i.imgur.com/aHiVv66.jpg", BackURL: "http://i.imgur.com/xL8AXmY.jpg{Unique}" } } return card; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AddCards(allCards) {\n const fragment = document.querySelector('.deck');\n for(let i =0; i < allCards.length; i++)\n {\n fragment.appendChild(allCards[i]);\n }\n}", "function addCards() {\n var boardGame = document.getElementById(\"boardGame\");\n for (var i = 0; i < 12; i++) {\n ...
[ "0.76849854", "0.74895567", "0.74499696", "0.72334117", "0.7187234", "0.7181875", "0.715759", "0.714325", "0.7080886", "0.7059476", "0.70571494", "0.70318323", "0.7021243", "0.7011357", "0.70092773", "0.70092773", "0.69831264", "0.6979432", "0.6965259", "0.6922808", "0.691489...
0.6787559
34
Attaches attrs.chartRisk scope variable watcher
function attachListener() { scope.$watch(attrs.chartRisk, function (riskSummaryData) { setChartBlockWidth(riskSummaryData); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRiskCreated() {\n vm.riskList = getRiskList();\n }", "function updateAtRisk(){\n\tvar svgAtRisk = d3.select(\"#vis-sec-at-risk\")\n\t\t\t\t\t\t.append(\"svg\")\n\t\t\t\t\t\t.attr(\"width\", width + margin.left + margin.right)\n\t\t\t\t\t\t.attr(\"height\", height + margin.top + margin.bottom)\n\t\...
[ "0.62455934", "0.5657551", "0.5550135", "0.548623", "0.54443216", "0.5205934", "0.51886714", "0.5124011", "0.5082364", "0.50385934", "0.5036777", "0.50070745", "0.49811822", "0.4980709", "0.4980709", "0.49757075", "0.49747786", "0.49603048", "0.491466", "0.49080738", "0.49080...
0.7296781
0
jshint rhino:true /eslintenv rhino
function getEnv (name) { return String(java.lang.System.getProperty(name)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function JSHint() {\n\n\treturn parent.gulp.src(parent.CONFIG.scripts)\n\t\t.pipe(parent.jshint())\n\t\t.pipe(parent.jshint.reporter(parent.stylish));\n\t\t\n}", "function jslint() {\n return gulp.src(paths.scripts.watch)\n .pipe(jshint('.jshintrc'))\n .pipe(jshint.reporter('default'));\n}", "functi...
[ "0.5940843", "0.5702928", "0.55635834", "0.55454826", "0.5495067", "0.54584265", "0.5366921", "0.5262324", "0.52322745", "0.51971656", "0.5176405", "0.51371455", "0.5105554", "0.5087184", "0.5071049", "0.50298166", "0.50227123", "0.5021358", "0.49860197", "0.49845386", "0.498...
0.0
-1
end datepicker function definition
function main() { styleSetup() // var map = newMap(); // console.log(map) var map = new L.Map('map', { center: [38, -119], zoom: 6, }); addTiles(map); // Make sure this runs first to get global variables jQuery.ajaxSetup({async:false}); // Define date range and set global variables $.getJSON('https://california-data-collaborative.carto.com/api/v2/sql?q=SELECT%20min(supply_reading_date),%20max(supply_reading_date)%20FROM%20supply_reading_extract', dateRange) //$.getJSON('https://california-data-collaborative.carto.com/api/v2/sql?q=ALTER%20TABLE%20reservoir_reading_extract%20ADD%20dateUTC%20timestamp') //$.getJSON('https://california-data-collaborative.carto.com/api/v2/sql?q=UPDATE%20reservoir_reading_extract%20SET%20dateUTC%20=%20date+"T00:00:00Z"FROM%20reservoir_reading_extract') jQuery.ajaxSetup({async:true}); // Get capacity data //drawCapacity(map, state.endDate); // Draw Animation of reservoir levels on map drawAnimation(map); // Adjust Statewide storage based on datepicker drawDatePicker(map); drawLegends(); } // end main
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Datepicker() {}", "function Datepicker() {}", "function DatePickerControl()\n{\n}", "function d(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId=\"ui-datepicker-div\",this._inlineClass=\"ui-datepicker-inline\",this._appendCla...
[ "0.83340704", "0.83340704", "0.7624151", "0.73965794", "0.73290354", "0.72314584", "0.71330553", "0.71274036", "0.7096862", "0.7096862", "0.7096862", "0.70495117", "0.7023234", "0.7023234", "0.7011322", "0.6985043", "0.6977587", "0.69663864", "0.69570243", "0.6955271", "0.694...
0.0
-1
Adds metadata tags to the footer.
addTags() { const { doc, margins, metadata, documentFont, documentBoldFont, } = this.pdfBuilder; const fontSize = 9; let lineHeight = this.data.length - 1; doc.font(documentFont); doc.fontSize(fontSize); const tags = metadata.tags || []; for (let i = 0; i < tags.length; i += 1) { if (typeof tags[i] === 'string') { doc.text( tags[i], margins.left, (this.height + margins.bottom) - (lineHeight * fontSize)); lineHeight -= 1; } else if (typeof tags[i] === 'object' && tags[i].value !== undefined && tags[i].label !== undefined) { doc .font(documentBoldFont) .text(`${tags[i].label}:`, margins.left, (this.height + margins.bottom) - (lineHeight * fontSize), { lineBreak: false }) .font(documentFont) .text(tags[i].value); lineHeight -= 1; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createFooter(footer) {\n footer.appendChild(footerTemplate.content);\n }", "function addFooter() {\r\n const contentsSrc = 'MasterPage/footer_contents.txt';\r\n if (document.getElementById) {\r\n let footer = document.getElementById('footer');\r\n if (footer) {\r\n let pathPrefix = relativePa...
[ "0.62264466", "0.6184167", "0.5966228", "0.59176284", "0.5886173", "0.5870695", "0.5862643", "0.57946664", "0.5774751", "0.5730894", "0.5713376", "0.5695958", "0.56797725", "0.5661281", "0.5631116", "0.5621426", "0.5594163", "0.5558887", "0.5527553", "0.5520443", "0.55010873"...
0.52707326
42
Adds the page number to the footer if enabled.
addPagination() { if (this.pdfBuilder.includePageNumber) { const { doc, margins, documentFont } = this.pdfBuilder; let text = this.currentPage; doc.font(documentFont); doc.fontSize(9); if (this.docTitle.length > 0) { text = `${this.docTitle} - ${text}`; } doc.text(text, margins.left, this.height + margins.bottom, { align: 'right', width: this.width }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addFooter(report) {\n report.getFooter().addClass(\"footer\");\n var versionLine = report.getFooter().addText(\"Banana Accounting - Page \", \"description\");\n report.getFooter().addFieldPageNr();\n}", "goToFooter() {\n this.owner.enableHeaderAndFooter = true;\n this.enableHeadersFo...
[ "0.6581624", "0.63644516", "0.62790376", "0.62181216", "0.60112476", "0.5886219", "0.57654256", "0.5645177", "0.56161845", "0.56085783", "0.5595043", "0.5594914", "0.55426466", "0.553101", "0.549846", "0.54967815", "0.54759806", "0.545483", "0.54474366", "0.5441457", "0.54240...
0.58928835
5
is this in the correct place?
isEmpty(){ return this.size==0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.6892941", "0.68278426", "0.66623014", "0.66250587", "0.6515964", "0.64029765", "0.6320984", "0.62367415", "0.6109403", "0.60940343", "0.6074002", "0.5993156", "0.5990777", "0.5951018", "0.5922288", "0.5921505", "0.58841264", "0.585513", "0.5851345", "0.5836027", "0.5781687...
0.0
-1
used to have a (runID)
checkAndRun(){ var checks=this.checkPointers(); if(checks.passed){ this.passedRun=true; this.update(); //this doesn't find if there are any fails in the update... }else{ checks.errors.forEach(function(error){console.error (error)}) this.passedRun=false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkRunId() {\n const ret = db.runCommand({find: \"c\", filter: {_id: 'block_test'}});\n assert.commandWorked(ret);\n\n const doc = ret[\"cursor\"][\"firstBatch\"][0];\n return doc[\"run_id\"];\n}", "getID() {}", "function ID(sample){ return sample.id == sampleID;}", "function idGen(){\...
[ "0.63493884", "0.5737148", "0.5721672", "0.5703246", "0.5687337", "0.5558516", "0.55462134", "0.5491464", "0.54781926", "0.5430642", "0.53978527", "0.53978527", "0.53978527", "0.53978527", "0.53978527", "0.53978527", "0.53978527", "0.5396078", "0.53956133", "0.5375573", "0.53...
0.0
-1
should we handle seperate error logs?
checkPointers(){ var self=this; var check=true; var errors=[]; ///check there are enough inputs specified and all are valid // if(this.inputs.length && this.inputs.every(input=>input || input===0)){ if(!this.inputs.length){ check=false; errors.push(`No input sources specified for ${self.constructor.name}`) }else{ for(let i=0;i<this.inputs.length;i++){ let val=this.inputs[i] let type=this.inputTypes[i] if(val===undefined){ check=false; }else{ if(val || val===0){ }else{ check=false; } // console.log(this.inputs[i],this.inputTypes[i]); } } if(check===false){ errors.push(`Not enough input sources specified for ${self.constructor.name}`) } } return {"passed":check,"errors":errors}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_logError (msg, url, lineNo, columnNo, error) {\n let log = ErrLogger.getLogs()\n if (!log) {log = { session: [] } }\n log.session.push({\n timestamp: new Date().valueOf(),\n columnNo,\n error: error,\n lineNo,\n message: msg,\n ...
[ "0.6783541", "0.66144705", "0.65754795", "0.65069044", "0.6477446", "0.64546734", "0.6429792", "0.6400925", "0.6399612", "0.63855135", "0.63630056", "0.635187", "0.62987435", "0.62821656", "0.62743145", "0.6265746", "0.6263134", "0.6257579", "0.62516415", "0.62366015", "0.623...
0.0
-1
Methodes pour les boutons next et prev
next () { console.log(this.currentItem) this.gotoItem(this.currentItem + this.slidesToScroll) // Appel de la methode gotoItem et parametres : index de l'item + nombres de slide a defiler }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tagNextPrev() {\n\t\t\tif ($nav_panels.children('.last').hasClass('active_page')) {\n\t\t\t\t$nav_panels.children('.next_link').add('.last_link').addClass('no_more ' + jquery_ui_disabled_class);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$nav_panels.children('.next_link').add('.last_link').removeClass('no_more ' + j...
[ "0.67157465", "0.6596782", "0.6348247", "0.6312729", "0.6281851", "0.6260482", "0.6235147", "0.6213501", "0.6195057", "0.6193063", "0.61920786", "0.6187541", "0.61347103", "0.6128562", "0.6118152", "0.60822576", "0.6059838", "0.6050084", "0.60205984", "0.6018712", "0.60094357...
0.57494795
71
Methode pour le bouton play
play () { this.playButton = $('#playButton') // Init Bouton play this.options.play ? this.options.play = false : this.options.play = true if (this.options.play === true) { // Si l'option play est égal à true this.playButton.removeClass('carousel__play') // Enlève la classe carousel__play this.playButton.addClass('carousel__pause') // Ajoute la classe carousel__pause this.interval = window.setInterval(() => { // Définis l'intervale this.gotoItem(this.currentItem + 1, this.options.animation) // Appel de la methode GotoItem avec le slide auquel j'ajoute 1 et l'animation à true }, this.options.timer) // 5 secondes entre les défillements } else if (this.options.play === false) { // Si option play est égal à false this.playButton.removeClass('carousel__pause') // Enleve la classe carousel__pause this.playButton.addClass('carousel__play') // Ajoute la classe carousel__play clearInterval(this.interval) // Nettoyage de l'intervale } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Play() {}", "function Play() {}", "ppllay(){\n super.play('Im playing' + ${this.club} );\n\n }", "play()\n {\n\n }", "play(){\n\n\n }", "function play() {\n \n}", "play ({$, buff}) {\n $('own minion').forEach(v => buff(v, 'CS2_046e'));\n }", "get playAutomatically() {}", "...
[ "0.7807121", "0.77972215", "0.7623775", "0.7456775", "0.7452273", "0.7351885", "0.6928759", "0.69191116", "0.68777275", "0.6870923", "0.6868757", "0.6868757", "0.6781055", "0.67616165", "0.67546993", "0.6692897", "0.6673415", "0.6671502", "0.663374", "0.65939397", "0.6578189"...
0.69634646
6