query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
create a function (algorithm) called "war" that takes two cards as parameters, compares them and returns a winner. A tie should return false.
function war(playerOneCard, playerTwoCard) { if (playerOneCard.number > playerTwoCard.number) { return playerOneCard; } else if (playerOneCard.number < playerTwoCard.number) { return playerTwoCard; } else { // If they are equal return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareWar(player, comp) {\n //if player's War card value is greater than the computer's War card value, player wins the tie\n if ((player % 13) > (comp % 13)) {\n //updates result section of the game board\n $('.result').html(\"Player wins!\");\n\n //pushes entire war array to ...
[ "0.74828345", "0.7019913", "0.6826457", "0.6821639", "0.6799728", "0.67607445", "0.6699715", "0.66931355", "0.6677971", "0.6675553", "0.6654929", "0.6625725", "0.6615082", "0.66123503", "0.65557176", "0.65177274", "0.65110135", "0.65082216", "0.6496393", "0.64850646", "0.6481...
0.75912756
0
create a play function compare the cards give the winner both cards (at end of deck)
function play() { var playerOneCard = cards_player_1[0]; var playerTwoCard = cards_player_2[0]; // card1 for player 1 deck, card2 for player 2 deck var winningCard = war(playerOneCard, playerTwoCard); if (winningCard === playerOneCard) { var firstCard = cards_player_1.shift(); var secondCard = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playRound() {\n if (cardValue.indexOf(deck1[0]) > cardValue.indexOf(deck2[0])) {\n moveToBack(deck1, deck1, 1);\n moveToBack(deck2, deck1, 1);\n }\n else if (cardValue.indexOf(deck2[0]) > cardValue.indexOf(deck1[0])) {\n moveToBack(deck1, deck2, 1);\n moveToBack(deck2,...
[ "0.8012061", "0.747832", "0.74550784", "0.73119766", "0.73081833", "0.72832054", "0.7278703", "0.72307986", "0.72267836", "0.7223607", "0.72155446", "0.7207747", "0.7194559", "0.7171687", "0.7171177", "0.7130349", "0.708381", "0.7079424", "0.70693725", "0.7064962", "0.7058880...
0.783534
1
Global Animator Controls Step through animations in given order
function step () { // Kick off animation if (!global_animator.started) { global_animator.animate(); } // Animate the Es to Scale if (global_animator.value >= (a_e_s.ratio * a_e_s.order) && !a_e_s.started) { // a_e_s.msec = global_animator.msec * a_e_s.ratio; a_e_s.animate(); } // // Animate th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createAnimations() {\r\n //#region Idle animation\r\n // Idle front\r\n this.anims.create({\r\n key: 'idle_front',\r\n frames: [\r\n {\r\n key: 'idle_front_0'\r\n },\r\n {\r\n key: 'idle_fr...
[ "0.6720101", "0.6594722", "0.6571702", "0.64699006", "0.6415734", "0.6414564", "0.6364853", "0.6351516", "0.6351516", "0.6313889", "0.6302441", "0.62908494", "0.6207539", "0.61855286", "0.6127771", "0.6123004", "0.61137927", "0.61115175", "0.6100287", "0.6089761", "0.60873246...
0.70661145
0
Get commits for repository
function getCommits(repos) { return new Promise((resolve, reject) => { setTimeout(() => { console.log('Calling Github API for getting commits...'); resolve({ commit1: ['file11', 'file12', 'file13'], commit2: ['file21', 'file22'] }); }, 2000); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCommits(gitPath) {\n return git.Repository.open(gitPath)\n .then(function(repo) {\n var allReferences = getAllReferences(repo);\n\n return Promise.filter(allReferences, function(reference) {\n return reference.match(/refs\\/heads\\/.*/);\n })\n .map(function...
[ "0.75178885", "0.74887496", "0.7395175", "0.7328341", "0.7284176", "0.7249618", "0.70097625", "0.69437546", "0.6898289", "0.68397593", "0.6839161", "0.68352926", "0.68042785", "0.67515755", "0.66883475", "0.66167295", "0.65766126", "0.6553917", "0.654996", "0.6535876", "0.649...
0.757561
0
delete() PURPOSE: Deletes the first instance of a given item from the list. equals() must be implemented for the item given.
delete(item){ if(!('equals' in item)){ //check if equals() exists throw new Error('Item given has no equals() implementation.\n'); } let curr = this.head; let prev = null; let found = false; //just do a linear search while(curr != null && !found){ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteListItem() {\n item.remove();\n }", "deleteFromList() {\n list.splice((this.id), 1)\n }", "removeItem(item) {\n var index = this.indexOf(item);\n if (index !== -1) {\n this.splice(index, 1);\n }\n }", "function handleDeleteItem(item){\n \...
[ "0.6993394", "0.68805057", "0.67707884", "0.6729824", "0.66888326", "0.66076344", "0.65447843", "0.64970523", "0.6496343", "0.64458096", "0.6442227", "0.64150316", "0.63334304", "0.63300943", "0.6321891", "0.6321891", "0.6321891", "0.6308941", "0.6295929", "0.6285216", "0.627...
0.7075051
0
returns a reversed linked list.
reverse(){ let original = this.iterator(); let curr = this.head; let out = new LinkedList(); //empty while(curr != null){ //non empty out.addFront(new ListItem(curr.getData())); curr = curr.getNext(); } return out; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reverse(){\n if(this.length < 1) return null;\n let node = this.head; // switches the head and tail\n this.head = this.tail;\n this.tail = node;\n let prev = null; // assigns prev to start as null\n let next;\n for(let i = 0; i < this.length; i++) {\n next = node.next; // updates next up ...
[ "0.83582735", "0.8293734", "0.8262213", "0.8238207", "0.82315046", "0.82303524", "0.8216269", "0.8195312", "0.81806713", "0.8166619", "0.8148352", "0.8143796", "0.8140126", "0.8120936", "0.7982918", "0.7963064", "0.78972965", "0.7881622", "0.78717846", "0.7865748", "0.7864991...
0.8327891
1
to be nested in the draw function! Lines should be drawn first so they are covered. this might duplicate lines however, inefficient just iterates through neighbors, and draws connecting lines
drawEdges(){ push(); let x1 = this.getX(); let y1 = this.getY(); let neighborList = this.neighbors.iterator(); strokeWeight(EDGE_WEIGHT); while(!neighborList.isEmpty()){ let neighborVert = neighborList.currItem(); let x2 = neighborVert.getX();...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawAllLines(){\n\tclearLines();\n\tvar nodesToBeDrawn = [];\n\t//create new array of objects ordered by id, with int list of indexes of linked nodes\n\tvar val = GJSONOrdered;\n\tGJSONOrdered.forEach(function(elem){\n\t\tnodesToBeDrawn[elem.properties.id] = {\n\t\t\t'node': elem, \n\t\t\t'linesToDo': ele...
[ "0.6985831", "0.6843124", "0.67318916", "0.6707312", "0.66488427", "0.6523839", "0.6514557", "0.6514276", "0.6498333", "0.64260167", "0.63356173", "0.63283163", "0.6310824", "0.6307423", "0.62975097", "0.62602377", "0.625461", "0.6250087", "0.6244336", "0.62183803", "0.617694...
0.70518076
0
will remove itself from neighbors' lists.
delete(){ let neighborList = this.neighbors.iterator(); while(!neighborList.isEmpty()){ neighborList.currItem().removeNeighbor(this); //remove this from its list neighborList.next(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFromNeighborLists(type, neighborList, vertex, graph) {\n\n $.each(neighborList, function () {\n\n var currentVertice = this;\n if (type === 'sink' || type === 'largestDegree') {\n $.each(graph.adjacencyList[currentVertice[1]].neighborsOut, function (index) {\n ...
[ "0.67847836", "0.6546088", "0.61292744", "0.6067261", "0.60062903", "0.5953369", "0.59268194", "0.5839516", "0.5829278", "0.58214813", "0.58132386", "0.5810339", "0.5787763", "0.575301", "0.5689128", "0.5687309", "0.5684159", "0.5676347", "0.56738466", "0.5654171", "0.5641952...
0.8059927
0
sets the burned variable to true for all stages >= 'stage'.
setBurned(stage){ if(this.burned == null){ console.log("here"); } for(let i = stage; i < this.burned.length; i++){ this.burned[i] = true; //set all future stages to true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function burn() { }", "function burn(my) {\n entities.forEach(function(element) {\n if (element.showburn) {\n let loc = returnRandomRingPoint(element.size * 2.2)\n //console.log(loc)\n var o = new Entity({\n x: element.x + loc.x,\n y: element.y +...
[ "0.5345176", "0.5268118", "0.5182364", "0.51702356", "0.51573676", "0.514824", "0.51160187", "0.5086736", "0.50808966", "0.4947419", "0.49233726", "0.4921267", "0.4908306", "0.48607266", "0.48594868", "0.48576257", "0.4825717", "0.4794851", "0.4788436", "0.4788436", "0.477083...
0.8313876
0
returns an iterator for the shapes.
shapeIterator(){ return this.vertices.iterator(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShapeIter(arcs) {\n this._arcs = arcs;\n this._i = 0;\n this._n = 0;\n this.x = 0;\n this.y = 0;\n // this.i = -1;\n }", "function readNextShape(i) {\n return shxBin ?\n readIndexedShape(shpFile, shxBin, i) :\n readNonIndexedShape(shpFile, shpOffset, i);\n }", ...
[ "0.68155044", "0.6152976", "0.61099833", "0.5704382", "0.5684093", "0.56380624", "0.5369495", "0.53528756", "0.53326106", "0.53307945", "0.5326207", "0.52644986", "0.519182", "0.5191755", "0.5188964", "0.51840985", "0.5120911", "0.5116434", "0.5116434", "0.51019347", "0.50624...
0.7576608
0
draws the graph using OOP principles, easy
drawGraph(){ let shapes = this.vertices.iterator(); while(!shapes.isEmpty()){ shapes.currItem().drawEdges(); shapes.next(); } shapes = this.vertices.iterator(); while(!shapes.isEmpty()){ shapes.currItem().draw(this.currentStage); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw() {\n // Set up the nodes and links of the graph.\n this.addNodes();\n this.addLinks();\n\n // Create the d3 simulation.\n this.createSimulation();\n\n // Set up SVG to draw the simulation.\n this.setupSvg();\n }", "display() {\n stroke([204, 0, 255, 100]);\n strokeWeight(1);\n ...
[ "0.73449653", "0.7032666", "0.69444114", "0.69290495", "0.69228494", "0.68685913", "0.6864763", "0.67820036", "0.6720063", "0.6693839", "0.66897744", "0.6649702", "0.65841657", "0.652908", "0.6509022", "0.64926636", "0.6482225", "0.64819986", "0.6475074", "0.6473707", "0.6466...
0.73542863
0
assume it is removing the currently selected vertex
delVertex(){ if(this.selectedVert != null){ this.selectedVert.delete(); this.vertices.delete(this.selectedVert); this.selectedVert = null; //pretty simple using OOP } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeVertex(vertex) {\n // remove from vertices\n let index = this.vertices.indexOf(vertex);\n this.vertices.splice(index, 1);\n // remove from adjacencyList\n delete this.adjacencyList[vertex];\n\n for (const prop in this.adjacencyList) {\n index = this.adjacencyList[prop].indexOf(vertex);...
[ "0.7387021", "0.7281", "0.7174953", "0.715263", "0.715263", "0.71367514", "0.7134863", "0.7029284", "0.69905376", "0.69202876", "0.69202876", "0.6897645", "0.68828976", "0.68546927", "0.6845989", "0.68236727", "0.67964244", "0.6773757", "0.67017007", "0.66847074", "0.66225445...
0.83416003
0
when not adding an edge, make sure we don't keep old data
resetNewEdge(){ this.newEdge1 = null; this.newEdge2 = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkandaddEdge(edge) {\n\tvar found = cy.$id(\"edge_\" + edge.identity.low);\n\tif (found[\"length\"] == 0) {\n\t\tvar output = {\n\t\t\t\tid: \"edge_\" + edge.identity.low,\n\t\t\t\tneo4j_id: edge.identity.low,\n\t\t\t\tneo4j_type: edge.type,\n\t\t\t\tsource: \"node_\" + edge.start.low,\n\t\t\t\ttarget:...
[ "0.6656079", "0.65793556", "0.65731305", "0.6413454", "0.6228403", "0.6209547", "0.6209547", "0.62071365", "0.6154401", "0.6132703", "0.6129147", "0.6067382", "0.60563815", "0.60543615", "0.6009067", "0.5942291", "0.59316945", "0.59314394", "0.5910667", "0.5909129", "0.589887...
0.6698708
0
runBurnAlgorithm() PURPOSE: Runs the approximation algorithm for burning a graph. This is the bulk of the program, it was a pain, it follows the algorithm in 'Approximation Algorithms for Graph Burning' by Anthony Bonato and Shahin Kamali. LOTS OF OVERHEAD Performs a BFS. Has to track the depth which is a pain, but it ...
runBurnAlgorithm(){ let MAXIMUM = Math.ceil(this.vertices.getLength()/2.0); //conjectured this is the maximum amt of rounds. //we want to build up to maximum, so maybe we can find smaller solutions! let currMin = Math.ceil(MAXIMUM/2); //minimum rounds desired, use integers, start at half the max...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function burn() { }", "function burn(my) {\n entities.forEach(function(element) {\n if (element.showburn) {\n let loc = returnRandomRingPoint(element.size * 2.2)\n //console.log(loc)\n var o = new Entity({\n x: element.x + loc.x,\n y: element.y +...
[ "0.6147107", "0.5417378", "0.5390907", "0.5344995", "0.5312226", "0.52524954", "0.52317435", "0.5213816", "0.5213816", "0.5197905", "0.5196491", "0.51775783", "0.5166253", "0.51492155", "0.50747687", "0.50108975", "0.50075537", "0.49984", "0.4990022", "0.49819484", "0.4974860...
0.6762047
0
more of a private function checks if all vertices have burned simple iteration fo the array
verticesBurned(burnedArray){ let out = true; //assume true until proven false if(burnedArray instanceof Array){ let shapes = this.vertices.iterator(); while(!shapes.isEmpty()){ if(!burnedArray[shapes.currItem().getNumber()-1]){ //found one that isn't burned yet ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkIntersection(){\n // check that there are enough vertices\n if (index <= 2)\n return false;\n // create an array of edges to test against\n var test_intersection = [];\n // for each identified edge pair set loop through\n for ( var i = 0; i < edges.length; i++) {\n // ...
[ "0.6683381", "0.6546082", "0.6387933", "0.6354421", "0.6286063", "0.6212334", "0.6198339", "0.609385", "0.60552555", "0.60461456", "0.6038062", "0.60302055", "0.6021254", "0.5993517", "0.5976883", "0.5965765", "0.5962777", "0.59523517", "0.5919983", "0.5892735", "0.58862275",...
0.70497817
0
checkBackgroundHit() Shouldn't have to check for this, as if the user misses all other shapes. then we know he hit the background. Should run when the mouse is dragged!
checkBackgroundHit(){ //we need increments in terms of the world coordinates system, //not mouse coords, so we must convert first. let MOUSE_ADJUSTMENT = 1.5; let incrX = (mouseX - pmouseX) / (width/MOUSE_ADJUSTMENT); //need constants!, this isn't perfect... let incrY = -(mouseY...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mouseMoved(e){\n //Construct a very small rectangle on the mouse position\n var mouseRect = {x: e.clientX - 5, y: e.clientY - 5, width: 2, height: 2};\n\n //Check if the mouse rect collides with our button rectangle\n //And assign the bool that returns from the function\n this.highlighted = this.col...
[ "0.67747456", "0.62949854", "0.6219975", "0.6198166", "0.6198166", "0.6176016", "0.6175115", "0.6174033", "0.6097954", "0.60707235", "0.60701734", "0.60122746", "0.5976409", "0.5966489", "0.5936003", "0.5922458", "0.5905811", "0.58821005", "0.58525294", "0.5849395", "0.584208...
0.80740505
0
first and second arguments must be defined above variables (posts and viewer)
function showPosts(posts, viewer, skip, amount) { viewer.showPhotoPosts(posts, skip, amount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayPost(post) {\r\n\r\n}", "function displayPosts(posts) {\r\n\t// use helper function displayPost\r\n\r\n}", "function addPost(post, viewer) {\n\n\tif (!posts.addPhotoPost(post)) {\n\t\treturn false; \n\t}\n\tviewer.showPost(post);\n\tviewer.incrementShown();\n\treturn true;\n}", "async myPos...
[ "0.685299", "0.6482765", "0.6394334", "0.6053808", "0.60441256", "0.60412735", "0.60347414", "0.60098684", "0.5967455", "0.59504724", "0.58884585", "0.58508795", "0.58163977", "0.5810924", "0.5709963", "0.5699033", "0.56741285", "0.5669106", "0.5663162", "0.5660491", "0.56527...
0.6936788
0
edit post; argument post must be an instance of the class Post /first and second arguments must be defined above variables (posts and viewer)
function editPost(posts, viewer, id, new_post) { if (!posts.editPhotoPost(id, new_post)) { return false; } viewer.redrawPost(id, new_post); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editPost(data) {\n User\n .posts.updateById(\n {\n id: vm.userId,\n fk: $stateParams.id\n },\n {\n title: data.title,\n content: data.content\n })\n .$promise\n .then(function() {\n $state.go('postDetail', {...
[ "0.74830097", "0.728677", "0.7231087", "0.7171018", "0.7091467", "0.7035922", "0.70138454", "0.7005446", "0.6996618", "0.68928593", "0.6762687", "0.6688201", "0.66791636", "0.66784596", "0.6677989", "0.6651517", "0.66413605", "0.65967655", "0.65886337", "0.6578781", "0.656539...
0.8079778
0
Initialises the button events that handle, joining, creating and leaving a peer connection room, this function also initialises the peer connection with the provided rtc configurations. Note, you can use this function for any additioanl events you need to have started before interacting with the app.
function init() { createRoomBtn.addEventListener("click", createRoom); joinRoomBtn.addEventListener("click", joinRoom); pc = new RTCPeerConnection(rtcconfig); initDataChannel(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connect() {\n\n\n var username = document.getElementById(\"userNameField\").value;\n var password = document.getElementById(\"passwordField\").value;\n if (username) {\n easyrtc.setUsername(username);\n }\n if (password) {\n easyrtc.setCredential({password: password});\n }\...
[ "0.6430267", "0.62941086", "0.62868184", "0.62795085", "0.6233619", "0.61833644", "0.6115071", "0.60685545", "0.60679287", "0.6060601", "0.60125875", "0.59535116", "0.5934446", "0.592658", "0.5904581", "0.58981293", "0.5871307", "0.5836731", "0.5784728", "0.5720406", "0.56878...
0.75258166
0
This function initialises the data channel on the peer connection in order to exchange messages
function initDataChannel() { dc = pc.createDataChannel("chat", { negotiated: true, id: 0 }); pc.oniceconnectionstatechange = (e) => { log(pc.iceConnectionState); if (pc.iceConnectionState === "disconnected") attemptReconnection(); }; dc.onopen = () => { console.log("chat open"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupDataChannel() {\n\t\tcheckDataChannelState();\n\t\tdataChannel.onopen = checkDataChannelState;\n\t\tdataChannel.onclose = checkDataChannelState;\n\t\tdataChannel.onmessage = Reversi.remoteMessage;\n\t}", "prepareDataChannel(channel) {\n channel.onopen = () => {\n log('WebRTC DataChannel ope...
[ "0.800714", "0.7249754", "0.69297004", "0.6914545", "0.6872356", "0.68171006", "0.6815895", "0.66889477", "0.6658007", "0.6563877", "0.650288", "0.64780295", "0.64560807", "0.6401314", "0.63978565", "0.63978565", "0.6394132", "0.6390291", "0.634031", "0.63230515", "0.62922376...
0.72606766
1
generates random code which creates a session and allows other users to join the session
function generateCode() { sessionCode = ""; var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; for (var i = 0; i < 6; i++) { sessionCode += characters.charAt(Math.floor(Math.random() * characters.length)); } // console.log(sessionCode); return sessionCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createNewSessionNumber(){\n\treturn Math.floor(Math.random()*1000000);//create a random number between 0-999999\n}", "function createSessionToken() {\n return secureRandom.randomArray(40).map(code => code.toString(16)).join('')\n}", "createSession () {\n\t\tlet token;\n\n\t\twhile (true) {\n\t\t\tt...
[ "0.74117965", "0.7185953", "0.71013683", "0.6932836", "0.68811387", "0.67452484", "0.67358696", "0.6712081", "0.6699312", "0.6638223", "0.65672934", "0.64600456", "0.64600456", "0.643213", "0.6403607", "0.63875926", "0.63620245", "0.63461775", "0.62933654", "0.62854517", "0.6...
0.7422852
0
Tracks a single button click using Google Analytics. You can use the _trackEvent command to track user interactions with different parts of your extension.
function trackButton(button_id) { _gaq.push(['_trackEvent', 'button' + button_id, 'clicked']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function trackButtonClick(e) {\n _gaq.push(['_trackEvent', e.target.id, 'clicked']);\n}", "function trackClicks(e) {\n _gaq.push(['_trackEvent', e.target.id, 'clicked']);\n }", "function trackSignupClick (e) {\n var buttonId = e.currentTarget.getAttribute('id');\n var pageId = document.que...
[ "0.81427616", "0.6965515", "0.67851", "0.6516604", "0.6516604", "0.6364836", "0.6325016", "0.6298218", "0.62758666", "0.6262052", "0.62338275", "0.62008077", "0.6198174", "0.61520636", "0.6151199", "0.61183596", "0.6106798", "0.5974471", "0.5972289", "0.5884608", "0.5827154",...
0.77811253
1
highlight hyperlinks and embed images
function markupHyperLinks(str){ var reg = new RegExp(/[-a-zA-Z0-9@:%_\+.~#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~#?&//=]*)?/gi); var match = str.match(reg); var res = ""; if(match != null) match.forEach( function(e){ var tmp = str.split(e)[0]; if(tmp != "") res...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "autolink() {\n const linkRegex = new RegExp(`(https?://\\\\S+\\\\.\\\\S+)\\\\s`, 'ig');\n const editor = this.getEditor();\n const content = editor.getDocument().toString();\n let match;\n while ((match = linkRegex.exec(content))) {\n const url = match[1];\n if (isURL(url)) {\n cons...
[ "0.63040763", "0.62004167", "0.61538863", "0.61436844", "0.61099", "0.59337926", "0.59092385", "0.59092385", "0.59092385", "0.57955813", "0.5793348", "0.57904494", "0.57899994", "0.57477367", "0.5743323", "0.57340324", "0.57255465", "0.57250535", "0.5686699", "0.5679983", "0....
0.6262632
1
Generate html for observatory thumbnails (PC)
function buildObservatoryThumbs() { // iterate through observatories array (PC) for (let i = 0; i < observatories.length; i++) { // declare htmlString var and add relevant html (PC) let htmlString = "<a class='obsThumb' href='#obs" + observatories[i].id + "'>"; htmlString += "<img src='" + observatories[i].thum...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateThumbnailElement() {\n var element;\n element += \"<a class='fancybox-button' rel='fancybox-button' href='images/Zetica_RASC_DC_main.png' title='Screenshot of main dash board'>\";\n element += \"<img class='thumbnail' src='images/Zetica_RASC_DC_main.png' alt='' />\";\n ...
[ "0.64248604", "0.63472986", "0.6157598", "0.61572045", "0.6139394", "0.6139393", "0.6093247", "0.6076156", "0.5995683", "0.59826654", "0.5971718", "0.5962038", "0.5945808", "0.592767", "0.59259087", "0.59163964", "0.5906079", "0.58879346", "0.58649427", "0.58492905", "0.57695...
0.7093614
0
Calculate number of observatories and place in first pane (PC)
function setNumObservatoriesOnline() { document.getElementById("obsOnline").innerHTML = observatories.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connCount() {\n var connCount = []\n for (var pixelid = 0; pixelid < 50; pixelid++) {\n connCount.push(null)\n var room = mobilesock.adapter.rooms[pixelid]\n if (room) {\n phones = pixelid\n connCount[pixelid] = room.length\n } else {\n connCount[pixelid] = 0\n }\n }\n pa...
[ "0.5723035", "0.5620106", "0.5545998", "0.5504202", "0.53691703", "0.5262134", "0.5257086", "0.5251354", "0.52403337", "0.52214885", "0.5217464", "0.5213207", "0.516868", "0.51563674", "0.51477706", "0.5135645", "0.51231015", "0.51168394", "0.5113032", "0.5097217", "0.5089134...
0.670112
0
Place prices from observatories array into the price fields (PC)
function populatePrices() { // iterate through observatories (PC) for (let i = 0; i < observatories.length; i++) { // Put price into relevant element id, e.g. #price0 for Palomar (PC) document.getElementById("price" + i).innerHTML = observatories[i].price; // Same for the initial badge state (PC) document.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function priceRepair(objArray) {\n \n for(i = 0; i < objArray.length; i++) {\n \n objArray[i].price = parseFloat(objArray[i].price);\n }\n}", "function makeMultiprice(response, locality) {\n traverseAndCollect(response, \"editorials.technicals.products.price\").forEach(function(price) {\n...
[ "0.56844294", "0.5642143", "0.56408256", "0.5457933", "0.54453766", "0.5404565", "0.54037833", "0.5358339", "0.5354846", "0.5306591", "0.52998877", "0.52687216", "0.525624", "0.52499694", "0.5239789", "0.5232773", "0.5231143", "0.52299315", "0.5226771", "0.52149206", "0.51934...
0.76009715
0
Read and set up shopping cart stuff (PC)
function initCart() { // If there's a cart already in the local storage... (PC) if (localStorage.cart) { // put the storage into our live array (PC) cartStorageToArray(); // update the cart icon badge in the nav bar (PC) updateCartIcon(); // update the shopping cart modal with the existing entries (PC) po...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setupCart()\r\n\t{\r\n\t\tthis.cart = {};\r\n\t\tthis.cart.id = Str.random(10);\r\n\t\tthis.cart.items = [];\r\n\t\tthis.cart.favorites = [];\r\n\t\tCookie.set(this.settings.cookie_name, this.cart, 2);\r\n\t}", "function loadCart() {\n productsInCart = JSON.parse(sessionStorage.getItem('shoppingCart')...
[ "0.69621074", "0.67975694", "0.6796627", "0.66069454", "0.6569758", "0.6557353", "0.6557353", "0.6496037", "0.64271206", "0.6393055", "0.63839835", "0.6362585", "0.63607603", "0.6321002", "0.6319479", "0.63159096", "0.63156134", "0.63082933", "0.6289952", "0.6275868", "0.6261...
0.71793526
0
update the cart icon badge in the nav bar (PC)
function updateCartIcon() { // if there's nothing in the cart (PC) if (cart.length == 0) { // remove the badge (PC) document.getElementById("navBadge").innerHTML = ""; document.getElementById("navBadgeMobile").innerHTML = ""; } else { // else update the badge contents with the number of items in cart (PC) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateCartIcon(arr) {\n const cartIcon = document.querySelector(\".badge\");\n if (arr) {\n cartIcon.innerHTML = arr.length;\n }\n}", "function updateCartIcon(arr) {\n const cartIcon = document.querySelector(\".badge\");\n if (arr) {\n cartIcon.innerHTML = arr.length;\n }\n}", "function up...
[ "0.7452691", "0.7452691", "0.7407573", "0.7378215", "0.71689785", "0.7157504", "0.7086284", "0.68406445", "0.67769814", "0.6665205", "0.66275316", "0.648846", "0.64863294", "0.645855", "0.6370361", "0.62531704", "0.62316525", "0.6201432", "0.61799085", "0.6179791", "0.6154624...
0.8599989
0
Function to add a coupon to the cart (PC)
function addCoupon() { // Hide the invalid coupon warning (PC) $("#invalidCoupon").hide(); // Get coupon code from input box (PC) let theCode = $("#couponInput").val(); // Boolean if coupon code is found in array (PC) let foundCoupon = false; // Iterate through coupons array (PC) for (let i = 0; i < coupons.len...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCoupon(code) {\n if (_.isDefined(code)) {\n $lastPromise = $$\n .postCartDiscounts({ code: code })\n .then(onSyncd);\n }\n\n return _this_;\n }", "function updateCoupons() {\n\t// Clear the coupon list div (PC)\n\t$(\"#couponDetailsHolder\").html(\"\");\n\t// Se...
[ "0.73332816", "0.69307387", "0.649106", "0.6485712", "0.6485712", "0.638102", "0.6296686", "0.61999685", "0.619477", "0.61698115", "0.61492735", "0.6145586", "0.5993753", "0.59448016", "0.59424144", "0.59325814", "0.5916499", "0.5894824", "0.58827627", "0.58607644", "0.585975...
0.7772839
0
Function to update coupon display in cart (PC)
function updateCoupons() { // Clear the coupon list div (PC) $("#couponDetailsHolder").html(""); // Set our total to the pre-coupon total (PC) cartPostTotal = cartPreTotal; // Tterate through coupons array (PC) for (let i = 0; i < coupons.length; i++) { // If coupon is active (PC) if (coupons[i][2]) { // A...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCoupon() {\n\t// Hide the invalid coupon warning (PC)\n\t$(\"#invalidCoupon\").hide();\n\t// Get coupon code from input box (PC)\n\tlet theCode = $(\"#couponInput\").val();\n\t// Boolean if coupon code is found in array (PC)\n\tlet foundCoupon = false;\n\t// Iterate through coupons array (PC)\n\tfor (l...
[ "0.7089412", "0.69303316", "0.68439", "0.64424664", "0.6420007", "0.6404916", "0.6402178", "0.63935024", "0.6341463", "0.62522614", "0.62342864", "0.6190715", "0.6156993", "0.61079174", "0.60934883", "0.60911393", "0.60838497", "0.60817045", "0.6070929", "0.60539687", "0.6042...
0.8359553
0
filter the point which x or y is NaN
function _filterPoints(points) { var filteredPoints = []; for (var i = 0, len = points.length; i < len; i++) { var point = points[i]; if (!isNaN(point.x) && !isNaN(point.y)) { filteredPoints.push(point); } } return filteredPoints; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterMissing(data, geo) {\n let missing = []\n data.nodes = data.nodes.filter(d => {\n try {\n geo.centroids[d.id]['x']\n geo.centroids[d.id]['y']\n\n return true\n } catch (e) {\n missing.push(d.id)\n return false\n }\n ...
[ "0.60682523", "0.57721007", "0.5767009", "0.5701446", "0.5686297", "0.568355", "0.56358874", "0.55696434", "0.5563252", "0.55184764", "0.54716563", "0.54668665", "0.5452987", "0.54463637", "0.54016674", "0.5401329", "0.5369979", "0.5327596", "0.531428", "0.5281573", "0.526799...
0.6831034
0
status is boolean argument that determines message is succeeded or failed cruds can be 'create', 'read' , 'update' , 'delete', 'search' determines kind of operation sid Specify what the requested ID isr
request(cruds, status, sid=null, name) { switch(cruds) { case 'create': if(status) { return `درخواست ایجاد ${sid}:${name} با موفقیت انجام شد.` } else if(status === false) { return `درخواست ایجاد ${sid}:${name} با خطا مواجه شد.` ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeStatus(status, id){\n \tif (status) {\n \t\treturn false;\n \t}\n \treturn true;\n }", "activeInactiveState(evt, status, id) {\n if (status == 1) {\n status = 0;\n } else {\n status = 1;\n }\n const r = window.confirm(\"Do you want to change status ?\");\n i...
[ "0.6120953", "0.5870998", "0.5731207", "0.56968015", "0.5675917", "0.56745094", "0.56655526", "0.56607354", "0.5634483", "0.5626684", "0.5615989", "0.5615989", "0.56056434", "0.55873626", "0.55632013", "0.5551544", "0.5500044", "0.54961157", "0.54943585", "0.5486964", "0.5470...
0.68288213
0
Create middleware for prevent nonplugins from accessing methods only available to plugins
createPluginMethodRestrictionMiddleware (isPlugin) { return createAsyncMiddleware(async (req, res, next) => { if (typeof req.method !== 'string') { res.error = rpcErrors.invalidRequest(null, req) return // TODO:json-rpc-engine } if (pluginRestrictedMethodDescriptions[req.method] &...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static validatePlugin(req, res, next) {\n // TODO\n next();\n }", "static MIDDLEWARE () {\n return []\n }", "function middleware(request, response, next) {}", "someMiddleware(strapi) {\n return {\n defaults: {},\n beforeInitialize() {},\n initialize() {},\n };\n }", "appMid...
[ "0.6183787", "0.5898799", "0.5820837", "0.5804915", "0.57963866", "0.5742226", "0.5673956", "0.56620777", "0.5570496", "0.5561079", "0.5543732", "0.5541391", "0.55228895", "0.54308504", "0.5419886", "0.5419886", "0.5419886", "0.5415949", "0.5398832", "0.5370043", "0.53532094"...
0.7759207
0
Removes all known domains and their related permissions.
clearPermissions () { this.permissions.clearDomains() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearPermissions () {\n this.permissions.clearDomains()\n this.notifyAllDomains({\n method: NOTIFICATION_NAMES.accountsChanged,\n result: [],\n })\n }", "async clear() {\n this.allDomains = new Map();\n this.allDomains.set(DEFAULT_DOMAIN, new Roles());\n }", "function clear...
[ "0.71173596", "0.65350294", "0.6338013", "0.61088115", "0.61055475", "0.5962611", "0.5461226", "0.54176396", "0.54098344", "0.54098344", "0.54098344", "0.53843486", "0.5360758", "0.52560914", "0.52475727", "0.51832867", "0.51608276", "0.51352334", "0.51097155", "0.5107435", "...
0.769691
0
Get data from a svgstyle badge. cb: function(err, string)
function fetchFromSvg(request, url, valueMatcher, cb) { request(url, (err, res, buffer) => { if (err !== null) { cb(err) } else { nodeifySync(() => valueFromSvgBadge(buffer, valueMatcher), cb) } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseBadgeData(data) {\n\t\tif(data != null){\n\t\t\tlet badgeId = \"\";\n\t\t\t// Validar QR Code\t\t\t\n\t\t\tif(data.substring(0,4) == \"VQC:\") {\n\t\t\t\tlet scannedData = data.substring(4);\n\t\t\t\tlet scannedFields = scannedData.split(\";\");\n\t\t\t\tif(scannedFields != null) {\n\t\t\t\t\tfor(let i = 0, j...
[ "0.6406799", "0.5969907", "0.5901655", "0.58654124", "0.5825943", "0.5748979", "0.56975216", "0.56154746", "0.5554882", "0.5481073", "0.54699874", "0.54202175", "0.5350635", "0.534646", "0.53460735", "0.53423965", "0.53302294", "0.5310301", "0.5301306", "0.529424", "0.5274206...
0.706838
0
on last active workspace
setLastActive(currentHost, activeProject) { const index = this.persistence.hosts.findIndex(elem => { return elem.host === currentHost.host && elem.port === currentHost.port }); if (index >= 0) { this.persistence.hosts[index].lastActiveOfLastWorkspace = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_previous() {\n let workspaceManager = global.workspace_manager;\n return Math.max(workspaceManager.get_active_workspace_index() - 1, 0);\n }", "function _getOnLastWS() {\n\treturn settings.get_boolean('onlastworkspace');\n}", "_move_to_previous_workspace() {\n\t\tthis.ws_count = WM.get_n_work...
[ "0.66355395", "0.6387906", "0.6282251", "0.6033357", "0.5930776", "0.5892115", "0.5761813", "0.5593495", "0.5561951", "0.5532599", "0.55312", "0.55227286", "0.550699", "0.5452979", "0.54415387", "0.5437923", "0.5412694", "0.5382451", "0.53790975", "0.5372617", "0.53328586", ...
0.6568099
1
Trading a token for an access code at Auth0
function tradeCodeForAccessToken() { return axios.post(`https://${process.env.REACT_APP_AUTH0_DOMAIN}/oauth/token`, payload) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tradeCodeForAccessToken() {\n return axios.post(`https://${process.env.REACT_APP_AUTH0_DOMAIN}/oauth/token`, payload).catch(error => {\n console.log('--- error getting access token ---', error); \n })\n }", "function fetchAccessToken(code) {\n let body = \"...
[ "0.8020717", "0.68577266", "0.67728925", "0.67597145", "0.664648", "0.66060185", "0.6556067", "0.65462923", "0.64687896", "0.640773", "0.6393332", "0.63282835", "0.63206047", "0.6296903", "0.62910146", "0.62833196", "0.62634933", "0.6249631", "0.62305707", "0.62038296", "0.62...
0.8033501
0
Boot core service providers.
bootCoreProviders() { if (this.booted) { throw new TypeError('The container was already booted.'); } if (!(0, _privateRegistry.default)(this).get('booted.core')) { [...coreProviders].reverse().map(provider => { return this.unshiftProvider(provider); }).reverse().forEach(providerMo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "boot() {\n const sorted = new SortedArray(\n this.providers.filter(providerRecord => providerRecord.hasBootFn),\n providerRecordComparator,\n );\n const postponeds = [];\n\n sorted.array.forEach((providerRecord) => {\n if (!this._bootProvider(providerRecord)) {\n postponeds.push(p...
[ "0.66700363", "0.666019", "0.6649178", "0.65178627", "0.6245495", "0.6151743", "0.61336595", "0.6048624", "0.6035984", "0.5985406", "0.59634125", "0.5932681", "0.59075594", "0.58805776", "0.58760685", "0.58741325", "0.58101255", "0.5784962", "0.5782373", "0.57771444", "0.5753...
0.7910865
0
returns 5 star components with an active class depending on the rating
mapStars () { const rating = this.props.rating return [1, 2, 3, 4, 5].map((i) => { let clickFn = this.props.clickStars.bind(this, i) let activeClass = rating >= i return <Star clickStars={clickFn} key={'star-' + i} active={activeClass} /> }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStarRating() {\n if ($('#star-3').hasClass('fa-star')) {\n return 3;\n } else if ($('#star-2').hasClass('fa-star')) {\n return 2;\n } else {\n return 1;\n }\n}", "function Rating({ max = 5, rating = 0, size = 2, variant = 'default' }) {\n const stars = Array.from(Array(max)).map((elem, ...
[ "0.7181254", "0.6982198", "0.6972621", "0.6955762", "0.6927545", "0.6914312", "0.69072455", "0.6868294", "0.6855927", "0.68491375", "0.6823571", "0.6813037", "0.6795705", "0.6794022", "0.6755989", "0.6732373", "0.67089325", "0.6705161", "0.6698784", "0.66845626", "0.6673638",...
0.7283289
0
Given a set of constituent parameters, a raiser's edge gift attribution, membership record, certainty, migration description, total set of ordered rows, and set of overrides, this routine constructs the appropriate membership gift for this configuration.
function makeMembershipGift( constituent_type, raw_gift, membership, certainty, description, gift_rows, overrides = {} ) { var base_row = makeBaseGift( raw_gift, constituent_type ); if ( typeof overrides['Donation Amount'] !== 'undefined' ) { base_row['Donation Amount'] = overrides['Donation Amount'];...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeGiftMembershipGifts( constituent_type, raw_gift, membership, certainty, description, gift_rows ) {\n\n var membership_gifts = makeMembershipGift( constituent_type, raw_gift, membership, certainty, description, gift_rows );\n\n if ( membership_gifts.length === 0 ) {\n // NOTE: In the case ...
[ "0.5506914", "0.43645886", "0.43098935", "0.42787075", "0.42510942", "0.42492086", "0.41582015", "0.4148101", "0.41477668", "0.41415986", "0.41096333", "0.4106135", "0.4081589", "0.40252888", "0.40230837", "0.40167677", "0.400586", "0.3998304", "0.3981782", "0.39766148", "0.3...
0.6176279
0
This routine constructs a membership gift set, including a sponsoring gift, any payments on that gift, and the gift membership record itself.
function makeGiftMembershipGifts( constituent_type, raw_gift, membership, certainty, description, gift_rows ) { var membership_gifts = makeMembershipGift( constituent_type, raw_gift, membership, certainty, description, gift_rows ); if ( membership_gifts.length === 0 ) { // NOTE: In the case that we en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeMembershipGift( constituent_type, raw_gift, membership, certainty, description, gift_rows, overrides = {} ) {\n\n var base_row = makeBaseGift( raw_gift, constituent_type );\n\n if ( typeof overrides['Donation Amount'] !== 'undefined' ) {\n base_row['Donation Amount'] = overrides['Donation...
[ "0.59980154", "0.49715817", "0.48794162", "0.48789993", "0.47226536", "0.46633777", "0.46385103", "0.45455158", "0.45254996", "0.45094842", "0.4486706", "0.44861537", "0.44776508", "0.4432493", "0.44233853", "0.44210717", "0.43914023", "0.43858463", "0.4364065", "0.4330973", ...
0.6107873
0
Function that obtains the ID and the names of the groups
obtainGroupsNamesID (callback) { this.retrieveGroups((err, groups) => { if (err) { if (_.isFunction(callback)) { callback(err) } } else { if (_.isFunction(callback)) { groups = _.map(groups, (group) => ({ 'id': group.id, 'name': group.n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getAllGroups() {\n try {\n // This return the id [g:1:${id}]\n const { response } = await doAjax({\n type: \"GET\",\n url: \"https://api.steampowered.com/ISteamUser/GetUserGroupList/v1/\",\n data: {\n key: SteamApiKey,\n steamid: steamId,\n ...
[ "0.6902481", "0.6867252", "0.68069243", "0.6782243", "0.6731414", "0.6708371", "0.67074937", "0.67009604", "0.66602343", "0.6607242", "0.6560435", "0.65386426", "0.6442427", "0.6394866", "0.6377845", "0.63571215", "0.6352694", "0.6301591", "0.6299579", "0.6290746", "0.6251161...
0.77287734
0
Function that groups the students by their average mark
groupByMark (examResults, groupName) { return _(examResults).countBy('result') .map((count, mark) => ({ 'exam': _.head(groupName).name, 'averageMark': parseFloat(mark), 'numStudents': count })).value() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAverage(student) {\n var sum = 0;\n\n for (var i = 0; i < student.marks.length; i++) {\n sum = sum + student.marks[i];\n }\n\n return sum / (student.marks.length); //average\n}", "function countStudents(studentList, avgMark) {\n if (!Array.isArray(studentList) || studentList.leng...
[ "0.7289254", "0.71139944", "0.7038953", "0.6982994", "0.6973313", "0.6911713", "0.68492067", "0.6806076", "0.6786314", "0.67516226", "0.6741925", "0.6656539", "0.66510683", "0.6590129", "0.6429415", "0.63621503", "0.6201853", "0.620075", "0.62003016", "0.6188993", "0.6183649"...
0.7662394
0
Finds a trait by multiname. The kind acts only like an arbitrer between getters and setters since thess two have the same multiname and differ only by kind. This means that when |kind === TRAIT_Setter| the getters will be skipped and when |kind === TRAIT_Getter| the setters will be skipped.
function findTrait(traits, multiname, kind) { var trait; for (var i = 0, j = multiname.namespaces.length; i < j; i++) { var qn = multiname.getQName(i); for (var k = 0, l = traits.length; k < l; k++) { if (Multiname.getQualifiedName(qn) === Multiname.getQualifiedName(traits[k].name)) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function kindMapping(kind) {\n if (kind === \"graph\") kind = \"datapoints\";\n if (kind === \"meter\") kind = \"number\";\n return kind;\n }", "static get(typeName) {\n return allTypes.all[typeName];\n }", "function getTrait(traits, personality){\n //console.log(personality);\n var traitDe...
[ "0.4685873", "0.44993612", "0.42272174", "0.4212132", "0.41994694", "0.4083329", "0.40014735", "0.39843878", "0.39823762", "0.39256352", "0.3893773", "0.38894787", "0.38720635", "0.3851837", "0.3829152", "0.38280317", "0.3827702", "0.381656", "0.3803343", "0.38007793", "0.379...
0.827323
0
Optionally pops a runtime multiname of the stack and stores a |RuntimeMultiname| object in the specified bytecode's |multinameTy| property.
function popMultiname(bc) { var multiname = multinames[bc.index]; if (multiname.isRuntime()) { var namespaces = multiname.namespaces; var name = multiname.name; if (multiname.isRuntimeName()) { // here we actually deal with abstract multinames, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mul() {\r\n const y = this.stack.pop();\r\n const x = this.stack.pop();\r\n this.stack.push(x * y);\r\n}", "function setTypeToMultiply(){\n type = \"multiply\";\n console.log(type);\n}", "function pop$2(stack, metaStack) {\n\t var obj = stack.pop();\n\n\t if (metaStack.length) {\n\t va...
[ "0.47257802", "0.43623555", "0.42948973", "0.42058337", "0.41733798", "0.41008535", "0.4098977", "0.40826494", "0.40826494", "0.40826494", "0.40826494", "0.40826494", "0.40826494", "0.40826494", "0.40826494", "0.40826494", "0.40826494", "0.40826494", "0.40826494", "0.40826494",...
0.728637
0
Creates a DeltaMergeable for an Array with a Proxy wrapper.
function createArray(args) { let oldLength = 0; const array = new DeltaArray(); const values = new Array(); const container = new delta_mergeable_1.DeltaMergeable({ key: args.key, parent: args.parent, initialValue: array, transform: (newArray, currentValue) => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extendTypedArray (array, deltaSize) {\n const ta = new array.constructor(array.length + deltaSize) // make new array\n ta.set(array) // fill it with old array\n return ta\n }", "function proxyArray (arr) {\n var handler = {\n set: function (target, property, value, receiver) {\n debugger;\n ...
[ "0.5750368", "0.57305545", "0.5436118", "0.54050946", "0.5370501", "0.5355809", "0.5297303", "0.5241711", "0.5241711", "0.5241711", "0.50885725", "0.50602573", "0.5054286", "0.5054286", "0.5054286", "0.5054286", "0.5054286", "0.5054286", "0.5054286", "0.5054286", "0.5054286",...
0.6846378
0
Given two numbers, return array of length num1 with each value num2. Print "Jinx!" if they are same.
function thisLength(num1, num2) { var arr = [] for (i = 0; i < num1; i++) { arr.push(num2) } if (num1 === num2){ return "Jinx"; } return arr }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thisLengthThatValue(num1, num2){\n var arr = [];\n for(var i = 0; i < num1; i++){\n arr.push(num2);\n }\n\n if(num1 == num2){\n console.log(\"Jinx!\");\n }\n\n return arr;\n}", "function thisLength(num1, num2) {\n if(num1 === num2){\n console.log( \"Jinx\");\n }\n ...
[ "0.7601742", "0.7485387", "0.74233747", "0.7325202", "0.7294179", "0.71722573", "0.71367085", "0.712685", "0.7016495", "0.68365425", "0.6817283", "0.68027717", "0.6622013", "0.65080243", "0.65015435", "0.6441735", "0.63732374", "0.63525236", "0.62911206", "0.6282588", "0.6263...
0.75431883
1
Kelvin wants to convert between temperature scales. Create fahrenheitToCelsius(fDegrees) that accepts a number of degrees in Fahrenheit and returns the equivalent temperature as expressed in Celsius degrees.
function fahrenheitToCelsius(fDegrees) { var celsius = (fDegrees-32) * 5 / 9; var result = fDegrees + " fahrenheit is equal to " + celsius + " celsius. " return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fahrenheitToCelsius(fDegrees) {\n var celsius = (fDegrees - 32) * 5 / 9;\n celsius = Math.round(celsius);\n return celsius;\n}", "function celsiusToFahrenheit(cDegrees){\n var fahrenheit = (9/5 * cDegrees) + 32\n return fahrenheit\n}", "function FahrenheitToCelsius(fDegree){\n var ce...
[ "0.82844406", "0.79125696", "0.7652484", "0.76123935", "0.7604621", "0.7557365", "0.75372595", "0.75372595", "0.7500432", "0.74738616", "0.7449172", "0.74239564", "0.74208146", "0.7396994", "0.7376949", "0.735751", "0.73564273", "0.7350292", "0.7321943", "0.73107433", "0.7299...
0.79316074
1
pause when mouseover both circles and visual imgs
function handlePauseEffect() { let onPauseLists = [visualImgs, circles]; onPauseLists.forEach((list) => list.forEach((elem) => { elem.onmouseover = function () { clearInterval(intervalId); }; elem.onmouseout = function () { interv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseOverCircle() {\n $(this).css(\"opacity\", \"0.5\");\n }", "function mouseStop() {\n for (let i = 0; i < visuals.length; i++) {\n visuals[i].addEventListener('mouseover', () => {\n window.clearInterval(timer)\n })\n visuals[i].addEventListener('mouseout',...
[ "0.65639615", "0.6547012", "0.6542917", "0.6380984", "0.63446456", "0.6329455", "0.6274036", "0.6188282", "0.61735415", "0.615142", "0.61051613", "0.60847956", "0.60843295", "0.6059686", "0.6043685", "0.6030014", "0.5976636", "0.5974324", "0.5963773", "0.5947998", "0.5947998"...
0.70262885
0
Both left and right click is used for flooding the cells when mines around a cell have all been discovered. Or it is used to highlight undiscovered surrounding cells. With MacBooks and some other laptops, simultaneous left/right click is not possible on the trackpad, so middle click is used instead to flood. Highlighti...
function middleClickHandler(e) { if (e && e.which == 3) { rightClickDown = true; } else if (e && e.which == 1) { leftClickDown = true; } // simultaneous left and right click if (leftClickDown && rightClickDown) { // console.log('both clicked'); e.preventDefault(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onRightClick( event ) {\r\n var cell = event.target.dataMine;\r\n this.flagCell(cell);\r\n event.preventDefault();\r\n }", "function cellRightClick() {\n\tcellClick(pointingAtX,pointingAtY, null);\n}", "function cellRightClickHandler() {\n let rowCol = cellIdNumToRowCol(parseInt((this.id).substrin...
[ "0.687726", "0.68680197", "0.67459047", "0.6629912", "0.64812666", "0.641283", "0.63992023", "0.626969", "0.62321514", "0.62146854", "0.6188101", "0.6167164", "0.6149268", "0.6053706", "0.59680665", "0.59624004", "0.59624004", "0.59277976", "0.5924748", "0.5859354", "0.584703...
0.72359335
0
game logic / Tile object: isMine > selfexplanatory isVisible > label is visible, meaning it has been clicked label > number of mines surrounding the cell rightClickStatus > toggles among mine flag, question mark, and no mark
function Tile(isMine, isVisible, label) { this.isMine = isMine; this.isVisible = isVisible; this.label = label; this.id = Tile.count++; this.rightClickStatus = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showCell(){\n\n if(this.currentState != 'hidden') // base condition- if flagged/visible, don't show\n return;\n \n if(this.hasMine) // game over check\n gameOver();\n\n else if(this.numMines > 0) // if cell cont...
[ "0.676895", "0.67587733", "0.668171", "0.6625637", "0.65201783", "0.64973", "0.64725393", "0.6417831", "0.6406796", "0.64042383", "0.6384786", "0.6341686", "0.63306135", "0.6324102", "0.63112366", "0.62971544", "0.62822664", "0.62628406", "0.6259857", "0.62518036", "0.624026"...
0.71121675
0
randomize mines on the grid
function randomizeMines(gridWidth, gridHeight, numMines) { for (let i = 0; i < numMines; i++) { while (true) { let randRow = Math.floor(Math.random() * gridHeight); let randCol = Math.floor((Math.random() * gridWidth)); // set mine if not already set if (!gri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setMines() {\n for (let i = 0; i < this.num_mines; i++) {\n do {\n var row = Math.floor(Math.random() * this.rows);\n var col = Math.floor(Math.random() * this.cols);\n }\n while (this.tiles[row][col].isMine());\n this.tiles[row][col]...
[ "0.8273855", "0.7912162", "0.73746175", "0.7373153", "0.73614603", "0.73573864", "0.73272777", "0.7276962", "0.7274288", "0.7271047", "0.7217595", "0.7109821", "0.7024211", "0.69869256", "0.6962186", "0.69610244", "0.69606215", "0.6955958", "0.6950743", "0.69399863", "0.69322...
0.82904136
0
method to rearrange the top nav items only called on mobile
function arrangeTopNav() { var $par = $('.navbar-nav'); var $child1 = $par.find('li').first(); var $child2 = $par.find('li').last(); $par.append($child1).prepend($child2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reposition_topnav() {\r\n\t\t\t\t\t\tif (jQuery('.nav-horizontal').length > 0) {\r\n\r\n\t\t\t\t\t\t\t// top navigation move to left nav\r\n\t\t\t\t\t\t\t// .nav-horizontal will set position to relative\r\n\t\t\t\t\t\t\t// when viewed in screen below 1024\r\n\t\t\t\t\t\t\tif (jQuery('.nav-horizontal').css...
[ "0.6535175", "0.65293777", "0.64982074", "0.6485001", "0.6427731", "0.640718", "0.6278917", "0.61353344", "0.61263525", "0.61204046", "0.6088818", "0.6068351", "0.60524917", "0.6045533", "0.60234314", "0.60201627", "0.5989752", "0.5981625", "0.59647554", "0.59607327", "0.5955...
0.6753507
0
Start a server and watch for modification for live reload
function serve() { var liveServer = require("live-server"); var params = { port: 8181, // Set the server port. Defaults to 8080. host: "0.0.0.0", // Set the address to bind to. Defaults to 0.0.0.0 or process.env.IP. open: false, // When false, it won't load your browser by...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function watch() {\n\tserverInit();\n\tgulp.watch(\"./app/scss/*.scss\", cssHandler);\n\tgulp.watch(\"./app/pug/*.pug\", htmlHandler);\n\tgulp.watch(\"./app/js/*.js\", jsHandler);\n}", "function server () {\n browserSync.init({\n server: {\n baseDir: `./${devDir}`,\n },\n })\n\n gulp.watch('src/*.h...
[ "0.7715409", "0.7643704", "0.75313187", "0.7394245", "0.73428833", "0.73341256", "0.7329079", "0.729589", "0.7257615", "0.71143293", "0.7104382", "0.7102052", "0.7094629", "0.7065434", "0.7062351", "0.7055079", "0.70316356", "0.7003371", "0.7001573", "0.6959436", "0.69292337"...
0.77216053
0
Function: RawModHandlers.rawMsgHandler() This function will be called from connections.js around line 50 on every arriving message => It won't be called on broken messages this.brokenMsgHandler() will be called on these It will calculate the actual KNX message out of rawMsg and rawMsgJson This will be passed to conCont...
static rawMsgHandler (rawMsg, rawMsgJson, conContext) { /* * Check the type of the message - only TUNNELING_REQUESTs are relevant */ if (rawMsgJson.service_type === KnxConstants.SERVICE_TYPE.TUNNELING_REQUEST) { /* * Check if this message sets of any custom handlers (see checkCallCustomMs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static brokenMsgHandler (rawMsg, conContext) {\n /*\n * Extract the sequence number from the broken message and send a acknowledge message\n */\n KnxNetProtocolExtra.sendAck(KnxNetProtocolExtra.msgGetSeqnum(rawMsg), conContext)\n }", "function handleMessage(msgEvent) {\n var ev, h;\n\n ...
[ "0.6953377", "0.6189469", "0.57713664", "0.5770771", "0.5677289", "0.5601639", "0.55508345", "0.5542667", "0.54811776", "0.5451828", "0.5428259", "0.5426035", "0.5419736", "0.541662", "0.5376873", "0.5365059", "0.5362947", "0.53586906", "0.5357294", "0.5349938", "0.53480566",...
0.8111483
0
Function: RawModHandlers.brokenMsgHandler() This functions will be called from Connections.js around line 60 if a broken message arrived This happens from time to time especially when doing things like unicast communication with devices on the bus etc. But it is important to catch these broken messages: Every message f...
static brokenMsgHandler (rawMsg, conContext) { /* * Extract the sequence number from the broken message and send a acknowledge message */ KnxNetProtocolExtra.sendAck(KnxNetProtocolExtra.msgGetSeqnum(rawMsg), conContext) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static rawMsgHandler (rawMsg, rawMsgJson, conContext) {\n /*\n * Check the type of the message - only TUNNELING_REQUESTs are relevant\n */\n if (rawMsgJson.service_type === KnxConstants.SERVICE_TYPE.TUNNELING_REQUEST) {\n /*\n * Check if this message sets of any custom handlers (see checkC...
[ "0.6471557", "0.5750918", "0.56314623", "0.5534597", "0.53882724", "0.53080326", "0.5208067", "0.5163367", "0.5047656", "0.49567115", "0.4942398", "0.49423116", "0.49153748", "0.4891742", "0.4869887", "0.48631895", "0.48625922", "0.48353285", "0.48043245", "0.47747353", "0.47...
0.844583
0
Function: RawModHandlers.connFailHandler() This functions will be called from ../FSM.js around line 125 when the connection to the KNXIP interface fails It will call a userset callback (this.handlers.connFailCb), if defined Arguments: conContext The connection context
static connFailHandler (conContext) { // Check if conContext is defined if (conContext) { if (conContext.handlers) { if (conContext.handlers.connFailCb) { conContext.handlers.connFailCb() } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static sendFailHandler (err, conContext) {\n if (conContext.handlers) {\n if (conContext.handlers.sendFailCb) {\n conContext.handlers.sendFailCb(err)\n }\n }\n }", "function _connectionFailureHandler(self, event) {\n return function() {\n // console.log(\"========== _connectionFai...
[ "0.7579041", "0.6046776", "0.5921115", "0.5873259", "0.5787205", "0.578574", "0.5650787", "0.563179", "0.55735373", "0.55592036", "0.5492361", "0.54865354", "0.5448694", "0.54218656", "0.5379984", "0.5343244", "0.53293025", "0.5328833", "0.5297722", "0.5238419", "0.52101004",...
0.81398225
0
Function: RawModHandlers.outOfConnectionsHandler() This function will be called from ../FSM.js around line 170 when the KNXIP interface reported that it ran out of connections It will check if the user defined a handler for this case (conContext.handlers.outOfConnectionsCb) and calls it, if defined Arguments: conContex...
static outOfConnectionsHandler (conContext) { if (conContext.handlers) { if (conContext.handlers.outOfConnectionsCb) { conContext.handlers.outOfConnectionsCb() } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static connFailHandler (conContext) {\n // Check if conContext is defined\n if (conContext) {\n if (conContext.handlers) {\n if (conContext.handlers.connFailCb) {\n conContext.handlers.connFailCb()\n }\n }\n }\n }", "static sendFailHandler (err, conContext) {\n if (c...
[ "0.6954693", "0.599257", "0.540715", "0.51833224", "0.51712006", "0.51712006", "0.51712006", "0.5167769", "0.5161517", "0.5147355", "0.5147355", "0.5147355", "0.5147355", "0.5147355", "0.5147355", "0.5145526", "0.5144423", "0.5144423", "0.5141617", "0.5131212", "0.5131212", ...
0.85582
0
Function: RawModHandlers.sendFailHandler() This function will be called from ../FSM.js around line 400 when trying to send a message to the KNXIP interface fails It will call this.handlers.sendFailCb, if defined Arguments: err The error returned by the send function conContext The connection context
static sendFailHandler (err, conContext) { if (conContext.handlers) { if (conContext.handlers.sendFailCb) { conContext.handlers.sendFailCb(err) } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static connFailHandler (conContext) {\n // Check if conContext is defined\n if (conContext) {\n if (conContext.handlers) {\n if (conContext.handlers.connFailCb) {\n conContext.handlers.connFailCb()\n }\n }\n }\n }", "errorProc(payload) {\r\n this.lm('Bad command ...
[ "0.693772", "0.6247337", "0.6212903", "0.5811932", "0.57941544", "0.5730666", "0.57112944", "0.57009417", "0.5683933", "0.5683933", "0.5649892", "0.55604744", "0.55117697", "0.5508572", "0.5507325", "0.5500732", "0.5493413", "0.5483915", "0.5465039", "0.54496", "0.5428515", ...
0.81402874
0
Function: RawModHandlers.waitAckTimeoutHandler() This function will be called from FSM.js around line 440 when a timeout was reached when waiting for an acknowledge message from the KNXIP interface The standard timeout is 2000ms but it can be changed by setting receiveAckTimeout when setting up the connection Arguments...
static waitAckTimeoutHandler (conContext) { if (conContext.handlers) { if (conContext.handlers.waitAckTimeoutCb) { conContext.handlers.waitAckTimeoutCb() } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static brokenMsgHandler (rawMsg, conContext) {\n /*\n * Extract the sequence number from the broken message and send a acknowledge message\n */\n KnxNetProtocolExtra.sendAck(KnxNetProtocolExtra.msgGetSeqnum(rawMsg), conContext)\n }", "subscribeAck(message, callback) {\n let timeoutId\n let o...
[ "0.533281", "0.52362883", "0.52005905", "0.51413786", "0.50351745", "0.49444425", "0.48857245", "0.48629022", "0.48629022", "0.48581436", "0.4775901", "0.47651106", "0.46778423", "0.46633697", "0.46275005", "0.46275005", "0.4603532", "0.458746", "0.4577104", "0.45682186", "0....
0.8028693
0
Equality as defined in the JSON Schema spec.
function jsonEqual(x, y) { var index, len; if (Array.isArray(x)) { if (!Array.isArray(y)) { return false; } if (x.length !== y.length) { return false; } for (index = 0, len = x.length; index !== len; ++index) { if (!jsonEqual(x[index], y[index])) { return false; } } return true; } if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsonEqual(x, y) {\n var index, len;\n\n if (Array.isArray(x)) {\n if (!Array.isArray(y)) { return false; }\n if (x.length !== y.length) { return false; }\n for (index = 0, len = x.length; index !== len; ++index) {\n if (!jsonEqual(x[index], y[index])) { return false; }\n }\n return t...
[ "0.6903268", "0.68444085", "0.6821933", "0.6765801", "0.6678919", "0.65105313", "0.6438302", "0.6415769", "0.6308181", "0.6284188", "0.6275333", "0.6219908", "0.6189691", "0.6185836", "0.6185836", "0.6185836", "0.6180624", "0.6180624", "0.6168779", "0.6168779", "0.6168779", ...
0.69053626
0
Given an instance value, get its apparent primitive type.
function apparentType(val) { switch (typeof val) { case 'boolean': case 'string': return typeof val; case 'number': if (val % 1 === 0) { return 'integer'; } return 'number'; default: if (val === null) { return 'null'; } if (Array.isArray(val)) { return 'array'; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function apparentType(val) {\n switch (typeof val) {\n case 'boolean':\n case 'string':\n case 'undefined':\n return typeof val;\n\n case 'number':\n if (val % 1 === 0) { return 'integer'; }\n return 'number';\n\n default:\n if (val === null) { return 'null'; }\n if (Array....
[ "0.66921103", "0.6542251", "0.63384354", "0.63097763", "0.6195388", "0.6178906", "0.60818803", "0.5984082", "0.59607404", "0.5904663", "0.5889742", "0.5881642", "0.586817", "0.5822863", "0.5821618", "0.5821618", "0.5821618", "0.5821618", "0.5805065", "0.5796446", "0.57948285"...
0.668324
1
Helper function to get the value of a schema property.
function getSchemaProperty(schema, propName, defaultValue) { if (schema.hasOwnProperty(propName)) { return schema[propName]; } else { return defaultValue; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSchemaProperty(schema, propName, defaultValue) {\n if (Object.prototype.hasOwnProperty.call(schema, propName)) {\n return schema[propName];\n } else {\n return defaultValue;\n }\n}", "function getPropertyValue( propertyName ) {\n const data = _data.get( this );\n return data.get( propertyN...
[ "0.7196071", "0.66872936", "0.6481798", "0.6472092", "0.63429606", "0.62557685", "0.62534994", "0.62521756", "0.6174719", "0.6174719", "0.6174719", "0.6174719", "0.6166309", "0.61663055", "0.61438155", "0.61290574", "0.6105528", "0.6105528", "0.6074806", "0.6053365", "0.60425...
0.72434205
0
Record current location (Button 1)
function recordLocation() { nav.getCurrentPosition(navHandler, errorHandler, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onLocationClicked(){}", "function setLocation(){\n $(\"#currentLocation\").text(city + \", \" + state + \" - \" + zipcode);\n }", "function CurrentLocation() {\n Marker1=new google.maps.LatLng(clat, clng); addMarker(Marker1, \"Current Location\");\n }", "SetLocation() {\n\n }", "function s...
[ "0.6969081", "0.6919492", "0.67502564", "0.6705783", "0.6646138", "0.65907985", "0.6542755", "0.65329915", "0.65070903", "0.64740145", "0.646285", "0.6408549", "0.63882047", "0.6349413", "0.6343361", "0.6334462", "0.6318255", "0.62997466", "0.62644464", "0.62045", "0.6195335"...
0.70493007
0
isAdjacent returns true if the array contains the designated char in a position adjacent to the designated position
isAdjacent(char, arr, position) { const height = arr.length; const width = arr[0].length; return [ [position[0] - 1, position[1]], [position[0], position[1] + 1], [position[0] + 1, position[1]], [position[0], position[1] - 1] ].filter(val => (val[0] >= 0 && val[0] < height && val[1] >= 0 && val[1] <...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isadjacentpoint(xc,yc)\n\t{\n\t\tvar davoid = whereisthespace();\n\t\tvar y = davoid[0];\n\t\tvar x = y.split(\",\");\n\t\tvar ydiff = yc - x[1];\n\t\tvar xdiff = xc - x[0];\n\t\tif ((xdiff == 0 && (ydiff < 200 && ydiff > -200)) || (ydiff == 0 && (xdiff < 200 && xdiff > -200)))\n\t\t{\n\t\t\treturn true;\...
[ "0.6411943", "0.6393736", "0.63782", "0.6377303", "0.6178239", "0.612664", "0.6113866", "0.59264594", "0.5916372", "0.58841956", "0.58825004", "0.585648", "0.5756792", "0.5668764", "0.5625358", "0.56104505", "0.5596382", "0.5588765", "0.5534052", "0.55288535", "0.5511696", ...
0.8517329
0
find businesses to suggest under the product's category
function findSuggestions(category, storedData, suggestions) { storedData.forEach(function (b) { if (b.category == category) suggestions.push(b); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _search()\n {\n var allCategoryNames = [];\n // Incorporate all terms into\n var oepterms = $scope.selectedOepTerms ? $scope.selectedOepTerms : [];\n var situations = $scope.selectedSituations ? $scope.selectedSituations : [];\n var allCategories = oepterms.concat(situations);\n allCate...
[ "0.64128375", "0.59367514", "0.58875185", "0.5877511", "0.5872398", "0.58432", "0.5818373", "0.5731277", "0.5679726", "0.56671494", "0.56345785", "0.56335115", "0.5609922", "0.5585651", "0.5546691", "0.5544697", "0.5543359", "0.55132025", "0.54408497", "0.54327613", "0.541049...
0.60328984
1
grid animation create SVG circle overlay and append it to the preview element
function createCircleOverlay(previewEl) { var dummy = document.createElementNS("http://www.w3.org/2000/svg", "svg"); dummy.setAttributeNS(null, "version", "1.1"); dummy.setAttributeNS(null, "width", "100%"); dummy.setAttributeNS(null, "height", "100%"); dummy.setAttributeNS(null, "cla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createCircleOverlay(previewEl) {\n var dummy = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n dummy.setAttributeNS(null, 'version', '1.1');\n dummy.setAttributeNS(null, 'width', '100%');\n dummy.setAttributeNS(null, 'height', '100%');\n dummy.setAttributeNS(null, 'class', ...
[ "0.6643856", "0.6367605", "0.61656415", "0.59619486", "0.5853296", "0.5832623", "0.5822311", "0.57805455", "0.5776886", "0.5740111", "0.5736191", "0.5716451", "0.5697685", "0.5662203", "0.5602987", "0.55955577", "0.5582767", "0.5580054", "0.55766433", "0.5569687", "0.5560286"...
0.6779911
0
Prompt 2: Add the following parameters to the constructor method and set it equal to the parameters: OS, model, app market, company.
constructor (OS, model, appMarket, company, ringtone) { this.OS = OS; this.model = model; this.appMarket = appMarket; this.company = company; this.ringtone = ringtone; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(name = prompt(\"Enter the name !\"), surname = prompt(\"Enter the surname !\"), about = prompt(\"Enter optional info !\")) {\n this.name = name; // get the name in command prompt\n this.surname = surname; // get the surname in command prompt\n this.about = about;// get the about in...
[ "0.65087104", "0.64185506", "0.6320697", "0.5991299", "0.5962607", "0.58764976", "0.58497167", "0.5785499", "0.5770923", "0.5721551", "0.56636", "0.5570467", "0.55000967", "0.5494611", "0.5478673", "0.5462855", "0.5442977", "0.5436668", "0.5434659", "0.54096234", "0.5398538",...
0.7205723
0
Prompt 7: Add a method called Call to the Smartphone class. This means you will also have to add another parameter called ringtone to the constructor to hold the value/sound the call method would make.
call () { console.log(this.ringtone); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sipCall(s_phone_number) {\n if (oSipStack && !oSipSessionCall && !tsk_string_is_null_or_empty(s_phone_number)) {\n //btnCall.disabled = true;\n btnHangUp.disabled = false;\n\n // create call session\n oSipSessionCall = oSipStack.newSession(\"call-audio\",...
[ "0.6092778", "0.57703847", "0.56861156", "0.56739974", "0.5637579", "0.5565069", "0.5548999", "0.55413216", "0.55378026", "0.5473662", "0.54297256", "0.5428276", "0.5427445", "0.54263496", "0.5416927", "0.54156685", "0.5412328", "0.5377984", "0.53779054", "0.5361971", "0.5354...
0.603474
1
Getters & Setter Prompts Prompt 12: Create a getter method called businessCalls that retrieves todays date and time.
set businessCalls (time) { //Prompt 12: Write a conditional in getter method that if the time is greater than 10 and less than 21 then return "phone has been ringing all day!". If not, then it will return "phone on nighttime mode". if (time > 10 || time < 21) { return "phone has been ringing all da...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToToday(){\r\n\tvar tempDate = new Date;\r\n\tintYear = tempDate.getFullYear();\r\n\tlistReminders();\r\n\tinitialise();\n\r\n}", "function getdata() {\n faxianSearchInfo.addition_search.first_start_time_or = getMonthStartDate()\n faxianSearchInfo.addition_search.last_start_time_or = getMonthEnd...
[ "0.5765137", "0.57158834", "0.5636001", "0.56051755", "0.55000085", "0.5490319", "0.5488283", "0.5445854", "0.5445472", "0.541394", "0.5385945", "0.5382625", "0.53694206", "0.53305805", "0.5328394", "0.52696747", "0.5266933", "0.524511", "0.52352446", "0.52204716", "0.5218247...
0.6261587
0
Prompt 13: Create a setter method called phoneOwner with a parameter of phoneOwner.
set phoneOwner (phoneOwner) { this._phoneOwner = phoneOwner //Prompt 14: Add a console log inside the setter method to make sure it has been called. console.log(phoneOwner); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get phoneOwner () {\n \n }", "set phone(val) {\n this._phone = val || null;\n }", "set IPhonePlayer(value) {}", "set owner(ownerName) {\n // debugger;\n console.log(\"We are setting the name of the owner. Please wait...\");\n\n ownerName.length > 1 ? this._owner = ownerName :...
[ "0.68557703", "0.6389098", "0.63034165", "0.622431", "0.59949136", "0.5813653", "0.56181604", "0.5397328", "0.53694797", "0.53694797", "0.53694797", "0.5337419", "0.5331339", "0.52964264", "0.5294178", "0.52739537", "0.5250065", "0.5210675", "0.51653945", "0.5125446", "0.5123...
0.83401227
0
Prompt 15: Create a getter method called phoneOwner.
get phoneOwner () { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set phoneOwner (phoneOwner) {\n this._phoneOwner = phoneOwner\n //Prompt 14: Add a console log inside the setter method to make sure it has been called.\n console.log(phoneOwner);\n }", "get phoneNo() { return this._phoneNo; }", "getPhoneNumber() {\n return this.phoneNumber;\n }", "get ...
[ "0.7371325", "0.68511343", "0.6613687", "0.6612617", "0.6612617", "0.6612617", "0.6491774", "0.64345086", "0.6261627", "0.61949193", "0.61894405", "0.60611904", "0.599998", "0.5957224", "0.5905715", "0.58866817", "0.5852204", "0.5852204", "0.5852204", "0.5852204", "0.5852204"...
0.8869731
0
MANIFEST CREATION METHODS //
function createManifest() { if (this.arrBookStructureEntries == null) return; if (this.arrPageXmlFiles == null) return; if (this.iPageXmlsLoaded != this.arrPageXmlFiles.length) return; //this.manifest = {label: "Manifest for img", sequences: "lol"}; this.manifest = { label: conf.bookTitle, "@type": "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Manifest() {\n _classCallCheck(this, Manifest);\n\n this.contents = {};\n this.options = {};\n this.bootstrap = null;\n }", "function manifest(ignored) {}", "static get manifest() { return 'package.json'; }", "function main(filePath) {\n /*// NON-CHEERIO WAY:\nvar manifestObject = ge...
[ "0.7149009", "0.70969856", "0.62507856", "0.61902386", "0.61167175", "0.61044586", "0.60388255", "0.60082406", "0.59053546", "0.5898709", "0.57647526", "0.5744663", "0.5710113", "0.5642899", "0.55630314", "0.55569947", "0.55522203", "0.55202204", "0.55022967", "0.5479423", "0...
0.7422171
0
Q10 10. Write a function that logs "Good morning", "Good afternoon", "Good evening", or "Good night" based on the hour of the day, and call it. 5 <= hour < 12: "Good morning" 12 <= hour < 16: "Good afternoon" 16 <= hour < 20: "Good evening" Otherwise, "Good night" __Note__: The hour can be obtained by using this statem...
function greeting(hour){ if(hour>=5 && hour<12){ console.log("Good Morning"); } else if(hour>=12 && hour<20){ console.log("Good Afternoon"); } else if(hour>=16 && hour < 20){ console.log("Good Evening"); } else{ console.log("Good Night"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function greeter() {\n let currentHour = hour + 3;\n \n if (currentHour >= 0 && currentHour <= 11) {\n console.log('Good Morning!');\n } else if (currentHour >= 12 && currentHour <= 16) {\n console.log('Good Afternoon!');\n } else if (currentHour >= 17 && currentHour <= 21) {\n ...
[ "0.8030349", "0.7820179", "0.7503578", "0.74869365", "0.747715", "0.7454901", "0.74435174", "0.7441325", "0.7420701", "0.7384393", "0.73662555", "0.7366193", "0.7364913", "0.73330796", "0.714851", "0.71335936", "0.7059988", "0.70530075", "0.70147467", "0.69828826", "0.6978772...
0.8379872
0
Extract atom by its fullname: chainName.residueId.atomName
getAtomByFullname(fullName) { const parts = fullName.split('.'); if (parts.length !== 3) { return null; } const chainName = parts[0]; const resId = parseInt(parts[1], 10); if (Number.isNaN(resId)) { return null; } const atomName = parts[2].toUpperCase(); let currAtom = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findAtom(atoms, keypath) {\n var level = keypath.shift();\n\n if (level) {\n var matches = atoms.filter(function (atom) {\n return (atom.name == level);\n });\n\n if (matches.length) {\n if (keypath.length > 0) {\n return findAtom(matches[0].children, keypath);\...
[ "0.5508213", "0.5238078", "0.5174632", "0.48919687", "0.4840747", "0.48061454", "0.48061454", "0.48061454", "0.48061454", "0.48019364", "0.4756822", "0.47535205", "0.47380072", "0.46995315", "0.46521544", "0.4636955", "0.4636955", "0.4636955", "0.4636955", "0.46328497", "0.46...
0.79892945
0
this function joins multiple complexes into one (this) atom, bond, ... objects are reused so input complexes are no longer valid
joinComplexes(complexes) { // clear target complex this._chains = []; this._components = []; this._helices = []; this._sheets = []; this.structures = []; this._atoms = []; this._residues = []; this._bonds = []; this._sgroups = []; const self = this; let atomBias = 0; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseMolecule(index, atomRecords, bondRecords, result) {\n let {atoms, bonds} = result,\n inc = atoms.length, // total number of atoms added into the structure previously\n spaceRE = /\\s+/;\n for (let rec of atomRecords) {\n let items = rec.trim().split(spaceRE);\n ...
[ "0.52998424", "0.52174085", "0.50626355", "0.5026172", "0.5015103", "0.5012357", "0.5000187", "0.49988902", "0.49909103", "0.4918138", "0.4912348", "0.48728952", "0.48675162", "0.48599207", "0.48522356", "0.48515618", "0.48442596", "0.48404485", "0.4829094", "0.48060825", "0....
0.7633245
0
Replace secondary structure with calculated one. DSSP algorithm implementation is used. Kabsch W, Sander C. 1983. Dictionary of protein secondary structure: pattern recognition of hydrogenbonded and geometrical features. Biopolymers. 22(12):25772637. doi:10.1002/bip.360221211.
dssp() { const ssMap = new SecondaryStructureMap(this); const structures = this.structures = []; const helices = this._helices = []; const sheets = this._sheets = []; const getSheet = (index) => { let item = sheets[index]; if (!item) { item = sheets[index] = new Sheet(String(in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findSecondaryStructure () {\n let conhPartners = this.conhPartners\n let residueNormals = {}\n\n let nRes = this.getResidueCount()\n let residue0 = this.getResidueProxy()\n let residue1 = this.getResidueProxy()\n\n let atom0 = this.getAtomProxy()\n let atom1 = this.getAtomProxy()\n\n functi...
[ "0.641768", "0.5872449", "0.50158376", "0.47956026", "0.47731718", "0.47688845", "0.47662044", "0.47620994", "0.47346917", "0.46838886", "0.46745023", "0.46650368", "0.46605366", "0.4633251", "0.45797548", "0.45740783", "0.45384258", "0.4506908", "0.45009798", "0.45009798", "...
0.6303824
1
conversions goes here infixToPostfix(expression);
function infixToPostfix(expr){ ///create a stack let stack=[]; //return postfix //rules //1. scan the infix expr from left to right // 2. If the scanned character is an operand, output it. // 3. Else, //..3.1 If the precedence of the scanned operator is greater than the precedence of the operator in the stack(or the st...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InfixtoPostfix() {\n \n // Postfix array created\n var postfix = [];\n var temp = 0;\n push('@');\n infixval = document.getElementById(\"infixvalue\").value;\n \n // Iterate on infix string\n for (var i = 0; i < infixval.length; i++) {\n var el = infixval[i];\n \n // Che...
[ "0.7581798", "0.7524423", "0.7484699", "0.69947183", "0.6946002", "0.68695474", "0.6852199", "0.6788679", "0.67731", "0.67397636", "0.66945976", "0.66899717", "0.6646743", "0.6594951", "0.6594951", "0.6594951", "0.65144914", "0.64497125", "0.6397138", "0.6378132", "0.6374968"...
0.7646506
0
is stack empty function
function isStackEmpty(stack){ return !(stack.length>0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "empty(){ return this.stack.length === 0; }", "function isEmpty(stack) {\n return !stack.top;\n}", "function isEmpty(stack) {\n return !stack.top;\n}", "function isEmpty(stack) {\n return stack.length == 0\n}", "function isEmpty(stack) {\n return stack.length === 0;\n}", "function _isStackEmpty()\...
[ "0.86585665", "0.81261307", "0.81178164", "0.80419374", "0.7995014", "0.797242", "0.7943271", "0.78984433", "0.78502077", "0.7692858", "0.7606067", "0.75286597", "0.71889484", "0.7155458", "0.6944281", "0.689467", "0.66110355", "0.65878826", "0.6580393", "0.6580393", "0.65803...
0.84840024
1
Create (dynamically) a two dimensional list with the following matrix. Use a loop! 0 0 0 1 0 0 1 0 0 1 0 0 1 0 0 0 Print this two dimensional list to the console size should depend on a variable Relax, a matrix is just like an array
function matrix2d(x){ let matrix = []; for (let i = 0; i < x; i++){ let row = []; for (let j = x - 1; j >= 0; j--){ if (i === j){ row.push('1'); }else{ row.push('0'); } } row = row.join(' '); matrix.push...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMatrix() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n }", "function defineMatrix(){\n matrix = new Array(6);\n for (let i = 0; i < 6; i++){\n matrix[i] = new Array(n + 1);\n for(let j = 0; j < n + 1; j++, numberMovement--){\n matrix[i][j] = numberMovement;\n ...
[ "0.6763215", "0.6683592", "0.6655153", "0.66223794", "0.6608335", "0.6584581", "0.65726733", "0.65600055", "0.64973617", "0.6401147", "0.6386899", "0.62994325", "0.62970954", "0.6272099", "0.6242617", "0.6236571", "0.620972", "0.62055916", "0.61637384", "0.6155926", "0.615592...
0.67074054
1
Computes the 'kid' of a JWK key using SHA256
async function computeKid(keyJwk) { // Kid computation requires properties in alphabetical order keyJwk = { "crv": "P-256", "kty": "EC", "x": keyJwk.x, "y": keyJwk.y, }; const keyBytes = new Uint8Array(JSON.stringify(keyJwk).split('').map(c => c.charCodeAt(0))); return window.crypto.subtle.digest({ n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jwk2id(jwk)\n{\n\tlet id = jwk.x + \"|\" + jwk.y;\n\treturn sha256(id.split(''));\n}", "function getKey(header, callback){\n client.getSigningKey(header.kid, function(err, key) {\n var signingKey = key.publicKey || key.rsaPublicKey;\n callback(null, signingKey);\n });\n}", "function stableKecc...
[ "0.7011896", "0.60203123", "0.5786354", "0.5767338", "0.56001735", "0.55948526", "0.5581203", "0.55083907", "0.5500703", "0.5500703", "0.5500703", "0.5500703", "0.5500703", "0.54865265", "0.5479707", "0.54741114", "0.54677314", "0.54675823", "0.5440718", "0.5428657", "0.54274...
0.73213387
0
Converts data om an ArrayBuffer to a base64url encoded string
function arrayBufferToBase64url(arrayBuffer) { return toBase64Url(btoa(String.fromCharCode(...new Uint8Array(arrayBuffer)))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "arrayBufferToBase64( buffer ) {\n var binary = '';\n var bytes = new Uint8Array( buffer );\n var len = bytes.byteLength;\n\n for (var i = 0; i < len; i++) {\n binary += String.fromCharCode(bytes[i]);\n }\n return window.btoa( binary );\n }", "function _arrayBufferToBase64(buffer) {\n ...
[ "0.71314204", "0.7117698", "0.71086866", "0.7095931", "0.7053193", "0.7051215", "0.7012366", "0.7009851", "0.69694006", "0.69199246", "0.6899449", "0.6862691", "0.6859246", "0.6849867", "0.6833651", "0.67966527", "0.67966527", "0.67966527", "0.67966527", "0.67966527", "0.6796...
0.7262304
0
Generates a new ES256 key with 'kid' and writes it to the SigningKey textarea element
async function generateKeyPair() { var key; return window.crypto.subtle.generateKey({ name: "ECDSA", namedCurve: "P-256", }, true, ["sign"]) .then(function (keyPair) { return Promise.all([window.crypto.subtle.exportKey('jwk', keyPair.publicKey), window.crypto.subtle.exportKey('jwk', keyPai...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateAKey() {\n // Create a random key and put its hex encoded version\n // into the 'aes-key' input box for future use.\n\n window.crypto.subtle.generateKey(\n {name: \"AES-CBC\", length: 128}, // Algorithm using this key\n true, // ...
[ "0.6577964", "0.65262926", "0.64689887", "0.62279415", "0.61813384", "0.6172678", "0.61299473", "0.61299473", "0.61299473", "0.61299473", "0.61299473", "0.6080972", "0.606463", "0.60407794", "0.60182047", "0.6000314", "0.5969896", "0.595925", "0.5938316", "0.5864502", "0.5854...
0.6644342
0
Given a link element pointing to an external stylesheet, return a style element with equivalent content.
function inline_stylesheet(link) { const style = document.createElement("style"); const css = [...link.sheet.cssRules].map(_ => _.cssText).join("\n"); const text = document.createTextNode(css); style.appendChild(text); return style; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xGetStyleSheetFromLink(cl) { return cl.styleSheet ? cl.styleSheet : cl.sheet; }", "_inlineStylesheet(cssLink) {\n return __awaiter(this, void 0, void 0, function* () {\n const stylesheetHref = dom5.getAttribute(cssLink, 'href');\n const resolvedImportUrl = this.bundler.analy...
[ "0.73718023", "0.7010155", "0.67626333", "0.63931155", "0.6312548", "0.62680125", "0.62679523", "0.6201664", "0.6164259", "0.61266696", "0.61174107", "0.60600424", "0.60453373", "0.6044132", "0.6044132", "0.6043977", "0.6006334", "0.60007614", "0.5995597", "0.59878725", "0.59...
0.76664615
0
populates nodes & edges data from warmly web response. Nodes & edges format used by vis.js to populate network diagram display for synonyms param: web response returns: object with array of nodes and array of edges
function transform_synonym_to_nodes_and_edges(data) { // return value var result = new Object(); var nodes = []; var edges = []; // unique node id var idgen=0; $.each(data['synonym'], function(i, sobj) { var start=idgen; //console.log('root: ' + idgen + ': ' + sobj['root'])...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadNodes(response)\n{\n\tgraph = new Graph();\n\t\n\tfor( var n in response.data)\n\t{\n\t\tvar post = response.data[n];\n\t\tvar node = graph.getNode(post.from.id);\n\t\tif(node == null)\n\t\t{\n\t\t\tnode = new Node( post.from.id);\n\t\t\tnode.data.message = post.message;\n\t\t\tnode.data.name = post.f...
[ "0.59009576", "0.5794093", "0.5713769", "0.56274664", "0.5507786", "0.54693776", "0.54498035", "0.54383266", "0.5428069", "0.53970975", "0.53864264", "0.53842974", "0.5367035", "0.53536606", "0.5327959", "0.52543175", "0.52509266", "0.52441776", "0.5243691", "0.52156115", "0....
0.60603046
0
not sure why we need the set timeout here, but it works, so i won't mess with it addLoadEvent(setTimeout(init, 1, new Point(0,0), 0)); / Init initializes the robot and the playing field. Ultimately, this should be configurable.
function init(startingLocation, startingOrientation) { console.log("Main: init"); r1 = new Robot(startingLocation, startingOrientation); geoApp = document.ggbApplet; console.log("geoApp: " + geoApp); pF = new PlayingField(); r1.show(); doc.initialize(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\tdocument.getElementById(\"play\").blur();\n\t//call function inside the object to start the game\n\tmyGame.start();\n}", "function initGame() {\r\n\tinitFE();\r\n\tinitGP();\r\n\tsetTimeout(startLoader, 250);\r\n}", "function init()\t\t\t\t\t\t\t\t\t\t\t\t\r\n{\r\n\trandom_position();\r\n\...
[ "0.6331237", "0.6290308", "0.62609804", "0.6227281", "0.62134254", "0.61970335", "0.6127396", "0.60904694", "0.60848075", "0.6084163", "0.6071098", "0.60009", "0.5985847", "0.59796536", "0.59792006", "0.59389305", "0.59303015", "0.5878335", "0.58726317", "0.585256", "0.584544...
0.6645281
0
initialize current cadr's values from other cadr
function initCadr(cadrToInit, cadrN) { // current cadr gets values gived cadr for (var i = 0; i < cadrToInit.length; i++) { isCubeClicked[i] = cadrToInit[i]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connectLocations(){\n\tdowntown.adjacentLocations = [autoShop, policeStation, shoppingDistrict] \n\tshoppingDistrict.adjacentLocations = [coffeeShop, hardwareStore, groceryStore, downtown, uptown]\n\tuptown.adjacentLocations = [library, hotel, shoppingDistrict]\n\tautoShop.adjacentLocations = [downtown]\n...
[ "0.5450218", "0.5415005", "0.5348856", "0.53424674", "0.5254869", "0.52547437", "0.5220708", "0.51913756", "0.51428896", "0.5132482", "0.5131114", "0.5107364", "0.50817305", "0.50569445", "0.50559455", "0.49847147", "0.49279207", "0.4920984", "0.4873703", "0.48671645", "0.485...
0.5899522
0
Several cadrs save current cadr's values
function Save() { cadrs[currentCadrN] = isCubeClicked.slice(); timesForCadrs[currentCadrN] = timeForCadrVal / 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveCordenadas(opt,lat,lon)\n{\n if (opt == 1) {\n //alert(lat +\" \"+lon);\n $(\"#btnGps\").removeAttr('onclick');\n $(\"#btnGps\").attr('style','background-color: rgb(223, 223, 223);padding: 0px 7px;');\n //$(\"#btnGps\").attr('onclick','renovarGps();');\n localStorage['jb_report...
[ "0.5789601", "0.5649234", "0.5591848", "0.54862386", "0.54379416", "0.5386724", "0.5364401", "0.5353481", "0.53411573", "0.5327161", "0.5327161", "0.53238976", "0.53228617", "0.5321905", "0.52985865", "0.52507985", "0.5240777", "0.52084476", "0.5205387", "0.52044666", "0.5195...
0.6649193
0
show current cadr num and cadrs quotity
function showCadrsNum() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sc_cadadr(p) { return p.cdr.car.cdr.car; }", "function details() {\n let did = dsel.value;\n if (!did) return;\n fetch(base + \"/dispenser/\" + did)\n .then(resp => resp.json()).then(function(json) {\n let perc = Math.ceil(json[\"valor_atual\"]/json[\"vol_max\"]*100);\n curml.innerText = json[...
[ "0.61433786", "0.5960005", "0.5877616", "0.58635503", "0.5851719", "0.5832217", "0.56535006", "0.5608479", "0.55975294", "0.5544144", "0.54860127", "0.5443338", "0.54023033", "0.5305118", "0.52513003", "0.5220926", "0.52051276", "0.51890147", "0.5145481", "0.51324064", "0.513...
0.6269274
0
Notify user to either fully charge/discharge if not doing so.
function checkToNotify(status, event, state) { state = state || getState(); var isChargingEvent = event.indexOf('Charging') >= 0; var text = null; var isInCycle = isWithinCycle(state); var isCharged = status.isCharging && status.percentage === chargedLimit; var isDischarged = !...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isConsumable(){\n\t\treturn (this._charges !== 0 || this.charges === -1) && Boolean(this.use_action);\n\t}", "chargePhasers() {\n if (this.currentShip === 'Looking for a Rig' || this.position !== 'Gunner') {\n return 'had no effect'\n } else if (this.position === 'Gunner') {\n this.currentShip.ph...
[ "0.5800075", "0.55948216", "0.5553276", "0.54772055", "0.545116", "0.54449445", "0.5404418", "0.5399504", "0.5393435", "0.535522", "0.535522", "0.5275781", "0.5269649", "0.5263481", "0.52625495", "0.5246725", "0.5238744", "0.5232662", "0.5220552", "0.5214252", "0.5191326", ...
0.58746284
0
Determine shallow value on battery status.
function getShallow(status) { status = status || device.battery.status; var uplo; if (status.percentage >= upperLimit) { uplo = 'upper'; } else if (status.percentage <= lowerLimit) { uplo = 'lower'; } else { // lower-upper range if (status.isCharging) { up...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBatteryState() {\n\t\tvar batteryLevel = Math.floor(battery.level * 100);\n\t\tdocument.getElementById(\"str-battery-status\").innerHTML = batteryLevel + \"%\";\n }", "function onBatteryStatus(status) {\n var batteryStatus = \"Unplugged\";\n if(status.isPlugged) {\n batteryStatus = \"...
[ "0.71375275", "0.6732165", "0.6679104", "0.66175383", "0.64534336", "0.6364713", "0.63382274", "0.6064184", "0.6012948", "0.5887992", "0.58547544", "0.57352406", "0.5731531", "0.5682878", "0.56789213", "0.56363547", "0.5570135", "0.55611813", "0.5539335", "0.5514298", "0.5505...
0.69060373
1
Get state from local storage.
function getState() { return JSON.parse(device.localStorage.getItem(stateKey)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadFromLocalStorage() {\n try {\n const serializedState = localStorage.getItem(\"state\");\n if (serializedState === null) return undefined;\n return JSON.parse(serializedState);\n } catch (e) {\n console.error(e);\n return undefined;\n }\n }", "function loadFromLocal...
[ "0.8088459", "0.7949791", "0.78165513", "0.7661001", "0.7659865", "0.7571593", "0.7454948", "0.7422987", "0.74031734", "0.73585635", "0.73132443", "0.7145406", "0.7138658", "0.698663", "0.69624263", "0.6951731", "0.69035774", "0.68760663", "0.6855158", "0.6833593", "0.6829829...
0.80240846
1
Returns true if recently notified.
function isNotifiedRecently() { var seconds = (new Date().getTime() - lastNotified.getTime()) / 1000; return seconds <= notifyInterval; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function canNotify() {\n\tvar now = new Date();\n\tvar last_notification_date_time_diff = Math.abs(now.getTime() - simple_storage.storage.last_notification_date.getTime());\n\tvar last_notification_date_time_diff_minutes = Math.ceil(last_notification_date_time_diff / (1000 * 60));\n\n\tif (last_notification_date_t...
[ "0.7421602", "0.62126297", "0.6060574", "0.6060574", "0.59883404", "0.5987516", "0.5951881", "0.5920276", "0.591471", "0.5877958", "0.5825557", "0.5818841", "0.5789092", "0.56931823", "0.5639535", "0.5614007", "0.5599604", "0.5590416", "0.55877805", "0.5578573", "0.5576897", ...
0.80485976
0
Resets last notified to now.
function resetLastNotified() { lastNotified = new Date(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "function reset() {\n subscribers.length = 0;\n cache = {};\n }", "function reset(...
[ "0.68958354", "0.68958354", "0.68958354", "0.68958354", "0.68958354", "0.6883318", "0.67825335", "0.6714614", "0.66843754", "0.66622627", "0.661168", "0.6530225", "0.6340382", "0.63337374", "0.632491", "0.63115156", "0.63026404", "0.6275519", "0.62612396", "0.6246803", "0.624...
0.75568324
0
Get state for logging.
function stateLog(state) { state = state || getState(); return JSON.stringify(state); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get state() {\n return this._clock.getStateAtTime(this.now());\n }", "function getState() {\n return state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getState() {\n return this._state;\n }", "getSta...
[ "0.64899844", "0.64334005", "0.6430973", "0.6430973", "0.6430973", "0.6430973", "0.64019096", "0.639062", "0.6340612", "0.6283737", "0.6283737", "0.6264166", "0.626231", "0.62365615", "0.6207903", "0.61785066", "0.6161906", "0.6145683", "0.6117544", "0.6117544", "0.6117544", ...
0.68154466
0
ALMemory helpers (event subscription requires a lot of boilerplate)
function MemoryEventSubscription(event) { this._event = event; this._internalId = null; this._sub = null; this._unsubscribe = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MemoryEventPersistence() {\n this.events = [];\n this.nextVersionToHandOut = 1;\n}", "function CallbackStore(){this._events={};}", "mapStoreEvents() {\n\t\tconst events = this.handleStoreEvents();\n\t\tfor (const eventType in events) {\n\t\t\t/* eslint-disable no-prototype-builtins */\n\t\t\tif (eve...
[ "0.65851575", "0.6141444", "0.5855676", "0.570962", "0.5632442", "0.5611626", "0.559057", "0.5579205", "0.55767304", "0.55147314", "0.5498294", "0.5488646", "0.5455146", "0.5440303", "0.54077613", "0.5398472", "0.53860754", "0.538507", "0.53745425", "0.5365166", "0.53608084",...
0.6573157
1
nodeServer : null, //Node IO Server Socket
constructor(){ console.log("NodeServer constructor"); this.nodeServer = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initConn(){\nnode.warn(\"LINE 15: node.path= \" + node.path);\n var socket = require('socket.io-client')(node.host, { path: node.path, multiplex:false });\n node.server = socket; // keep for closing\n handleConnection(socket);\n }", "function myServer() {\n\tthis....
[ "0.7252043", "0.6946761", "0.68360615", "0.6817466", "0.67983204", "0.6614078", "0.6590248", "0.6544474", "0.65418625", "0.6463996", "0.6357801", "0.634442", "0.63262355", "0.62468004", "0.6206671", "0.61634576", "0.615524", "0.61327803", "0.61285216", "0.6114559", "0.6110452...
0.7695662
0
Return a boolean value which indicate the queue is full or not when maxSize is not giving, this method always return false
isFull(){ if(this.maxSize){ return this.size() === this.maxSize; } else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "queueIsFull() {\n return this.queue.length >= this.maxSize\n }", "isEmpty() {\n if (this.queue.length) {\n return false;\n }\n return true;\n }", "isFull() {\n return this.length() === this.capacity;\n }", "dequeue() {\n if (this.isEmpty() === true) {\n return false;\n ...
[ "0.89525217", "0.71847004", "0.71828103", "0.71279925", "0.70874834", "0.69060665", "0.6888329", "0.67945147", "0.6691765", "0.66832393", "0.6678629", "0.6678629", "0.6671294", "0.6665967", "0.66578", "0.6654303", "0.66527504", "0.66395754", "0.6630988", "0.6618198", "0.66045...
0.80430084
1
Return the front element in the queue
getFrontElement(){ return this.queue[this.front]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function peek(){\n return queue[0];\n }", "front() {\r\n if(this.isEmpty()){\r\n console.log(\"Queue is empty\");\r\n return null;\r\n }\r\n return this.head;\r\n }", "front() {\n if (this._array.length === 0) {\n throw new error.NotFound('Que...
[ "0.83195764", "0.8311428", "0.81147045", "0.7936274", "0.790539", "0.7777237", "0.7777237", "0.7760782", "0.77580947", "0.7723985", "0.76580554", "0.7615353", "0.7607194", "0.75935024", "0.7587784", "0.7574052", "0.7529508", "0.74897724", "0.74790025", "0.74455714", "0.740066...
0.8572069
0
Return the rear element in the queue
getRearElement(){ return this.queue[this.rear]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dequeue() {\n const element = this.queue.binaryTree.shift();\n this.queue.binaryTree.unshift(this.queue.binaryTree.pop());\n this.queue.siftDown(0);\n return element;\n }", "function dequeue(){\n return queue.shift();\n }", "dequeue() {\n this.size -= 1;\n return this.q...
[ "0.7980588", "0.79323936", "0.7916146", "0.78961056", "0.78414136", "0.78113747", "0.7755663", "0.7728308", "0.77033937", "0.7689363", "0.76746744", "0.7654547", "0.76467", "0.76296467", "0.7620896", "0.7615159", "0.76038814", "0.75827295", "0.75806296", "0.7564773", "0.75559...
0.8527533
0