Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
draws a popup box with lines inside it. retuns an html element (div)
function drawDetailBox(lambda) { var h = canvas.height; var ctx = canvas.getContext("2d"); for (var i = 1; i <= 100; i++) { ctx.beginPath(); ctx.moveTo(i * 4, 0); ctx.lineTo(i * 4, h); ctx.lineWidth = 2; if (lambda.includes(i)) ctx.strokeStyle = "black" else ctx.strokeStyle = "gray"; ctx.stroke(); } return wrapper; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPopup() {\n\tif (document.getElementById(\"blackOverlay\")) {\n\t\tdocument.body.removeChild(document.getElementById(\"blackOverlay\"));\n\t}\n\tvar popup = document.createElement(\"DIV\");\n\tpopup.id = \"blackOverlay\";\n\t\n\tvar prompt = document.createElement(\"DIV\");\n\tprompt.id = \"whitePro...
[ "0.6487277", "0.6350732", "0.6260988", "0.62387156", "0.62269163", "0.6212835", "0.6211153", "0.6169823", "0.61305827", "0.61226046", "0.61226046", "0.6115224", "0.60810894", "0.6063727", "0.5980384", "0.59793425", "0.59627765", "0.59517384", "0.5947049", "0.5933405", "0.5891...
0.0
-1
adds a number to the bootom of the popup box when mouse is over the corresponding line
function showLineNumberInBox(e, lambdaList) { x = e.clientX; y = e.clientY; var lineNum = 0; const xOff = e.offsetX; if (xOff % 4 <= 2) { cursor = " "; lineNum = parseInt(xOff / 4); if (lambdaList.includes(lineNum)) { cursor = lineNum; } } else { cursor = " "; } document.getElementById("displayArea").style.display = 'block'; document.getElementById("displayArea").innerHTML = 'Wavelength Number: ' + cursor; document.getElementById("displayArea").style.right = x + 'px'; document.getElementById("displayArea").style.top = y + 'px'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showLineNumberInBox(e, lambdaList) {\n // console.log(e.target.getContext(\"2d\"));\n x = e.clientX;\n y = e.clientY;\n var lineNum = 0;\n const xOff = e.offsetX;\n if (xOff % 4 <= 2) {\n cursor = \" \";\n lineNum = parseInt(xOff / 4);\n if (lambdaList.includes(lineN...
[ "0.67592955", "0.6614352", "0.62537307", "0.6186476", "0.618575", "0.61709523", "0.61543155", "0.6144594", "0.6143707", "0.61396706", "0.61323035", "0.61254305", "0.6089654", "0.6072405", "0.6065777", "0.6059029", "0.6055843", "0.6055259", "0.6049621", "0.60314864", "0.602596...
0.6657385
1
removes the line number created in method showLineNumberInBox when mouse leaves the line
function unshowLineNumberInBox() { document.getElementById("displayArea").innerHTML = "Wavelength Number: "; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "timelineUnmarkEvents() {\n this.line.setSelection();\n }", "function showLineNumberInBox(e, lambdaList) {\n // console.log(e.target.getContext(\"2d\"));\n x = e.clientX;\n y = e.clientY;\n var lineNum = 0;\n const xOff = e.offsetX;\n if (xOff % 4 <= 2) {\n cursor = \" \";\n ...
[ "0.6328683", "0.63186103", "0.622773", "0.6204096", "0.6202259", "0.6202259", "0.6109514", "0.6082548", "0.5948113", "0.5938224", "0.59150827", "0.58933675", "0.5865645", "0.58542687", "0.58542687", "0.5800403", "0.5773268", "0.57700723", "0.5767764", "0.57254225", "0.5677842...
0.6563106
1
check for links connected to marker, also delete the data. params? only works for new nodes now check for links connected to marker, also delete the data. params? only works for new nodes now
function deleteOnRightClick(event, featureGroup, markers, links, mymap) { closeAllPopups(); tempMarkerlist = []; if (event.layer instanceof L.Marker) { //delete data, connected links; marker = event.layer; var connectedLinks = []; getConnectedLinks(marker, featureGroup, connectedLinks); if (connectedLinks.length == 0) { deleteOnRightClickLayer(marker, markers, featureGroup); } else { popupAlert("Marker cannot be deleted - remove the connected links first.", mymap); } } else if (event.layer instanceof L.Polyline) { link = event.layer; deleteOnRightClickLayer(link, links, featureGroup); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processLinks(nodes, lookup) {\n var removeList = []\n\n nodes.forEach(function(node){\n if( node.geometry !== null ) return;\n\n if( node.properties.origin && node.properties.terminus ) {\n var origin = lookup[node.properties.origin];\n var terminus = lookup[node.properties.terminus];\n\...
[ "0.64207", "0.63151026", "0.6297795", "0.6297795", "0.62342083", "0.6112339", "0.60563415", "0.60457855", "0.6022371", "0.5996544", "0.5932092", "0.58405936", "0.5814767", "0.5805265", "0.57879716", "0.5785061", "0.57657623", "0.57478344", "0.5737907", "0.5735337", "0.5728360...
0.5966008
10
not using this now codes's acting strange
function checkLinkValidity(featureGroup) { if (tempMarkerlist.length === 0) { return { "isValid": false, "msg": "No chosen nodes." }; } else if (tempMarkerlist.length === 1) { return { "isValid": false, "msg": "Chose a destination node." }; } if (tempMarkerlist[tempMarkerlist.length - 1] === tempMarkerlist[tempMarkerlist.length - 2]) { return { "isValid": false, "msg": "Chose a destination node." }; } latlngs = [ tempMarkerlist[tempMarkerlist.length - 1].getLatLng(), tempMarkerlist[tempMarkerlist.length - 2].getLatLng(), ]; featureGroup.eachLayer(layer => { if (layer instanceof L.Polyline) { if (layer.getLatLngs().includes(latlngs[0]) && layer.getLatLngs().includes(latlngs[1])) { // console.log("rep", layer.getLatLngs(), latlngs[0], latlngs[1]); return { "isValid": false, "msg": "rep" }; } } }); return { "isValid": true, "msg": "" }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "protected internal function m252() {}", "private public function m246() {}", "transient protected internal function m189() {}", "static private internal function m121() {}", "transient private protected internal function m182() {}", "transient final protected inte...
[ "0.70855063", "0.6764414", "0.65513563", "0.6338111", "0.6330737", "0.62323064", "0.61664426", "0.6143234", "0.61214405", "0.5926528", "0.59206116", "0.5834241", "0.5778488", "0.57752734", "0.57743365", "0.57153547", "0.5714668", "0.57003194", "0.56828666", "0.5673236", "0.56...
0.0
-1
replacement functions do not copy them into your code, you already have them.
function links_click_event(event) { console.log("works link"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function funcReplacer(match, id) {\n return functions[id];\n }", "function applyModifiers() {\n\t\ttry {\n\t\t\tvar rt = this.funcOldString;\n\t\t\tvar active = false;\n\n\t\t\tfor (var i=0; i< this.modifiers.length; i++){\n\t\t\t\tif ( !this.modsActive[i]) continue;\n\n\t\t\t\tx = rt.replace(this.modifiers[...
[ "0.6744191", "0.67120796", "0.63454187", "0.62559104", "0.598685", "0.5982629", "0.5922289", "0.5878065", "0.58572155", "0.5725822", "0.57194215", "0.5699527", "0.5684683", "0.56741697", "0.5669155", "0.56646496", "0.56393826", "0.56158507", "0.56145203", "0.5602656", "0.5597...
0.0
-1
props are passed in from app, set up a blank state to receive article to be passed down to components, edit and delete are bound at object scope and passed down to component
constructor(props){ super(props); this.state = {articles: [], categories: []} this.handleLink = this.handleLink.bind(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\n super(props);\n this.state = {\n visible: false,\n is_follow: false,\n id: props.id,\n action: 'new',\n article: store.get_current_article(),\n content: '',\n };\n this.share = this.share.bind(this);\n this.handle_submit = this.handle_submit.bind(...
[ "0.69546324", "0.6915817", "0.68562263", "0.6641745", "0.6608698", "0.6594315", "0.65392333", "0.6391952", "0.63841134", "0.635811", "0.63385904", "0.6327693", "0.63176423", "0.6313578", "0.62447524", "0.6243676", "0.61990654", "0.6197271", "0.6187437", "0.6154973", "0.614267...
0.6073866
29
todo: Create JSON schema and validate object against schema
function validatePointsObject(pointsObject) { var valid = true; valid &= pointsObject['point1'] != null && pointsObject['point2'] != null; // first check parent nodes if (!valid) return false; valid &= !isNaN(pointsObject['point1']['lat']) && !isNaN(pointsObject['point1']['lng']); valid &= !isNaN(pointsObject['point2']['lat']) && !isNaN(pointsObject['point2']['lng']); return valid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get jsonSchema() {\n return {\n type: \"object\",\n required: [\n \"user_id\",\n \"verified_by\",\n \"hospital\",\n \"address\",\n \"specialization\",\n \"license_number\",\n \"gender\",\n \"alt_email\",\n \"alt_phone\",\n ],\n...
[ "0.73966765", "0.72902364", "0.72122175", "0.70063823", "0.6875793", "0.68678474", "0.67872113", "0.66434723", "0.66413265", "0.66275895", "0.6581166", "0.65784395", "0.65448296", "0.6533849", "0.6437929", "0.6401585", "0.6399698", "0.6354862", "0.63491166", "0.62535924", "0....
0.0
-1
write all the rows in the given array
function writeToDrive(oauth2Client){ var data=queue; //SPREADSHEET: 1lUstzodzzziKhnLtvcnRhBhKO0sDKOr3yObSDPLplsI var sheets = google.sheets('v4'); var request = { spreadsheetId: '1lUstzodzzziKhnLtvcnRhBhKO0sDKOr3yObSDPLplsI', //TODO it should be dynamic and created as needed when data grows range: 'Sheet1', includeValuesInResponse: 'true', valueInputOption: 'USER_ENTERED', insertDataOption: 'INSERT_ROWS', resource:{ "values": data }, auth: oauth2Client }; // sheets.spreadsheets.values.get({spreadsheetId: '1lUstzodzzziKhnLtvcnRhBhKO0sDKOr3yObSDPLplsI', // range: 'Sheet1',auth: oauth2Client}, function(err, response){ // if (err) { // console.error(err); // return; // } // } // ); console.log("%s Writing %s rows to Google drives",new Date().toISOString(),data.length); sheets.spreadsheets.values.append(request, function(err, response) { if (err) { console.error(err); return; } queue=queue.slice(data.length,queue.length); console.log("%s remaining rows in the queue:%s",new Date().toISOString(),queue.length); } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printGrid(arr) {\n for (var j = 0; j < arr[0].length; j++) {\n var rowStr = \"\";\n for (var i = 0; i < arr.length; i++) {\n rowStr += arr[i][j];\n }\n fs.appendFile(\"./grid.txt\", rowStr + \"\\n\", (err) => {\n if (err) {\n console.log(...
[ "0.62822825", "0.5982951", "0.5975066", "0.59336877", "0.58772254", "0.58746153", "0.57763946", "0.57440925", "0.56147873", "0.55836165", "0.555648", "0.55488473", "0.5490231", "0.5454952", "0.544563", "0.54132086", "0.5405613", "0.53920597", "0.53753924", "0.5362929", "0.532...
0.0
-1
write to Google API in batch to respect rate limits
function batchWriteToDrive(oauth2Client){ //Google Sheet API Quota: 100req/100s per user. if (queue.length > 0){ writeToDrive(oauth2Client); } setTimeout(function(){ batchWriteToDrive(oauth2Client) },3000 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doBatchWrite(batch) {\r\n\r\n let requestBatch = batch.map(function (item) {\r\n return {\r\n PutRequest: {\r\n Item: item\r\n }\r\n };\r\n });\r\n\r\n let params = {\r\n RequestItems: {}\r\n };\r\n\r\n params.RequestItems[tableName] = requestBatch;\r\n...
[ "0.7247172", "0.6488182", "0.6431659", "0.6353969", "0.62039834", "0.6197206", "0.604436", "0.59201676", "0.58174837", "0.57005084", "0.56742567", "0.5663563", "0.5654786", "0.5646171", "0.55959135", "0.55823845", "0.55812925", "0.5573223", "0.55704427", "0.55629694", "0.5561...
0.7140714
1
FUNCTIONS request for json data
function getData() { $.get('/api/get', function() { }).done(function(data) { var json = JSON.parse(data); json.forEach(function(todo, i) { renderTodo(todo); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testJson() {\n var baseUrl = 'https://rxnav.nlm.nih.gov/REST/';\n var testUrl = 'https://rxnav.nlm.nih.gov/REST/rxcui?name=xanax'\n var request = Meteor.npmRequire('request');\n request(testUrl, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n ...
[ "0.71121454", "0.6793429", "0.6669767", "0.6665902", "0.6626412", "0.66127604", "0.66106755", "0.6507974", "0.64713794", "0.64438224", "0.64390486", "0.643685", "0.6432208", "0.6427079", "0.6426449", "0.64045554", "0.6402555", "0.63850814", "0.638002", "0.63504946", "0.634824...
0.0
-1
renders todos into list
function renderTodo(todo) { var html = '<a class="collection-item" id="'+todo.id+'" href="#modal-todo"'+ 'data-id="'+todo.id+'"'+ 'data-title="'+todo.title+'"'+ 'data-priority="'+todo.priority+'"'+ 'data-details="'+todo.details+'"'+ 'data-created="'+todo.createdAt+'"'+ 'data-elapsed="'+todo.elapsedTime+'"'+ 'data-finish="'+todo.finishAt+'"'+ 'data-complete="'+todo.isComplete+'"'+ '>'+ '<span class="badge '+todo.priority+'">'+ todo.priority+ '</span>'+ todo.title+ '</a>'; list.append(html); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTodoList () {\n if (!data.todo.length && !data.done.length) return;\n for (var i=0;i<data.todo.length;i++){\n addItemList(data.todo[i], 'todo');\n }\n for (var j=0;j<data.done.length;j++){\n addItemList(data.done[j], 'done');\n }\n\n}", "function renderTodos () {\n ...
[ "0.82022727", "0.794333", "0.789683", "0.7819229", "0.7647979", "0.75708413", "0.7537786", "0.7511343", "0.75055003", "0.74943507", "0.74279547", "0.74085474", "0.7372558", "0.73592174", "0.73560476", "0.7331652", "0.7271383", "0.7230757", "0.72179824", "0.72143036", "0.71821...
0.7016427
31
renders todo details in modal
function renderModalTodo(todo) { todo = $(todo); var id = todo.attr('data-id'), title = todo.attr('data-title'), priority = todo.attr('data-priority'), details = todo.attr('data-details'), created = todo.attr('data-created'), elapsed = parseInt(todo.attr('data-elapsed')), finish = todo.attr('data-finish'), complete = todo.attr('data-complete'), duration = getDuration(created, elapsed); modalTodo.find('.modal-header').text(title + " - "); modalTodo.find('.modal-header').append( '<span class="'+priority+'-text">'+ priority+ '</span>'+ '<button class="right waves-effect waves-light btn"><i class="material-icons">play_arrow</i></button>' ); var html = '<h5>'+ details+ '</h5>'+ '<table>'+ '<tbody>'+ '<tr>'+ '<td>Elapsed time</td>'+ '<td>'+duration+'</td>'+ '</tr>'+ '<tr>'+ '<td>Created</td>'+ '<td>'+moment(created).format("DD/MM/YY, HH:MM:SS")+'</td>'+ '</tr>'+ '<tr>'+ '<td>Finish by</td>'+ '<td>'+moment(finish).format("DD/MM/YY, HH:MM:SS")+'</td>'+ '</tr>'+ '</tbody>'+ '</table>' ; modalTodo.find('.modal-details').html(html); modalTodo.find('#trigger-edit').attr('data-id', id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderModalEdit(todo) {\n\t\tvar form = $('#form-todo-edit');\n\t\t\n\t\tvar id = todo.attr('data-id'),\n\t\t\t\ttitle = todo.attr('data-title'),\n\t\t\t\tpriority = todo.attr('data-priority'),\n\t\t\t\tdetails = todo.attr('data-details'),\n\t\t\t\tcreated = todo.attr('data-created'),\n\t\t\t\telapsed = p...
[ "0.7492966", "0.7484302", "0.6420262", "0.6416993", "0.6294539", "0.6256276", "0.62361515", "0.6209705", "0.6191751", "0.6191233", "0.6190431", "0.61891675", "0.6180034", "0.61781734", "0.6170497", "0.61701435", "0.61595416", "0.6092127", "0.60896057", "0.6089572", "0.6059959...
0.82247376
0
renders todo info on edit modal
function renderModalEdit(todo) { var form = $('#form-todo-edit'); var id = todo.attr('data-id'), title = todo.attr('data-title'), priority = todo.attr('data-priority'), details = todo.attr('data-details'), created = todo.attr('data-created'), elapsed = parseInt(todo.attr('data-elapsed')), finish = todo.attr('data-finish'), complete = todo.attr('data-complete'), duration = getElapsed(created, elapsed).split(':'); form.find('#inputId').val(id); form.find('#inputTitle').val(title); form.find('#inputPriority').val(priority); form.find('#inputDetails').val(details); form.find('#inputDetails').trigger('autoresize'); form.find('#inputCreatedDate').val(getDate(created)); form.find('#inputCreatedTime').val(getTime(created)); form.find('#inputFinishDate').val(getDate(finish)); form.find('#inputFinishTime').val(getTime(finish)); form.find('#inputElapsedHours').val(duration[0]); form.find('#inputElapsedMinutes').val(duration[1]); form.find('#inputElapsedSeconds').val(duration[2]); Materialize.updateTextFields(); $('select').material_select(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderModalTodo(todo) {\n\t\ttodo = $(todo);\n\t\t\n\t\tvar id = todo.attr('data-id'),\n\t\t\t\ttitle = todo.attr('data-title'),\n\t\t\t\tpriority = todo.attr('data-priority'),\n\t\t\t\tdetails = todo.attr('data-details'),\n\t\t\t\tcreated = todo.attr('data-created'),\n\t\t\t\telapsed = parseInt(todo.attr...
[ "0.7879672", "0.72978574", "0.71237314", "0.679732", "0.6789736", "0.6735313", "0.67139035", "0.6689956", "0.6672412", "0.66141886", "0.66096693", "0.6608107", "0.65953094", "0.6585301", "0.656784", "0.65665364", "0.6566337", "0.65657467", "0.6564237", "0.65475243", "0.647148...
0.8279227
0
returns duration in string
function getDuration(createdAt, elapsed) { var elapsedTime = moment(createdAt).add(elapsed,'seconds').format('X'); var initTime = moment(createdAt).format('X'); var delta = elapsedTime - initTime; delta = moment.duration(delta, "s"); var duration = delta.hours() + 'h ' + delta.minutes() + 'm ' + delta.seconds() + 's'; return duration; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDurationStr(duration) {\n return utils.round(duration);\n}", "toString() {\n\t\tlet difference;\n\t\tif (this.options && this.options.ms) {\n\t\t\tdifference = this.toMs(this.difference);\n\t\t} else {\n\t\t\tdifference = `${this.difference} ms`;\n\t\t}\n\t\treturn `Timer took ${difference}`;\n\t}",...
[ "0.8008544", "0.7346449", "0.7295704", "0.7259352", "0.7213701", "0.71944994", "0.7163233", "0.7145003", "0.7042864", "0.7009834", "0.6949314", "0.69286734", "0.69119906", "0.68601567", "0.6777103", "0.6775744", "0.6729581", "0.67156386", "0.6691657", "0.668552", "0.6650191",...
0.0
-1
returns elapsed time in string
function getElapsed(createdAt, elapsed) { var elapsedTime = moment(createdAt).add(elapsed,'seconds').format('X'); var initTime = moment(createdAt).format('X'); var delta = elapsedTime - initTime; delta = moment.duration(delta, "s"); var duration = delta.hours() + ':' + delta.minutes() + ':' + delta.seconds(); return duration; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function timeElapsed(){\n\tvar h = Math.floor(sec_elapsed / 3600);\n\tvar m = Math.floor(sec_elapsed / 60);\n\tvar s = sec_elapsed - (m*60);\n\t\n\tif(h<10){\n\t\th = '0' + h;\n\t}\n\tif(m<10){\n\t\tm = '0' + m;\n\t}\n\tif(s<10){\n\t\ts = '0' + s;\n\t}\t\n\t\n\treturn h + ':' + m + ':' + s;\n}", "toString() {\n\...
[ "0.8201184", "0.76156014", "0.7572001", "0.7549486", "0.68174595", "0.6746245", "0.6639818", "0.6627749", "0.65106666", "0.64950687", "0.6494705", "0.6493344", "0.64827216", "0.6478704", "0.64257", "0.64121014", "0.6372463", "0.6347693", "0.63442135", "0.63289857", "0.6318888...
0.0
-1
returns date in string
function getDate(datetime) { return moment(datetime).format("DD MMM, YYYY"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDateString() {\n // Initializing variables for date, month and year\n let day = date.getDate();\n let month = date.getMonth() + 1;\n let year = date.getFullYear() - 2000;\n \n let strDate = month.toString() + \"/\" + day.toString() + \"/\" + year.toString();\n return strDate\n }", ...
[ "0.7865741", "0.7733878", "0.7722129", "0.75780684", "0.75453395", "0.7509569", "0.75010115", "0.74770427", "0.7459786", "0.7407767", "0.74073", "0.73844194", "0.7371184", "0.7329175", "0.7314917", "0.731109", "0.7275957", "0.7269731", "0.7266134", "0.7263692", "0.7257782", ...
0.0
-1
returns time in string
function getTime(datetime) { return moment(datetime).format("HH:MM"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function time() {\n\treturn `[${(new Date()).toTimeString().substr(0,8)}]`\n}", "function get_timestr() { \n\tvar d = new Date();\n\treturn d.toLocaleString() + \"<br />\\n\";\n}", "function time_str() {\n var d = new Date();\n var date = two(d.getDate());\n var month = two(d.getMonth() + 1);\n var hour =...
[ "0.82413846", "0.7740092", "0.7722576", "0.7689842", "0.7612112", "0.7598986", "0.7584392", "0.75562626", "0.75352097", "0.7532658", "0.7513505", "0.75134856", "0.74821216", "0.74804187", "0.7444703", "0.7435134", "0.7388182", "0.7376904", "0.73646927", "0.73614186", "0.73538...
0.0
-1
joins elapsed time and returns seconds
function joinElapsed(elapsedHours, elapsedMinutes, elapsedSeconds) { var h = parseInt(elapsedHours); var m = parseInt(elapsedMinutes); var s = parseInt(elapsedSeconds); var joined = moment.duration(h, 'h'); joined = joined.add(moment.duration(m, 'm')); joined = joined.add(moment.duration(s, 's')); return joined.asSeconds(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function seconds_elapsed() {\n var date_now = new Date();\n var time_now = date_now.getTime();\n var time_diff = time_now - startTime;\n var seconds_elapsed = Math.floor(time_diff / 1000);\n return (seconds_elapsed);\n}", "function timeElapsed(){\n\tvar h = Math.floor(sec_elapsed / 3600);\n\tvar m...
[ "0.73675424", "0.7313149", "0.7118391", "0.6913448", "0.6837171", "0.67343444", "0.64772594", "0.64548427", "0.63994884", "0.63948196", "0.63704854", "0.634836", "0.6327369", "0.6316579", "0.63108796", "0.62390286", "0.6205545", "0.6186461", "0.617995", "0.6159959", "0.613807...
0.6775952
5
manages data and sends add POST
function addTodo(form) { var name = form.find('#inputTitle').val(), priority = form.find('#inputPriority').val(), finishDate = form.find('#inputFinishDate').val(), finishTime = form.find('#inputFinishTime').val().split(':'), details = form.find('#inputDetails').val(); var finishAt = moment(finishDate, 'D MMM, YYYY'); finishAt = finishAt.add(finishTime[0], 'hours').add(finishTime[1], 'minutes'); var json = { "title": name, "priority": priority, "details": details, "createdAt": moment().format(), "elapsedTime": 0, "finishAt": finishAt, "isComplete": false }; $.post( '/api/add', JSON.stringify(json) ).done(function(data) { location.reload(); }).fail(function(error) { console.log(error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleAdd() {\n const { opps, formData } = this.state\n // Optimistic update\n this.teardownForm()\n this.setState({\n opps: opps.slice().concat([formData])\n })\n\n // Update server\n xhr({\n url: '/api/opps',\n method: 'POST',\n json: formData,\n }, (err, res) => {\n ...
[ "0.6969995", "0.68774486", "0.67415947", "0.67207855", "0.67141575", "0.67140734", "0.6671303", "0.6559669", "0.65168726", "0.6485735", "0.64642763", "0.64597607", "0.6459527", "0.64586073", "0.64454645", "0.6406801", "0.6396785", "0.6371603", "0.63156044", "0.6299307", "0.62...
0.0
-1
manages data and sends edit POST
function editTodo(form) { var id = form.find("#inputId").val(), name = form.find('#inputTitle').val(), priority = form.find('#inputPriority').val(), beginDate = form.find('#inputCreatedDate').val(), beginTime = form.find('#inputCreatedTime').val().split(':'), finishDate = form.find('#inputFinishDate').val(), finishTime = form.find('#inputFinishTime').val().split(':'), elapsedHours = form.find('#inputElapsedHours').val(), elapsedMinutes = form.find('#inputElapsedMinutes').val(), elapsedSeconds = form.find('#inputElapsedSeconds').val(), details = form.find('#inputDetails').val(), complete = form.find('#inputComplete'), elapsedTime = joinElapsed(elapsedHours, elapsedMinutes, elapsedSeconds); var isComplete = (complete == 'checked') ? true : false; console.log(complete); var createdAt = moment(beginDate, 'D MMM, YYYY'); createdAt = createdAt.add(beginTime[0], 'hours').add(beginTime[1], 'minutes'); var finishAt = moment(finishDate, 'D MMM, YYYY'); finishAt = finishAt.add(finishTime[0], 'hours').add(finishTime[1], 'minutes'); // var json = { "id": id, "title": name, "priority": priority, "details": details, "createdAt": createdAt, "elapsedTime": elapsedTime, "finishAt": finishAt, "isComplete": isComplete }; console.log(json); // // $.post( // '/api/add', // JSON.stringify(json) // ).done(function(data) { // location.reload(); // }).fail(function(error) { // console.log(error); // }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async edit({ params, request, response, view }) {}", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ params, request, response, view }) {\n }", "async edit ({ p...
[ "0.7771302", "0.7563481", "0.7563481", "0.7563481", "0.7563481", "0.7563481", "0.7563481", "0.7563481", "0.7301777", "0.72475225", "0.69805485", "0.69672596", "0.6955587", "0.6945238", "0.68680555", "0.6860806", "0.68564874", "0.6675044", "0.66404355", "0.6612959", "0.6588204...
0.0
-1
Depcreated, use "/logout" instead. Will be removed in later release.
logout(req, res) { if (req.session) { req.session = null; } if (req.logout) { req.logout(); } res.redirect(`${this.config.baseUriPath}/`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "logout () {\n\n }", "function dummyLogout() {\n document.location = baseUrl + \"auth/logout/?redirect=\" + document.location;\n }", "function interpret_logout(content) {\n}", "function safeLogout() {\n clearCache();\n toDashboard.url = '';\n m.siteAlias = '';\n ...
[ "0.74865955", "0.7353531", "0.7343239", "0.73090696", "0.72075164", "0.7161158", "0.7159108", "0.71406037", "0.71129096", "0.7108269", "0.71011007", "0.70770174", "0.7074036", "0.7037562", "0.7013939", "0.6992817", "0.69379467", "0.69060564", "0.68928", "0.68755186", "0.68699...
0.66537094
42
You shouldn't need to edit this function its tests should pass once you've written makeDisplayNameFromId
function makeProducerDiv(producer) { const containerDiv = document.createElement("div"); containerDiv.className = "producer"; const displayName = makeDisplayNameFromId(producer.id); const currentCost = producer.price; let html = ` <div class="producer-column"> <div class="producer-title">${displayName}</div> <button type="button" id="buy_${producer.id}">Buy</button> </div> <div class="producer-column"> <div>Quantity: ${producer.qty}</div> <div>Coffee/second: ${producer.cps}</div> <div>Cost: ${currentCost} coffee</div> </div> `; containerDiv.innerHTML = html; return containerDiv; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDisplayNameFromId(id) {\n let words = id.split('_');\n let titleCaseWords = [];\n\n words.forEach(word => {\n titleCaseWords.push(word.charAt(0).toUpperCase() + word.slice(1));\n })\n\n // returns a string - from [] to '' w' join plus add a space between words\n return titleCaseWords.join(' '...
[ "0.7268972", "0.7178332", "0.6747061", "0.6557478", "0.65521824", "0.6540289", "0.6511926", "0.6493901", "0.64668846", "0.6464186", "0.64633447", "0.64587414", "0.6430982", "0.6380561", "0.6380561", "0.6351274", "0.63185704", "0.63149023", "0.6224293", "0.62138075", "0.619500...
0.0
-1
create functionality to update the player as they progress through the game
function updateGameStatus(data) { // store total number of unlocked producers const allUnlockedProducers = getUnlockedProducers(data); // store 'directions' element const directions = document.getElementById("directions"); // store minimum upgrade price const allPrices = data.producers.map((producer) => { return producer.price; }); const cheapestUpgrade = Math.min(...allPrices); // change the text of 'directions' depending on number of upgrades, if (allUnlockedProducers.length === 12) { // if all producers are unlocked: directions.innerText = "So much coffee!!!"; } else if (allUnlockedProducers.length && data.coffee >= cheapestUpgrade) { // if producers are available and the user can afford at least one: directions.innerText = "Click to buy an upgrade! →"; } else { // otherwise, display default text: directions.innerText = "↑ Click on the coffee! ↑"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n\n \n this.movePlayerManager();\n\n\n \n\n }", "function updateProgressBar(){\n // Update the value of our progress bar accordingly.\n $('#progress-bar').val((player.getCurrentTime() / player.getDuration()) * 100);\n }", "update() {\n // On every win\n win();\n ...
[ "0.71993554", "0.7183711", "0.71561456", "0.70855904", "0.70816195", "0.7045397", "0.69896036", "0.6952311", "0.6935845", "0.69224524", "0.6919745", "0.6872595", "0.6831523", "0.6820777", "0.68136966", "0.6813433", "0.6811955", "0.68009305", "0.67783064", "0.677771", "0.67703...
0.0
-1
intialize the game through finction
function initBasicGame() { // declaring the variables inside the function var currentCard; var cardArray = []; var initialScore = 0; var initialIndex = 0; // looping the card array for (var i = 0; i < cardData.length; i++) { // creating a new instance for the basic card/front and back both sides currentCard = new BasicCard(cardData[i].front, cardData[i].back); // pushing the cards in the current card deck cardArray.push(currentCard); } // playing the round playRound(initialScore, initialIndex, cardArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run(){ //the only function which is executed.Rest all functions are interconnected by this function.\n initial(); //it creates snakes,food and walls\n int=setInterval(gameloop,interval);\n }", "function initGame() {\r\n initPelota();\r\n initNavecilla();\r\n initLadrillos();\r\n}", "fu...
[ "0.7046092", "0.7034551", "0.6980371", "0.69612277", "0.69582736", "0.69537616", "0.6927157", "0.6920376", "0.68847877", "0.68822443", "0.68516773", "0.68346286", "0.6834344", "0.6832087", "0.6825237", "0.67856467", "0.674963", "0.6749094", "0.67309594", "0.6730915", "0.67130...
0.0
-1
invoking the function to play game
function playRound(currentScore, currentIndex, cardArray) { // if condition to check the new cards are available if(currentIndex< cardArray.length) { // propmt user to play next card promptUser(cardArray, currentIndex, currentScore); // or else finish the game } else { endGame(currentScore); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playGame() {\n}", "function clickHandler() // play game.\n{\n playGame();\n}", "function playGame(){\r\n //set game to runnning and not paused\r\n gameRunning = true;\r\n gamePaused = false;\r\n hideMenuTable();\r\n setupNewGame();\r\n showGameTables(...
[ "0.82847035", "0.7912593", "0.7754937", "0.7696056", "0.76871383", "0.7659405", "0.7649674", "0.7507878", "0.74120104", "0.7391831", "0.7351698", "0.7332689", "0.73226017", "0.7275666", "0.7261002", "0.7252238", "0.724604", "0.723455", "0.72173965", "0.72061646", "0.71803015"...
0.0
-1
invoking the function end game
function endGame(score){ console.log('End game'); console.log(score); // asking the user if they want to play more game inquirer.prompt([{ type: "input", name: "text", message: "Do you want to play again?" }]).then(function(answer){ // if user wants to play more game if(answer.text === 'yes' || answer.text === 'y'){ // intialize the game again initGame(); } else { console.log('Thankyou for playing!'); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endGame() {\n \n}", "function handleEndGame() {\n\n}", "function end() {\n game.end();\n console.log('End!!, thank you for playing');\n }", "function endSala() {\r\n\tgame.endSala();\r\n}", "endGameAction() {\n\n }", "function endGame() {\r\n\t\tgameOver = true;\r\n\t\tsetMessage2(\"Gam...
[ "0.8849182", "0.86364377", "0.8571009", "0.8436919", "0.8428862", "0.84172803", "0.83033925", "0.82777846", "0.81529665", "0.8127345", "0.8078822", "0.80602217", "0.80593556", "0.80395615", "0.8038341", "0.8009025", "0.8002107", "0.7994674", "0.79841816", "0.79649836", "0.796...
0.0
-1
function to prompt the user to play card
function promptUser(cardArray,currentIndex,currentScore) { var card = cardArray[currentIndex]; inquirer.prompt([{ type: "input", name: "text", message: card.front +"\nAnswer" }]).then (function(answer){ if(answer.text.trim().toLowerCase() === card.back.trim().toLowerCase()){ currentScore++; console.log("your answer is correct"); } else{ console.log("sorry you are wrong! currentanswer is" + card.back); currentIndex++; playRound(currentScore,currentIndex,cardArray); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function game() {\n easyQuestions();\n hardQuestions();\n inquirer.prompt([\n //This will be the user choice for Basic or Clozed questions\n {\n type: \"li...
[ "0.732434", "0.70435596", "0.6944638", "0.68279356", "0.680024", "0.67515856", "0.67206794", "0.670351", "0.66868895", "0.66671205", "0.66492176", "0.66471195", "0.66454554", "0.65982753", "0.6570302", "0.65521574", "0.65461713", "0.6542514", "0.6458754", "0.6439896", "0.6437...
0.6786687
5
Message to both players Write values in global variables out to the database
function updateDatabase() { database.ref().set({ p1name: v_p1name, p1pick: v_p1pick, p1wins: v_p1wins, p1losses: v_p1losses, p1ties: v_p1ties, p2name: v_p2name, p2pick: v_p2pick, p2wins: v_p2wins, p2losses: v_p2losses, p2ties: v_p2ties, conversation: v_conversation, message: v_message }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendGameDataToServer() {\n // initialize data message\n var data = {};\n\n // attach room and player ids\n data.roomId = viewModel.currentRoomId();\n data.playerId = localPlayerId;\n\n // initialize character array\n data.chars = [];\n\n // find local player and pack player data on message\n var ...
[ "0.6050087", "0.5949858", "0.58548886", "0.58364403", "0.5824958", "0.5796896", "0.5793975", "0.578975", "0.5778029", "0.5749695", "0.5741349", "0.57377756", "0.57227606", "0.5715116", "0.56820834", "0.56739", "0.56731427", "0.56703824", "0.56426835", "0.5639739", "0.563403",...
0.56150216
22
Reset the display for the next round.
function resetGame() { // Hide what was chosen during last round $(".choice").attr("hidden", true); // Display the game choice buttons $(".game").attr("hidden", false); $(".game").css("visibility", "visible"); // Update the player instructions. v_message = "Make your choices ..."; updateDatabase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetDisplay() {\n\t\tctx.clearRect(0,0,610,550);\n\t\tctx.strokeRect(40, 10, 530, 539);\n\t\t$(\"#controls button\").button(\"disable\");\n\t\t$(\"#seeker\").slider(\"disable\");\n\t\t$(\"#display-options input\").attr(\"disabled\",\"disabled\");\n\t\t$(\".game-status .p1, .game-status .p2, .game-status ...
[ "0.75362486", "0.73819315", "0.7286757", "0.7253121", "0.720564", "0.71722883", "0.71388805", "0.7029468", "0.6998004", "0.69702154", "0.6968658", "0.692189", "0.6911407", "0.6861497", "0.68610424", "0.68489814", "0.68306124", "0.68212664", "0.6815459", "0.6813681", "0.680570...
0.0
-1
Determine which player won the game.
function determineWinner () { var winner = ""; // Flag indicating which player won or tie game var intervalID = 0; // Timer interval id. // Determine winner based on each possible combination of choices. switch (v_p1pick) { case "rock": switch (v_p2pick) { case "rock": winner = "tie"; break; case "paper": winner = "p2"; break; case "scissors": winner = "p1"; break; }; // Set the image for Player 1 choice. $("#image1").attr("src","assets/images/rock.jpg") break; case "paper": switch (v_p2pick) { case "rock": winner = "p1"; break; case "paper": winner = "tie"; break; case "scissors": winner = "p2"; break; }; // Set the image for Player 1 choice. $("#image1").attr("src", "assets/images/paper.jpg") break; case "scissors": switch (v_p2pick) { case "rock": winner = "p2"; break; case "paper": winner = "p1"; break; case "scissors": winner = "tie"; break; }; // Set the image for Player 1 choice. $("#image1").attr("src", "assets/images/scissors.jpg") break; }; // Set the image for Player 2 choice. switch (v_p2pick) { case "rock": $("#image2").attr("src", "assets/images/rock.jpg") break; case "paper": $("#image2").attr("src", "assets/images/paper.jpg") break; case "scissors": $("#image2").attr("src", "assets/images/scissors.jpg") break; }; // Update each player's scores according to who won // and update the common message to both players. if (winner === "p1") { v_p1wins = v_p1wins + 1; v_p2losses = v_p2losses + 1; v_message = v_p1name + " wins!!"; } else if (winner === "p2") { v_p2wins = v_p2wins + 1; v_p1losses = v_p1losses + 1; v_message = v_p2name + " wins!!"; } else { v_p1ties = v_p1ties + 1; v_p2ties = v_p2ties + 1; v_message = "Tie Game!!"; }; // Reset the variables with each player's choices. v_p1pick = ""; v_p2pick = ""; updateDatabase(); // Pause for 5 seconds before resetting the game for the next round. intervalID = setTimeout(resetGame, 5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkWin () {\n\t\tif (scores[0] === 10) {\n \t\treturn player1;\n } else if (scores[1] === 10) {\n \t\treturn player2;\n } else {\n \t\treturn null;\n }\n}", "function getWinner(){\n if(player1.score > player2.score){\n winner = \"Player1\"\n } else if(player2...
[ "0.7470841", "0.73979217", "0.730281", "0.72820836", "0.72731924", "0.7266726", "0.7259731", "0.7257109", "0.72549754", "0.7249323", "0.7204083", "0.71785057", "0.7111715", "0.7098823", "0.70804036", "0.7043733", "0.7024506", "0.7014854", "0.7000613", "0.6978096", "0.69530445...
0.0
-1
For license information, please see license.txt Function to at variables in string
function parse(str) { var args = [].slice.call(arguments, 1), i = 0; return str.replace(/%s/g, () => args[i++]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processVariables(str) {\n if (!str) return '';\n var variables = ['MONTH','QUARTER','YEAR'];\n for (var i=0; i<variables.length; i++) {\n var variable = variables[i];\n var regexp = new RegExp(':' + variable + '[+-]?[\\\\d]*', 'g');\n var matches = str.match(regexp);\n if (!matc...
[ "0.6294985", "0.6255095", "0.6231003", "0.6083021", "0.6017686", "0.5892693", "0.58016527", "0.57685065", "0.57240236", "0.5569855", "0.5528753", "0.5480313", "0.545602", "0.5448759", "0.5438926", "0.543641", "0.5419741", "0.536137", "0.5339832", "0.53323114", "0.5321396", ...
0.0
-1
pick & show random word
function showWord(words){ // generate random Array Index const randIndex = Math.floor(Math.random() * words.length); // output random word currentWord.innerHTML = words[randIndex].toUpperCase(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showWord(words) {\r\n const randIndex = Math.floor(Math.random() * words.length);\r\n currentWord.innerHTML = words[randIndex];\r\n }", "function showWord(words) {\n const randIndex = Math.floor(Math.random() * words.length);\n currentWord.innerHTML = words[randIndex];\n}", "function showWord(...
[ "0.8195292", "0.81868297", "0.81232285", "0.8092015", "0.7974458", "0.7954044", "0.7947433", "0.79459184", "0.7929834", "0.7914344", "0.78949654", "0.7879488", "0.78731376", "0.78596306", "0.7837906", "0.7717689", "0.769889", "0.76771945", "0.76375425", "0.7619843", "0.761318...
0.78401124
14
Returns the path at which the asset can be found in the archive
function getPathInArchive(asset) { if (Platform.OS === 'android') { var assetDir = getBasePath(asset); // E.g. 'assets_awesomemodule_icon' // The Android resource system picks the correct scale. return (assetDir + '/' + asset.name) .toLowerCase() .replace(/\//g, '_') // Encode folder structure in file name .replace(/([^a-z0-9_])/g, '') // Remove illegal chars .replace(/^assets_/, ''); // Remove "assets_" prefix } else { // E.g. 'assets/AwesomeModule/icon@2x.png' return getScaledAssetPath(asset); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get assetPath() {}", "get assetPath() {}", "get assetBundleManifestPath() {}", "get assetpath() {\n // Don't override existing assetpath.\n if (!this.__assetpath) {\n // note: assetpath set via an attribute must be relative to this\n // element's location; accomodate polyfilled HTMLImports\n ...
[ "0.72988594", "0.72988594", "0.6928078", "0.6344683", "0.6304178", "0.62533545", "0.61659217", "0.6121274", "0.59751874", "0.5935436", "0.5926797", "0.5808916", "0.5782934", "0.5780586", "0.57536286", "0.5746315", "0.57212144", "0.56528574", "0.56408256", "0.5589051", "0.5582...
0.73705804
0
Returns an absolute URL which can be used to fetch the asset from the devserver
function getPathOnDevserver(devServerUrl, asset) { return devServerUrl + getScaledAssetPath(asset) + '?hash=' + asset.hash; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function url(id) {\n var basedir = getCallsiteDirname();\n return 'url(' + requireAssets(id, basedir) + ')';\n}", "getURL(url) {\n return this.isDev() ? path.join(\"../\", url) : url\n }", "get 'asset-path'() { return process.env.PUBLIC_URL ? `\"${process.env.PUBLIC_URL}\"` : '\"/\"'; }", "get as...
[ "0.6948651", "0.6923575", "0.68518424", "0.66799545", "0.66799545", "0.65441257", "0.6415133", "0.63643956", "0.63643956", "0.63643956", "0.63643956", "0.63579535", "0.63579535", "0.62959653", "0.6251196", "0.6241207", "0.6232682", "0.62325305", "0.6221429", "0.62188184", "0....
0.74271345
0
Returns a path like 'assets/AwesomeModule'
function getBasePath(asset) { // TODO(frantic): currently httpServerLocation is used both as // path in http URL and path within IPA. Should we have zipArchiveLocation? var path = asset.httpServerLocation; if (path[0] === '/') { path = path.substr(1); } return path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get assetPath() {}", "get assetPath() {}", "function getAssetsPath() {\r\n return getBuildPath() + config.build.assetsPath;\r\n}", "get assetBundleManifestPath() {}", "function _getBasePath() {\r\n\tvar refPath = '/assets/kindeditor/';\r\n\tvar els = document.getElementsByTagName('script'), src;\r\n\tfor ...
[ "0.720717", "0.720717", "0.6714291", "0.66264737", "0.6525416", "0.652097", "0.6433398", "0.63855135", "0.6257597", "0.6245888", "0.6233124", "0.61162937", "0.6095459", "0.60704434", "0.6065881", "0.60069966", "0.5997081", "0.59740335", "0.5961288", "0.59564257", "0.59315115"...
0.553292
67
Delete snippet by id
function delete_snippet(id) { $(".snippet_row_" + id).remove(); // if there aren't any visible rows (i.e. excluding the 0 row that we use for cloning) if ($('#manage_snippets_table .snippet_row:visible').length <= 0) { $('#no_snippets_row').show(); } else { $('#no_snippets_row').hide(); } $.ajax({ url: ajaxurl, data: { id: id, action: "orb_ctc_addon_cloud_lib_delete" }, success: function (json) { // update max items via js $('.usage_items').text(get_snippet_count()); if (json.status) { // the row is deleted anyways so nothing to do. // just have some coffee. } else { alert(json.msg); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteExercise(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/exercises/\" + id\n })\n .then(function () {\n $(`[data-exercise=${id}]`).remove();\n });\n }", "function remove(id){\n var direccion = urlDelete.replace...
[ "0.6677927", "0.6606545", "0.6560378", "0.64950675", "0.64659834", "0.6445743", "0.64454406", "0.63364446", "0.6326042", "0.62944067", "0.62941897", "0.62693906", "0.62572294", "0.6239765", "0.62353086", "0.6210317", "0.61874735", "0.61831236", "0.61811054", "0.6143782", "0.6...
0.7400315
0
on body load function
function main() { //get canvas elementFromPoint canvas = document.getElementById("AMC"); if(!canvas) console.log("Obtaining canvas from main document failed\n"); else console.log("Obtaining canvas from main document succeeded\n"); //print obtained canvas width and height on console console.log("Canvas width:" + canvas.width +" height:" +canvas.height); canvas_original_width = canvas.width; canvas_original_height = canvas.height; //register keyboard and mouse event with window class window.addEventListener("keydown", keydown, false); window.addEventListener("click", mouseDown, false); window.addEventListener("resize", resize, false); init(); resize(); draw(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleBodyLoad() {\n document.body.classList.add('loaded');\n}", "function onLoad()\n{}", "function onBodyLoad() {\n document.querySelector('.presentation').classList.add('visible')\n\n // Set up\n getSlideNumberFromUrlFragment()\n showSlide(true, true)\n onSlideEnter(slideEls[currentSlideNumber...
[ "0.7331144", "0.7243662", "0.7133408", "0.7052372", "0.6990392", "0.697745", "0.6972269", "0.69541526", "0.694778", "0.6864656", "0.6843282", "0.6814684", "0.6801337", "0.6775726", "0.6762896", "0.67622274", "0.67222625", "0.6705906", "0.66984266", "0.66921777", "0.66772544",...
0.0
-1
writeCards(["Lisa", "Kaitlin", "Jan"], 'surprise');
function countDown(num) { let i = -1 while(i < num){ console.log(num--); } return num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeCards (names, birthday) {\n let thankYouCards = [];\n for (let i = 0; i < names.length; i++) {\n thankYouCards.push(`Thank you, ${names[i]}, for the wonderful ${birthday} gift!`)\n }\nreturn thankYouCards\n}", "function writeCards(arrayOfNames, eventName) {\n let returnArray = []\n ...
[ "0.73049355", "0.7050327", "0.70452535", "0.6843317", "0.68239504", "0.67984444", "0.6783954", "0.6764512", "0.6733885", "0.66254485", "0.64052397", "0.6364714", "0.62897104", "0.62504303", "0.624323", "0.62428135", "0.624153", "0.62324065", "0.620111", "0.61764693", "0.61563...
0.0
-1
return the twodigit hexadecimal code for a byte
function toHexString(charCode) { return ("0" + charCode.toString(16)).slice(-2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hex_byte(num)\n{\n return hex_chr.charAt((num >> 4) & 0x0F) + hex_chr.charAt(num & 0x0F);\n}", "function byteToHex(byte) {\n return ('0' + byte.toString(16)).slice(-2);\n}", "function byte2Hex(n) {\n var nybHexString = \"0123456789ABCDEF\";\n return String(nybHexString....
[ "0.75188696", "0.7042452", "0.7005195", "0.6967609", "0.6967609", "0.6950585", "0.692007", "0.68321645", "0.6793029", "0.6785783", "0.67763716", "0.6761339", "0.6718711", "0.6692226", "0.6689676", "0.66757405", "0.6617002", "0.660528", "0.6604771", "0.6595199", "0.65835464", ...
0.64684343
29
! Vue.js v2.5.3 (c) 20142017 Evan You Released under the MIT License.
function r(e){return void 0===e||null===e}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mounted() {\n }", "mounted() {\n\n }", "mounted() {\n\n }", "constructor() {\n this.vue = new Vue();\n }", "mounted() {\n /* eslint-disable no-console */\n console.log('Mounted!');\n /* eslint-enable no-console */\n }", "created () {\n\n }", "created () {...
[ "0.695794", "0.6913845", "0.68894804", "0.6556369", "0.6501232", "0.6373165", "0.6373165", "0.63345695", "0.6331294", "0.6320368", "0.6306127", "0.630461", "0.62363356", "0.62242454", "0.622238", "0.61852306", "0.61851555", "0.6168488", "0.61634433", "0.61634433", "0.61620957...
0.0
-1
use 'id' instead of 'index' for 'key' property in the loop:
render() { return ( <div className="todos-wrapper"> <ol> {this.props.todos.map(todo => { return !todo.deleted && <li key={todo.id} > <Todo todo={todo} todoId={todo.id} toggleTodo={this.handleToggle} deleteTodo={this.handleDelete} /> </li> })} </ol> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "for (let i = 0; i < props.data.length; i++) {\n // the data point\n const datum = props.data[i]\n\n // save the index of the key\n this._keyCache[datum.key] = i\n }", "getKey() {\n return container[idx]\n }", "key(i) { return this.#offset + thi...
[ "0.66981316", "0.65497315", "0.64865094", "0.6399498", "0.6389417", "0.6234483", "0.61698127", "0.61501473", "0.6017312", "0.59804213", "0.5898025", "0.58880156", "0.5842643", "0.5836375", "0.5808706", "0.57528687", "0.5747172", "0.5745296", "0.57336533", "0.57308954", "0.571...
0.0
-1
FUNCTION TO CHANGE SLIDES AUTOMATICALLY
function autoChange(){ setInterval(() => { slideNum++ if(slideNum > slides.length){ slideNum = 1 document.querySelector(`.slide-${slideNum}`).classList.add("fade-in") document.querySelector(`.slide-${slideNum}`).classList.remove("fade-out") document.querySelector(`.slide-${slides.length}`).classList.add("fade-out") document.querySelector(`.slide-${slides.length}`).classList.remove("fade-in") } else{ document.querySelector(`.slide-${slideNum}`).classList.add("fade-in") document.querySelector(`.slide-${slideNum}`).classList.remove("fade-out") document.querySelector(`.slide-${slideNum-1}`).classList.add("fade-out") document.querySelector(`.slide-${slideNum-1}`).classList.remove("fade-in") } }, 10000) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeSlide(i) {\n //0;\n // if i == 0 then / deactivate slide 3 / activate slide 0\n if (i == 0) {\n activateSlide(i);\n deactivateSlide(3);\n }\n\n // if i == 1,2,3 then / deactivate i-1 / activate i\n if (i > 0) {\n activateSlide(i);\n deactivateSlide(i - 1);\n }\n}", "function swa...
[ "0.6626485", "0.6557228", "0.64963454", "0.64846665", "0.64678144", "0.6386141", "0.63850635", "0.63388145", "0.6335285", "0.6328688", "0.6326049", "0.6307592", "0.630215", "0.6261143", "0.62419695", "0.6231625", "0.6203001", "0.61942214", "0.61914074", "0.6166216", "0.616494...
0.0
-1
Update the form controls each time the user interacts with them.
handleChange(e, { name, value }) { this.setState({ [name]: value }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update() {\n controls.update();\n stats.update();\n }", "updateControl(){\n this._control.update();\n }", "function update() {\n resize();\n controls.update();\n }", "function update() {\n\n\tupdateFocus();\n\tupdateFamilyTooltip();\n\tupdateHighlights();\n}", ...
[ "0.6893606", "0.68622506", "0.6752346", "0.6496982", "0.64865994", "0.6481366", "0.63915396", "0.62272984", "0.6135622", "0.6135067", "0.6135067", "0.6086767", "0.6028141", "0.5995277", "0.599338", "0.5988231", "0.59881186", "0.59581953", "0.5920385", "0.5911577", "0.5911577"...
0.0
-1
Handle Signup submission using Meteor's account mechanism.
handleSubmit() { const { email, password } = this.state; Accounts.createUser({ email, username: email, password }, (err) => { if (err) { this.setState({ error: err.reason }); } else { this.setState({ signed: true }); this.props.history.push('/addprofile'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSignUp() {\n \n if (email.length < 4 || password.length < 4) {\n setFeedback({color: 'red', message: 'Mailadress/lösenord måste innehålla mer än 4 tecken.'})\n return\n }\n \n // Sign in with email and pass.\n firebase.auth().createUserWithEmailAndPassword(email, ...
[ "0.73121166", "0.72460973", "0.716876", "0.71652585", "0.7161959", "0.711264", "0.7029215", "0.70280516", "0.70277226", "0.6965956", "0.6962865", "0.6938823", "0.6885949", "0.68830234", "0.6875263", "0.6871981", "0.68713", "0.68707484", "0.6859423", "0.683193", "0.68216926", ...
0.66821253
30
Busca estudiante por matricula
async function findByMatricula(matricula){ let estudiante = await db.Estudiante.findAll({ where: { matricula: matricula } }); return estudiante; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "isMat(color) {\n // this.mat permet de vérifier que la fonction n'a pas déjà été effectué d...
[ "0.6209102", "0.598249", "0.59235054", "0.5839722", "0.5777203", "0.57393456", "0.57326937", "0.57200927", "0.57190186", "0.57020307", "0.57008684", "0.56675166", "0.5646028", "0.5577797", "0.55736595", "0.5567458", "0.55451494", "0.55431575", "0.55427456", "0.5537339", "0.55...
0.0
-1
borra estudiante por MATRICULA
async function eraseMatricula(matricula) { let estudiante = await db.Estudiante.destroy({ where: { matricula: matricula } }); return estudiante; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ocen_statycznie()\n{\n return szachownica.ocena.material + (szachownica.ocena.faza_gry * szachownica.ocena.tablice + (70 - szachownica.ocena.faza_gry) * szachownica.ocena.tablice_koncowka) * 0.03;\n}", "function caricaModello() {\n // CARICA MAPPA DISPLACEMENT\n mappaTemp = mappa;\n //mappaTemp....
[ "0.6519", "0.6048538", "0.5991316", "0.5858125", "0.5839421", "0.5836711", "0.5829012", "0.582076", "0.58188117", "0.57817715", "0.5744801", "0.5721798", "0.57147866", "0.57030535", "0.5702282", "0.5678489", "0.56706405", "0.5659324", "0.5648584", "0.56459934", "0.563017", ...
0.0
-1
to login like manager user name and pass manager/manager
function login() { if (location.href.indexOf('login.php') !== -1) { document.getElementById('loginA').addEventListener('click', function () { var name = document.getElementById('username').value; var pass = document.getElementById('password').value; if ((name === 'user') && (pass === 'user')) { alert('Logged Successfully'); location.href = 'home.php'; } else if ((name === 'manager') && (pass === 'manager')) { alert('Logged Successfully'); location.href = 'managerhome.html'; } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doLogin(userName, password){\n\n}", "static async getLogin(ctx) {\n const context = ctx.flash.formdata || {};\n\n // user=email querystring?\n if (ctx.request.query.user) context.username = ctx.request.query.user;\n\n if (context.username) {\n // if username set & ...
[ "0.6678683", "0.66650367", "0.65721667", "0.65551937", "0.63741463", "0.63050944", "0.62986374", "0.6262497", "0.624804", "0.62280893", "0.62198144", "0.61914164", "0.6184897", "0.61746424", "0.61737317", "0.61231035", "0.61044204", "0.6100706", "0.6098712", "0.60715884", "0....
0.0
-1
function showing error message
function showPopUp(message) { var modal = document.getElementById('myModal'); var span = document.getElementsByClassName("close")[0]; var messageP = document.getElementById("message"); messageP.textContent = message; modal.style.display = "block"; span.onclick = function () { modal.style.display = "none"; }; window.onclick = function (event) { if (event.target === modal) { modal.style.display = "none"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showError() {}", "function showError(type, text) {}", "function showErrorMessage(msg) { }", "function showError() {\n showStatus('error');\n}", "showErrorMessage() {}", "function showError() {\r\n console.log(\"There is some error\");\r\n}", "function showError() {\n console.log(\"There w...
[ "0.8691914", "0.83180195", "0.81096506", "0.7912872", "0.7862791", "0.7772021", "0.7553128", "0.74583834", "0.7426294", "0.74205774", "0.7393937", "0.73559994", "0.7350916", "0.7338263", "0.7327685", "0.73043233", "0.73043233", "0.7296762", "0.72808546", "0.72543365", "0.7250...
0.0
-1
itemSelector Toplevel function called by Script Deployment
function itemSelector(request, response) { if (request.getMethod() == 'GET') { //Get the parameters and create the form getParams(request, response); createSelectionForm(request, response); response.writePage(selectionForm); } //POST else { //Check the Search Criteria if(getSearchCriteria(request, response)==true) { postItems(request, response); } else { createSelectionForm(request, response); response.writePage(selectionForm); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectionMitem(item) {\n let titleSelection = $('#' + item + '').attr(\"title\");\n sNameTitle = titleSelection;\n let items = item.replace(\"mItem\", \"mSubItem\") + \"_0\";\n let dataForm = items.substring (items.indexOf('_', items.length)).replace(\"mSubItem_\",\"\")\n $('.collapsible - ...
[ "0.64251363", "0.6165957", "0.61287576", "0.59687084", "0.590061", "0.5897274", "0.58856964", "0.5870555", "0.5834007", "0.58337814", "0.58101183", "0.5810001", "0.58005357", "0.5791584", "0.5781253", "0.5728514", "0.568956", "0.5678085", "0.56746966", "0.56713194", "0.566435...
0.6121593
3
getParams Get the parameter information
function getParams(request, response) { try { custBrandParam = request.getParameter('custparam_brand'); customer = request.getParameter('custparam_cust'); //Set errorDisplay display errorDisplay = 'hidden'; } catch (e) { errorHandler('checkCustomerBrand', e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getParams() {\n return util.copyObject(currentState.params);\n }", "getParams() {\n\t\tlet params = \"?\";\n\t\tparams += \"&key=\" + this.config.apiKey;\n\t\tparams += \"&locatie=\" + this.config.lat + \",\" + this.config.lon;\n\n\t\treturn params;\n\t}", "getParams() {\n const params = {}...
[ "0.69304407", "0.6885752", "0.67742133", "0.66605014", "0.6498137", "0.642117", "0.6397994", "0.636412", "0.63394904", "0.63177556", "0.6313064", "0.6297894", "0.6278161", "0.6248462", "0.62339985", "0.6159306", "0.610189", "0.6084473", "0.6041255", "0.603953", "0.5988341", ...
0.0
-1
createSelectionForm Create an item selection form
function createSelectionForm(request, response) { try { //CreateSselection Form selectionForm = nlapiCreateForm('Add Item',true); //Create Buttons selectionForm.addSubmitButton('Submit'); //Create Fields errorLabel = selectionForm.addField('custpage_errorlabel','text', 'Error').setDefaultValue(errorText); selectionForm.getField('custpage_errorlabel').setDisplaySize(37, 10); selectionForm.getField('custpage_errorlabel').setDisplayType(errorDisplay); hiddenCustomer = selectionForm.addField('custpage_hiddencustomer','integer','Customer Id').setDefaultValue(customer); selectionForm.getField('custpage_hiddencustomer').setDisplaySize(10, 10); selectionForm.getField('custpage_hiddencustomer').setDisplayType('hidden'); hiddencustomerBrand = selectionForm.addField('custpage_hiddencustomerbrand','integer','Customer Brand Id').setDefaultValue(custBrandParam); selectionForm.getField('custpage_hiddencustomerbrand').setDisplaySize(10, 10); selectionForm.getField('custpage_hiddencustomerbrand').setDisplayType('hidden'); //Create SubList itemlines = selectionForm.addSubList('custpage_sublist_itemlines', 'inlineeditor', 'Add Items', 'itemlines'); itemCode = itemlines.addField('custpage_custcol_item', 'text', 'Item Code').setMandatory(true); itemlines.setLineItemValues(itemCode); qty = itemlines.addField('custpage_custcol_quantity', 'integer', 'Quantity').setMandatory(true); itemlines.setLineItemValues(qty); } catch(e) { errorHandler('createSelectionForm ', e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OSelect_XFormItem() {}", "function createSellform(d,item,quant,descid,hash,itemimage,textdesc) {\n var form = document.createElement('form');\n form.setAttribute('name','sellform');\n form.setAttribute('action','managestore.php');\n form.setAttribute('method','post');\n form.setAttribute(...
[ "0.6568907", "0.61604923", "0.60122895", "0.59901494", "0.5973197", "0.5971516", "0.59151924", "0.5914817", "0.5910627", "0.5890022", "0.58494586", "0.58254844", "0.58111006", "0.580995", "0.5785791", "0.5781966", "0.574826", "0.57324183", "0.5718386", "0.56893796", "0.568786...
0.69874
0
postItems Post the Item to the line
function postItems(request, response) { var addNewScript = ''; var url = ''; var scriptId = 0; try { //Check Environment and Account and set the URL if(getEnvironment() && getAccountID()) { // Sandbox 1 scriptId = 162; } else { // Sandbox 2 & Production scriptId = 203; } url = '/app/site/hosting/scriptlet.nl?script=' + scriptId + '&deploy=1&custparam_cust=' + customer + '&custparam_brand=' + customerBrand; addNewScript = '<script type="text/javascript">'; for (var i=1; i <= lineCount; i++) { addNewScript += "window.opener.nlapiSetCurrentLineItemValue(\'item\',\'item\',\'" + itemArray[i-1] + "\', true, true);"; addNewScript += "window.opener.nlapiSetCurrentLineItemValue(\'item\',\'custcol_itemdepartment\',\'" + itemArray[i-1] + "\', true, true);"; addNewScript += "window.opener.nlapiSetCurrentLineItemValue(\'item\',\'quantity\',\'" + qtyArray[i-1] + "\', true, true);"; addNewScript += "window.opener.nlapiCommitLineItem('item');"; } addNewScript += "window.location.href='" + url + "';"; addNewScript += '</script>'; addNewScript += '<body onblur="self.focus();">'; response.write(addNewScript); } catch(e) { errorHandler("postItems ", e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processItems() {}", "function sendItem ( item ) {\n oauth.sendSignedRequest(\n url,\n sendItemHandler,\n {\n 'method': 'POST',\n 'parameters': {\n 'operation': 'insertItem',\n 'message': item.message,\n 'imageUrl': item.imageUrl\n }\n }\n );\n}", "f...
[ "0.6130734", "0.5910054", "0.5888954", "0.55749893", "0.5568133", "0.5446455", "0.54139936", "0.538187", "0.5379793", "0.53779024", "0.5367255", "0.5342791", "0.53397524", "0.5335092", "0.53263664", "0.53146493", "0.5289795", "0.52637213", "0.5241706", "0.5241644", "0.5228958...
0.58456343
3
Adapted from convertsourcemap (MIT)
function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractSourceMap(fs, logger, file) {\n var inline = convert_source_map_1.commentRegex.test(file.text);\n var external = convert_source_map_1.mapFileCommentRegex.exec(file.text);\n if (inline) {\n var inlineSourceMap = convert_source_map_1.fromSource(file.text);\n ...
[ "0.69679236", "0.69377637", "0.67660517", "0.644171", "0.63287604", "0.62983114", "0.6256009", "0.6210124", "0.61941147", "0.61812603", "0.6174446", "0.6158444", "0.6158444", "0.6158444", "0.6154958", "0.60953784", "0.6039884", "0.5989862", "0.5980611", "0.5979347", "0.597915...
0.0
-1
checks if props are coming from yourmenuitem because of edit recipe button
componentDidMount() { if (this.props.menuItem) { const { menuItem } = this.props; const { name, ingredients, directions, categories, id } = menuItem; this.setState({ name, ingredients, directions, categories, id }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isEditMenuItemValid(){\r\n return(EMenuItemNameField.isValid() && EMenuItemDescField.isValid() && EMenuItemValidFromField.isValid() && EMenuItemValidToField.isValid() && EMenuItemPriceField.isValid() && EMenuItemTypePerField.isValid());\r\n }", "function handleEdit(recipe: string, props: State & Wrapp...
[ "0.6741978", "0.6352564", "0.61313254", "0.61196285", "0.6115168", "0.6111925", "0.61020166", "0.60936314", "0.60280794", "0.59706736", "0.59706736", "0.58798563", "0.58744997", "0.5863178", "0.58624846", "0.58619314", "0.5755007", "0.57430243", "0.57375443", "0.56895524", "0...
0.0
-1
arrow functions can not be used as constructors new a();
function outer(){ console.log(this) function inner(){ console.log(this) } inner(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function i(e){return new s.default(function(t){t(a(e))})}", "function temporaryConstructor() {}", "constructur() {}", "function tempCtor() {}", "function o(e){return new a[\"default\"](e)}", "function Foo(a) {\n this.a = a;\n }", "function TempCtor() {}", "function TempCtor() {}", "function...
[ "0.65385205", "0.6372191", "0.6324294", "0.6294236", "0.62859017", "0.61193246", "0.6092351", "0.6092351", "0.6092351", "0.6092351", "0.6092351", "0.6092351", "0.6024952", "0.58751243", "0.58751243", "0.58751243", "0.58751243", "0.58751243", "0.58751243", "0.58751243", "0.587...
0.0
-1
For paginated scrolling, simply scroll the gallery one item in the given // direction and let css scroll snaping handle the specific alignment.
function scrollToNextPage() { gallery_scroller.scrollBy({ left: gallery_item_size, top: 0, behavior: 'smooth' }); // updateBtns() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "scroll(direction) {\n // Keeps the index from going higher than the max length or lower than 0\n if (direction === \"left\") {\n this.currentIndex--;\n } else this.currentIndex++;\n if (this.currentIndex < 0) {\n this.currentIndex = this.indexMax;\n retu...
[ "0.70670897", "0.675597", "0.67098963", "0.6574764", "0.6327665", "0.61983526", "0.6159656", "0.61009616", "0.60126805", "0.5959501", "0.59357655", "0.592107", "0.5913941", "0.58752733", "0.5864747", "0.58629566", "0.5848337", "0.5841379", "0.5838567", "0.58115864", "0.579824...
0.6808054
1
WIN OR TIE GAME?
function winCheck() { if (winGameVertical(0,0) == true || winGameHorizontal(0,0) == true || winGameLeftToRight(2,0) == true || winGameRightToLeft(0,0) == true) { gamewon = true; if (symbol == playerOne.symbol) { P1Wins.innerHTML = (Number(P1Wins.textContent) + 1); turn.textContent = "Player " + playerOne.name + " is the winner!"; } else { P2Wins.innerHTML = (Number(P2Wins.textContent) + 1); turn.textContent = "Player " + playerTwo.name + " is the winner!"; } fillBoard(); tictacbingo = false; symbol = "O"; } else if (symbol == playerOne.symbol) { turn.textContent = "Your turn player " + playerTwo.name + ": O"; } else { turn.textContent = "Your turn player " + playerOne.name + ": X"; } return gamewon }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "winGame() {\n gameWon();\n }", "function votewin() {\n if (!win()) {\n // not win\n night();\n } else {\n // win\n end();\n }\n}", "checkForWin() {\n if (this.numMafia <= 0) { this.gameState = TOWN_WIN; }\n if (this.getInnocentPlayerCount() <= 0) { this.ga...
[ "0.74927545", "0.74479127", "0.74200004", "0.73133266", "0.7248724", "0.72431815", "0.72077996", "0.7194075", "0.7175416", "0.70965385", "0.7077904", "0.7045506", "0.70189595", "0.6998817", "0.69928575", "0.69695824", "0.69667375", "0.69662374", "0.69612616", "0.6946095", "0....
0.0
-1
if winCheck finds a win, THEN: prevent more moves from being made.
function fillBoard() { for (row=0; row < 3; row++) { for (column=0; column < 3; column++) { if (gameboard[row][column].textContent == "") { gameboard[row][column].textContent = " "; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkForWin() {\n if ((this.state.availCells.length <= 4) && (this.state.winner === '')) {\n this.winCheck()\n } else {\n this.nextTurn()\n }\n }", "function checkWin(){\n if ((board.top.col1===board.top.col2 && board.top.col3===\"X\") || (board.top.col1===board.top.col2 && board.top.col3===...
[ "0.7271911", "0.72370684", "0.72306937", "0.72039825", "0.7156855", "0.71302634", "0.71044135", "0.70923954", "0.70907706", "0.70544285", "0.701905", "0.7010281", "0.70058864", "0.69997317", "0.6994093", "0.6987053", "0.6963083", "0.6952513", "0.69363093", "0.6926301", "0.692...
0.0
-1
Fill board with moderator
fillModerator(grid) { for (var x = 0; x < this.nCols; x++) { for (var y = 0; y < this.nRows; y++) { grid[x][y] = new Moderator(x, y, this); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function applyBoard(){\n g_wall = new Wall(g_newBoard,0,0);\n reset();\n}", "function setNewGame() {\n const fieldsArr = board.fields;\n\n for (let i = 0; i <= 64; i++) {\n let startPostion = fieldsArr[i];\n let piece = false;\n\n if (i >= 8 && i <= 15) {\n ...
[ "0.6520373", "0.6321369", "0.6300839", "0.6237424", "0.61506736", "0.6076635", "0.60347265", "0.600643", "0.59284896", "0.5926426", "0.59053224", "0.59016913", "0.58932483", "0.5882883", "0.5870567", "0.58621615", "0.5853807", "0.5834048", "0.58315206", "0.5778541", "0.576403...
0.72101647
0
Fill edges with walls
fillEdges(grid) { for (var x = 0; x < this.nCols; x++) { grid[x][0] = new Wall(x, 0, this); grid[x][this.nRows-1] = new Wall(x, this.nRows-1, this); } for (var y = 1; y < this.nRows-1; y++) { grid[0][y] = new Wall(0, y, this); grid[this.nCols-1][y] = new Wall(this.nCols-1, y, this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fill(edges,inner)\n{\n var r;\n var l;\n var d;\n var u;\n\n var count=0;\n var visited = new Set();\n var visit_later=new Set([intify(inner)]);\n while(visit_later.length != 0)\n {\n v = pointify(Array.from(visit_later)[0]);\n r = intify([v[0]+1,v[1]])\n l = intify([v[0]-1,v[1]])\n d...
[ "0.6780318", "0.665928", "0.6615446", "0.6555187", "0.6404461", "0.6328344", "0.62806356", "0.62559336", "0.622399", "0.620246", "0.6186758", "0.6156086", "0.6133909", "0.6103521", "0.60797733", "0.60089236", "0.5964475", "0.59593767", "0.595872", "0.5914151", "0.59028786", ...
0.76997936
0
Create reactor from genome's data
createReactorFromGenome(genome) { for (var x = 0; x < this.nCols; x++) { for (var y = 0; y < this.nRows; y++) { this.grid[x][y] = new TILE_MAP[genome.grid[x][y]](x, y, this); } } this.fillEdges(this.grid); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mating (parent1, parent2) {\n // Create a child genome\n let child = new Genome();\n\n parent1.neurons.forEach(neuron => {\n child.pushNeuron(neuron.neuron);\n });\n\n parent1.synapses.forEach(synapse => {\n if (parent2.synapses.id == synapse.id) {\n child.pushSynapse(util.randBool(...
[ "0.5178849", "0.51047647", "0.47394875", "0.4737446", "0.46850276", "0.46726274", "0.46125326", "0.46085462", "0.45834824", "0.45480216", "0.45465487", "0.45460716", "0.45187247", "0.45109233", "0.45065793", "0.45057622", "0.44775924", "0.44625717", "0.43933642", "0.43859088", ...
0.65718883
0
Returns the reactor's heat
getTotalHeat() { var totalHeat = 0; for (var x = 0; x < this.nCols; x++) { for (var y = 0; y < this.nRows; y++) { totalHeat += this.grid[x][y].heat; } } return totalHeat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stats(heat) {\r\n\t\t// If max hasn't been set yet or if the value is bigger, use the current value.\r\n\t\tif (typeof max === 'undefined' || heat > max) max = heat;\r\n\t\t// If min hasn't been set yet or if the value is smaller, use the current value.\r\n\t\tif (typeof min === 'undefined' || heat < min)...
[ "0.5725281", "0.5705587", "0.5526374", "0.5522373", "0.55149597", "0.5491786", "0.5486443", "0.53699565", "0.5363011", "0.53147906", "0.5285283", "0.52120245", "0.5204996", "0.51845163", "0.51728326", "0.5164788", "0.5143756", "0.5143756", "0.51254344", "0.50591487", "0.50378...
0.5792577
0
Create a glowing effect
glow(x, y, color) { if ((CONFIG.renderGlow) && !(this.heatOverlay)) { for (var i = 0; i < RENDER.gLayers; i++) { fill(color.r, color.g, color.b, round(255/RENDER.gLayers)); noStroke(); ellipse(x, y, (RENDER.gSize/RENDER.gLayers)*(i+1), (RENDER.gSize/RENDER.gLayers)*(i+1)); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addGlowEffect()\n\t{\n\t\t// clear previous glow interval (if any)\n\t\tif (_glowInterval != null)\n\t\t{\n\t\t\tclearInterval(_glowInterval);\n\t\t}\n\n\t\t// create gradient color generator\n\t\tvar gradient = new Rainbow();\n\t\tvar range = 16;\n\t\tvar index = 0;\n\t\tgradient.setNumberRange(0, range ...
[ "0.77231836", "0.6952363", "0.6822934", "0.68209517", "0.6775819", "0.65353125", "0.63898504", "0.63600284", "0.6336795", "0.63015604", "0.6251064", "0.6248621", "0.6217673", "0.6123779", "0.61117685", "0.6064038", "0.60639983", "0.6039543", "0.60394305", "0.60371625", "0.603...
0.68668896
2
Updates the monitor with information
updateStats() { if (this.visualize) { var ncount = document.getElementById("ncount"); ncount.innerHTML = "Neutron count: " + this.neutrons.length; var meanHeat = document.getElementById("meanHeat"); meanHeat.innerHTML = "Mean heat: " + this.getMeanHeat(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doUpdate () {\n\t\tif (! this.isDisplayConditionActive) {\n\t\t\tthis.setPaused (false);\n\t\t\tthis.clearStage ();\n\t\t\treturn;\n\t\t}\n\t\tconst monitorstatus = App.systemAgent.agentControl.getLocalAgent ().lastStatus.monitorServerStatus;\n\t\tif ((typeof monitorstatus != \"object\") || (monitorstatus == null)...
[ "0.66343194", "0.66332155", "0.64013964", "0.6381926", "0.6253539", "0.624404", "0.6030699", "0.60276973", "0.5897045", "0.582892", "0.5816831", "0.58063763", "0.5788189", "0.5759749", "0.57371235", "0.5726047", "0.57059234", "0.5676226", "0.56720674", "0.5654307", "0.5652041...
0.5376478
46
Here it searches for an email
function contact_response(response,extension) { var doc = new DOMParser() .parseFromString(response.responseText, "text/html"); var i,j, email_val, my_match; if(extension===undefined) extension=''; console.log("in contact_response "+response.finalUrl); var short_name=response.finalUrl.replace(my_query.url,"");//.replace(/[\/]+/g,""); var links=doc.links,email_matches=doc.body.innerHTML.match(email_re); var phone_matches=doc.body.innerText.match(british_phone_re); var replacement=response.finalUrl.match(/^https?:\/\/[^\/]+/)[0]; console.log("replacement="+replacement); var temp_url,curr_url; if(email_matches!==null) { j=0; console.log("email_matches="+JSON.stringify(email_matches)); for(j=0; j < email_matches.length; j++) { if(!MTurk.is_bad_email(email_matches[j]) && email_matches[j].length>0) { my_query.fields.email=email_matches[j]; // document.getElementsByName("Email ")[0].value=my_query.email; break; } } console.log("Found email hop="+my_query.fields.email); } if(phone_matches) { my_query.fields.phoneNumber=phone_matches[0]; } for(i=0; i < links.length; i++) { // console.log("i="+i+", text="+links[i].innerText); if(extension==='') { if(/(Contact|About|Privacy)/i.test(links[i].innerText) && !/^\s*mailto/i.test(links[i].href)) { console.log("blunk"); // console.log(my_query.url.match(/https?:\/\/[^\/]+/)); curr_url=links[i].href; temp_url=window.location.href.replace(/\/$/,""); while(temp_url.split("/").length>=3) { links[i].href=links[i].href.replace(temp_url,replacement); temp_url=temp_url.replace(/\/[^\/]+$/,""); console.log("link="+links[i].href+", temp_url="+temp_url); } let new_link=links[i].href; if(!my_query.queryList.includes(new_link)) { my_query.queryList.push(new_link); console.log("*** Following link labeled "+links[i].innerText+" to "+new_link); get_page(new_link, contact_response,"NOEXTENSION"); } } } //if(my_query.fields.email.length>0) break; if(links[i].dataset.encEmail!==undefined) { console.log("### "+links[i].dataset.encEmail); let temp_email=MTurkScript.prototype.swrot13(links[i].dataset.encEmail.replace(/\[at\]/,"@")); console.log("### "+temp_email); if(!MTurkScript.prototype.is_bad_email(temp_email)) { my_query.fields.email=temp_email; } } if(links[i].href.indexOf("amazonaws.com")===-1 && links[i].href.indexOf("mturkcontent.com")===-1) { // console.log(short_name+": ("+i+")="+links[i].href); } if(links[i].href.indexOf("cdn-cgi/l/email-protection#")!==-1) { var encoded_match=links[i].href.match(/#(.*)$/); if(encoded_match!==null) { email_val=MTurkScript.prototype.cfDecodeEmail(encoded_match[1]); console.log("DECODED "+email_val); if(!MTurkScript.prototype.is_bad_email(email_val.replace(/\?.*$/,""))) { my_query.fields.email=email_val.replace(/\?.*$/,""); my_query.doneEmail=true; } } } if(email_re.test(links[i].href.replace(/^mailto:\s*/,""))) { email_val=links[i].href.replace(/^mailto:\s*/,"").match(email_re); console.log("Found emailBlop="+email_val); if(email_val.length>0 && !MTurkScript.prototype.is_bad_email(email_val)) { console.log("set email"); my_query.fields.email=email_val; } } if(links[i].href.indexOf("javascript:location.href")!==-1) { my_match=links[i].href.match(/String\.fromCharCode\(([^\)]+)\)/); console.log("my_match="+JSON.stringify(my_match)); var match_split=my_match[1].split(","); email_val=""; for(j=0; j < match_split.length; j++) { email_val=email_val+String.fromCharCode(match_split[j].trim()); } //email_val=String.fromCharCode(my_match[1]); console.log("new email_val="+email_val); my_query.fields.email=email_val; } if(links[i].href.indexOf("javascript:DeCryptX(")!==-1) { my_match=links[i].href.match(/DeCryptX\(\'([^\)]+)\'\)/); console.log("my_match="+JSON.stringify(my_match)); email_val=MTurkScript.prototype.DecryptX(my_match[1]); console.log("new email_val="+email_val); my_query.fields.email=email_val; } if(/^tel:/.test(links[i].href)) { my_query.fields.phoneNumber=links[i].href.replace(/^tel:/,""); console.log("Found phone="+my_query.fields.phoneNumber); } } console.log("my_query="+JSON.stringify(my_query)); if(my_query.fields.email.length>0 && document.getElementById("email").value.length===0) { document.getElementById("email").value=my_query.fields.email; /* if(!my_query.submitted) { my_query.submitted=true; check_and_submit(check_function,automate); }*/ } if(extension==='') { my_query.doneWeb=true; } else { my_query.doneQueries++; } add_to_sheet(); submit_if_done(); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emailSearch(email) {\n desk.get('cases/search/',{email: email, sort_field:'created_at', sort_direction: 'desc'}, function(error, data) {\n if (data._embedded.entries.length > 0) {\n caseAttachment(data._embedded.entries[0].id)\n } else if (data._embedded.entries.length < 1) {\n ...
[ "0.77180046", "0.7529995", "0.72207934", "0.70810175", "0.6808174", "0.67928135", "0.67781824", "0.6744428", "0.6671264", "0.6648262", "0.6627082", "0.6610432", "0.653376", "0.65091103", "0.64861715", "0.6445668", "0.6442297", "0.63982964", "0.6391133", "0.6388537", "0.637803...
0.0
-1
Search on bing for search_str, parse bing response with callback
function query_search(search_str, resolve,reject, callback) { console.log("Searching with bing for "+search_str); var search_URIBing='https://www.bing.com/search?q='+ encodeURIComponent(search_str)+"&first=1&rdr=1"; GM_xmlhttpRequest({method: 'GET', url: search_URIBing, onload: function(response) { callback(response, resolve, reject); }, onerror: function(response) { reject("Fail"); }, ontimeout: function(response) { reject("Fail"); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function query_search(search_str, resolve,reject, callback,type,filters) {\n console.log(\"Searching with bing for \"+search_str);\n if(!filters) filters=\"\";\n var search_URIBing='https://www.bing.com/search?q='+\n encodeURIComponent(search_str)+\"&filters=\"+filters+\"&first=1&rd...
[ "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.73907745", "0.7368026", "0.73543155", "0.73543155", "0.73543155", "0.7196501", "0.6733122", "0.6420894", "0.6346361", "0.6180528", "0.6147053", "0.6122946", "0.6...
0.7414053
2
Following the finding the district stuff
function query_promise_then(result) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function districtSets() {\n let defaultFilter = feature => {\n return (\n feature.properties.SWCDIST_N &&\n feature.properties.SWCDIST_N.match(/\\s+[0-9]+$/)\n );\n };\n let defaultGrouping = feature => {\n return feature.properties.SWCDIST;\n };\n let defaultParser = input => {\n // Get...
[ "0.6800403", "0.6655514", "0.6353948", "0.6333048", "0.6284119", "0.61306876", "0.60741776", "0.6042948", "0.60080963", "0.59532034", "0.58715427", "0.5793652", "0.5790668", "0.5774097", "0.5755154", "0.57330287", "0.5723503", "0.57139504", "0.5684567", "0.56777835", "0.56468...
0.0
-1
Detail: Factorials, as we defined them, should only be calculated for nonnegative integers. However, the function we wrote doesn't verify if its argument is valid or not. Can you add the necessary checks? Try to avoid repeated, redundant tests!
function fact(n) { if (n < 0) { return 0; } else if (n === 0) { return 1; } else { return n * fact(n - 1); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function factorialZeros(n) {\n // mathy problem\n}", "function factorial(value){ \n if (typeof(+value) != \"number\") \n return \"Its not a number. try again!\" \n if (value <= 0) \n return 1 \n return value * factorial(value-1) \n}", "function factorial(number) { // Recibe un...
[ "0.7552674", "0.7503302", "0.746183", "0.7442232", "0.7394075", "0.738543", "0.73772234", "0.73387", "0.7323305", "0.73103005", "0.7286367", "0.7284619", "0.7265239", "0.7256822", "0.72537756", "0.72420716", "0.7231157", "0.7231157", "0.7225532", "0.7221759", "0.7218096", "...
0.0
-1
We need a function which handles requests and send response.this is a single server to handle both client registration and sending push notifs.
function handleRequest(request, response){ var jsonString = ''; var id=''; if (request.method == 'POST') { request.on('data', function (data) { jsonString += data; }); request.on('end', function () { console.log(JSON.parse(jsonString)); id=JSON.parse(jsonString).regId; var fs = require('fs'); fs.appendFile('Registration_Id.txt', id+"\n", function (err) { if(err) { return console.log(err); } console.log("The file was saved!"); }); }); response.writeHead(200, {"Content-Type": "text/plain"}); response.write("FIST"); //response.end("Hello World\n"); } else { var fs = require('fs'); fs.readFile('Registration_Id.txt', function(err, data) { if(err) throw err; var array = data.toString().split("\n"); uniqueArray = array.filter(function(elem, pos) { return array.indexOf(elem) == pos; }) for(i in uniqueArray) { if(uniqueArray[i]!=''){ console.log(uniqueArray[i]); pushnotif(uniqueArray[i]); } } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleServerRequest()\n{\n\t//send data to the div or html element for notifications\n}", "function onRequest(request, response){\n\tvar command = \trequest.headers[\"command\"]\n\tvar deviceIP = \trequest.headers[\"tuyapi-ip\"]\n\t\n\tvar cmdRcvd = \"\\n\\r\" + new Date() + \"\\r\\nIP: \" + deviceIP + ...
[ "0.64631295", "0.6420052", "0.6390667", "0.6386358", "0.6368065", "0.62666863", "0.62128633", "0.6205268", "0.61738414", "0.6150401", "0.606214", "0.60494465", "0.6041068", "0.6037845", "0.6031522", "0.601927", "0.6010661", "0.5996427", "0.5984185", "0.5979232", "0.5976719", ...
0.5648917
57
Generating markup for each position from the array of the bookmarks. Stored in the model module in 'state' variable. Called in the controller module.
_generateMarkup() { return this._data.map(result => PreviewView.render(result, false)).join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderBookmarkList() {\n \n \n const bookmarkItemsString = generateBookmarksString(store.bookmarks);\n \n // insert that HTML into the DOM\n $('.js-bookmark-list').html(bookmarkItemsString);\n \n\n}", "function createBookmarksList(bookmarks) {\n\n // Reset next bookmark ID\n BookmarkShowcas...
[ "0.6540716", "0.622713", "0.60755736", "0.5915292", "0.56479", "0.55604416", "0.55351645", "0.5514224", "0.54078996", "0.53795403", "0.5367853", "0.51981914", "0.518914", "0.5187464", "0.5167791", "0.5146413", "0.51034963", "0.5086719", "0.5007213", "0.49874547", "0.49817076"...
0.49227783
28
class helper functions from bonzo
function welcome(){ var nickname = 'Hello, Halo, Hi.' $('#nickname').html(nickname) var t = new Date() var hour =t.getHours() var gretting = 'Good Morning !' if (hour >= 9 && hour <12){ gretting = 'Good Later Morning !' } if (hour >= 12 && hour <14){ gretting = 'Good Middle Day !' } if (hour >= 14 && hour <18){ gretting = 'Good Afternoon !' } if (hour >= 18 && hour <20){ gretting = 'Good Evening !' } if (hour >= 20 && hour <23){ gretting = 'Good Night !' } if (hour >= 23 && hour <24){ gretting = 'Good Later Night !' } if (hour >= 24 && hour <6){ gretting = 'Nice Dream !' } $('#gretting').html(gretting) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function HelperConstructor() {}", "obtain(){}", "function hobbitPrototype(){}", "function Bevy() {}", "function _beeswarm () {} // constructor ???", "transient protected internal function m189...
[ "0.60303414", "0.6020362", "0.6020362", "0.6013159", "0.5998919", "0.5954897", "0.59544575", "0.59524184", "0.5907265", "0.5897004", "0.5897004", "0.5885336", "0.58415973", "0.58415973", "0.58415973", "0.58415973", "0.5839296", "0.5778861", "0.5773885", "0.5765922", "0.576217...
0.0
-1
TODO: adjust this to corep2p
__filterPeers (peers) { let filteredPeers = peers .filter(peer => peer.status === 'OK') .filter(peer => peer.ip !== '127.0.0.1') filteredPeers = orderBy(filteredPeers, ['height', 'delay'], ['desc', 'asc']) const networkHeight = filteredPeers[0].height return { networkHeight, peers: filteredPeers .filter(peer => Math.abs(peer.height - networkHeight) <= 10) .map(peer => (`${peer.ip}:${peer.port}`)) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get PSP2() {}", "private public function m246() {}", "obtain(){}", "get Prologic() {}", "transient private protected internal function m182() {}", "private internal function m248() {}", "set PSP2(value) {}", "constructPdpData() {\n const { productItem } = this.state;\n const { gtmDataLayer } = ...
[ "0.60746676", "0.5352841", "0.52485436", "0.51821196", "0.51505977", "0.5141365", "0.49691093", "0.49618715", "0.49363482", "0.48408335", "0.4803663", "0.4758082", "0.4723983", "0.4706467", "0.4681579", "0.4676185", "0.46706092", "0.46465266", "0.4643425", "0.46395966", "0.46...
0.0
-1
const [buttonClick, setButtonClick] = useState([true, false]);
function sortData(dataA) { if (order.column === 'Name') { const DATA = sortString(dataA); return DATA; } const DATA = sortNumber(dataA); return DATA; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buttonClicked() {\n this.setState({\n button_clicked: true\n })\n }", "handleClick() {\n this.setState({ devModeOn : !this.state.devModeOn });\n }", "handleClick( item ) {\n this.setState( prevState => ( \n { [ item ]: !prevState[ item ] } \n ) )\n }", "handleClick( item ) {...
[ "0.6907572", "0.6715152", "0.66576374", "0.66576374", "0.66321546", "0.66091675", "0.6592989", "0.6592443", "0.6576014", "0.6515604", "0.6511741", "0.6510355", "0.64627206", "0.64487743", "0.64435005", "0.644126", "0.6411399", "0.6411399", "0.6411399", "0.63956875", "0.636485...
0.0
-1
open the popup Form
function openForm(){ document.getElementById("myForm").style.display = "block"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showPopupFormular() {\r\n $(\"#\" + global.Element.PopupFormular).modal(\"show\");\r\n }", "function showPopupElementFormular() {\r\n $(\"#\" + global.Element.PopupElementFormular).modal(\"show\");\r\n }", "function openModalForm(){\n createForm();\n openModalWindow();\n}", "fu...
[ "0.7928303", "0.7556579", "0.7388117", "0.73147434", "0.7191848", "0.7182122", "0.7030674", "0.6980471", "0.69788677", "0.69731677", "0.68084675", "0.6800486", "0.67939425", "0.67939425", "0.67651755", "0.67256606", "0.671159", "0.65500116", "0.6547953", "0.65468943", "0.6542...
0.0
-1
close the popup Form
function closeForm() { document.getElementById("myForm").style.display = "none"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "close() {\n super.close();\n this._popupForm.reset();\n }", "function closeForm() {\r\n document.getElementById(\"popupForm\").style.display = \"none\";\r\n document.getElementById(\"taForm\").style.display = \"none\";\r\n document.getElementById(\"anmtForm\").style.display = \"none\";\r\n}", "...
[ "0.842297", "0.8010219", "0.800799", "0.78565913", "0.78311396", "0.77245045", "0.767624", "0.767624", "0.7561124", "0.7459362", "0.74384135", "0.7411449", "0.73706293", "0.73184854", "0.7302026", "0.7291647", "0.7288605", "0.7269356", "0.7205403", "0.71939963", "0.71902674",...
0.7137235
31
for details on configuring this project to bundle and minify static web assets. Write your Javascript code.
async function Test() { await CefSharp.BindObjectAsync("boundAsync"); console.log("this is Html"); boundAsync.div(9, 1).then(function (rs) { //document.URL = "http://www.baidu.com"; self.location = "http://www.baidu.com"; alert(rs); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function javascript() {\n return gulp.src('src/assets/js/*.js')\n //.pipe($.sourcemaps.init())\n //.pipe($.babel())\n //.pipe($.concat('appfou.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n ...
[ "0.6974635", "0.69583184", "0.68143684", "0.66433996", "0.6574842", "0.6558184", "0.64963174", "0.6483537", "0.64761007", "0.646632", "0.6450911", "0.64255106", "0.64230084", "0.6411383", "0.63389003", "0.63328975", "0.63192475", "0.6311831", "0.629543", "0.62642235", "0.6260...
0.0
-1
PIN CATEGORY SIDE BAR
function category_pin() { var category_div = document.getElementById('category_sidebar'); category_div.className = 'pinned'; var button = document.getElementById('category_pin_button'); button.innerHTML = 'открепить'; button.onclick = function(){category_unpin();}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function category_unpin()\n {\n var category_div = document.getElementById('category_sidebar');\n category_div.className = '';\n var button = document.getElementById('category_pin_button');\n button.innerHTML = 'закрепить';\n button.onclick = function(){category_pin();};\n }", "function pinSidebar(pin)...
[ "0.6158295", "0.60753703", "0.591074", "0.5605908", "0.54719955", "0.5331518", "0.53056294", "0.5298818", "0.5294535", "0.52878004", "0.5282211", "0.5244853", "0.51596785", "0.513349", "0.5128288", "0.51180726", "0.5116166", "0.5092711", "0.50923866", "0.5052136", "0.50391245...
0.6795635
0
UNPIN CATEGORY SIDE BAR
function category_unpin() { var category_div = document.getElementById('category_sidebar'); category_div.className = ''; var button = document.getElementById('category_pin_button'); button.innerHTML = 'закрепить'; button.onclick = function(){category_pin();}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function category_pin()\n {\n var category_div = document.getElementById('category_sidebar');\n category_div.className = 'pinned';\n var button = document.getElementById('category_pin_button');\n button.innerHTML = 'открепить';\n button.onclick = function(){category_unpin();};\n }", "function S...
[ "0.6633049", "0.61525327", "0.5794614", "0.5732173", "0.5698377", "0.5660663", "0.56453115", "0.5632748", "0.5581395", "0.5539151", "0.5536879", "0.5531846", "0.5501331", "0.547862", "0.5447614", "0.54385215", "0.54380804", "0.5434021", "0.5430503", "0.5367485", "0.5366992", ...
0.6570702
1
Drag functionality of beaker
function dragAndDrop_Beaker(current_test_beaker_name) { machine_container.getChildByName(current_test_beaker_name).on("pressmove", function(evt) { evt.target.x = evt.stageX-60; evt.target.y = evt.stageY-60; tub_current_position_x = evt.stageX; tub_current_position_y = evt.stageY; enable_disable_beaker(false) /** Disabling the mouseEnabled functionality of other beakers */ machine_container.getChildByName(current_test_beaker_name).mouseEnabled = true; }); /**Drop functionality of Beaker. */ machine_container.getChildByName(current_test_beaker_name).on("pressup", function(evt) { if (tub_current_position_x > hit_image_x && tub_current_position_y < hit_image_y && tub_current_position_x < hit_max_x && tub_current_position_y > hit_max_y) { /**Finding the Drop area of the Beaker. */ /** setting the beaker in the bottom of the machine */ machine_container.getChildByName(current_test_beaker_name).x = beaker_drop_x; machine_container.getChildByName(current_test_beaker_name).y = beaker_drop_y; enable_aspirate(scope)/** enabling the aspirate button */ scope.sample_disable=true; /** It disabling the sample drop-down */ scope.test_disable=true;/** It disabling the test drop-down */ scope.$apply(); if(aspirate_flag && sample_selected_flag){ /* if the fruit juice is selected */ scope.aspirate_disable=true; /** It disabling the aspirate button */ scope.start_test_disable=false; /** It enables the "start test" button */ scope.$apply(); } } else { revertBeakers() /** calling the revertBeakers function for replace the beakers in its original position */ } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startDrag(x, y) {}", "function drag(e){\ndraggedItem=e.target;\ndragging=true;\n}", "function CdkDragDrop() {}", "function CdkDragDrop() {}", "function win_drag_start(ftWin){draggingShape = true;}", "drag_feedback(){\r\n this.dragging = true;\r\n }", "function drag(e) {\n draggedItem = e.t...
[ "0.72728145", "0.71896046", "0.71252334", "0.71252334", "0.7117768", "0.71021706", "0.7099971", "0.7083431", "0.70378935", "0.7032791", "0.7032791", "0.7032663", "0.7023351", "0.69985044", "0.6993123", "0.6983251", "0.6983251", "0.69374585", "0.6927577", "0.6911308", "0.69061...
0.7129158
2
Change the test depends on the selection from the dropdown box
function test_ChangeOption(scope) { selected_Test = scope.first_test; current_test=selected_Test; scope.sample_disable=true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test_dialog_dropdown_ui_values_in_the_dropdown_should_be_visible_in_edit_mode() {}", "function test_user_should_be_able_to_change_the_order_of_values_of_the_drop_down_list() {}", "fashionselect(){\n cy.get('.border-left-0').click();\n cy.get('.dropdown-menu >').contains('Fashion').then(o...
[ "0.67946875", "0.6755283", "0.6581949", "0.65648925", "0.65648925", "0.6526555", "0.6436549", "0.6434502", "0.6424533", "0.6420319", "0.6415478", "0.6392609", "0.63565344", "0.63557845", "0.635174", "0.63439506", "0.62650853", "0.6246674", "0.6242976", "0.6237628", "0.6232605...
0.7133847
0
Change the juice sample on the selection from the dropdown box
function samplechangeOption(scope) { selected_sample =scope.select_sample; sample_number= parseInt(selected_sample)+5; for (var i = 5; i < 15; i++) { var _beaker_name = "beaker_" + i; beaker_name_container = machine_container.getChildByName(_beaker_name); beaker_name_container.visible=false; } machine_container.getChildByName("beaker_"+sample_number).visible=true; if(sample_number>=6){ sample_selected_flag=true; enable_disable_beaker(false) scope.test_disable=true; } else{ sample_selected_flag=false; enable_disable_beaker(true) scope.test_disable=false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function optionChanged() {\n // Obtain selected sample from dropdown\n var selectedSample = Plotly.d3.select('select').property('value'); \n console.log('selectsamle_value : ' , selectedSample)\n // Call plot function with the new sample value\n fillOutTable(selectedSample);\n buildCharts(selecte...
[ "0.66189796", "0.6478805", "0.6455171", "0.6378742", "0.6339185", "0.62233233", "0.6163575", "0.61579686", "0.6103114", "0.6088636", "0.6085081", "0.60725796", "0.6068693", "0.6038692", "0.6037897", "0.60126996", "0.5999956", "0.5995459", "0.59934384", "0.5974364", "0.5973837...
0.6771794
0
function for aspirate the sample
function aspirateSample(scope){ aspirate_flag=true; if(current_test==0){ machine_stage.getChildByName("test_1").text = beaker_values[current_test_beaker_number-1]+" ppm"; changeFlame(1); } else{ machine_stage.getChildByName("test_1").text = beaker_values[current_test_beaker_number-1]+" ppm"; changeFlame(0); if(current_test_beaker_number == 1){ changeFlame(1); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Sample() {}", "Next() {\r\n return this.InternalSample();\r\n }", "readSample() {\n return 0;\n }", "function loopRecordedSample(name) {\n }", "function displayInitialSample(){\n\t\t//probably call it when starwars is clicked\n\t\tclearInfo();\n\t\t$spanInfo.html(\"<h4><b>Sample pie...
[ "0.640226", "0.63033336", "0.6285483", "0.6206293", "0.6042451", "0.59828913", "0.5927889", "0.5922859", "0.5878001", "0.58676636", "0.5837722", "0.5830816", "0.581275", "0.5781232", "0.5768793", "0.5758464", "0.5747044", "0.57237124", "0.5721485", "0.5719678", "0.5716194", ...
0.67916924
0
Function for changing the flames inside the machine
function changeFlame(flame){ if(flame==1){ machine_container.getChildByName("normal_flame").visible = true; machine_container.getChildByName("second_flame").visible = false; } else{ machine_container.getChildByName("normal_flame").visible = false; machine_container.getChildByName("second_flame").visible = true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lightMode() {\n change(\n \"rgb(255 255 255 / 50%)\",\n \"rgb(0 0 0 / 50%)\",\n \"Light Mode\",\n \"fa-moon\",\n \"fa-sun\",\n \"img/undraw_proud_coder_light.svg\",\n \"img/undraw_feeling_proud_light.svg\",\n \"img/undraw_conceptual_idea_light.svg\"\n );\n \n}", "function flak...
[ "0.6119707", "0.589232", "0.5880041", "0.584753", "0.58289", "0.58140135", "0.5796855", "0.5793538", "0.5757344", "0.5730048", "0.5710642", "0.5705972", "0.5695456", "0.5693474", "0.5683954", "0.5680432", "0.56637627", "0.5646314", "0.56396985", "0.56367624", "0.56318754", ...
0.66716665
0
function for start the test
function start_test(scope){ if(current_test==0){ machine_stage.getChildByName("test_1").text = kplus_test_values[current_test_beaker_number-6] +" ppm"; changeFlame(1); } else{ machine_stage.getChildByName("test_1").text = naplus_test_values[current_test_beaker_number-6] +" ppm"; changeFlame(0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "run_test() { start_tests(); }", "function runStart()/* : void*/\n {\n this.setUp();\n }", "function start() {\n console.log('Starting!');\n test1();\n}", "function testRun()\r\n{\r\n}", "function run_test() {\n do_calendar_startup(run_next_test);\n}", "function run(){\n\n\tdescri...
[ "0.8165839", "0.7585207", "0.7422914", "0.7390192", "0.72263736", "0.71169496", "0.6816433", "0.67840767", "0.6733656", "0.6729169", "0.67176247", "0.6673616", "0.6666806", "0.6640745", "0.6632733", "0.6607318", "0.6569699", "0.6543394", "0.6543394", "0.6543394", "0.6543394",...
0.694906
6
Function nicked from gmail
function el(id) { if (document.getElementById) { return document.getElementById(id); } else if (window[id]) { return window[id]; } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GmailAccount() {\n}", "private public function m246() {}", "function SeamonkeyImportMail() {}", "function bindEventToGmail() {\n // Check if there is opening email then hide ad right panel.\n var currentRightPanel = $('.Bu.y3')[0];\n if (!currentRightPanel) {\n return;\n }\n\n // Show unl cu...
[ "0.63145924", "0.60169244", "0.60107625", "0.5780003", "0.57477105", "0.5689678", "0.564821", "0.5619129", "0.56028223", "0.5600195", "0.55948657", "0.5582043", "0.5581148", "0.55789864", "0.5576217", "0.55668026", "0.5545331", "0.5524189", "0.5514364", "0.5513864", "0.548390...
0.0
-1
Set to 1 when images have been downloaded Load the images
function LoadImages() { var loadedImages = 0; var numImages = 0; for (var src in ImgList) { numImages++; } for (var src in ImgList) { Imgs[src] = new Image(); Imgs[src].onload = function() { loadedImages = loadedImages +1; if(loadedImages >= numImages) { //Finished loading! tstsetup(); ImgsFinished = 1; } }; if (src < 6) { Imgs[src].src = ImgList[src]; } else { Imgs[src].src = ImgURL + ImgList[src]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function imageLoaded() {\n loadedImages++;\n if (loadedImages === totalImages) {\n ready = true;\n loader.hidden = true;\n count = 30;\n }\n}", "function imageLoaded(){\n imagesLoaded++;\n if(imagesLoaded === totallImages){\n ready =true;\n loader.hidden = true;\n count = 1...
[ "0.78154147", "0.76731503", "0.7651768", "0.76379204", "0.7622793", "0.7595641", "0.7566192", "0.7477516", "0.7469799", "0.7428003", "0.73923427", "0.73823583", "0.7355395", "0.73309684", "0.731137", "0.7300096", "0.72339004", "0.7187371", "0.71635747", "0.71390754", "0.71042...
0.6895601
37
Rename this later you mug
function LolWut() { //Change fill and outline colours simpleText.setFill((getRandomColour())); simpleText.setStroke((getRandomColour())); //stage.draw(); //Redraw text simpleText.draw(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rename () {\n }", "getName(newName) {\n this.name = newName;\n }", "function changeName(newName){\n\tthis.currentName = newName;\n}", "rename(newName) {\n this.name = newName;\n return this;\n }", "setName(name) { }", "set name(newName) {\n\t this.setName(newName);\n\t }",...
[ "0.7268357", "0.6747382", "0.6700619", "0.65855426", "0.64010906", "0.63651925", "0.6355663", "0.63196933", "0.63040966", "0.6279242", "0.6273887", "0.6270998", "0.6261195", "0.61612344", "0.61239976", "0.60722333", "0.60643995", "0.60387176", "0.59874266", "0.5928104", "0.59...
0.0
-1
Generate colours, modified from something found on S.O.
function makeid() { var text = ""; var possible = "ABCDEF0123456789"; for(var i=0;i<6;i++) text += possible.charAt(Math.floor(Math.random() * possible.length)); return text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colorGen($usr) {\n var hexArray = GM_getValue(\"hexArrayStore\", \"\") || [];\n var tempArray = [];\n\n // Convert string to hex\n var hexStr = $usr.text();\n var result = \"\";\n for (var i=0; i<hexStr.length; i++) {\n result += hexStr.charCodeAt(i).to...
[ "0.7444679", "0.73473984", "0.7258371", "0.72360754", "0.7078691", "0.6997037", "0.6968734", "0.69417775", "0.6917109", "0.68845403", "0.6883309", "0.68771887", "0.686044", "0.686044", "0.68508625", "0.68232095", "0.68117523", "0.67966133", "0.6775468", "0.67696106", "0.67657...
0.0
-1
Moves and draws the text
function testSin() { //Local counter, increment t (x-position) and refresh the stage var i = 0; t = t-0.14; stage.draw(); var Drawn = 0; //Draw out the text! while (i < sctext.length) { //Only bother to print out chars that are inside the canvas if (i*spacing+t*10 < 0-1.5*spacing) { //Not visible, ignore } else if (i*spacing+t*10 < sw) { //Draw char! Drawn++; sinText.setText(sctext[i]); sinText.setX(i*spacing+t*10); if (mode == 1) { //Upwards sinText.setY(110+1.2*Math.tan(t+i*2)*10); } else if (mode == 2) { //Sideways-S if (i*spacing+t*10 > 300) { // sinText.setY(110+1.2*Math.pow(2, -(60-(t+i*2)))*10); sinText.setY(110+1.2*Math.pow(2, i*spacing+t*10-640)*10); } else { sinText.setY(110+1.2*-Math.pow(2, -(i*spacing+t*10)+20)*10); } } else if (mode == 3) { //Downwards sinText.setY(110+1.2*Math.tan(-(t+i*2))*10); } else { //Wave sinText.setY(110+1.2*Math.sin(t+i*2)*10); } sinText.setStroke(textcol[i]); // sinText.setFill(textcol[i]); sinText.draw(); } else { //Why recheck other characters when we're outside the frame! break; } ++i; } //Clear the text to stop overlapping sinText.setText(''); if (Drawn == 0 && t < 0) { //Finished drawing. t = 70; if (Finished == 0) { sctext = "~~ Still here? ;) Wait for it! ♥ xx ~~"; Finished++; } else if (Finished == 1) { sctext = "Extra Special Greets: Tom Von Annie Liz DCB West Cpt.Snow Christopher Lemon Walv Derp Sarge Eskimo Podder Emily"; //Text Finished++; setTimeout(DoCode, 50); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n drawText();\n}", "function drawText()\n\t{\n\t\t// Figure out the correct text\n\t\tvar text = getText();\n\n\t\twid = that.add('text', {\n\t\t\ttext: text,\n\t\t\tcolor: style.color,\n\t\t\tfont: style.font,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\t// Set the width of the widget\n\t\tthat.w...
[ "0.76521015", "0.7532574", "0.75104934", "0.741328", "0.7272683", "0.7173339", "0.7138787", "0.7132935", "0.71317434", "0.7123729", "0.7100793", "0.7090229", "0.70706534", "0.70541763", "0.69711286", "0.6970651", "0.6964934", "0.69635653", "0.695962", "0.69258195", "0.6902727...
0.0
-1
Change the mode of the text
function changeSinMode() { mode = mode +1; if (mode > 3) { mode = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function textLevel(mode)\r\n{\r\n textMode = mode;\r\n console.log(textMode);\r\n return textMode;\r\n}", "function changeTextMode(field, mode)\n{\n\tif(mode != 1)\n\t{\n\t\tfield.readOnly = true;\n\t\tfield.style.backgroundColor = \"#E1E1E1\";\n\t}\n\telse\n\t{\n\t\tfield.readOnly = false;\n\t\tfield.style.b...
[ "0.719321", "0.71184945", "0.68040085", "0.67591006", "0.67067283", "0.6601631", "0.6566229", "0.6476135", "0.6411494", "0.6344079", "0.6280976", "0.6205678", "0.61954355", "0.6161406", "0.6143829", "0.61231166", "0.6118049", "0.6083623", "0.60792536", "0.60662776", "0.604398...
0.0
-1
A statushoz tartozo szamok
makeDict() { const dict = {}; const { invitations } = this.state; invitations.forEach((inv) => { dict[inv.status] = 0; }); invitations.forEach((inv) => { dict[inv.status] += 1; }); this.setState({ statusDict: dict }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayBackgroundUpdateStatus(taustapaivityksenTila) {\n var finished = taustapaivityksenTila.valmistui\n var statusBeginning = taustapaivityksenTila.kaynnistetty\n ? 'Viimeisin päivitys ' +\n taustapaivityksenTila.hakujenMaara +\n ' haulle on käynnistetty ' +\n taustapaivityksenTila.k...
[ "0.63136774", "0.62519157", "0.6028023", "0.60214186", "0.60138637", "0.5973966", "0.59630316", "0.5940255", "0.5894286", "0.5839702", "0.5812421", "0.58088833", "0.57781154", "0.5743223", "0.5742213", "0.5737909", "0.5720811", "0.5720736", "0.5717034", "0.5688482", "0.568549...
0.0
-1
purple color scale: "F0EEFE" "D9D4FC" "ACA0F9" "705BF4" "4327F1" "331EB7" "281791" "1B1060"
function CustomizingThemes() { return ( <Block display="flex" justifyContent="center"> <img src={assetUrl("./mockup_themes.png")} width="60%" /> </Block> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeColorScale() {\n var blue = chroma('darkblue');\n var red = chroma('darkred');\n var white = chroma('white');\n return scale = [[0, blue.css()], [0.35, white.css()], [0.5, white.css()], [0.65, white.css()], [1, red.css()]];\n}", "function color() {\n var map = {\n \"black\" : [ 0/...
[ "0.7524565", "0.7207855", "0.7112867", "0.70557415", "0.6801171", "0.6801171", "0.6800588", "0.6800588", "0.6800588", "0.6789981", "0.6785671", "0.67202264", "0.66722125", "0.66661465", "0.6655424", "0.66240686", "0.6600711", "0.65752125", "0.65680337", "0.6561414", "0.655890...
0.0
-1
Toggle children on clickProc.
function clickProc(d, textclicked) { if (CheckSelectionClick()) { return; } //exit function if it was a panning click, instead of a selection click if (d.expertise_intern) {//zuklappen d._expertise_intern = d.expertise_intern; d.expertise_intern = null; expertise_intern_shown=false; } else { //aufklappen d.expertise_intern = d._expertise_intern; d._expertise_intern = null; } if (d.expertise_extern) {//zuklappen d._expertise_extern = d.expertise_extern; d.expertise_extern = null; expertise_extern_shown=false; } else { //aufklappen d.expertise_extern = d._expertise_extern; d._expertise_extern = null; } collapseExpertise(getRoot(d),d); // console.log(d); updateproc(d); /* vis.attr("transform", "translate(" + d.y + "," + d.x + ")" );*/ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleChildren() {\n\t\tthis.setState({\n\t\t\tlinksVisible: !this.state.linksVisible\n\t\t});\n\t}", "function toggle_sidebar_sublist()\n{\n $(\".navbar_right_sidebar .sidebar_main_item.expandable\").click(function(){\n var child_container=$(this).find(\".subele_container\");\n if (child_contai...
[ "0.6737321", "0.663927", "0.6420604", "0.64026815", "0.62457526", "0.62280923", "0.61911494", "0.61800927", "0.61721647", "0.6154921", "0.6134101", "0.6124957", "0.61043066", "0.6100964", "0.60912746", "0.6042099", "0.60410625", "0.60364926", "0.6025569", "0.6017601", "0.6005...
0.0
-1
Click sur une Carte
function Jouer(objID) { // La Carte ne doit pas être retournée if(Tirage && objID.className != "Front") { Tirage = false; if(LastCarte == null) { objID.className = "Front"; objID.style.backgroundImage = "url("+ArrayDonne[objID.id]+".jpg)"; LastCarte = objID; Tirage = true; } else { if(LastCarte.id != objID.id && objID.className != "Front") { // Retourne la Carte et Affiche sa Valeur/Image objID.className = "Front"; objID.style.backgroundImage = "url("+ArrayDonne[objID.id]+".jpg)"; // Si les deux Cartes sont DIFFÉRENTE if(ArrayDonne[objID.id] != ArrayDonne[LastCarte.id]) { // Declenche le Temporisateur a = setTimeout( "ResetChoix(" + objID.id + ", "+ LastCarte.id + ")", Tempor); LastCarte = null; } else { // Les Deux Cartes sont EGALE LastCarte = null; Count ++; PairesOk ++; document.getElementById('paires').innerHTML = PairesOk; // Si Tout Gagner (nbr de paires) if(Count == (NbrValeur/2)) { Gagner ++; document.getElementById('NbrGagner').innerHTML = Gagner; document.getElementById('Rejouer').disabled = false; } Tirage = true; } Tentative ++; document.getElementById('Try').innerHTML = Tentative; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "click() { }", "function clickElement(el) {\r\n\t/*var clickMouse = document.createEvent(\"MouseEvents\");\r\n\tclickMouse.initMouseEvent(\"click\", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\r\n\tplaybutton.dispatchEvent(clickMouse);*/\r\n\tvar clickUI = document.createEvent(\"UIEve...
[ "0.7109835", "0.6932361", "0.68938094", "0.68671274", "0.68282276", "0.67586887", "0.67577577", "0.6745214", "0.6737549", "0.6737549", "0.67135024", "0.67135024", "0.67135024", "0.67135024", "0.67135024", "0.67135024", "0.66657233", "0.66607606", "0.665433", "0.6601053", "0.6...
0.0
-1
Check symbols inside combinations
function checkCombines(symbol) { let hasWinner = false; //In each win line we check symbol in every rectangle winCombines.forEach(winLine => { const isWin = winLine.every(rect => rect.dataset.symbol === symbol); if (isWin) { hasWinner = true; winLine.forEach(rect => rect.classList.add('win')); gameField.removeEventListener('click', gameClickHandler); infoTxt.textContent = 'Winner is --->'; infoTxt.style.color = 'rgb(189, 135, 250)'; restartBtn.classList.add('pulse'); } }); return hasWinner; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkwin(cells,symbol) {\n return winCombination.some((combination) => {\n return combination.every(function(idx) {\n if (cells[idx].firstChild !== null) {\n return cells[idx].firstChild.getAttribute('value') === symbol;\n } else {\n return false;\n }\n ...
[ "0.6485642", "0.63190293", "0.6194346", "0.61056167", "0.60941476", "0.607304", "0.59655255", "0.5926665", "0.5824737", "0.5817394", "0.57199466", "0.5695219", "0.56815994", "0.56677413", "0.56654525", "0.5638078", "0.5628671", "0.56219906", "0.56219715", "0.55694383", "0.556...
0.60770273
5
Enable / Disable form button when user filled input
function keyupInput() { if(!!parseFloat(document.getElementById('value').value)) { document.getElementById("Button").disabled = false; document.getElementById("Button").style.backgroundColor = '#edc298'; } else { document.getElementById("Button").disabled = true; document.getElementById("Button").style.backgroundColor = '#9e8065'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enableButton() {\n const input = document.querySelector('.form-input');\n const button = document.querySelector('.form-submit');\n input.onkeyup = () => {\n if (input.value.length > 0) {\n button.disabled = false;\n }\n else {\n button.disabled = true;\n }\n };\n}", "function c...
[ "0.7383982", "0.72251654", "0.715211", "0.7132965", "0.70729905", "0.7038714", "0.70330554", "0.7024157", "0.69708055", "0.69494426", "0.69272727", "0.6921037", "0.69065183", "0.68852717", "0.6884972", "0.68826354", "0.68753934", "0.6831376", "0.68268913", "0.68108326", "0.67...
0.0
-1
matcheds 3rd party API output to CSS emotion
emotionPicker() { let emotionalRendering; console.log("this is this.props.emotionInput ", this.props.emotionInput) if (this.props.emotionInput == "Verypositive") { emotionalRendering = <input id="happy" type="radio" name="smiley" defaultValue="Happy" checked={true} className="emotion-radio"/> console.log("Emotion component will choose happy face") } else if (this.props.emotionInput == "Positive") { emotionalRendering = <input id="happy" type="radio" name="smiley" defaultValue="Happy" checked={true} className="emotion-radio"/> console.log("Emotion component will choose happy face") } else if (this.props.emotionInput == "Negative") { emotionalRendering = <input id="angry" type="radio" name="smiley" defaultValue="Angry" checked={true} className="emotion-radio"/> console.log("Emotion component will choose mad face") } else if (this.props.emotionInput == "Neutral") { emotionalRendering = <input id="normal" type="radio" name="smiley" defaultValue="Normal" checked={true} className="emotion-radio"/> console.log("Emotion component will choose neutral face") } else if (this.props.emotionInput == "Verynegative") { emotionalRendering = <input id="furious" type="radio" name="smiley" defaultValue="Furious" checked={true} className="emotion-radio"/> console.log("Emotion component will choose furious mad face") } else { console.log("Emotion cannot be chosen, incorrect input") } return emotionalRendering; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_css$l() {\n\tvar style = element(\"style\");\n\tstyle.id = \"svelte-18ymnss-style\";\n\tstyle.textContent = \".wrapper.svelte-18ymnss.svelte-18ymnss{height:var(--size);width:var(--size);position:relative;display:flex;justify-content:center;align-items:center}.wrapper.svelte-18ymnss .svelte-18ymnss{lin...
[ "0.56144387", "0.5477976", "0.54674333", "0.5443159", "0.542435", "0.5397282", "0.53913593", "0.53876346", "0.5385852", "0.5382102", "0.5381167", "0.53371596", "0.53367007", "0.5330744", "0.5330494", "0.53286934", "0.53247344", "0.5306069", "0.52652663", "0.526246", "0.525572...
0.0
-1
Takes a word as a parameter and returns a transfromed word.
function wordToPigLatin(word) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translate(word)\n{\n return Language[word]\n\n}", "function convertWord(word) {\n if(word === 'rock') return 'Rock';\n if(word === 'paper') return 'Paper';\n if(word === 'scissors') return 'Scissors';\n if(word === 'lizard') return 'Lizard';\n if(word === 'spock') return 'Spock';\n}", ...
[ "0.72567374", "0.71669793", "0.6810853", "0.6765785", "0.6718004", "0.671184", "0.670803", "0.6661229", "0.66438144", "0.6583307", "0.6566228", "0.65311337", "0.6511276", "0.6511276", "0.64981335", "0.64792794", "0.64601904", "0.64423484", "0.6375535", "0.6375535", "0.6362439...
0.6539626
11
form submit delete empty file table
function delEmptyFileTable() { var arrDelNum = new Array(); var tmpSort = 0; $("[name=attanames]").each(function(i){ var attanamesId = $(this).attr("id"); var delNum = attanamesId.replace('attaname',''); var delFileInfo = ''; if(document.getElementsByName('attafiles') !=null && document.getElementsByName('attafiles')[i] != null) delFileInfo = document.getElementsByName('attafiles')[i].value; var delFileInfoPath = ''; if(document.getElementsByName('savePath') != null && document.getElementsByName('savePath')[i] != null) delFileInfoPath = document.getElementsByName('savePath')[i].value; if(delFileInfo== null || delFileInfo == '') { if(delFileInfoPath== null || delFileInfoPath == '') { arrDelNum[tmpSort] = parseInt(delNum); tmpSort++; } } }); for(var i= 0;i<arrDelNum.length;i++) { deleteRow(arrDelNum[i]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fileDeleted(){\n let form = this\n let file = ''\n $('#fileupload').bind('fileuploaddestroy', function (e, data) {\n // remove inputs named 'selected_files[]' that will interfere with the back end\n $(\"input[name='selected_files[]']\").remove();\n $(\"input[name='sf_ids']\").ea...
[ "0.7204416", "0.6918951", "0.6832437", "0.6826155", "0.67882264", "0.67180246", "0.6670666", "0.66552645", "0.6595723", "0.6572796", "0.6497151", "0.64416236", "0.6421615", "0.63921726", "0.638505", "0.6349582", "0.63241607", "0.6256853", "0.62384754", "0.6091419", "0.6085645...
0.7063793
1