query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Turn cube into a sphere by normalizing each vertex then multiply each vertex by some radius
function generateQuadsphere(radius, tessellation) { var quadsphere = generateCube(radius, tessellation); quadsphere.mergeVertices(); for (var i = 0; i < quadsphere.vertices.length; i++) { quadsphere.vertices[i].normalize().multiplyScalar(radius); } return quadsphere; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _Sphere(radius) {\n var __sphereData = null,\n __sphereVertexPositionBuffer = null,\n __sphereVertexIndexBuffer = null,\n __sphereVertexNormalBuffer = null,\n\n __colour = {r: 0.8, g: 0.8, b: 0.8, a: 1.0},\n __radius = radius || 1.0,\n __modelMatrix = mat4.crea...
[ "0.7115987", "0.6684585", "0.6659432", "0.6654077", "0.66152364", "0.6603149", "0.6589228", "0.65668523", "0.6562506", "0.6528039", "0.6492917", "0.6491811", "0.649082", "0.6489783", "0.6487828", "0.6477708", "0.64752066", "0.64719397", "0.6453133", "0.6434485", "0.64002323",...
0.7068709
1
Disable all elements which contains '.target' for to keep once '.target' at time
disableAll() { let targets = document.querySelectorAll('.target'); if(targets.length > 0) { targets.forEach( t => { t.classList.remove('target') }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearTarget() {\n\thasTarget = false;\n}", "resetTarget () {\n if (!this.target)\n return;\n\n this.target.style.willChange = 'initial';\n this.target.style.transform = 'none';\n this.target.style.opacity = 1;\n this.target = null;\n }", "function removeTargetHighlig...
[ "0.6406472", "0.6155896", "0.5944707", "0.5921429", "0.5841374", "0.5835405", "0.5826604", "0.5781198", "0.57313526", "0.5634051", "0.5630774", "0.5615939", "0.56089586", "0.55876034", "0.5509776", "0.5487563", "0.5461302", "0.5420681", "0.541733", "0.5397513", "0.53762585", ...
0.8036602
0
Handle Ice Candidate and send it to other peer. This callback is called from within the peer connection object whenever there are candidates available. We need to send each candidate to remote peer. For this, we use signalling service of this library. Refer to the Signalling Service for more information on signalling. ...
function handleIceCandidate(event) { if (event.candidate) { Signalling.sendMessage({ type: 'candidate', label: event.candidate.sdpMLineIndex, id: event.candidate.sdpMid, candidate: event.candidate.candidate }); } else { //console.log('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_sendIceCandidate(candidate, remoteId) {\n console.log('Signal candidate 222', console.log(candidate, remoteId));\n return; \n\t\tif (candidate) {\n\t\t\tSocketService.getInstance().send({\n\t\t\t\ttype: SOCKET_MESSAGE_TYPES.PEER_SIGNAL_ICE,\n\t\t\t\tpeerData: {\n\t\t\t\t\tcandidate,\n\t\t...
[ "0.760642", "0.7563382", "0.75311285", "0.7513592", "0.7481695", "0.74752104", "0.7444029", "0.7372387", "0.7344325", "0.73173094", "0.72873706", "0.7206421", "0.71990883", "0.71528584", "0.7132883", "0.71110725", "0.71030927", "0.7089642", "0.70802975", "0.70766807", "0.6983...
0.75984
1
Handle the remote stream. This call back function is used to handle the streams sent by the remote peer. Currently, we have two types of streams to hold: video streams, audio stream and screen sharing stream. This function takes care of handling of all stream and assigning them to correct video or audio element. When s...
function handleRemoteStreamAdded(event) { if (event.stream.getAudioTracks().length) { remoteAudio.src = URL.createObjectURL(event.stream); remoteAudioStream = event.stream; } if (event.stream.getVideoTracks().length) { if (!remoteVideoStream || sharingVideo) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gotRemoteStream(event) {\n // Associate the remote video element with the retrieved stream\n remoteVideo.srcObject = event.stream;\n remoteVideo.play();\n }", "function gotRemoteStream(event){\n\t// Associate the remote video element with the retrieved stream\n\tif ('srcObject' i...
[ "0.7271834", "0.7085367", "0.6976662", "0.6951833", "0.68694603", "0.6755149", "0.6712779", "0.6712779", "0.6696714", "0.6683837", "0.66823894", "0.6637838", "0.66259944", "0.6597456", "0.65051085", "0.6501146", "0.6484244", "0.6480683", "0.64561695", "0.633792", "0.63210255"...
0.7407624
0
Handle the remote peer stream removal. This callback function is used to handle the situation when remote peer removes any stream i.e. stops screen sharing. This function takes care of knowing which stream has been removed. When screen is removed it broadcasts 'screenShared' to the application. Application is responsib...
function handleRemoteStreamRemoved(event) { //console.log(event); if(hidingVideo){ remoteVideoStream.stop(); remoteVideoStream = null; hidingVideo = false; } if (typeof remoteStreamScreen != 'undefined' && !hidingVideo) { remoteStreamScreen.stop(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRemoteStreamRemoved(event) {\n console.log(\"Remove remote stream\");\n remotevid.src = \"\";\n }", "function onRemoteStreamRemoved(event) {\n\tconsole.log(\"Remove remote stream\");\n\tremotevid.src = \"\";\n }", "function handleRemoteStreamRemoved(event) {\n console.log('Remot...
[ "0.77133554", "0.75903094", "0.7589171", "0.7363975", "0.67101157", "0.6680652", "0.66169095", "0.6533714", "0.6458456", "0.64512426", "0.63752156", "0.63730323", "0.63185376", "0.6227856", "0.62216526", "0.62024945", "0.61057997", "0.60978997", "0.60754323", "0.6039877", "0....
0.8321663
0
Questa funzione crea una nuovo nodo input hidden assegandola /alla form specificata da input, di conseguenza i parametri /accettati da input sono /node_name= nome del nuovo nodo da creare, /node_value =valore del nuovo nodo da creare, /form_name=nome della form a cui assegnare / la nuova variabile hidden.
function append_hidden_node(node_name,node_value,form_index) { //alert("node_name:\t" + node_name + "\nnode_value:\t" + node_value + "\nform_name:\t" + form_index); var oParent = null, new_element = null; //alert("sto creando il nuovo elemento"); //acquisisco il riferimento alla form da aggiornare if ((oPar...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHiddenInput(form, name, value) {\n var input = document.createElement('input');\n input.type = 'hidden';\n input.name = name;\n input.value = value;\n form.appendChild(input);\n}", "function createHiddenInputElement() {\n const form = document.getElementById(\"single-conversation-t...
[ "0.73135954", "0.7138779", "0.70761573", "0.6699323", "0.65397054", "0.63989836", "0.6398437", "0.6379388", "0.63772553", "0.6321032", "0.6257029", "0.622515", "0.6125728", "0.6054559", "0.60494006", "0.602695", "0.598793", "0.5965251", "0.5956633", "0.5948406", "0.5934227", ...
0.8291758
0
Calcola tariffa "totale" > il totale da versare "versato" > il versato
function calcola_tariffa(totale,versato) { if(totale == '') totale=0; if(versato == '') versato=0; var differenza=(parseFloat(totale).toFixed(2))-(parseFloat(versato).toFixed(2)); differenza=differenza.toFixed(2); //var re_dot = new RegExp(/\./); //if(!differenza.match(re_dot)) { // differenza=differenza+".00";...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculaVazaoAtual(){\n var vazaoAtual = 10/(1000/this.state.graficos.rpmAtual);\n if(vazaoAtual<84){\n return alert(\"Produção em nível crítico com RPM atual!!\")\n }\n }", "function calcularTotalBoleta(){\n var aPagar = parseInt($('#res-total-mercaderia').data(...
[ "0.6739033", "0.66773844", "0.65938354", "0.6503421", "0.64199287", "0.63612413", "0.6356783", "0.6348032", "0.6342545", "0.63024986", "0.62630695", "0.6262099", "0.6250841", "0.622103", "0.62126565", "0.6191231", "0.6163323", "0.61562073", "0.6151496", "0.6140393", "0.613806...
0.6915391
0
FUNZIONE PER IL CALCOLO DELLE DIFFERENZE DI DATE. data1 = prima data (in ordine cronologico) data2 = seconda data unita = valori ammessi ('gg' = giorni, 'mmFULL' = mesi pieni, 'mm' = mesi da giorno a giorno 'aa' = anni) ATTENZIONE: L'opzione mmFULL non si comporta a volte in modo intuitivo: new Date(2010, 0, 1), // Jan...
function diff_date(data1, data2, unita){ difference = 'error'; if (isNaN(data1.getDate())) return "Errore: data1 non valida"; if(isNaN(data2.getDate())) return "Errore: data2 non valida"; switch(unita){ case 'gg': data1.setHours(0,0,0,0); data2.setHours(0,0,0,0); diff = data2 - data1...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diferencaDias(valor1, valor2){\r\n\t//Cria um Arry\r\n\tvalor1 = valor1.split(\"/\");\r\n \tvalor2 = valor2.split(\"/\");\r\n \t\r\n\t//Transforma em Data formato yyyyMMdd\r\n\t//Obs.:Metodo \"Date\" visualiza (0,Janeiro), (1,Fevereiro)\r\n\tvar data1 = new Date(valor1[2], valor1[1]-1, valor1[0])\r\n\tv...
[ "0.65807796", "0.61750823", "0.60206264", "0.60145515", "0.5984302", "0.59193873", "0.58936465", "0.58742166", "0.58503324", "0.5848894", "0.58052987", "0.5769519", "0.57499933", "0.57216245", "0.57181376", "0.57149637", "0.57125014", "0.56964403", "0.5674817", "0.5641871", "...
0.7247404
0
SupressLine for a file
function suppressLineFromFile(lineStart, lineStop, fileName) { return new Promise(function(fn) { let cmd = "sed -i.bak '" + lineStart + "," + lineStop + "d' " + fileName + ""; var child = exec(cmd, function(error, stdout, stderr) { console.log(stdout); console.log(stderr); if (error !...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doNotDisplayLineText() {\r\n this._ignoredLine = true;\r\n }", "function appendLine (line) {\n\tline.ishidden = false;\n\tswitch (line.exclude) {\n\t\tcase 'rule':\n\t\t\tappendProblemLineExcludingRule(line);\n\t\t\tbreak;\n\t\tcase 'premises':\n\t\t\tappendProblemLineExcludingPremise(line);\n\t\t\tbre...
[ "0.6466649", "0.6089945", "0.59248054", "0.5846022", "0.5760782", "0.57112557", "0.5673645", "0.5573251", "0.55687404", "0.5553584", "0.552982", "0.55204844", "0.5515022", "0.5515022", "0.5515022", "0.55147135", "0.55147135", "0.55147135", "0.55147135", "0.55147135", "0.55147...
0.69697106
0
Creates the fog of War for a given map.
createFog() { const width = this.map.widthInPixels; const height = this.map.heightInPixels; // make a RenderTexture that is the size of the screen this.renderTexture = this.scene.make.renderTexture( { x: 0, y: 0, width...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createFog()\n{\n //Skip if reveal all is active\n if (revealAll == true)\n {\n return;\n }\n \n fogmask = new Array(mapHeight*mapWidth).fill(1);\n getLocation(currentPlayer);\n recursiveFog(targetLocation.x,targetLocation.y,visionRange);\n}", "drawFog() {\n this.map...
[ "0.68454075", "0.58004683", "0.5773969", "0.57415485", "0.57188135", "0.5691521", "0.56692934", "0.56521386", "0.56280637", "0.56107414", "0.5598817", "0.55778885", "0.5513657", "0.54730356", "0.5471036", "0.5460979", "0.5432376", "0.54280865", "0.5420552", "0.53768444", "0.5...
0.5833329
1
Updates the fog of war.
updateFog() { this.renderTexture.clear(); this.renderTexture.fill(0x000000, 0.7); this.renderTexture.setTint(0x0a2948); if (this.player && this.imageMask) { this.imageMask.x = this.player.container.x; this.imageMask.y = this.player.container.y; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateFog( root ) {\n\n\t\tif ( root.fog ) {\n\n\t\t\troot.fog.color.setHex( oldFogColor );\n\n\t\t\tif ( root.fog.near !== undefined ) root.fog.near = oldFogNear;\n\t\t\tif ( root.fog.far !== undefined ) root.fog.far = oldFogFar;\n\t\t\tif ( root.fog.density !== undefined ) root.fog.density = oldFogDensi...
[ "0.69695836", "0.6370342", "0.6203824", "0.593864", "0.579789", "0.5667834", "0.56175613", "0.55582184", "0.5494637", "0.54296666", "0.54154426", "0.53936994", "0.5388998", "0.5267078", "0.5266256", "0.52560854", "0.5223589", "0.52078766", "0.5189007", "0.5180294", "0.5126529...
0.6515424
1
List Payment Type in select 2
function listPaymentType() { let data = { "query": 'fetch', "databasename": 'payment_master', "column": { "payment_mode": "payment_mode", "payment_master_id": "payment_master_id" }, "condition": { "status": '1' }, "like": ""...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPaymentTypeSelect(payment_method) {\r\n \r\n var bank_account_type_element = document.getElementsByName(bank_account_type_name);\r\n\r\n if (payment_type_select_id){\r\n var payment_type_select = document.getElementById(payment_type_select_id);\r\n }\r\n\r\n if (bank_account_type_el...
[ "0.6711211", "0.63608706", "0.6233583", "0.6233158", "0.61712414", "0.614684", "0.59481114", "0.5941465", "0.5846356", "0.5809303", "0.58005744", "0.57821", "0.5780517", "0.5750167", "0.574569", "0.5731784", "0.5727503", "0.57109314", "0.5705173", "0.569633", "0.5670892", "...
0.7174814
1
this function updates the element
update() { this.remove(); this.add(false); if (this.style) this.element.style.cssText = this.style; this.updated = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update()\n {\n \n }", "_updateDOM() {\n this._updateAttributes();\n this._updateStyles();\n }", "refresh () {\n this.element ? this.element.update(this) : null\n }", "function update() {\n\t\t\n\t}", "function updateFromElement() {\n if ( !isRendered ) { return; }\n\n ...
[ "0.6974", "0.692655", "0.69138277", "0.68922836", "0.6763901", "0.6716763", "0.6707563", "0.6702365", "0.6677776", "0.6677776", "0.6650085", "0.6627504", "0.6619295", "0.6601733", "0.6601733", "0.6601733", "0.6601733", "0.6601733", "0.6601733", "0.6601733", "0.6601733", "0....
0.7027376
0
this function changes the title of the navbar
setTitle(title = "Navbar", href = "#") { let navTitle = document.getElementById("navbar-title"); if (href !== "#") { navTitle.href = href; } navTitle.innerText = title; this.title = [title, href]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setTitle(title) {\r\n this.title = title;\r\n if (this.isActive) {\r\n this.router.updateTitle();\r\n }\r\n }", "static setTitle(title) {\n $(\"#main_title\").text(title);\n $(\".active\").removeClass(\"active\")\n if (title == \"Add/Edit a character\") {\n...
[ "0.7627815", "0.7542566", "0.7530994", "0.73754907", "0.73683834", "0.72615665", "0.7170864", "0.7147412", "0.7120914", "0.7108647", "0.70827615", "0.7075566", "0.70553493", "0.70344037", "0.69789326", "0.6960546", "0.6928926", "0.6893733", "0.6886678", "0.6886678", "0.688543...
0.8198292
0
this function adds HTML code to the body
function addHTML(code) { let span = document.createElement("span"); span.innerHTML = code; body.appendChild(span); return span; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setBody(html){\n this.body.html(html);\n }", "function insertHtml() {\n MAPP.refreshTimer = false;\n var outputHtml = MAPP.editors.htmlmixed.getTextArea().value,\n outputCss = MAPP.editors.css.getTextArea().value,\n outputScript = MAPP.editors.javascript.getTextArea().value,\n ...
[ "0.696898", "0.68049294", "0.6767711", "0.65324455", "0.6491579", "0.64798415", "0.64322776", "0.6301714", "0.62871754", "0.6272142", "0.614534", "0.6136266", "0.6135256", "0.6135231", "0.61214566", "0.60998774", "0.606782", "0.6040507", "0.6017899", "0.6003525", "0.5980109",...
0.70864886
0
this function creates a card
function createCard(title, text, link, image = "", position = "left") { let card = new Card(title, text, link, image, position); card.add(); return card; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCard() {\n let icebox = document.getElementById('icebox');\n let cardContent = new Assignment(getValue('#assignment'), getValue('#description'));\n let card = document.createElement('div');\n let cardTitle = document.createElement('h2');\n let cardDescription = document.createElement('p');\n\n ...
[ "0.7693145", "0.7532894", "0.7484421", "0.7470633", "0.74624306", "0.73675513", "0.7365127", "0.7360795", "0.7348917", "0.7343574", "0.7335271", "0.7333561", "0.7318926", "0.7310964", "0.73064953", "0.7298968", "0.72916645", "0.72802514", "0.7280077", "0.72519207", "0.7247301...
0.7550577
1
this function creates a field for alerts
function createAlertField() { let alertField = document.createElement("span"); alertField.id = "alertField"; body.appendChild(alertField); return alertField; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addAttachmentField(aName, aValue) {}", "function _init_client_email_field(){\n try{\n var client_email_field = Ti.UI.createTableViewRow({\n filter_class:'set_client_email',\n classN...
[ "0.6097579", "0.5869563", "0.5769572", "0.57641613", "0.56855834", "0.5653999", "0.5651713", "0.56276464", "0.56273466", "0.5619237", "0.55728585", "0.5565286", "0.556394", "0.55588543", "0.5553888", "0.5553726", "0.5548107", "0.5547471", "0.554456", "0.5543888", "0.5543888",...
0.75364625
0
this function adds provided style to the style tag
function addStyle(string) { style.innerHTML += string; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertStyle(style) {\n var a=document.createElement(\"style\");\n a.innerHTML=style;\n document.head.appendChild(a);\n}", "attachStyle(style) {\n\t\tlet componentName = this.getComponentName();\n\t\tlet node = document.createElement(\"style\");\n\t\tnode.id = componentName + \"-style\";\n\n\t\t...
[ "0.76079035", "0.73481053", "0.73235834", "0.731134", "0.7266337", "0.72602355", "0.7252994", "0.72248375", "0.7183263", "0.7062393", "0.7061285", "0.6984063", "0.6982382", "0.69743544", "0.6967711", "0.6960053", "0.69557476", "0.6949903", "0.6945162", "0.6913803", "0.6913597...
0.74456865
1
Get a random string for searching
function randSearch() { // Variable length to lower collision rate further var v = ""; for(var i = 0; i < 14; i++) { var n1 = Math.random(); var n2 = Math.random(); if(n1 * 1.5 > 1) { v += String.fromCharCode(Math.round(Math.random() * 9) + 48); } else if (n2 * 1.5 > 1) { v += String.fromCharCode(Math....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomString() {\n\treturn getRandomStringByLength(10);\n}", "function getRandomString () {\n var seed = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789';\n var result = '';\n for (var i = 0; i < 10; i++) {\n var pos = Math.floor(Math.random() * seed.length);\n resul...
[ "0.7893067", "0.7500958", "0.73751503", "0.7371812", "0.7292508", "0.7278692", "0.7250568", "0.72427815", "0.72396916", "0.72363937", "0.72360843", "0.7234909", "0.7229112", "0.72126967", "0.72029454", "0.7184977", "0.71643364", "0.71641445", "0.7160638", "0.7151788", "0.7148...
0.7708806
1
funzioni con pattern device/nome/comando funzione di supporto che Restituisce l'UIDD di un un Hub, partendo dal nome impostato dall'utente. Se non lo trova, restituisce stringa vuota
function GetUIDDFromName(sname) { var uidd=""; console.log(sname); const connectedHubs = poweredUP.getConnectedHubs(); connectedHubs.forEach(hub => { if (hub.name==sname){ uidd=hub.uuid; } }); return uidd; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getName() {\n let name = this.getDeviceName(); // SHRGBW2#1234#1\n let ip = this.getIP(); // 192.168.11.1\n let deviceid = this.getDeviceId(); // shellyplug-s-12345\n let id = this.getId(); // shellyplug-s-12345\n return ip + ' (' + deviceid + ' / ' + id + ' / ' + name + ')';\n }", "getDeviceName...
[ "0.6117378", "0.61085236", "0.6019713", "0.5963867", "0.581837", "0.57883155", "0.5757105", "0.57080454", "0.56608975", "0.5653711", "0.56000704", "0.55867946", "0.5545145", "0.55217046", "0.5494777", "0.5480134", "0.5462442", "0.54552865", "0.54447436", "0.5440617", "0.54257...
0.68613327
0
function checks: 1 document extension is pdf 2 certificate serial number is saved in profile 3 plugin is running 4 certificate is physically exists in client user machine now if all the above succeeded , then sign the document and import new version to jupiter
function validateCertificateAndSign() { //1-Check document extension to apply digital signature to only PDFs //2-Check if there is alias saved in profile //3-Check if Plug-in is running //if plug-in down after setting isSignaturePluginRunning to true , service call of check certificate will alert the er...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function kawiGenerateSignedPDFFiles() {\n result = getKawi().generateSignedPDFFiles();\n \n //Evaluar resultado obtenido del applet\n if(result === \"PKI_KEYS_CANCEL\") {\n ////Ha presionado boton Cancelar durante la carga de las llaves\n return false;\n \n } if( (result.search(...
[ "0.63343394", "0.5971729", "0.5951112", "0.5877981", "0.5839556", "0.5820688", "0.57694775", "0.55903554", "0.55778015", "0.5544169", "0.5484438", "0.54837716", "0.5475961", "0.5474841", "0.54370207", "0.54051226", "0.5383426", "0.53293407", "0.5328994", "0.5288137", "0.52244...
0.8110641
0
Calls the constructor for the object that needs to be drawn. "object" is the name of that object. "payload" is the thing you need to construct your object. For example if you need a list to construct a certain object, paylod should be a list. It then calls the draw function for the object, and draws it in the HTML elem...
function launch(object, payload, id) { console.log("Calling Launch"); console.log(object); console.log(payload); var newObject = new object(payload); // grade object var content = document.getElementById(id); newObject.draw(content); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addObject(object) {\n object.clearCache();\n object.show();\n object.cache();\n current_layer.draw();\n}", "function createObject() {\n if (idNum === 0) {\n document.getElementById(\"prompt\").innerHTML = \"Drag object to start building!\";\n setTimeout(deletePrompt, 5000);\n ...
[ "0.6215976", "0.59779733", "0.5949301", "0.5881024", "0.58718616", "0.5826794", "0.5801053", "0.5706084", "0.5697911", "0.5650251", "0.5649389", "0.5630309", "0.5565488", "0.5533186", "0.55254036", "0.55205595", "0.5490732", "0.5483882", "0.5481934", "0.547012", "0.5462022", ...
0.8194596
0
Sets the onclick attribute of the HTML elements of a given class "name" / TODO not currently used nor tested
function onclickClass(name, func) { console.log("Onlick Class: " + name); var change = document.getElementsByClassName(name); // Find the elements for (var i = 0; i < change.length; i++) { change[i].onclick = func; // Change the content } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setonclick2(){\n\tvar i, n, str;\n\tfor (var i in Board.children){\n\t\tn=i.length;\n\t\tstr=i.slice(-3, n);\n\t\tif (str==\"Img\"){\n\t\t\tstr=i.slice(0, -3);\n\t\t\tBoard.children[i].setAttribute(\"onclick\", \"selectattackdefense('\"+str+\"')\");\n\t\t}\n\t}\n}", "function click_act(name, act=[], set...
[ "0.6324562", "0.6167238", "0.6119299", "0.6050341", "0.6029373", "0.5930399", "0.5824779", "0.58184874", "0.57969147", "0.5785346", "0.5772184", "0.5692752", "0.5660149", "0.56114423", "0.5594157", "0.5593566", "0.55390006", "0.5504267", "0.5477602", "0.5442736", "0.54136956"...
0.7837298
0
! AdminLTE app.js ================ Main JS application file for AdminLTE v2. This file should be included in all pages. It controls some layout options and implements exclusive AdminLTE plugins.
function _init(){"use strict";$.AdminLTE.layout={activate:function(){var a=this;a.fix(),a.fixSidebar(),$("body, html, .wrapper").css("height","auto"),$(window,".wrapper").resize(function(){a.fix(),a.fixSidebar()})},fix:function(){$(".layout-boxed > .wrapper").css("overflow","hidden");var a=$(".main-footer").outerHeight...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _init() {\n 'use strict';\n $.AdminLTE.layout = { activate: function () {\n var a = this;a.fix(), a.fixSidebar(), $('body, html, .wrapper').css('height', 'auto'), $(window, '.wrapper').resize(function () {\n a.fix(), a.fixSidebar();\n });\n }, fix: function () {\n $('.layout-box...
[ "0.71345025", "0.7099098", "0.7099098", "0.7099098", "0.7099098", "0.70987827", "0.70987827", "0.70987827", "0.70987827", "0.7097767", "0.7037158", "0.70332456", "0.70332456", "0.6969588", "0.6969588", "0.6913589", "0.6890279", "0.6833706", "0.67821777", "0.6189093", "0.60640...
0.71100855
1
insert response text into ajaxcontent box, and show the continue button, cause now we're ready to GO!
function alertContents() { try { if (httpRequest.readyState === 4) { if (httpRequest.status === 200) { //show the ajax box with the html from step 3 in it. Trigger create is used to apply the jqmobile styles to the returned html $(".ajaxContent").show().html(httpRequest.responseText).fadeIn("...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showResponseText(request, resultRegion) {\r\n if ((request.readyState == 4) &&\r\n (request.status == 200)) {\r\n htmlInsert(resultRegion, request.responseText);\r\n }\r\n}", "function showResponseText(request, resultRegion) {\n if ((request.readyState == 4) &&\n (request.status == 200))...
[ "0.7090769", "0.7068126", "0.70663214", "0.697104", "0.6951751", "0.67227864", "0.6721262", "0.6714685", "0.6636047", "0.6620683", "0.6608269", "0.6500713", "0.6465823", "0.6449894", "0.64295876", "0.6394192", "0.6385029", "0.6381262", "0.63725775", "0.6371097", "0.636366", ...
0.7096937
0
At the end of every run, behaveplusradical calls a storage function The internal default simply stores the results in memory for each variable Here, though, we define a new storage function that will write results to a file See Step 1b, where the DAG is instructed to use this as the storage function
function customStore( dag ) { // Collect the input and output values for this run const fields = [] // This is the fastest... /// dag.results.map.forEach((runs, node) => fields.push(node.value)) // OR ... this is slower due to formatting, about 4400 ms dag.results.map.forEach((runs, node) => fields.push(nod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeDataInTangle() {\n loadFile().then(function(obj) {\n generateAddress(seed).then(function(address) {\n let tx = createTransactions(obj.buffer, obj.name, address);\n totalPows = tx.length;\n sendTransactions(tx, seed).then(function(result) {\n totalPows = 0;\n pows = 0;...
[ "0.5873536", "0.5647558", "0.5621568", "0.56007606", "0.54455346", "0.5412827", "0.5409668", "0.53875846", "0.53848803", "0.5378971", "0.53469425", "0.52964205", "0.5290944", "0.52525675", "0.52212733", "0.5203245", "0.51729214", "0.51624846", "0.51484007", "0.5100646", "0.50...
0.62661374
0
Common function to create an id attribute for a photo entry This currently uses the only matched attributes of the url and the name to generate a hash.
function createId(url, name) { var sha1 = crypto.createHash("sha1"); sha1.update(url); if (name) sha1.update(name); return sha1.digest("hex"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePhoto(id) {\n\treturn ('[url=' + images[id].link + '][img]' + images[id].url + document.getElementById('photoSize').value +'[/img][/url]');\n}", "createId () {\n\t\tthis.attributes.id = this.useId || this.collection.createId();\n\t}", "function setIdPic(idName) {\r\n\tid = idName;\r\n}", "fu...
[ "0.62511826", "0.60156244", "0.5922236", "0.59218735", "0.5919191", "0.5919191", "0.5765807", "0.57627535", "0.5664194", "0.56030506", "0.55689454", "0.55315167", "0.55068326", "0.54668164", "0.5408443", "0.53773415", "0.53752524", "0.53673166", "0.5277891", "0.5268459", "0.5...
0.6385973
0
Append price to form
function priceAppender() { var value = $('.total-price').find('.amount').text(); $('.popup-form').find('.total-price').val(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateEditForm(data){\n $('#EditTicketPrice').val(data.price);\n }", "function showCarPrice(price) {\n $(modelPrice).empty().text(price + '$');\n }", "function update_form_product_price(item){\n const form_product = findParentElementByClass(item, 'product...
[ "0.6783614", "0.6574343", "0.64885765", "0.64462286", "0.6408418", "0.63693357", "0.6296465", "0.62297505", "0.6213997", "0.61151475", "0.6095377", "0.6032316", "0.6028655", "0.60048634", "0.600226", "0.59961253", "0.59911335", "0.59835905", "0.5950326", "0.59496915", "0.5939...
0.7786082
0
Gets the amount of settlements associated with the specified clearing id
getSettlementsCountByClearingId$({ args }, authToken) { return RoleValidator.checkPermissions$( authToken.realm_access.roles, "ACSS", "getSettlementsCountByClearingId$()", PERMISSION_DENIED_ERROR_CODE.code, PERMISSION_DENIED_ERROR_CODE.description, ["PLATFORM-ADMIN", "BUSINESS-OW...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "countSettlements(){\n return this.settlements.length\n }", "getSizeOfSet(elemIndex) {\n return this.sizes[this.getRepresentative(elemIndex)];\n }", "function size() {\r\n var counter = 0;\r\n for (var i = 0; i < this.PriorityQueueContents.length; i++) {\r\n counter += this.Prio...
[ "0.6181183", "0.5683356", "0.53853965", "0.5353852", "0.5318039", "0.53161895", "0.5295502", "0.527751", "0.5258872", "0.524256", "0.524256", "0.5233138", "0.51578325", "0.5145446", "0.5127016", "0.5127016", "0.51080257", "0.5088684", "0.50547105", "0.5029473", "0.5021616", ...
0.71847194
0
Gets the amount of settlements associated with the specified business id
getSettlementsCountByBusinessId$({ args }, authToken) { return RoleValidator.checkPermissions$( authToken.realm_access.roles, "ACSS", "getSettlementsCountByBusinessId$()", PERMISSION_DENIED_ERROR_CODE.code, PERMISSION_DENIED_ERROR_CODE.description, ["PLATFORM-ADMIN", "BUSINESS-OW...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getSettlementsCountByClearingId$({ args }, authToken) {\n return RoleValidator.checkPermissions$(\n authToken.realm_access.roles,\n \"ACSS\",\n \"getSettlementsCountByClearingId$()\",\n PERMISSION_DENIED_ERROR_CODE.code,\n PERMISSION_DENIED_ERROR_CODE.description,\n [\"PLATFORM-ADM...
[ "0.58983123", "0.5720775", "0.5577145", "0.5194948", "0.51916516", "0.51492494", "0.5081311", "0.50665295", "0.5066439", "0.50609887", "0.5021146", "0.50186104", "0.50167555", "0.49386337", "0.49247515", "0.49202684", "0.48724166", "0.4868682", "0.48610485", "0.48607728", "0....
0.6986418
0
runs the given function with the (optional) given initialResults and checks the results against the object in expected. The test gets duration ms to complete the specs object can have the following values: expected:: expected results object, results may contain more properties than expected! (required), toTest:: the fu...
function asyncTest(specs){ var temp=specs.initialResults || {}; var results={}; for(var prop in temp){ results[prop]=temp[prop]; } specs.results=results; var processTestResults=function(){ var failed=false; for(var prop in specs.expected){ if(specs.expected[p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testFunction(actual, expected) {\n\tif (actual === expected) {\n\t\tconsole.log(\"Test passed\");\n\t} else {\n\t\tconsole.log(\"Test failed:\");\n\t\tconsole.log(\"Expected Result: \" + expected);\n\t\tconsole.log(\"Actual Result: \" + actual);\t\n\t}\n}", "function testFunctionWorks(fn, input, expecte...
[ "0.58735746", "0.5734208", "0.5543257", "0.55251306", "0.55251306", "0.5505217", "0.54308045", "0.5422858", "0.542211", "0.5378467", "0.5328711", "0.52403724", "0.52274865", "0.5213255", "0.5178956", "0.5141961", "0.5128619", "0.5105393", "0.5105119", "0.51047635", "0.5096442...
0.62322354
0
Returns the hostname portion of a URL.
function hostname(url) { return new _url.URL(url).hostname; } // Normalizes a URL by stripping any anchors
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHostname(url) {\n return decodeURIComponent(url).replace(/.*\\/\\//, \"\").replace(/\\/.*$/, \"\");\n}", "function getHostname(url) {\n let nURL = \"\";\n if (url[5] === \":\") {\n url = url.substr(8, url.length);\n } else {\n url = url.substr(7, url.length);\n }\n for (i in...
[ "0.8323266", "0.8225829", "0.8095053", "0.8082797", "0.804158", "0.8038009", "0.8015611", "0.79698706", "0.79403085", "0.7890312", "0.7810821", "0.7725466", "0.7725466", "0.7725466", "0.7725466", "0.7725466", "0.7725466", "0.7725466", "0.7713327", "0.77068967", "0.7672686", ...
0.83742964
0
it will also return true if the host matches end of the domain.
function domainCheck(domain, host, isWild) { if (host === domain) { return true; } if (isWild && host) { let last = host.lastIndexOf(domain); return last >= 0 && last + domain.length === host.length; } return false; } // Returns true or false if `url` matches the provided domain `pattern`.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isHostnameMatch(url) {\n // return urlWithoutProtocol(url).substring(hostReg, host.length) === host;\n return false;\n }", "isInDomain(url) {\n return url.replace(/(https|http):/i, \"\").startsWith(\"//\" + this.args.domain);\n }", "function matchDomain(str) {\n let re = new RegExp(/^([A-Z...
[ "0.70995766", "0.68354756", "0.68001246", "0.67454964", "0.6675826", "0.6560304", "0.6506081", "0.64512473", "0.6387421", "0.63759714", "0.6347811", "0.63193005", "0.6315674", "0.62997484", "0.625685", "0.6252321", "0.62019813", "0.6184995", "0.6167119", "0.6122184", "0.60855...
0.69407094
1
Returns match by user_id
function getMatch(userId) { if (angular.isUndefined(userId)) { return { code: 0, message: 'Must provide userId' }; } return $http.get('/api/users/matches/' + userId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async getUserMatches(user_id) {\n let res = await this.request(`evaluations/matches/${user_id}`);\n return res;\n }", "getMatchedUsers(userId) {\n return fetch(`${config.API_ENDPOINT}/matched/${userId}`)\n .then(res => \n (!res.ok)\n ? res.json().then(e => Pr...
[ "0.7582109", "0.70877093", "0.68220186", "0.64738107", "0.6473493", "0.6395297", "0.6371378", "0.6369435", "0.6296175", "0.62835175", "0.6261329", "0.623039", "0.62289065", "0.6215403", "0.6191588", "0.61817026", "0.616794", "0.61505866", "0.61355877", "0.6116281", "0.6109066...
0.7661094
0
Check if the same page exists in the other documentation set. If yes, return the new link. Otherwise, link to the index page of the other documentation set.
function findNewURL(paths,newset) { var newURL = URLprefix.concat(newset,"/",paths['page']); var xhr = new XMLHttpRequest(); xhr.open('HEAD', newURL, false); xhr.send(); if (xhr.status == "404") { return URLprefix.concat(newset,"/"); } else { return newURL; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPageUrl(){\n if(pageUrl === \"index.html\"){\n currentPage = \"index\";\n return \"index\";\n }\n else if(pageUrl === \"results.html\"){\n currentPage = \"results\";\n return \"results\";\n }\n}", "function linkedDocs(doc, f, sharedHistOnly) {\n\t\t functi...
[ "0.57463974", "0.5313988", "0.53076494", "0.52976763", "0.5286702", "0.5286702", "0.5279728", "0.5279728", "0.5279728", "0.5279728", "0.5279728", "0.5279728", "0.5279728", "0.5279138", "0.52775127", "0.52775127", "0.52775127", "0.52775127", "0.52775127", "0.52775127", "0.5277...
0.54161566
1
Toggle the version dropdown.
function dropdown() { document.getElementById("all-versions").classList.toggle("show"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleVersionsOnly() {\n if (showVersionsEl.get('checked')) {\n modalEl.addClass('boolean-on');\n } else {\n modalEl.removeClass('boolean-on');\n }\n }", "function show_on_click(){\t\n\t...
[ "0.7187726", "0.7066334", "0.65791285", "0.6181388", "0.6181388", "0.6154343", "0.6130362", "0.60327935", "0.5914048", "0.5887952", "0.58675", "0.5856041", "0.5843032", "0.58029866", "0.5787323", "0.5783523", "0.5783523", "0.5779001", "0.57740307", "0.5763851", "0.56762683", ...
0.76591355
0
change text style to italic
function changeItalic() { var fontStyle = document.querySelector("textarea").style.fontStyle; if (fontStyle == "italic") { document.querySelector("#text").style.fontStyle = ""; } else { document.querySelector("#text").style.fontStyle = "italic"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeItalic() {\n var fontStyle = document.querySelector(\"textarea\").style.fontStyle;\n if (fontStyle == \"italic\") {\n document.querySelector(\"#text\").style.fontStyle = \"\";\n } else {\n document.querySelector(\"#text\").style.fontStyle = \"italic\";\n }\n}", "function italics(){\n ...
[ "0.7562278", "0.7514904", "0.74453354", "0.74307764", "0.7387971", "0.73598963", "0.7347764", "0.7309535", "0.7309535", "0.7309535", "0.7309535", "0.7309535", "0.7309535", "0.72803205", "0.725167", "0.72393465", "0.7224335", "0.7184623", "0.71001285", "0.7078952", "0.7022584"...
0.75611573
1
change align text to right
function rightMe() { $("#textarea").css("text-align", "right"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rightMe() {\n $(\"#textarea\").css(\"text-align\", \"right\");\n}", "function alinearALaDerecha(){\n comentarioModificado.style.textAlign = \"right\";\n\n}", "function jright() {\n\treachtext.document.execCommand('justifyRight',false,null);\n \n}", "get justifyRightButton() {\n return {\n ...
[ "0.71297026", "0.71286565", "0.70471835", "0.70208263", "0.67031515", "0.6649992", "0.6573514", "0.6555365", "0.62731916", "0.62105227", "0.6196492", "0.61592287", "0.6146317", "0.6146203", "0.6144779", "0.6075566", "0.6057078", "0.60365355", "0.6004805", "0.59512514", "0.593...
0.719971
0
loadCreateMaquette Function for load event for create maquette
function loadCreateMaquette(){ /** * @close-create-maquette */ $('#close-create-maquette').click(function(){ //Style CSS for tools bar $('#create-maquette-btn').css({ 'background': 'none', }); for(let i = 0; i<$('.create-maquette').length; i++ ){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n roulette.data = utils.loadData();\n }", "function handleFileLoad(event) {\n console.log(\"A file has loaded of type: \" + event.item.type);\n // create bitmaps of images\n if (event.item.id == \"background\") {\n background = new createjs.Bitmap(event.result);\n } else if (event.i...
[ "0.5709151", "0.5693147", "0.56499946", "0.564858", "0.5641042", "0.54443395", "0.54380774", "0.5433709", "0.5432278", "0.5431673", "0.5416595", "0.54047406", "0.53663725", "0.5361101", "0.5358451", "0.53560615", "0.5355341", "0.53176254", "0.5283904", "0.5266448", "0.5254923...
0.65053403
0
loadToolsEvent Function for load all event for tools
function loadToolsEvent(){ /** * @show-create-tools */ $('#btn-show-create-tool').click(function() { for(let i = 0; i < $('#list-create li').length; i++){ $($('#list-create li')[i]).toggle(); } if($('#list-create li')[0].style.displ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function iniEvents() {\n\n function _gather_table_thead() {\n data.fields.forEach(field => {\n let id = GatherComponent.idByGatherTeamField(gatherMakers, gatherMakers.team, field);\n elementById(id).addEventListener('change', refresh); // TODO optimize scope to table header rows\n ...
[ "0.60542655", "0.5975423", "0.589782", "0.58524615", "0.58524615", "0.58524615", "0.58524615", "0.582534", "0.58251625", "0.57658964", "0.5755438", "0.567822", "0.56486106", "0.56399065", "0.5601486", "0.5572816", "0.55245805", "0.55203193", "0.55191684", "0.55001867", "0.548...
0.623284
0
loadHeaderCreateEvent Function for load all event for headercreate Load all event and function for do create header
function loadHeaderCreateEvent(){ /** * Hidde the formulaire for create header */ $('#close-create-header').click(function (){ $('#create-header-btn').css({ 'background':'none', }); for(let i = 0; i<$('.create-header').length; i++ ){ $('.create-header')[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadHeaderViewEvent(){\n\n /**\n * @close-header-view\n */\n $('#close-header-view').click(function (){\n $('#view-header-btn').css({\n 'background':'none',\n });\n for(let i = 0; i<$('.header-view').length; i++ ){\n ...
[ "0.6747859", "0.65985", "0.6517519", "0.6382509", "0.6207579", "0.6207276", "0.6043838", "0.6022511", "0.5975772", "0.59642315", "0.59055674", "0.5847862", "0.582812", "0.5811268", "0.577331", "0.57505065", "0.57111174", "0.5686047", "0.56695324", "0.5650934", "0.5612739", ...
0.79725707
0
loadHeaderViewEvent Function for load all event for headerview Load all event and function for do header_view
function loadHeaderViewEvent(){ /** * @close-header-view */ $('#close-header-view').click(function (){ $('#view-header-btn').css({ 'background':'none', }); for(let i = 0; i<$('.header-view').length; i++ ){ $('.header-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadHeaderCreateEvent(){\n /**\n * Hidde the formulaire for create header\n */\n $('#close-create-header').click(function (){\n $('#create-header-btn').css({\n 'background':'none',\n });\n for(let i = 0; i<$('.create-header').length; i++ ){\n $('.cr...
[ "0.67338216", "0.6693456", "0.6573414", "0.6375419", "0.62839144", "0.62649655", "0.6168356", "0.616259", "0.6155251", "0.61209375", "0.60348463", "0.60069656", "0.59961766", "0.5986102", "0.5890331", "0.58771193", "0.5843836", "0.58343595", "0.5828436", "0.5794406", "0.57944...
0.7859737
0
function runs through array and checks each el at a time. if an el is prime, it will print it to the console.
function primePrint(element) { if (isNaN(element)) { return false; } if (element <= 0 || element === 1) { return false; } if (element % 2 === 0 && element != 2 || element % 3 === 0 && element != 3 || element % 5 === 0) { return false; } if (element % Math.sqrt(element) === 0) { return false; } console....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function seventhProblem(){\n\tconsole.log('\\nProblem 7\\nThis number is prime:');\n\tvar arr = [1, 2, 3, 4, 9, 37, 97, 51, -3, 0],\n\t\tii = 0,\n\t\tlen = arr.length;\n\tfor(ii; ii < len; ii++){\n\t\tvar prime = true;\n\t\tif(arr[ii] >= 2) {\n\t\t\tfor(var i = 2; i <= Math.floor(Math.sqrt(arr[ii])); i++){\n\t\t\t...
[ "0.74076444", "0.7272854", "0.7272748", "0.719987", "0.7113663", "0.7098857", "0.7050548", "0.7020627", "0.69633067", "0.6957794", "0.69195414", "0.6888149", "0.687576", "0.6861612", "0.67744875", "0.67435217", "0.67393947", "0.66954386", "0.6691649", "0.6684379", "0.6659813"...
0.7615928
0
area de un circulo (pi r 2)
function area_circulo(r) { let area; area = (3.14 * r * r); return area; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function areaCirculo(radioCirculo) {\n return (PI * (radioCirculo*radioCirculo))\n}", "function areaCirculo(radio){\n return (radio*radio)*pi;\n}", "function areaCirculo (radio){\n \n return (radio*radio)*PI;\n}", "function calcolaArea(r) {\n\treturn Math.pow(r, 2) * piGreco;\n}", "area() {\n ...
[ "0.78230673", "0.754513", "0.74193746", "0.71001583", "0.6989057", "0.6983617", "0.6919378", "0.6883072", "0.68706566", "0.68299955", "0.6827677", "0.6827677", "0.6827677", "0.6805225", "0.6773749", "0.67460644", "0.67273057", "0.6709691", "0.6693479", "0.6693479", "0.6693479...
0.77320725
1
Remove device by devices key
removeDevice(a_device) { //a_device is a key if (typeof a_device === 'string') { //If devices has key if (this.devices.has(a_device)) { //Delete Debug.Log("Removing device by key. UID: " + a_device, "blue"); return this.devices.dele...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "remove(device) {\n\t\tlet index = this.devices.findIndex(d => d.id === device.id);\n\t\tif(index > -1) {\n\t\t\tlet [device] = this.devices.splice(index, 1);\n\t\t\tdevice.destroy();\n\t\t}\n\t}", "function removeOldDevices(data){\n var hueIds = _.pluck(data, \"uniqueid\");\n var toDelete = [];\n network.get(...
[ "0.66464335", "0.64433706", "0.6420081", "0.6395443", "0.6351733", "0.6273921", "0.6264702", "0.6236449", "0.6158556", "0.6135126", "0.60954547", "0.60932463", "0.60505533", "0.59937644", "0.59910536", "0.59881747", "0.59765124", "0.59756917", "0.59706473", "0.5966484", "0.59...
0.74365336
0
Emit to specific device with id
emit(a_uid, a_message) { //Get reference to device var device = this.devices.get(a_uid); //Device does not exist if (!device) { Debug.Error("Could not find device with uid: " + a_uid); return; } //Send message to device device.sendMessage...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function individualCarDataSender(id) {\n console.log(id);\n msg = createSensorsMsg();\n helper.PostCode(host, port, endpoint, msg);\n\n}", "function emitSystemMessage(id, action, target){\n var out = {\n type: 'system',\n action: action,\n id: id,\n target: target\n }\n io.sockets.emit('c...
[ "0.6420324", "0.633938", "0.63178563", "0.6294339", "0.62606853", "0.625474", "0.6097013", "0.60668314", "0.6063909", "0.584244", "0.58327156", "0.5821122", "0.57658535", "0.5763478", "0.5743206", "0.5734803", "0.57187253", "0.57160884", "0.563398", "0.56330955", "0.5628886",...
0.69641757
0
Given a state transition (s1, s2), infer the name of the action associated with this transition.
function infer_action_name(s1, s2){ // Initial states are not a transition. if(s1===null){ return ""; } servers = Object.keys(s1["val"]["configTerm"]); console.log("servers"); console.log(servers); function configChanged(s){ return s1["val"]["config"][s] !== s2["val"]["config...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actionToName(action, board) {\n switch (action.action) {\n case 'assign': {\n return 'Assign: ' + cellToString(action.cell) + ' \\u2190 ' + (action.value +1);\n }\n case 'exclude': {\n return 'Exclude: ' + cellToString(action.cell) + ' \\u2260 ' + (action.val...
[ "0.59460264", "0.5859969", "0.56586766", "0.56072193", "0.53562176", "0.519843", "0.51672184", "0.51447314", "0.51382834", "0.5130099", "0.5110879", "0.506393", "0.50620604", "0.5011413", "0.49802855", "0.49355748", "0.48984298", "0.48837677", "0.48555663", "0.4849406", "0.48...
0.67500234
0
View function. Takes a protocol state and returns an SVG object that is a visual representation of that state. With the 'skeleton' option, it just draws the nodes and their names, without details of their values.
function view(state, skeleton){ var group = document.createElementNS(svgns, 'g'); // console.log(state["configTerm"]) var servers = Object.keys(state["configTerm"]); ind = 0 num_servers = servers.length; for(var server in state["configTerm"]){ // console.log(server) // console.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showGraphViz(gr) {\n var element = document.getElementById(\"shownGraphDiv\");\n element.innerHTML = Viz(gr.toGraphViz(), \"svg\");\n}", "function putSvg(next) {\n if (next == VIEWS.DOT.hash) {\n goToDot(next + \"/\" + dot_top);\n return;\n }\n if (!next) next = dot_top;\n va...
[ "0.5748761", "0.5729834", "0.550515", "0.5454584", "0.54000324", "0.5388848", "0.5356373", "0.53367925", "0.5307759", "0.5306111", "0.5286281", "0.5272073", "0.52686805", "0.5263649", "0.52437264", "0.5230785", "0.52266943", "0.5172698", "0.5161909", "0.5116305", "0.5100507",...
0.6631013
0
Refreshs selection dialogs model, and shows it.
__showSelectionDialog() { if (this.isEnabled() == true) { // Set index before items, because setItems() triggers rendering. this.__selectionDialog.setSelectedIndex(this.getSelection()); this.__selectionDialog.setItems(this.getModel()); this.__selectionDialog.show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function data_SelectionView()\n{\n var molidx = new Array();\n for (var n = 1; n <= num_molecules; n++) {\n\tif (IsMoleculeSelected(n)) molidx.push(n);\n }\n if (molidx.length == 0) {\n\talert(\"Select some molecules first.\");\n\treturn;\n }\n PopupPersistentMolecules(molidx, null);\n}", "trig...
[ "0.6064242", "0.60447687", "0.6042187", "0.5980713", "0.5867368", "0.5758767", "0.57358", "0.5733649", "0.5723346", "0.56632185", "0.5662876", "0.56611216", "0.5660306", "0.5570573", "0.5560276", "0.5537173", "0.5487386", "0.54496783", "0.5437067", "0.54310155", "0.5336028", ...
0.7056386
0
Set up internal logging
setupLogging() { this.on('error', logger.error); this.on('rss', (body) => logger.silly(`emitted: ${body.id}`)); this.on('ws:update:raw', (body) => logger.silly(`emitted raw: ${body.platform}`)); this.on('ws:update:parsed', (body) => logger.silly(`emitted parsed: ${body.platform} in ${body.language}`));...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static setup() {\r\n if (!Utils.exists(Utils.log)) {\r\n super.setup(C.LOG_SRC.UTILS);\r\n }\r\n }", "initLogger() {\n this.logger = this.getLogger();\n }", "function initializeLoggers(settings) {\n // We configure our loggers as follows:\n // * our base logger tags all l...
[ "0.73751795", "0.6935435", "0.67944705", "0.6787339", "0.6787339", "0.6764993", "0.67494833", "0.6633127", "0.6578593", "0.654735", "0.65468395", "0.6495023", "0.64720595", "0.6468232", "0.642646", "0.6423416", "0.6405594", "0.6256021", "0.6234641", "0.6204464", "0.6198082", ...
0.7259742
1
Create an alert popup containing the price of the main product
function alertPrice(mainButtonElement){ //TODO: make alert look cooler let price = mainButtonElement.parentElement.children.mainProductPrice.innerHTML; alert(`The price is: ${price}`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function avgCarPriceAlert() {\r\n let averagePrice = carsStore.getAveragePrice();\r\n\r\n let message = alertsHelper.averagePriceMessage(averagePrice);\r\n\r\n alert(message);\r\n}", "function featurePrice(product, price) {\n document.getElementById(product + '-price').innerText = price;\n const t...
[ "0.69331515", "0.6581961", "0.6459417", "0.63975143", "0.6336313", "0.63194174", "0.6308916", "0.6295916", "0.6259425", "0.62558955", "0.62458247", "0.62342757", "0.618967", "0.61851656", "0.6180622", "0.61791265", "0.6176895", "0.61586136", "0.61571765", "0.61523426", "0.614...
0.72473335
0
Deliverable 2 & 3 In that component, render a button. On that button, add event handlers that listens for the focus and blur events.
render(){ return( <button onFocus={this.focus} onBlur={this.blur}>Press Me</button> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onBlur(event) {\n window.setTimeout(() => {\n try {\n if (document.activeElement !== this.buttonComponent.getButtonComponent()\n && document.activeElement !== this.inputComponent.getInputComponent()) {\n this.props.formProps.onBlur()\n }\n } catch (e) {\n // @inf...
[ "0.64509434", "0.6255121", "0.6130121", "0.6090886", "0.6057753", "0.6018172", "0.5828863", "0.581079", "0.5759759", "0.57571375", "0.57504934", "0.5695346", "0.56832224", "0.56740063", "0.56724876", "0.5651891", "0.56442535", "0.5641747", "0.5637388", "0.56059396", "0.560120...
0.76081806
0
Initialize a random direction.
initializeDirection() { // 1, 2, 3, 4. this.direction = Math.floor(Math.random() * 4) + 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomDirection() {\n var y = Math.random() * 1.6 - 0.8;\n var x = Math.sqrt(1 - y ** 2);\n if (objectMove.direction[0] > 0) {\n x = -x;\n }\n objectMove.direction[0] = x;\n objectMove.direction[1] = y;\n}", "getRandomDirection(){\n this.setDirection(Math.floor(Math.rando...
[ "0.7715398", "0.7688131", "0.7523828", "0.74323356", "0.71948177", "0.6984383", "0.6952979", "0.6929447", "0.68379635", "0.68119395", "0.66326666", "0.6411991", "0.6405223", "0.63580877", "0.6287153", "0.62825006", "0.6261594", "0.62114686", "0.62021476", "0.6191826", "0.6191...
0.8531407
0
Move queue according to previous snake head location.
moveQueue() { if (this.crashed) { return; } if (this.queue.length) { this.queue.unshift({ x: this.x, y: this.y }); this.queue.pop(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "moveQueue() {\n if (this.localQueue.length > 0) {\n \n const currentEntry = this.localQueue[0];\n\n switch (currentEntry[0]) {\n case \"add\":\n addTrie(currentEntry[1]);\n break;\n case \"remove\":\n removeTrie(currentEntry[1]);\n ...
[ "0.7118682", "0.6778798", "0.6736484", "0.6612369", "0.65977734", "0.6534186", "0.6525772", "0.6447864", "0.6447003", "0.6375614", "0.6345519", "0.631942", "0.631942", "0.6297642", "0.6297332", "0.6293231", "0.6278315", "0.62574273", "0.6222548", "0.61633337", "0.61633337", ...
0.759015
0
Get if snake has crashed to its tail.
getTailCrash() { for (let i = 0; i < this.queue.length; i++) { if (this.detectCollision( this.x, this.y, this.queue[i].x, this.queue[i].y )) { this.setCrashed(true); return; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isEaten() {\r\n if (snake.segments.tail != null) {\r\n return this.isCircleinCircle(new Circle(snake.position.x, snake.position.y, snake.width / 2));\r\n }\r\n }", "didSnakeEatItself() {\n const snakeHeadLocation = this.snake.segments[this.snake.segments.length - 1];\n this.snak...
[ "0.6694782", "0.6290058", "0.62514853", "0.60436773", "0.59357363", "0.59024525", "0.58706844", "0.5828683", "0.58163893", "0.5752058", "0.55905455", "0.5577123", "0.55341965", "0.5515108", "0.5509246", "0.55020285", "0.5491905", "0.5471525", "0.54709345", "0.54345864", "0.54...
0.6458052
1
Get if snake has crashed to the wall.
getWallCrash() { let up = this.y <= 0; let right = this.x >= settings.canvasSize - settings.step; let down = this.y >= settings.canvasSize - settings.step; let left = this.x <= 0; if (up || right || down || left) { this.setCrashed(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkDeath() {\n for (let i = 5; i < snake.length; i++) {\n let collision = snake[i].x === snake[0].x && snake[i].y === snake[0].y;\n\n if (collision) return true;\n }\n\n const hitLeftWall = snake[0].x < 0;\n const hitRightWall = snake[0].x > gc.width - (size + gc.width / 2);\n ...
[ "0.69175893", "0.6694", "0.66923666", "0.66569066", "0.665122", "0.65601903", "0.65034366", "0.64853996", "0.6459296", "0.6448119", "0.64462656", "0.63643324", "0.6348867", "0.6336009", "0.63055944", "0.6293804", "0.62927157", "0.62835795", "0.62700933", "0.6206055", "0.62044...
0.749937
0
function mapFrom x,y sind die Vertikalen und Horizentalen Spalten
function mapFromXY(x,y) { let invY = 5 - y; let mappedPixel = invY + (x*6); return mappedPixel; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pointToIndex(x, y) {\n return x + y * map.cols;\n }", "function gtaCoordToMap(x, y)\r\n{\r\n\tvar mapx = x * 0.03;\r\n\tvar mapy = y * 0.03;\r\n\treturn {x: mapx, y: mapy};\r\n}", "function transformedPoint(x, y) {\n\t\t\t\treturn {\n\t\t\t\t\t\"x\" : mapTranslate[0] + (x * mapScale),\n\t\t\t\t\t\...
[ "0.67594737", "0.67215014", "0.6719228", "0.67152435", "0.658683", "0.6579604", "0.65787613", "0.6574968", "0.6563693", "0.6499723", "0.64502347", "0.6389275", "0.6338215", "0.6275645", "0.6182752", "0.61773425", "0.6145796", "0.6083788", "0.60463095", "0.60439867", "0.601630...
0.71439797
0
The constructor receives the instance of the express.js app and the Blockchain class.
constructor(app, blockchainObj) { this.app = app; this.blockchain = blockchainObj; // All the endpoint methods need to be called in the constructor to initialize the route. this.getBlockByHeight(); this.requestOwnership(); this.submitStar(); this.getBlockByHash(); this.testChainValidation(); this.getS...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(app, blockchainObj) {\n this.app = app;\n this.blockchain = blockchainObj;\n // All the endpoints methods needs to be called in the constructor to initialize the route.\n this.getBlockByHeight();\n this.requestOwnership();\n this.submitStar();\n this.get...
[ "0.782503", "0.65925777", "0.65046185", "0.6448849", "0.6435855", "0.63598645", "0.6299317", "0.6272659", "0.62330323", "0.6212654", "0.61978966", "0.61978966", "0.6188522", "0.6185278", "0.6163293", "0.6085326", "0.60741293", "0.60582626", "0.60352266", "0.601421", "0.597781...
0.7771616
1
Endpoint that allows user to request Ownership of a Wallet address (POST Endpoint)
requestOwnership() { this.app.post('/requestOwnership', async (req, res) => { if (req.body.address) { const address = req.body.address; const message = await this.blockchain.requestMessageOwnershipVerification( address ); if (message) { return res.status(200).json(message); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateAddress() {\r\n _doGet('/account/generate', _updateWallet);\r\n }", "getUserWallet(uid) {\n return Request.get({\n url: `${URLS.WALLET_USER}/${uid}`,\n });\n }", "handler(app, req, res) {\n wallet.addNewAddress(wallet.getDefaultActiveWallet())\n ...
[ "0.57981795", "0.5780988", "0.5776694", "0.5753552", "0.5742088", "0.5626975", "0.5603251", "0.55655634", "0.55655634", "0.5554621", "0.5531843", "0.5529998", "0.5528095", "0.5497089", "0.5473281", "0.54606247", "0.54561275", "0.5428322", "0.54233986", "0.5407166", "0.5404177...
0.7342625
0
Endpoint to Submit a Star First must `requestOwnership` to have the message (POST endpoint)
submitStar() { this.app.post('/submitstar', async (req, res) => { if ( req.body.address && req.body.message && req.body.signature && req.body.star ) { const address = req.body.address; const message = req.body.message; const signature = req.body.signature; const star = req.body.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "requestOwnership() {\n\t\tthis.app.post('/requestOwnership', async (req, res) => {\n\t\t\tif (req.body.address) {\n\t\t\t\tconst address = req.body.address;\n\t\t\t\tconst message = await this.blockchain.requestMessageOwnershipVerification(\n\t\t\t\t\taddress\n\t\t\t\t);\n\t\t\t\tif (message) {\n\t\t\t\t\treturn r...
[ "0.693771", "0.6091197", "0.5750861", "0.5637248", "0.5595955", "0.5521009", "0.54520833", "0.54051137", "0.53887326", "0.53510696", "0.53391695", "0.53148144", "0.5307945", "0.5276355", "0.5262162", "0.5250861", "0.52469695", "0.5243578", "0.5225717", "0.5215215", "0.5191354...
0.6331982
1
Endpoint to call validateChain() (GET endpoint) assumes that a blockchain exists
testChainValidation() { this.app.get('/testChainValidation', async (req, res) => { try { await this.blockchain.validateChain(); return res.status(200).send('Blockchain valid.'); } catch (error) { return res.status(500).send('Error in function testChainValidation.'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function testChainValidation() {\n return blockchain.validateChain();\n}", "getChainErrorList() {\n this.app.get(\"/chainErrorList\", async (req, res) => {\n return res.status(200).json(await this.blockchain.validateChain().catch(error => {\n return res.status(500).send(...
[ "0.7351369", "0.6754401", "0.6567067", "0.6403647", "0.6382725", "0.6367985", "0.6297128", "0.6233005", "0.62261534", "0.61196893", "0.6105833", "0.61042404", "0.60990876", "0.60794806", "0.6071335", "0.6069185", "0.6065092", "0.60375744", "0.6022857", "0.6014901", "0.6006818...
0.74271685
0
Endpoint to request list of Stars registered by an owner
getStarsByOwner() { this.app.get('/blocks/:address', async (req, res) => { if (req.params.address) { const address = req.params.address; try { let stars = await this.blockchain.getStarsByWalletAddress(address); if (stars) { return res.status(200).json(stars); } else { return res....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStars(req, res, next) {\n const datasetId =\n req.params.datasetId === 'undefined' ? null : req.params.datasetId\n if (datasetId) {\n Star.find({\n datasetId: datasetId,\n }).toArray((err, stars) => {\n if (err) {\n return next(err)\n }\n res.send(stars)...
[ "0.6320727", "0.6041487", "0.5920327", "0.5872521", "0.56055546", "0.55814934", "0.5557116", "0.5469711", "0.5468596", "0.52888834", "0.5244033", "0.5236113", "0.5230477", "0.5211169", "0.51960117", "0.5166859", "0.5164776", "0.5156117", "0.51160365", "0.50771856", "0.5071770...
0.6555981
0
add an additional option field for the specified question template
function addOptionField(questionId, optionNumber) { let optionsContainer = document.getElementById('q' + questionId).getElementsByClassName('answers-container')[0]; let optionInput = document.getElementById('option-input'); let clonedOptionInput = optionInput.cloneNode(true); clonedOptionInput.getEleme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCustomQuestion() {\n updateQuestions();\n let question = new Question(\"Custom\", \"\", \"\");\n question.options.push(constructOptionObject(\"\", \"\"));\n questions.push(question);\n displayQuestions();\n hideAddQuestionModal();\n\n // add a field\n}", "function populateQuestio...
[ "0.68980306", "0.62638324", "0.6224596", "0.6081756", "0.60782784", "0.60669", "0.60217273", "0.58952034", "0.5892677", "0.58561814", "0.5843845", "0.58142227", "0.57373834", "0.5730508", "0.57279676", "0.5707922", "0.5698608", "0.56981605", "0.5674471", "0.56728053", "0.5657...
0.6675337
1
add question to DB and add a new empty question template to the page
function addQuestionHandler() { if (!addQuestionToDB(questionId)) {return} // enable update and delete buttons for added question document.getElementById("btn-update" + (questionId)).disabled = false; document.getElementById("btn-delete" + (questionId)).disabled = false; // increment q...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addQuestionsFromDB() {\n questions.forEach(question => {\n addNewTemplate(question[\"ID\"]);\n populateQuestionTemplate(question[\"ID\"], question);\n });\n\n // after all questions from database have been added, update current question ID and add a new template \n questionId = q...
[ "0.7776877", "0.72003734", "0.71184826", "0.70513856", "0.70356834", "0.7016434", "0.70126003", "0.6944037", "0.6912639", "0.6866234", "0.6829505", "0.6758209", "0.6748674", "0.67334414", "0.6721553", "0.6616229", "0.66136795", "0.6612989", "0.6610696", "0.6552603", "0.654283...
0.7404456
1
populate question template with content from question object
function populateQuestionTemplate(questionId, questionObj) { let questionTemplate = document.getElementById("q" + questionId); questionTemplate.getElementsByTagName("textarea")[0].value = questionObj["text"]; // add extra options fields if question contains more than 2 let numOptions = questionObj["opt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function questionTemplate() {\n // create a variable to store the radio buttons with the labels as a list item\n let answerTemp = ``;\n // get the question we are at assign the value to questionTemp\n let questionTemp = store.questions[store.questionNumber];\n\n for (let i = 0; i < questionTemp.answers.length...
[ "0.7375544", "0.7211794", "0.71491545", "0.70924175", "0.7069473", "0.7060209", "0.7060209", "0.7043569", "0.6974393", "0.69476455", "0.69176924", "0.6913352", "0.6903415", "0.6889751", "0.685309", "0.6852519", "0.68419814", "0.6797679", "0.6787861", "0.6777586", "0.6761781",...
0.72835165
1
add all questions retrieved from the DB onto the page
function addQuestionsFromDB() { questions.forEach(question => { addNewTemplate(question["ID"]); populateQuestionTemplate(question["ID"], question); }); // after all questions from database have been added, update current question ID and add a new template questionId = questions[questio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addQuestions(questions) {\n if(Array.isArray(questions))\n {\n questions.forEach(function(question){\n addQuestionsToPage(question);\n });\n }else{\n addQuestionsToPage(questions);\n }\n }", "addQuestions() {\n this.sh...
[ "0.713267", "0.70180285", "0.70080984", "0.69453305", "0.6825171", "0.66906756", "0.66764545", "0.6658176", "0.66454774", "0.6629381", "0.6550485", "0.64995956", "0.6499431", "0.648557", "0.648557", "0.6479139", "0.647271", "0.6461289", "0.64459133", "0.6430671", "0.64128", ...
0.7357476
0
ROUTE POST /api/training/create DESCRIPTION Create a new training SUCCESS 200 : Training created ERROR 400 : Invalid data format 404 : Workout not found 404 : Exercise not found 500 : Database query error
create(req, res) { var self = this; var datas = req.body; // Add session token to datas datas.token = req.cookies.token; // Validate data format joi.validate(datas, joi.object().keys({ token: joi.string().required(), workoutId: joi.number().integer(), exerciseId: joi.number()...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addTraining(training) {\n console.log(training);\n fetch('https://customerrest.herokuapp.com/api/trainings/',\n { method: 'POST',\n headers: { 'Content-Type': 'application/json', },\n body: JSON.stringify(training)\n })\n .then(res => this.loadTrainings())\n .then(res => this.setS...
[ "0.66241115", "0.6332864", "0.63105345", "0.60903585", "0.60835", "0.5976974", "0.5955606", "0.58951086", "0.58502823", "0.57469004", "0.5733922", "0.5721992", "0.57147187", "0.5686214", "0.5674552", "0.5671941", "0.5649998", "0.5645797", "0.5615305", "0.5608468", "0.5588385"...
0.7006137
0
ROUTE POST /api/training/read DESCRIPTION Get all trainings SUCCESS 200 : List of trainings objects ERROR 400 : Invalid data format 404 : Workout not found 404 : Exercise not found 500 : Database query error
read(req, res) { var self = this; var datas = req.cookies; // Validate data format joi.validate(datas, joi.object().keys({ token: joi.string().required(), }), (error, result) => { if (error) { // Invalid data format return res.status(400).json(error.details[0].message); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addTraining(training) {\n console.log(training);\n fetch('https://customerrest.herokuapp.com/api/trainings/',\n { method: 'POST',\n headers: { 'Content-Type': 'application/json', },\n body: JSON.stringify(training)\n })\n .then(res => this.loadTrainings())\n .then(res => this.setS...
[ "0.65632707", "0.614054", "0.5965108", "0.58370566", "0.57925427", "0.5787361", "0.5720727", "0.5696429", "0.5668274", "0.5648818", "0.56030464", "0.55735064", "0.554678", "0.5499209", "0.5449057", "0.53870755", "0.5313841", "0.53028077", "0.5292819", "0.52883846", "0.5285561...
0.6687311
0
Runs a diff on the two router states and returns an array of two arrays: 1) the routes that we are leaving, starting with the leaf route and 2) the routes that we are entering, ending with the leaf route.
function computeDiff(prevState, nextState) { var fromRoutes = prevState && prevState.branch; var toRoutes = nextState.branch; var leavingRoutes, enteringRoutes; if (fromRoutes) { leavingRoutes = fromRoutes.filter(function (route) { return toRoutes.indexOf(route) === -1 || routeParamsChanged(rou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getTransitionHooks(nextState) {\n var { history } = this.context;\n var prevState = this.state;\n var fromRoutes = prevState.branch;\n var toRoutes = nextState.branch;\n\n var hooks = this.transitionHooks.map(function (hook) {\n return hook.bind(this, history, nextState);\n }, this);\n\n ...
[ "0.58791506", "0.56682616", "0.5512692", "0.5296939", "0.5262915", "0.52175844", "0.5200423", "0.5061642", "0.50587386", "0.50247073", "0.50247073", "0.49884054", "0.4959542", "0.49519813", "0.49519813", "0.49519813", "0.49519813", "0.49519813", "0.49519813", "0.49519813", "0...
0.76976126
0
Compiles and returns an array of transition hook functions that should be called before we transition to a new state. Transition hook signatures are: route.onLeave(nextState, transition[, callback ]) route.onEnter(nextState, transition[, callback ]) Transition hooks run in order from the leaf route in the branch we're ...
function getTransitionHooks(prevState, nextState) { var _computeDiff = computeDiff(prevState, nextState); var leavingRoutes = _computeDiff[0]; var enteringRoutes = _computeDiff[1]; var hooks = getTransitionHooksFromRoutes(leavingRoutes, 'onLeave'); hooks.push.apply(hooks, getTransitionHooksFromRoutes(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getTransitionHooks(nextState) {\n var { history } = this.context;\n var prevState = this.state;\n var fromRoutes = prevState.branch;\n var toRoutes = nextState.branch;\n\n var hooks = this.transitionHooks.map(function (hook) {\n return hook.bind(this, history, nextState);\n }, this);\n\n ...
[ "0.7424265", "0.63437045", "0.63437045", "0.63437045", "0.61721534", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069", "0.6127069",...
0.67683256
1
/ Private functions Calculate the kth qquantile of a set of numbers in an array. As per
function quantile (arr, k, q) { var sorted, count, index; if(k === 0) return Math.min.apply(null, arr); if (k === q) return Math.max.apply(null, arr); sorted = arr.slice(0); sorted.sort(function (a, b) { return a - b; }); count = sorted.length; index = count * k / q; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function quantile(arr, k, q) {\n var sorted, count, index;\n\n if (k === 0) return Math.min.apply(null, arr);\n\n if (k === q) return Math.max.apply(null, arr);\n\n sorted = arr.slice(0);\n sorted.sort(function (a, b) {\n return a - b;\n });\n count = sorte...
[ "0.8595845", "0.7343081", "0.7335172", "0.7322946", "0.73084414", "0.7305843", "0.7290255", "0.72378117", "0.72378117", "0.72378117", "0.72092146", "0.719474", "0.70559806", "0.69574916", "0.6953804", "0.6908286", "0.6706629", "0.6540529", "0.62781215", "0.608774", "0.608774"...
0.86237586
0
Calcula el total entre el pesa de la actividad y la cantidad
function calcularTotal() { const pesoAct = Number(document.getElementById('pesoAct').innerHTML); const cantidad = Number(document.getElementById('cantidad').value); const total = pesoAct * cantidad; document.getElementById('total').innerHTML = total.toFixed(2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcularTotal() {\n // Limpiamos precio anterior\n total = 0;\n // Recorremos el array del carrito\n carrito.forEach((item) => {\n // De cada elemento obtenemos su precio\n const miItem = baseDeDatos.filter((itemBaseDatos) => {\n return itemBaseDatos.id === parseInt(it...
[ "0.6988521", "0.6925512", "0.69225", "0.6908719", "0.688061", "0.6835352", "0.6797338", "0.6771257", "0.67455006", "0.67253596", "0.6718349", "0.66225135", "0.6620134", "0.66125613", "0.6567319", "0.6565368", "0.653296", "0.6507418", "0.6505014", "0.64989257", "0.64868516", ...
0.70211226
0
unbind resize handler stop watching DOM if watch option enabled reset rows array remove element and clear it's height.
destroy() { window.removeEventListener('resize', this._boundResizeHandler); if(this._watcher && this._watcher.type === 'event') { document.body.removeEventListener('DOMNodeInserted', this._watcher.handler); document.body.removeEventListener('DOMNodeRemoved', this._watcher.handler); } else if(th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deinitExistingRows() {\n var view = null;\n removeAllChildren($.mediumSwatchRefinement);\n _.each(listenerViews, function(view) {\n view.removeEventListener('click', onViewClick);\n });\n}", "destroy() {\n if (!this.initialized) {\n return;\n }\n\n let ...
[ "0.6365247", "0.63300306", "0.63093364", "0.6282583", "0.62712955", "0.6234819", "0.62274194", "0.6211359", "0.61335427", "0.61070746", "0.60781986", "0.60781986", "0.6076598", "0.6055171", "0.60214853", "0.6012456", "0.6005461", "0.5972545", "0.5972128", "0.5968634", "0.5968...
0.76241523
0
get rows of the grid depending on current container children and it's order
_updateGridRows() { [...this.element.children].forEach((item, i) => { let index = i % this.maxItemsPerRow; let position; if ( index === 0){ this.rows.push([]); } position = this._getItemPosition(index); this.rows[this.lastIndex].push({item: item, position: position}); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getGrid(pos) {\n\tlet childs = c.childNodes;\n\treturn childs[pos];\n}", "rows() {\n var self = this;\n return Array.apply(this.topRow(), Array(this.bottomRow()+1)).map(function (x, row) {\n return Array.apply(self.topColumn(), Array(self.bottomColumn()+1)).map(function (x, col) {\n re...
[ "0.63754743", "0.62321395", "0.6110409", "0.6110409", "0.6110409", "0.6110409", "0.6110409", "0.5912592", "0.5867406", "0.5863156", "0.5861488", "0.5845047", "0.5781938", "0.5757324", "0.5751165", "0.5645784", "0.56442034", "0.5594242", "0.5587262", "0.55681163", "0.5554918",...
0.6252555
1
update the position of each item depending on position iformation stored in item object of in rows property
_updatePositions() { let direction = this.options.direction; let largestHeight = 0; if(this.lastIndex === -1) return; if(this.options.onPosition && typeof this.options.onPosition === 'function') this.options.onPosition.call(); this.rows.forEach(row => { row.forEach(rowItem => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_updateGridRows() {\n\n [...this.element.children].forEach((item, i) => {\n let index = i % this.maxItemsPerRow;\n let position;\n if ( index === 0){\n this.rows.push([]);\n }\n\n position = this._getItemPosition(index);\n this.rows[this.lastIndex].push({item: item, position...
[ "0.66890883", "0.6481797", "0.64612085", "0.63888204", "0.6345269", "0.6234622", "0.62285924", "0.6188995", "0.6082383", "0.6063241", "0.60607404", "0.60568744", "0.6033131", "0.6030159", "0.60074085", "0.599302", "0.5972228", "0.5963879", "0.59421617", "0.593961", "0.5906690...
0.70213944
0
/ Single sign on interface. / / Database connection configuration
function SingleSignOn(mysqlConnectionConfig) { if (!mysqlConnectionConfig) { throw new Error('Mysql connection configuration missing'); } else { /// <value type='object' mayBeNull='false'> /// Returns the current mysql connection configuration. /// </value> Object.defineProperty(this, 'mysqlConnectionConf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initDBConnection() {\n\n var serviceCreds = appEnv.getServiceCreds(\"Cloudant_SO\");\n\n if (!serviceCreds) {\n console.log(\"service 'cloudant' not bound to this application\");\n return;\n }\n\n dbCredentials.host = serviceCreds.host;\n dbCredentials.port = serviceCreds.port...
[ "0.6094398", "0.60214376", "0.59840983", "0.59582067", "0.585914", "0.58124804", "0.57217354", "0.5712291", "0.55450994", "0.5476894", "0.54699016", "0.5459381", "0.54462415", "0.5441333", "0.5441333", "0.54204476", "0.54073024", "0.5402531", "0.5384395", "0.53749335", "0.534...
0.65494454
0
/ Creates a new SingleSignOn object and returns it. / / Database connection configuration / New PasswordEncrypter instance
function SingleSignOnFactory(mysqlConnectionConfig) { return new SingleSignOn(mysqlConnectionConfig); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SingleSignOn(mysqlConnectionConfig) {\n\tif (!mysqlConnectionConfig) {\n\t\tthrow new Error('Mysql connection configuration missing');\n\t}\n\telse {\n\t\t/// <value type='object' mayBeNull='false'>\n\t\t/// \tReturns the current mysql connection configuration.\n\t\t/// </value>\n\t\tObject.defineProperty...
[ "0.6026805", "0.561988", "0.55047196", "0.5329477", "0.5313869", "0.51534796", "0.51311964", "0.50763685", "0.5063406", "0.50407606", "0.50156575", "0.50152427", "0.4991033", "0.49847567", "0.49831936", "0.49793687", "0.49594736", "0.49537736", "0.49493086", "0.49369058", "0....
0.75028217
0
unsubscribe and remove from the tracker
function unsubscribe(tracker): void { tracker.current.isActive = false; if (tracker.current.subscriber) { tracker.current.subscriber.then((unsubFn): void => unsubFn()); tracker.current.subscriber = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "unsubscribe() {\n this.subscriptions.forEach((unsub) => unsub());\n }", "unsubscribe() {\n this.subscriptions.forEach((unsub) => unsub());\n this.subscriptions = [];\n }", "unsubscribe() {\n Object.keys(this.subscriptions).forEach(key => {\n if (this.subscriptions[key].subscription.d...
[ "0.75734425", "0.75613225", "0.74141675", "0.7345709", "0.7335681", "0.733149", "0.7325524", "0.7325524", "0.73063767", "0.7301835", "0.7301835", "0.72437996", "0.7240133", "0.72091347", "0.72081804", "0.71979773", "0.7194933", "0.7178548", "0.71632594", "0.7145609", "0.70635...
0.80184287
0
Assumes colors and cutoffs have length of 5!
getColor(cnt) { const colors = this.get('colors'); const cutoffs = this.get('cutoffs'); if (cnt > cutoffs[4]) return colors[4]; if (cnt > cutoffs[3]) return colors[3]; if (cnt > cutoffs[2]) return colors[2]; if (cnt >= cutoffs[1]) return colors[1]; return colors[0]; // return cnt > cutof...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_prepareColorShades(min, max) {\n let step = (max - min) / 5;\n this._shades = [];\n for (let i = 0; i < 5; i++) {\n this._shades.push(max - i * step);\n }\n }", "function createColorizer(breaks, colorRange) {\n const colors = colorRange.map((c) => [\n c.r,\n c.g,...
[ "0.6546391", "0.6288758", "0.6183635", "0.59940475", "0.5985648", "0.59594667", "0.5945649", "0.5893079", "0.5880714", "0.58408844", "0.58345646", "0.5823236", "0.57946265", "0.5754965", "0.57507515", "0.5721472", "0.5695766", "0.56904924", "0.56904924", "0.56817275", "0.5677...
0.6948487
0
checks if there are choices on the display, if so shows a help overlay on top
function getChoices() { $('#helpOptions').html(''); //empty var count = $('.conversationContainer .optionContainer').children().length for (var i = 0; i < count; i++) { var x = i+1 var str = x.toString() $('#helpOptions').append('<a href=""><h3>Choice Option '+str+'</h3></a>'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showHelp() { \n var search = $(select).find(':selected').nextAll().andSelf();\n var num_display = 1;\n\n // Clear out div.\n $(suggest_div).find('.suggest-prompt').empty();\n \n // Add help text.\n for (var i = 0; i < Math.min(nu...
[ "0.70125264", "0.6613309", "0.65229523", "0.6494657", "0.63750833", "0.63154376", "0.6311779", "0.6290863", "0.62548184", "0.62383235", "0.62152356", "0.6184135", "0.617308", "0.6170192", "0.61471766", "0.60670817", "0.60587484", "0.60562795", "0.60240835", "0.60190105", "0.6...
0.6935204
1
Load the content from the SERP urls
function loadContents(urls, language, endCallback) { var tasks = _.map(urls, function(url){ return function(callback){ loadContent(url, language, callback);}; }); async.parallel(tasks, function(error, results){ endCallback(error, results); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadURLs(urls, fDone, individualClasses) {\n var fNext = function() {\n if (urls.length > 0) {\n var url = urls.shift();\n if (url.search(/http/) == 0) {\n // For coursews data\n \tExhibit.importers[\"application/jsonp\"].load(\n ...
[ "0.6037334", "0.5918783", "0.58282787", "0.58271", "0.57440144", "0.5648558", "0.56147134", "0.56070226", "0.5569856", "0.5566778", "0.5560686", "0.55279106", "0.55236226", "0.55127716", "0.5509774", "0.55064267", "0.55024946", "0.5497078", "0.5496009", "0.5470655", "0.546263...
0.61234075
0
This function will get the marker's current location and then add the lat/long values to our textfields so that we can save the location.
function markerLocation(){ //Get location. var currentLocation = marker.getPosition(); //Add lat and lng values to a field that we can save. document.getElementById('lat').value = currentLocation.lat(); //latitude document.getElementById('lng').value = currentLocation.lng(); //longitude }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function markerLocation() {\n\t\t\t//Get location.\n\t\t\tvar currentLocation = marker.getPosition();\n\t\t\t//Add lat and lng values to a field that we can save.\n\t\t\tfrm.set_value(\"latitude\", currentLocation.lat()); //latitude\n\t\t\tfrm.set_value(\"longitude\", currentLocation.lng()); //longitude\n\t\t}", ...
[ "0.82088065", "0.77680105", "0.7012341", "0.68859684", "0.68817455", "0.68618107", "0.6860318", "0.6807559", "0.6601834", "0.6587563", "0.658307", "0.6577848", "0.6573569", "0.6517939", "0.65178144", "0.6487559", "0.6466434", "0.6457334", "0.64532816", "0.64526695", "0.64442"...
0.816666
1
The below method helps to view loans of one specific user
viewUserLoans(userId, callback) { console.log("[LoanMapper] viewUserLoans"); let IDM = this.LoanIdentitymap; this.LoanTDG.viewUserLoans(userId, function (msg) { IDM.putData(msg); callback(msg.data); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserLeagues() {\n var userId = $window.localStorage.getItem('com.tp.userId');\n DashboardFactory.getUserLeagues(userId)\n .then(function(userLeagues){\n $scope.userLeagues = userLeagues;\n });\n }", "function getBillsForUser(userEmail) {\n var queryURL = baseUrl + 'api/user...
[ "0.59369636", "0.56431234", "0.55990404", "0.5569748", "0.55302685", "0.54975474", "0.5462244", "0.54521835", "0.543686", "0.5406295", "0.53905565", "0.5384075", "0.5379995", "0.5368349", "0.534366", "0.53341603", "0.5313215", "0.53127193", "0.5303015", "0.5294236", "0.528525...
0.6505333
0
brisanje kartica odnosno izbora sekvence da bi se omogucilo ponovno popunjavanje kombinacije
function obrisi_sekvencu(kliknuta_kartica) { // koji igrac zeli ponovo da popuni kombinaciju var br_igraca = nadji_igraca(kliknuta_kartica); if (br_igraca == 1) { localStorage.setItem("sekvenca_zemalja1", ""); //sekvenca_zemalja1 = []; } if (br_igraca == 2) { localStorage.setItem("sekvenca_zemalja2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ordenatuBerriak(berriako,prop, asc) {\n \n var berriab = berriako.Berriak.sort(function(a, b) {\n if (asc) {\n if (a[prop] > b[prop]) return 1;\n if (a[prop] < b[prop]) return -1;\n return 0;\n } else {\n if (b[prop] > a[prop]) return 1;\n ...
[ "0.56800085", "0.56154776", "0.56137115", "0.56062555", "0.5561564", "0.5514205", "0.5501674", "0.5466315", "0.54400027", "0.5410395", "0.53480387", "0.5277752", "0.52360785", "0.52349395", "0.5206344", "0.51706374", "0.51583594", "0.5147083", "0.5145127", "0.51311564", "0.51...
0.5796523
0
Sets mapWidth value to use in sizing initial map and on window resize
setMapWidth() { let windowWidth = window.innerWidth; switch(true) { case windowWidth >= 1200: this.mapWidth = 950; this.scale = 950; return; case windowWidth >= 992: this.mapWidth = 850; this.scale = 850; return; default: this.mapWidth = 670; this.scale = 670; return; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resize() {\n\tmap.setSize();\n}", "function resizeMap() {\n\t\tvar offset_width_twitter = $('#cont_twitter').outerWidth(true),\n\t\t\toffset_width_menu = $('#menu').outerWidth(true);\n\t\tif (!$rootScope.twitter_opened || !$('#cont_twitter').is(':visible')) {\n\t\t\toffset_width_twitter = 0;\n\t\t}\n\t\...
[ "0.7877126", "0.78012043", "0.76173925", "0.75846696", "0.7578235", "0.7517182", "0.7355042", "0.7339692", "0.7263071", "0.7258818", "0.7222506", "0.7157667", "0.7105007", "0.70872647", "0.7063499", "0.7020326", "0.69930077", "0.68945116", "0.6863973", "0.6832013", "0.6795783...
0.823527
0
Draws the map of US
drawMap() { let width = this.mapWidth, height = width / 2, scale = this.scale; let projection = d3.geoAlbers() .translate([width/2, height/2]) // translate to center of screen .scale([scale]); // scale things down so see entire US // Define path generator let path = d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function view_contact_draw_map() {\n\n // Draw San Francisco Map\n\n var element = document.getElementById(\"contact-location-map-san-francisco\");\n var latitude = 37.7893041;\n var longitude = -122.4003783;\n var tooltip_content =\n \"<div id='content'>\"+\n \"<h5 class='flush-top shor...
[ "0.718643", "0.708176", "0.70379937", "0.70111966", "0.69525313", "0.6943257", "0.6861397", "0.68482864", "0.6845299", "0.6841124", "0.68350315", "0.68335736", "0.68198436", "0.68190986", "0.6816204", "0.6808638", "0.67905396", "0.67721564", "0.67715085", "0.6742133", "0.6730...
0.7355668
0
display image in the message area
function displayImage(user , srcData ) { var newImage = document.createElement('img'); newImage.src = srcData; // document.getElementById("historyMsg").innerHTML = user + newImage.outerHTML; messageArea.append(newImage); appendMessage(`${user} send image...`); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function consoleDisplay(img) {\n elements.gameMessageContainer.innerHTML = \"\";\n let html = `\n <img class=\"console-messages\" src=\"img/${img}.png\">\n `\n\n elements.gameMessageContainer.innerHTML = html;\n}", "function displayImage(srcData,usernameData) {\r\n const div = doc...
[ "0.70055777", "0.69778186", "0.6632514", "0.64981186", "0.64728117", "0.6415774", "0.6414348", "0.64137864", "0.6358145", "0.6337286", "0.63052994", "0.6279886", "0.6255862", "0.62476194", "0.6238302", "0.6229773", "0.62097853", "0.6196849", "0.6195483", "0.6169504", "0.61651...
0.70579773
0
posts the signed transaction
function post_transaction(){ signed_transacion = unsigned_transaction; signed_transacion['signatures'] = [$("[name='signed-data']").val()]; signed_transacion['pubkeys'] = [$("[name='public-key']").val()]; ajaxPost('/blockcypher/post_transaction',JSON.stringify(signed_transacion),function(response){ modal_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function signedPost() {\n\targuments[0] = arguments[0] + (arguments[0].indexOf('?') > -1 ? '&' : '?') + 'signed_request=' + CastleAge.signed_request;\n\t$.post.apply(this, arguments);\n}", "_signTransaction(raw) {\n raw['from'] = this.address;\n\n return new Promise(function(resolve, reject) {\n web3....
[ "0.70307684", "0.6767422", "0.6724428", "0.67037916", "0.6611106", "0.65970165", "0.64371246", "0.6336306", "0.6115327", "0.60734785", "0.6033785", "0.60048795", "0.5993988", "0.596047", "0.59161067", "0.5909634", "0.5908804", "0.58989424", "0.58698744", "0.5853048", "0.58487...
0.6794026
1
Noncompliant // +1 nesting
function nested() { // +1 nesting, nested if (x) { // +1 nesting, nested } return 1; // +0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "transient private protected internal function m182() {}", "static transient final private internal function m43() {}", "private internal function m248() {}", "function StupidBug() {}", "transient final private protected internal function m167() {}", "protected inter...
[ "0.62407666", "0.61627054", "0.6136423", "0.604313", "0.59800476", "0.5966151", "0.59190357", "0.588414", "0.5879095", "0.57851285", "0.5770449", "0.57592034", "0.57450116", "0.5744413", "0.57216626", "0.57164097", "0.5705435", "0.56910694", "0.5666635", "0.5653118", "0.56451...
0.62038213
1
Inject the EthicalAds ad client
function inject_ads_client() { var script = document.createElement("script"); script.src = "https://media.ethicalads.io/media/client/beta/ethicalads.min.js"; script.type = "text/javascript"; script.async = true; script.id = "ethicaladsjs"; document.getElementsByTagName("head")[0].appendChild(scr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adClient(params) {\n\tthis.params = params;\n\tthis.masterClient = false;\n\tthis.masterBound = false;\n\tthis.userClient = false;\n\tthis.userBound = false;\n}", "constructor(client) {\n this.client = client;\n }", "constructor(client) {\n this.client = client;\n }", "constructo...
[ "0.57971776", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", "0.5640056", ...
0.7508246
0
Colored rotating cube with controls for moving it around. Depends on CS336Object.js. See handleKeyPress() for details of key controls. Creates data for vertices, colors, and normal vectors for a unit cube. Return value is an object with three attributes vertices, colors, and normals, each referring to a Float32Array.
function makeCube() { // vertices of cube var rawVertices = new Float32Array([ -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, 0.5, -0.5]); var rawColors = new Float32Array([ 0.4, 0.4, 1.0, 1.0, // Z blue 1.0, 0.4, 0.4, 1.0,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCube(gl) {\n var cube = [];\n // Coordinates Cube which length of one side is 1 with the origin on the center of the bottom)\n var vertices = new Float32Array([\n 0.5, 1.0, 0.5, -0.5, 1.0, 0.5, -0.5, 0.0, 0.5, 0.5, 0.0, 0.5, // v0-v1-v2-v3 front\n 0.5, 1.0, 0.5, 0.5, 0.0, 0....
[ "0.7143348", "0.71266276", "0.7040096", "0.70332384", "0.6964827", "0.6952998", "0.6952998", "0.691361", "0.6890625", "0.6743951", "0.6734157", "0.672232", "0.66964144", "0.6672335", "0.66573477", "0.66153836", "0.6604197", "0.6582995", "0.647404", "0.646633", "0.64331007", ...
0.7541131
0
ranksum enrichment calc and render
function gLyphsExpressionPanelRankSumRender(glyphTrack) { //will render into SVG the data that was precalculated var g1 = document.createElementNS(svgNS,'g'); g1.id = "exp_panel_ranksum_svg_g1"; g1.setAttributeNS(null, "font-size","8pt"); g1.setAttributeNS(null, "font-family", 'arial,helvetica,sans-serif');...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderRanking() {\n var context = { artists: rankingData };\n var tpt = window[\"JST\"][\"templates/ranking.hbs\"];\n var html = tpt(context);\n $(\"#ranking\").html(html);\n }", "function calcRank() {\n\t\t\tif (!vm.current) {\n\t\t\t\treturn;\n\t\t\t}...
[ "0.6232543", "0.6155728", "0.5972984", "0.59515333", "0.5910438", "0.58952045", "0.58789665", "0.58429664", "0.57704675", "0.5719532", "0.5682573", "0.56805223", "0.56466734", "0.5615433", "0.56137395", "0.5591735", "0.55759895", "0.55657536", "0.555086", "0.55408525", "0.553...
0.6529555
0
Expression panel export tools
function gLyphsCreateExperimentExpressExportWidget() { var g1 = document.createElementNS(svgNS,'g'); if(!current_region.exportSVGconfig) { g1.setAttributeNS(null, "onclick", "gLyphsToggleExpressionSubpanel('export');"); g1.setAttributeNS(null, "onmouseover", "eedbMessageTooltip(\"export data\",80);"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reportExport(){\n bcdui.component.exports.exportWysiwygAsExcel({rootElement: this.gridRenderingTarget});\n }", "function actionExport(name)\r\n{\r\n\tvar field = document.getElementById(name);\r\n\tvar result = [];\r\n\r\n\tif (field)\r\n\t{\r\n\t\tfor (var i = 0; i < grid.source.length; i++)\r\n\t\t\tresult...
[ "0.66606385", "0.6365485", "0.6176881", "0.61377865", "0.6135179", "0.6124578", "0.6117729", "0.6079047", "0.6065465", "0.60542107", "0.60482204", "0.59746534", "0.5922985", "0.58135605", "0.57794577", "0.57266694", "0.565591", "0.56447214", "0.56118095", "0.5607342", "0.5534...
0.63957983
1
widget creation section use svg and events to create "widgets" inside the tracks to allow users to manipulate the tracks
function createAddTrackTool() { if(zenbu_embedded_view) { return; } var glyphset = document.getElementById("gLyphTrackSet"); var div = document.createElement('div'); div.setAttribute("align","left"); div.setAttribute("style", "margin: 0px 0px -2px 0px; border-width: 0px; padding: 0px 0px 0px 0px;"); div.id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createAddTrackTool(glyphsGB) {\n if(zenbu_embedded_view) { return; }\n var glyphset = glyphsGB.gLyphTrackSet;\n if(!glyphset) { return null; }\n\n if(glyphsGB.add_track_div) { \n glyphset.appendChild(glyphsGB.add_track_div);\n return glyphsGB.add_track_div; \n }\n \n var add_track_div = docum...
[ "0.62409914", "0.5988147", "0.5976885", "0.5927658", "0.5856688", "0.58408684", "0.5794038", "0.5766153", "0.5718403", "0.5709772", "0.569171", "0.5678939", "0.5668894", "0.56554604", "0.5655104", "0.5654929", "0.56012857", "0.5580559", "0.55697733", "0.5561694", "0.5548948",...
0.64917403
0
download data from track control panel section
function gLyphsDownloadTrackPanel(trackID) { var glyphTrack = gLyphTrack_array[trackID]; if(glyphTrack == null) { return; } var trackDiv = glyphTrack.trackDiv; if(!trackDiv) return; if(!glyphTrack.svg) { return; } if(glyphTrack.newconfig !== undefined) { return; } glyphTrack.newconfig = new Object; i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trackDownload(txt) {\n var s = s_gi(s_account);\n s.linkTrackVars='prop18,eVar18,event17';\n s.linkTrackEvents='event17';\n s.eVar18=s.prop18=txt;\n s.events='event17';\n s.tl(this,'d',prop18);\n}", "function gLyphsDownloadTrackPanel(glyphTrack) {\n if(glyphTrack == null) { return; }\...
[ "0.65697646", "0.5897495", "0.5722009", "0.57022583", "0.5692513", "0.5625858", "0.5588026", "0.557658", "0.5520896", "0.5509879", "0.54701716", "0.5451634", "0.5449079", "0.5440181", "0.54112154", "0.54040956", "0.5393077", "0.5361997", "0.5359569", "0.5356606", "0.53523415"...
0.63269097
1
new (2.5+) interface for editing/adding sources to a track based on the new predefined track code. can eventually be used for creating new tracks
function gLyphsTrackEditSources(trackID) { var glyphTrack = gLyphTrack_array[trackID]; if(glyphTrack == null) { return; } var trackDiv = glyphTrack.trackDiv; if(!trackDiv) return; var e = window.event moveToMouseLoc(e); var top_pos = toolTipSTYLE.ypos-400; if(top_pos< 180) { top_pos=180;} var e...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addSource(details){\n //if the source already exists then delete it\n if (this.map.getSource(details.id)) this.removeSource(details.id);\n this.map.addSource(details.id, details.source);\n }", "function update_track(new_track) {\r\n local_track.id = new_track.id;\r\n local_track.name = new_track....
[ "0.6176951", "0.5977918", "0.57653385", "0.572917", "0.570031", "0.563231", "0.5599087", "0.5582435", "0.5552319", "0.55251753", "0.55225253", "0.54792494", "0.54534537", "0.54302776", "0.5426312", "0.5413126", "0.53886366", "0.53282195", "0.53168917", "0.5315093", "0.5303573...
0.6610063
0
create a new chat room of the given name
function createRoom(name) { document.getElementsByClassName('dropdown-item selected')[0].className = 'dropdown-item' var room = document.createElement('div') room.className = 'dropdown-item selected' room.innerText = name createDropdownClickMethod(room) get('create-room-name').value = '' dropdown.appen...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNewRoom() {\r\n // Generate room id.\r\n const newID = uuidv4().substring(0, 8);\r\n\r\n // Join room\r\n socket.join(newID);\r\n\r\n // Update corressponding object in usersArray\r\n updateUserRoom(socket, newID);\r\n\r\n // Send room data to socket\r\n io.to(socket.id).emit...
[ "0.7637265", "0.7258775", "0.72188866", "0.70563567", "0.6896983", "0.6881088", "0.68625593", "0.68381006", "0.6814351", "0.6738361", "0.67248833", "0.6715604", "0.6658082", "0.6625967", "0.65953654", "0.6579669", "0.65655935", "0.6543639", "0.6527336", "0.6527041", "0.650478...
0.7359401
1
Define the chat functionality take the text in the input and the drawing (if any) and send them as a chat
function SendChat() { var canvas = get('current-canvas') // drawing canvas (actual SVG element) textInput = get('chat-text-input') // chat text input var text = textInput.value // if there's nothing to send, don't send it if (text == '' && (canvas == null || get('current-drawing').innerHTML == '')) { r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dogdate1Chat() {\n background(250);\n //top bar\n fill(255, 0, 220);\n textFont(Font, 50);\n textAlign(CENTER);\n text('Chat with Milo!', 150, 50);\n line(0, 50, 800, 50);\n //exit box\n line(750, 0, 750, 50);\n line(750, 0, 800, 50);\n line(800, 0, 750, 50);\n if (mous...
[ "0.69113874", "0.67240447", "0.6631562", "0.65748733", "0.654512", "0.652533", "0.6506949", "0.64889824", "0.64702916", "0.6398658", "0.6397727", "0.63880885", "0.6344389", "0.6335644", "0.62810963", "0.6264469", "0.6255158", "0.62551373", "0.6230701", "0.6228339", "0.6221500...
0.76550376
0
Set's the prompt text, optionally receives an DOM object obj and a text which is appended at the end of the prompt. Appended text is for example the output of a command.
function setPrompt(path, userPrompt, appendText) { userPrompt = userPrompt || document.getElementById('prompt'); appendText = appendText || ''; userPrompt.innerText = 'guest@title:' + path + '$ ' + appendText; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writePrompt() {\n\t if (repl.debug) {\n\t\tconsole.log(\"Writing prompt text area: string\\n\");\n\t }\n\t var r = $(repl.parent);\n\t r.val(r.val() + \"\\n\" + prompt);\n\t}", "function renderPrompt(){\n console.log('render=============================render');\n document.getElementById(\...
[ "0.7135008", "0.63833225", "0.63423264", "0.6087057", "0.6010714", "0.59904754", "0.59695506", "0.5965392", "0.59575534", "0.58823687", "0.5842175", "0.58384854", "0.5829408", "0.579362", "0.5792552", "0.57888293", "0.5744189", "0.5730164", "0.5730164", "0.5717507", "0.570359...
0.72019106
0
Keeps track of overlaps in the current state and the last step state.
function OverlapKeeper() { this.overlappingShapesLastState = new TupleDictionary(); this.overlappingShapesCurrentState = new TupleDictionary(); this.recordPool = []; this.tmpDict = new TupleDictionary(); this.tmpArray1 = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detectOverlap() {\n // Reload timeblocks for overlap check\n var timeBlocks = [];\n totalDuration = 0;\n for (var i = 0; i < eventSource.length; i++) {\n var event = eventSource[i]\n var block = {};\n block.start = event.start.getHours() + event.start.getMinutes()/60;\n ...
[ "0.53449464", "0.53430295", "0.5301924", "0.5173285", "0.5171313", "0.51279485", "0.5031866", "0.5006386", "0.5003922", "0.4993898", "0.4991296", "0.4965019", "0.49535522", "0.49054873", "0.49007535", "0.4886262", "0.48754716", "0.48745677", "0.48718917", "0.48703408", "0.486...
0.56370306
0