Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
assigns most common fields. if different, assign individually after this call.
function getBaseColObj(dataField, dataType, baseObject) { var objColumn = {}; // objColumn.caption = ""; objColumn.dataField = dataField; objColumn.dataType = dataType; objColumn.width = "auto"; objColumn.allowEditing = false; objColumn.showInColumnChooser = true; objColumn.allowResizing = true; objColumn.allowHiding = true; baseObject.push(objColumn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupCommonData () {\n for (const field in commonFields) {\n setSharedData(field, getSharedDataInitialValue(field, commonFields[field]))\n }\n }", "resetFields() {\n keys(this.initialFields).forEach((key) => this[key] = this.initialFields[key]);\n }", "function setUpFields(fields...
[ "0.5959618", "0.5810431", "0.5778541", "0.57492185", "0.5659831", "0.5567871", "0.5419523", "0.5365992", "0.53191066", "0.52941424", "0.5288597", "0.5285243", "0.52661186", "0.52308005", "0.52087677", "0.520761", "0.5177636", "0.5176716", "0.51059186", "0.5076708", "0.5065225...
0.0
-1
Uses the bandsintown api to search for the artist selected
function getBandsInTown() { if (searchTerm === "") { searchTerm = "Ariana Grande"; //default search } axios .get( "https://rest.bandsintown.com/artists/" + searchTerm + "/events?app_id=codingbootcamp" ) .then(function(response) { logString += "\n\n\nYou Searched For: " + searchTerm + "\n******** Results *********\n\n"; if (response.data[0] === undefined) { logString += "*** There were no results for this search ***\n\n\n"; } else { var unformattedDate = response.data[0].datetime; var dateFormat = "MM/DD/YYYY hh:mmA"; var formattedDate = moment(unformattedDate).format(dateFormat); logString += "Venue Name - " + response.data[0].venue.name; logString += "\nVenue City - " + response.data[0].venue.city; logString += "\nRegion - " + response.data[0].venue.region; logString += "\nEvent Date - " + formattedDate; } logString += "\n\n******** End *********\n\n\n"; console.log(logString); logResults(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchBandsInTown(artist) {\n\n // Querying the bandsintown api for the selected artist, the ?app_id parameter is required, but can equal anything\n var queryURL = \"https://rest.bandsintown.com/artists/\" + artist + \"/?app_id=codingbootcamp\";\n $.ajax({\n url: queryURL,\...
[ "0.7821169", "0.7791348", "0.75015295", "0.7329022", "0.71192056", "0.70393944", "0.6978266", "0.69250035", "0.6918478", "0.68931204", "0.68496895", "0.6803995", "0.68021816", "0.6800402", "0.6780966", "0.6753521", "0.6732823", "0.6726986", "0.6705482", "0.6629712", "0.661629...
0.6723383
18
Uses the nodespotifyapi package to get information from spotify based on song selected
function getSpotifyInfo() { if (searchTerm === "") { searchTerm = "the sign ace of base"; // default search } spotify.search({ type: "track", query: searchTerm }, function(err, data) { if (err) { logString += "Error occurred: " + err; return console.log(logString); } logString += "\n\n\nYou Searched For: " + searchTerm; logString += "\n******** Results *********\n\n"; logString += "\nSong Name - " + data.tracks.items[0].name; logString += "\nArtist Name - " + data.tracks.items[0].album.artists[0].name; logString += "\nAlbum Name - " + data.tracks.items[0].album.name; if (data.tracks.items[0].preview_url) { logString += "\nPreview URL - " + data.tracks.items[0].preview_url; } else { logString += '\nPreview URL - Unavailable for "' + searchTerm + '"'; } logString += "\n\n******** End *********\n\n\n"; console.log(logString); logResults(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lookupSpecificSong() {\n\n//sets spotify equal to the key info to call the spotify API\nvar spotify = new Spotify(SpotifyKeys.spotify);\n\n//searches the spotify API by track name \nspotify\n .request( 'https://api.spotify.com/v1/tracks/3DYVWvPh3kGwPasp7yjahc' )\n .then(function(response) {\n //Conso...
[ "0.83971447", "0.823613", "0.81894684", "0.8185489", "0.8134054", "0.8132945", "0.80786073", "0.8076742", "0.80210364", "0.8003488", "0.8002035", "0.7974239", "0.7962454", "0.7961985", "0.7957632", "0.7948961", "0.7948034", "0.7937842", "0.793703", "0.79339707", "0.79287845",...
0.0
-1
Uses the omdb api to display results for the movie searched
function getMovieInfo() { if (searchTerm === "") { searchTerm = "Star Wars"; } axios .get("http://omdbapi.com/?apikey=trilogy&s=" + searchTerm) .then(function(response) { logString += "\n\n\nYou Searched For: " + searchTerm + "\nThis Search Resulted in " + response.data.Search.length + " results" + "\n******** Results *********\n\n"; response.data.Search.forEach(movie => { logString += "Movie Title - " + movie.Title + `\nMovie Year - ${movie.Year}` + `\nMovie IMDB ID - ${movie.imdbID}` + "\nMedia Type - " + movie.Type + "\nPoster URL - " + movie.Poster + "\n\n"; }); logString += "\n******** End *********\n"; console.log(logString); logResults(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchMovie(searchWord, page) {\n fetch(\n `http://www.omdbapi.com/?s=${searchWord}&apikey=dd68f9f&page=${page}&plot=short`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n let searchResults = data.Search;\n results.innerHTML = \"\";\n...
[ "0.7878871", "0.785368", "0.77785176", "0.7773909", "0.77615285", "0.77196485", "0.76891106", "0.7630794", "0.7605803", "0.7590908", "0.758079", "0.7555545", "0.7530774", "0.7530091", "0.7512227", "0.7493034", "0.74816453", "0.7469865", "0.7461724", "0.7441799", "0.73821294",...
0.7667548
7
A default function that reads from random.txt
function doWhatItSays() { fs.readFile("./random.txt", "utf8", (err, data) => { if (err) { console.log(err); } else { const searchTermArray = data.split(","); command = searchTermArray[0]; searchTerm = searchTermArray[1]; executeRequest(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function random() {\n\tfs.readFile(random.txt, \"utf8\", function(err, data){\n\n\t});\n}", "function readRandom() {\n fs.readFile(\"random.txt\", \"utf8\", function (error, data) {\n\n if (error) {\n return console.log(error);\n }\n // Feed info from random into global function for main switch\n ...
[ "0.80098003", "0.78512967", "0.75839806", "0.7449414", "0.7435265", "0.7419434", "0.7407276", "0.73581463", "0.73260665", "0.7298345", "0.7270083", "0.7217721", "0.71686184", "0.7129002", "0.712501", "0.7123335", "0.7108262", "0.7038708", "0.7008166", "0.6992401", "0.6972389"...
0.0
-1
Users are able to run the request with a command in argv[2] and a search term in argv[3] OR without argv, inquirer presents a menu instead
function executeRequest() { switch (command) { case "concert-this": getBandsInTown(); break; case "Bands in town": getBandsInTown(); break; case "spotify-this-song": getSpotifyInfo(); break; case "Search for a Spotify song": getSpotifyInfo(); break; case "movie-this": getMovieInfo(); break; case "Search for movie info": getMovieInfo(); break; case "do-what-it-says": doWhatItSays(); break; case "Default": doWhatItSays(); break; default: console.log( "This was not a valid option. Please make a valid selection" ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runSearch() {\n inquirer\n .prompt({\n name: 'action',\n type: 'list',\n message: 'What action would you like to perform?',\n choices: [\n 'Add new department?',\n 'Add new Employee role?',\n 'Add new Employ...
[ "0.7080934", "0.70037", "0.6926543", "0.68710035", "0.6841091", "0.6811644", "0.67863184", "0.67243725", "0.6664714", "0.66454047", "0.66433966", "0.6630193", "0.6627814", "0.65823215", "0.6572293", "0.6547668", "0.65012944", "0.6496893", "0.6420769", "0.6354439", "0.6350943"...
0.62929934
23
Used in all search functions to log results
function logResults() { fs.appendFile("log.txt", logString, "utf8", function(err) { if (err) throw err; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function logResults(data) {\n console.log(data);\n}", "searchAndLog(phrase) {\n /* eslint-disable no-console */\n this.search(phrase).then(results => {\n console.group(`Search For '${phrase}'`);\n for (let result of results) {\n let doc = result.document;\n if (doc.type...
[ "0.7280798", "0.71244586", "0.6808927", "0.67695844", "0.66040295", "0.65138143", "0.6489094", "0.6468287", "0.6468287", "0.63495666", "0.6228953", "0.6224071", "0.6169784", "0.6155906", "0.614315", "0.6073584", "0.60394686", "0.6020869", "0.59996074", "0.5983229", "0.5972326...
0.6189312
12
Builds the menu using Inquirer if the user doesn't provide argv[2] and argv[3]
function buildRequest() { inquirer .prompt([ { type: "list", message: "What type of search would you like to do?", name: "searchType", choices: [ "Bands in town", "Search for a Spotify song", "Search for movie info", "Default" ] }, { type: "input", message: "What would you like to search for?", name: "searchTerm" } ]) .then(answers => { searchTerm = answers.searchTerm; command = answers.searchType; executeRequest(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userInput() {\n debugger;\n userChoice = process.argv[2];\n userSearch = process.argv.splice(3).join(\" \");\n\n if (userChoice === undefined) {\n toDo();\n } else {\n checkingToDo();\n }\n}", "function appMenu() {\n inquirer\n .prompt({\n name: 'options',\n t...
[ "0.63738406", "0.62467605", "0.61290306", "0.6073349", "0.6065181", "0.6016832", "0.5969397", "0.59220463", "0.5899242", "0.5897801", "0.58758014", "0.58625966", "0.5841483", "0.5821357", "0.58135724", "0.580731", "0.5799611", "0.57930106", "0.57923263", "0.57882756", "0.5788...
0.52482367
97
switch is set for the command the user gave, looking for the correct keywords
function lexaBrain (service, search) { let queryUrl =""; switch (service){ case "spotify-this-song": //checking to see if a song was provide, if not defaults to the sign let spotifySearch = ""; if(search===""){ spotifySearch="the+sign" }else{ spotifySearch=search; } //call out to spotify for 5 results. spotify.search({ type: 'track', query: spotifySearch, limit: 5 }).then(function(response) { //checking to see if any items in response, if none let user know if(response.track.items.length===0){ console.log("No song by that name found.") } //each song sent back, we print out the info for it. response.tracks.items.forEach(function(result){ console.log(); console.log ("Artist(s): "+result.artists[0].name); console.log ("Song Title: "+result.name); console.log ("Album: "+result.album.name); console.log ("On Spotify: "+result.external_urls.spotify); }) }) //incase something goes wrong .catch(function(err) { console.log("No song by that name found"); }); break; case "concert-this": //using axios to call out to bandsintown and get back results queryUrl = "https://rest.bandsintown.com/artists/" + search + "/events?app_id=codingbootcamp"; axios.get(queryUrl.replace("+", " ")).then(function(response){ if(response.data.length === 0){ console.log ("No band by that name found."); } //for each gig a band has, print out the info response.data.forEach(function(gig){ let date = gig.datetime.split("T"); let formatedDate = moment(date[0]).format("MM/DD/YYYY"); let venue = gig.venue console.log(` Venue name: ${venue.name} Location: ${venue.city}, ${venue.region}, ${venue.country} Date of show: ${formatedDate} `) }); }) //if something goes wrong... .catch(function(err){ console.log ("Band not found"); }); break; case "movie-this": queryUrl = "http://www.omdbapi.com/?t=" + search + "&y=&plot=short&apikey=trilogy"; axios.get(queryUrl).then(function(response) { let movie = response.data if (movie.length === 0){ console.log("No movie by that name found"); } console.log(` Movie Title: ${movie.Title} Release Date: ${movie.Released} IMDB Rating: ${movie.imdbRating} Rotten T: ${movie.Ratings[1].Value} Country of O: ${movie.Country} Language: ${movie.Language} Movie Plot: ${movie.Plot} Actors: ${movie.Actors} `) }) //incase something goes wrong. .catch(function(err){ console.log("No movies by that name found"); }); break; case "do-what-it-says": console.log("FreeStyle huh?...lets see...."); //reading my file and getting its contents fs.readFile("random.txt", "utf8", function(err, data) { if(err){ console.log("I wasn't able to read that...") } console.log(data); //removes "" around song name, then splits the command in two. one for command. one for searchterm. let response = data.replace(/"+/g, '').split(",");; lexaBrain(response[0],response[1]); }); break; default: console.log("I havent been programmed to do that yet..."); break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function switchCommand(){\n\tswitch(command){\n\t\tcase \"my-tweets\":\n\t\t\tmyTweets();\n\t\t\tbreak;\n\t\tcase \"spotify-this-song\":\n\t\t\tspotifyThisSong(userChoice);\n\t\t\tbreak;\n\t\tcase \"movie-this\":\n\t\t\tmovieThis(userChoice);\n\t\t\tbreak;\n\t\tcase \"do-what-it-says\":\n\t\t\tdoWhatItSays();\n\t\...
[ "0.74844915", "0.73354304", "0.7311376", "0.70203483", "0.6978233", "0.6945885", "0.68616295", "0.68492204", "0.6840321", "0.6824964", "0.6800482", "0.68002796", "0.6779106", "0.6704138", "0.66694117", "0.6649002", "0.66163087", "0.65868175", "0.6571123", "0.656467", "0.65271...
0.0
-1
Sigma Create a function "sigma(num)" that given a number, returns the sum of all positive integers up to that number. e.g., sigma(3) = 6 (1+2+3) Assume the argument passed is a positive integers Approach1: Math Sum of first 'n' integers = n(n+1)/2
function sigma(num){ return num * (num + 1)/2 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sigma(num){\n var sum = (num*(num+1))/2\n\n return sum\n}", "function sigma(num){\n var sum = 0 // total starts at 0 because anything added to 0 is itself\n for(var i=1;i<=num;i++){\n sum += i\n }\n return sum\n}", "function sigma(num) {\n var sum = 0;\n for (var i = 0; i <...
[ "0.86038154", "0.840468", "0.83293515", "0.83150125", "0.8301374", "0.82602745", "0.8193486", "0.8175304", "0.80067545", "0.79544044", "0.79159516", "0.7850919", "0.78148293", "0.7715286", "0.75696945", "0.75355506", "0.7471225", "0.74197567", "0.73510236", "0.67472255", "0.6...
0.8369511
2
While mouse is over the image, move the crop line.
function mouseMove(event) { //mouse x position in percentage var x = (event.clientX / innerWidth)*100; //Whole numbers z=~~x; //Set value for HTML. 100-z mirrors the movement. root.style.setProperty('--mouse-x', 100-z+"%"); //Test Values //document.getElementById('demoT').innerHTML = "Mouse position once leave Div: " + z; //Kills the centerCrop() while mouse is over the img stopTime(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move(deltaX, deltaY){\n\t\t\tif(is_pinching)\n\t\t\t\treturn;\n\t\t\timg_to_crop.css({\n\t\t\t\tleft: (x_pos + deltaX) + 'px',\n\t\t\t\ttop: (y_pos + deltaY) + 'px' \n\t\t\t});\n\t\t}", "function _onMouseMove(e) {\n if (this.activeEl) {\n this.activeEl.style.transform = 'translate(0, 0)';\n let p...
[ "0.64896244", "0.6479174", "0.62135065", "0.62135065", "0.61003375", "0.6051681", "0.60460746", "0.6024008", "0.602197", "0.5991036", "0.5979421", "0.59721714", "0.59677637", "0.5956943", "0.59469306", "0.59291136", "0.5890521", "0.5888201", "0.5881932", "0.57974154", "0.5776...
0.63598144
2
Once mouse is not over the image, auto center the crop
function centerCrop() { //48% simply crops better on my face if (z<48){ z++; root.style.setProperty('--mouse-x', 100-z+"%"); //document.getElementById('demoT').innerHTML = "Mouse position once leave Div: " + z; } else if (z>48){ z--; root.style.setProperty('--mouse-x', 100-z+"%"); //document.getElementById('demoT').innerHTML = "Mouse position once leave Div: " + z; } //Kills timer once centered else if (z==48){ stopTime() } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cropImage(evt) {\n var image = evt.target;\n var style = image.style;\n\n var parentWidth = image.parentElement.clientWidth;\n var parentHeight = image.parentElement.clientHeight;\n\n var childRatio = image.naturalWidth / image.naturalHeight;\n var parentRatio = parentWidth / parentHeight;\n\n if (...
[ "0.67732865", "0.67732865", "0.67248094", "0.66021156", "0.6565707", "0.6516829", "0.6509342", "0.6470251", "0.62128586", "0.614087", "0.61285263", "0.6102237", "0.60938966", "0.6079338", "0.60525525", "0.6020802", "0.5998355", "0.59373134", "0.59348565", "0.5922593", "0.5904...
0.70073164
0
A sample plugin that renders a Youtube video using an iframe
function Video() { const name = 'video'; const tags = [ { html: 'video', slate: 'video', md: 'video' } ]; /** * Augment the base schema with the video type * @param {*} schema */ const augmentSchema = ((schema) => { const additions = { blocks: { video: { isVoid: true, }, }, }; const newSchema = JSON.parse(JSON.stringify(schema)); newSchema.blocks = { ...newSchema.blocks, ...additions.blocks }; newSchema.document.nodes[0].match.push({ type: tags[0].slate }); return newSchema; }); /** * @param {Event} event * @param {Editor} editor * @param {Function} next */ const onEnter = (event, editor, next) => next(); /** * @param {Event} event * @param {Editor} editor * @param {Function} next */ const onKeyDown = (event, editor, next) => { switch (event.key) { case 'Enter': return onEnter(event, editor, next); default: return next(); } }; /** * @param {Object} props * @param {Editor} editor * @param {Function} next */ const renderBlock = (props, editor, next) => { const { node, attributes, children } = props; switch (node.type) { case 'video': { let { src } = node.data.get('attributes'); if (!src) { src = 'https://www.youtube.com/embed/dQw4w9WgXcQ'; } return (<iframe {...attributes} src={src} frameBorder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowFullScreen title="video" >{children}</iframe>); } default: return next(); } }; /** * @param {ToMarkdown} parent * @param {Node} value * @param {Integer} depth */ const toMarkdown = (parent, value, depth) => `<video ${value.data.get('attributeString')}/>\n\n`; /** * @param {fromMarkdown} parent */ const fromMarkdown = (stack, event, tag) => { const block = { object: 'block', type: 'video', data: Object.assign(tag), }; stack.push(block); stack.pop(); return true; }; /** * @param {fromHTML} parent */ const fromHTML = (editor, el, next) => ({ object: 'block', type: 'video', data: {}, nodes: next(el.childNodes), }); /** * When then button is clicked * * @param {Editor} editor * @param {Event} event */ const onClickButton = (editor, event) => { event.preventDefault(); alert('Video plugin button clicked!'); }; /** * Render a video toolbar button. * * @param {Editor} editor * @return {Element} */ const renderToolbar = editor => (<StyledIcon key={name} name='youtube' aria-label='youtube' className='toolbar-2x4' onMouseDown={event => onClickButton(editor, event)} />); return { name, tags, augmentSchema, onKeyDown, renderBlock, toMarkdown, fromMarkdown, fromHTML, renderToolbar }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playYoutube(element){\r\n element.contentWindow.postMessage('{\"event\":\"command\",\"func\":\"playVideo\",\"args\":\"\"}', '*');\r\n }", "function playYoutube(element){\r\n element.contentWindow.postMessage('{\"event\":\"command\",\"func\":\"playVideo\",\"args\":\"\"}', '*'...
[ "0.72613734", "0.72613734", "0.72613734", "0.72613734", "0.72613734", "0.7249787", "0.7248794", "0.7248794", "0.7248794", "0.7248794", "0.7248794", "0.72089267", "0.719086", "0.71029", "0.7049943", "0.70475173", "0.7033596", "0.7028378", "0.6992733", "0.6992721", "0.6976561",...
0.0
-1
Function: computerPlay() Outputs a random rock paper scissor value argument: none return: Rock Paper or Scissors Author: Bhupinder Singh Date: Sept 23 2021 Revision:
function computerPlay(){ let computerNumVal= Math.floor(Math.random()*3) //Math.random returns a value between 0 to 1 not inclusive. The value is scaled by 3 and floored //since the max number .random can provide is 0.99, the floor will round the value down. The max val will always be 2 let computerChoice; switch(computerNumVal){ case 0: computerChoice="Rock"; break; case 1: computerChoice="Scissors"; break; case 2: computerChoice="Paper"; break; default: computerChoice="Error"; break; } return computerChoice; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computerPlay() {\n const choices = [\"rock\", \"paper\", \"scissors\"];\n return choices[Math.floor(Math.random() * choices.length)];\n}", "function computerPlay() {\n const choices = ['rock', 'paper', 'scissors', 'lizard', 'spock']\n return computer = choices[Math.floor(Math.random() * ...
[ "0.8825437", "0.8809297", "0.875337", "0.8719921", "0.8627114", "0.86139256", "0.8612123", "0.8597474", "0.8585874", "0.85847056", "0.8573937", "0.8539177", "0.85364884", "0.85130465", "0.8488591", "0.8481874", "0.8467892", "0.8441602", "0.84175783", "0.8406771", "0.8405978",...
0.8211035
42
Function: playRount Outputs the outcome of one round of rock paper scissors argument: playerSelection and computerSelection return: +1 if player wins, 1 if computer wins, 0 if tie Author: Bhupinder Singh Date: Sept 23 2021 Revision:
function playRound(playerSelection, computerSelection){ playerSelection= playerSelection.toLowerCase(); //converting to this format: Name. This way it's not key sensitive playerSelection= playerSelection.charAt(0).toUpperCase() + playerSelection.slice(1); let matchOutcomeMessage="error"; //initial value is set to error. let pointEarned=404;//404 indicates an invalid selection //if statements to determine outcomes. There must be a big brain algorithm outhere instead. if(playerSelection == "Rock" && computerSelection =="Scissors"){ matchOutcomeMessage= "You win! Rock beats scissors."; resultText.textContent=`${matchOutcomeMessage}`; pointEarned=1; } else if(playerSelection == "Rock" && computerSelection =="Rock"){ matchOutcomeMessage= "It's a tie! Rock cannot beat rock."; resultText.textContent=`${matchOutcomeMessage}`; pointEarned=0; } else if(playerSelection == "Rock" && computerSelection =="Paper"){ matchOutcomeMessage= "You lose! Paper beats rock."; resultText.textContent=`${matchOutcomeMessage}`; pointEarned=-1; } else if(playerSelection == "Paper" && computerSelection =="Rock"){ matchOutcomeMessage= "You win! Paper beats rock."; resultText.textContent=`${matchOutcomeMessage}`; pointEarned=1; } else if(playerSelection == "Paper" && computerSelection =="Paper"){ matchOutcomeMessage= "It's a tie! Paper cannot beat paper."; resultText.textContent=`${matchOutcomeMessage}`; pointEarned=0; } else if(playerSelection == "Paper" && computerSelection =="Scissors"){ matchOutcomeMessage= "You lose! Scissors beats paper."; resultText.textContent=`${matchOutcomeMessage}`; pointEarned=-1; } else if(playerSelection == "Scissors" && computerSelection =="Rock"){ matchOutcomeMessage= "You lose!! Rock beats scissors."; resultText.textContent=`${matchOutcomeMessage}`; pointEarned=-1; } else if(playerSelection == "Scissors" && computerSelection =="Paper"){ matchOutcomeMessage= "You win! Scissors beats paper."; resultText.textContent=`${matchOutcomeMessage}`; pointEarned=1; } else if(playerSelection == "Scissors" && computerSelection =="Scissors"){ matchOutcomeMessage= "It's a tie! Scissors cannot beat scissors."; resultText.textContent=`${matchOutcomeMessage}`; pointEarned=0; } //returning score. return pointEarned; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playRound(playerSelection, computerSelection) {\n playerSelection = playerSelection.toLowerCase();\n computerSelection = computerPlay();\n computerSelection = computerSelection.toLowerCase();\n if (playerSelection === computerSelection) return 0;\n else if (\n (playerSelection === \"rock\" && comp...
[ "0.863175", "0.85239923", "0.84496284", "0.8438544", "0.8408462", "0.84058946", "0.8381335", "0.83567536", "0.83399177", "0.83178955", "0.82966834", "0.8285967", "0.8272153", "0.8271456", "0.82300484", "0.82243884", "0.8220587", "0.82109475", "0.8199798", "0.8194244", "0.8189...
0.7489584
83
Function: game() main function that runs 5 rounds and declares a winner argument: none return: none Author: Bhupinder Singh Date: Sept 23 2021 Revision:
function game(playerSelection){ let matchOutcome; roundNum++;//new round matchOutcome=playRound(playerSelection, computerPlay()); if(matchOutcome==1){ playerScore++; playerScoreDiv.textContent=`${playerScore}`; } else if(matchOutcome==-1){ computerScore++; pcScoreDiv.textContent=`${computerScore}`; } else if(matchOutcome==404){ resultText.textContent="invalid selection"; roundNum--; //go again } if(roundNum>=5){ if(computerScore>playerScore){ resultText.textContent="You lose!"; } else if(playerScore>computerScore){ resultText.textContent="You win!"; } else{ resultText.textContent="It's a tie!"; } roundNum=0; computerScore=0; playerScore=0; playerScoreDiv.textContent=`${playerScore}`; pcScoreDiv.textContent=`${computerScore}`; } roundDiv.textContent=`Round: ${roundNum}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function game(){\n\twhile(rounds<5){\n\t\tconst playerSelection = playerPLay();\n\t\tconst computerSelection = computerPlay();\n\t\tconsole.log(playRound(playerSelection, computerSelection));\n\t\tconsole.log(\"Scoreboard: Won: \" + won + \" Lost: \" + lost + \" Drawn: \" + drawn );\n\t\trounds++;\n\t}\n\n}", "f...
[ "0.8215834", "0.8152174", "0.80570525", "0.80288607", "0.7962611", "0.7923167", "0.7895302", "0.7864561", "0.7850117", "0.7830454", "0.78063947", "0.7772654", "0.77143735", "0.77079946", "0.7671418", "0.76088285", "0.7588962", "0.7582852", "0.7556986", "0.7539248", "0.7474877...
0.7835149
9
listed below. Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the compiled file. Read Sprockets README ( for details about supported directives. = require jquery = require jquery_ujs = require turbolinks = require bootstrap = require bootstrapmultiselect = require_tree .
function loadChoices(id) { var candArr = []; $('#select' + id).find('select').each(function() { candArr.push($(this).children(':selected').text()); }); candArr = $.map(candArr, function(val){ if(val == "No Selection") { return ""; console.log(val + "is ns"); } else { return "<li>" + val + "</li>"; } }); $('#modal'+id+' .cand-list').html(candArr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function js(cb){\n src([jquery,bootstrap_js]).pipe(dest(jsDest));\n cb();\n}", "function js(cb) {\n return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jquery/dist/jquery.min.js', 'node_modules/popper.js/dist/popper.min.js'])\n .pipe(gulp.dest(\"src/js\"));\n cb();\n}", ...
[ "0.64295995", "0.5998014", "0.5985546", "0.57723314", "0.56597626", "0.5559396", "0.55020773", "0.5482309", "0.5426608", "0.542174", "0.54152995", "0.5400125", "0.53876173", "0.53817755", "0.53639567", "0.5363022", "0.5358238", "0.53159285", "0.53138137", "0.5294372", "0.5278...
0.0
-1
handle dropdown list change
changeHandler(e) { console.log('Selection changed.'); // bookname or scl-major search let searchType = ''; let searchValue = e.target.value; switch(searchValue) { case 'bookname': searchType = 'booknameSearch'; this.setState({ searchNameFlag: true, searchMajorFlag: false }); break; case 'school-course': searchType = 'school_courseSearch'; this.setState({ searchMajorFlag: true, searchNameFlag: false }); break } console.log('Search type: ' + searchType); this.setState({ selectValue: searchValue, searchType: searchType }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleDropdownSelection(e) {\n var $a = (0, _jquery2.default)(e.target);\n var value = $a.attr('data-value');\n updateOption(this, value, $a.hasClass('aui-dropdown2-checked'));\n}", "function changeSelectValue(e) {\n optionValue = e.target.value;\n buildList(optionValue);\n }", "functi...
[ "0.6918728", "0.6915321", "0.6810033", "0.6808954", "0.6756094", "0.6748758", "0.6731845", "0.66973305", "0.6693101", "0.6633853", "0.6633853", "0.66116077", "0.65703905", "0.655354", "0.654157", "0.654157", "0.6527178", "0.6494276", "0.6492261", "0.64769846", "0.6474762", ...
0.0
-1
end function / web socket stuff
function websockets(jsonobject) { /* if websocket is supported */ if ("WebSocket" in window) { alert("WebSocket is supported by your Browser!"); // hurray its supported! alert("The jsonobject to be sent is:\n" + jsonobject); // test to make sure jsonobject is passed // Let us open a web socket var ws = new WebSocket("ws://localhost:8080/Peasant_Kitchen/user/signin"); ws.onopen = function() { // Web Socket is connected, send data using send() alert("Message is sent..."); ws.send(jsonobject); }; ws.onmessage = function(evt) { //fields: response, error alert(evt.data); var response = JSON.parse(evt.data); var responseObject = response.response; var error = response.error; if (error === null || error === undefined) { //happy days alert("Happy days") } else { alert(JSON.stringify(error)) } // var response = JSON.parse(evt.data); // var responseObject = response.response; // // alert(JSON.stringify(responseObject)); }; ws.onclose = function() { // websocket is closed. alert("Connection is closed..."); }; } else { // browser doesn't support websockets alert("WebSocket NOT supported by your Browser!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function socketOnEnd() {\n const websocket = this[kWebSocket$1];\n\n websocket._readyState = WebSocket$1.CLOSING;\n websocket._receiver.end();\n this.end();\n}", "function socketOnEnd () {\n const websocket = this[kWebSocket];\n\n websocket.readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n t...
[ "0.7593937", "0.75756675", "0.75756675", "0.7560715", "0.7560715", "0.75263155", "0.75263155", "0.751542", "0.751542", "0.7450447", "0.7372517", "0.7372517", "0.7372517", "0.7064275", "0.6987558", "0.6978182", "0.69325846", "0.68809354", "0.68782073", "0.68483555", "0.6847588...
0.0
-1
Used to give each handler binding a unique name Anonymizer so we can bind the same handler multiple times per eventtype
function _anon(f) { return function() { f.apply(this, arguments); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "on(name, handler) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this[EVENT_NAME_TO_HANDLER_NAME[name]] = handler;\n }", "function bindHandlers(handlerMap) {\n var m,\n dups = [];\n\n if (noHandlersWarn(handlerMap, 'bindHandlers')) {\n re...
[ "0.6446479", "0.5982156", "0.59468323", "0.5801778", "0.57824343", "0.5730809", "0.57039785", "0.56157696", "0.56157696", "0.560587", "0.56026125", "0.55877066", "0.55459523", "0.5513133", "0.54940796", "0.5486296", "0.54812366", "0.5460206", "0.5440172", "0.54384565", "0.543...
0.0
-1
returns a list of users filtered by profession, and ordered by city.
function findByProfession(profession, citySortOrder) { var cursor = users.find({profession: profession}, { sort: {city: citySortOrder}}); return Q.ninvoke(cursor, 'toArray'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsers(term, opt) {\n\t\t\t\t\tvar ajaxOptions = $.extend({\n\t\t\t\t\t\turl: X.T.getRootPath(\"Profiles\") + \"/atom/search.do\",\n\t\t\t\t\t\tcache: false,\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\tactiveUsersOnly: true,\n\t\t\t\t\t\t\tsearch: composeUserSearchQuery(term),\n\t\t\t\t\t\t\tps: 25\n\t\t\t\t\t\...
[ "0.6009031", "0.587922", "0.5743411", "0.57241595", "0.56823266", "0.5664023", "0.5639883", "0.55925834", "0.55359656", "0.55140996", "0.5486778", "0.54855555", "0.54660034", "0.54575557", "0.5429201", "0.5426428", "0.54245836", "0.5415212", "0.5406743", "0.54029703", "0.5387...
0.72985756
0
As we are using hash based navigation, hack fix to highlight the current selected menu Requires jQuery
function menuFix(slug) { var $ = jQuery; var menuRoot = $('#toplevel_page_' + slug); var currentUrl = window.location.href; var currentPath = currentUrl.substr(currentUrl.indexOf('admin.php')); menuRoot.on('click', 'a', function () { var self = $(this); $('ul.wp-submenu li', menuRoot).removeClass('current'); if (self.hasClass('wp-has-submenu')) { $('li.wp-first-item', menuRoot).addClass('current'); } else { self.parents('li').addClass('current'); } }); $('ul.wp-submenu a', menuRoot).each(function (index, el) { if ($(el).attr('href') === currentPath) { $(el).parent().addClass('current'); return; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highlightMenu() {\n $('#myNavbar').find('span').removeClass('active-menu');\n $('.submenu-panel li a').each(function() {\n if (curURL.indexOf(this.href) != -1) {\n var submenuId = $(this).closest('.submenu-panel').attr('id');\n var mainMenu = $('#myNa...
[ "0.76408577", "0.7418786", "0.737805", "0.70966727", "0.7017602", "0.70118827", "0.6985208", "0.6973471", "0.6919579", "0.6895767", "0.6824916", "0.67649335", "0.673893", "0.6721831", "0.6684298", "0.6644306", "0.663242", "0.6631638", "0.66258645", "0.66185796", "0.6606134", ...
0.583272
85
at click of reset button do function resetGame()
function resetGame(){ // declares function to resetGame() for(var i=0; i<9; i++){ // counts til 9th square is reached theSquares[i].innerText=""; // clears the X and O theSquares[i].style.backgroundColor=""; // clears the colors } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function actionOnResetClick () {\n gameRestart();\n }", "function resetButton() {\n $('#reset').click(function() {\n startGame(gameSpaces);\n })\n}", "function reset() {\n // make a new game object\n myGame = new Game('X');\n // update the view\n updateView();\n document.get...
[ "0.88297737", "0.88232756", "0.85038954", "0.8400225", "0.83810043", "0.83778554", "0.8358845", "0.83370703", "0.82406944", "0.82359594", "0.8162039", "0.8131504", "0.8105617", "0.810352", "0.8078351", "0.8075854", "0.80614007", "0.804067", "0.8040448", "0.80370116", "0.80357...
0.0
-1
"Same" means, here, that the elements in b are the elements in a squared, regardless of the order. Examples Valid arrays a = [121, 144, 19, 161, 19, 144, 19, 11] b = [121, 14641, 20736, 361, 25921, 361, 20736, 361] comp(a, b) returns true because in b 121 is the square of 11, 14641 is the square of 121, 20736 the square of 144, 361 the square of 19, 25921 the square of 161, and so on. It gets obvious if we write b's elements in terms of squares: a = [121, 144, 19, 161, 19, 144, 19, 11] b = [1111, 121121, 144144, 1919, 161161, 1919, 144144, 1919]
function comp(array1, array2) { let arr = []; for (let i = 0; i < array1.length; i++) { arr.push(array1[i] * array1[i]); } if (arr === null || array2 === null || arr.length !== array2.length) { return false; } if (arr.sort().join('') === array2.sort().join('')) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function comp(a1, a2){\n if (!a1 || !a2 || a1.length !== a2.length) return false;\n return a1.map(x => x * x).sort().toString() === a2.sort().toString();\n }", "function comp(array1, array2) {\n if (Array.isArray(array1) && Array.isArray(array2)) {\n return array2.map(n => Math.sqrt(n)).sort().toStrin...
[ "0.7593977", "0.7341688", "0.70429915", "0.7008257", "0.68374234", "0.6796594", "0.6752801", "0.67153317", "0.6611535", "0.6569882", "0.6553605", "0.6552328", "0.65517277", "0.6546285", "0.65299916", "0.6472498", "0.6472498", "0.6472498", "0.646439", "0.6457488", "0.644346", ...
0.7622596
0
WEIGHT OF SLAB NONCOMPOSITE CAPACITY
wu_nc(){ return (1.2*this.DL + 1.6*this.CL)*(this.Sj/12) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get weight() {}", "set weight(value) {}", "get weighting() { return this._weighting; }", "function Weight() {\n\tthis.value = Math.random() * .2 - .1;\n\tthis.gradient = 0;\n}", "subtreeWeight () {\n const localWeight = this.template && this.template.weight;\n\n return this.components.reduce(...
[ "0.63498646", "0.63481456", "0.6335232", "0.6307861", "0.6218092", "0.6083915", "0.6080341", "0.5969871", "0.5856862", "0.582981", "0.5789264", "0.57813805", "0.57172376", "0.5682611", "0.5669368", "0.5660923", "0.5649592", "0.5641576", "0.55960643", "0.55145323", "0.5511028"...
0.0
-1
NONCOMPOSITE FLEXURAL CAPACITY COMPOSITE CAPACITY
wu_c(){ return (1.2*(this.DL+this.SDL) + 1.6*this.LL)*(this.Sj/12) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get capacity () {return this._p.capacity;}", "get capacity () {\n\t\treturn this._capacity;\n\t}", "get capacity () {throw ae.EXCEPTION_ABSTRACT_METHOD;}", "capacity() {\n return this.capacity - 1;\n }", "get capacity(){ return this.maxStackSize - this.stackSize; }", "...
[ "0.6110791", "0.5838048", "0.565443", "0.5583031", "0.55775034", "0.54763526", "0.54625386", "0.54515606", "0.5311668", "0.53064954", "0.5237873", "0.5212904", "0.51699424", "0.51588255", "0.50862277", "0.50533575", "0.5052286", "0.50473624", "0.503345", "0.5032229", "0.50178...
0.0
-1
EFFECTIVE COMPOSITE SLAB WIDTH
a(){ return (this.Abc*this.Fy)/(0.85*this.Fc*this.beff()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ggw() {\n return this.cr.canvas.width / this.cr.options.scaleFactor;\n }", "function _c_width() { \n\t\t\t\t\treturn _width + _padding.l + _padding.r; \n\t\t\t\t}", "function _cumulativeWidth (_bounces) {return (Math.pow (_base,_bounces) - 1) / (_base - 1)}", "resizeFactor() {\n var i;\n for ...
[ "0.63911945", "0.62344795", "0.605708", "0.5887095", "0.5728543", "0.56822586", "0.5677043", "0.56741023", "0.56644946", "0.56512636", "0.5646162", "0.5633434", "0.56137", "0.55851877", "0.55821013", "0.5564035", "0.5559385", "0.5536762", "0.5517531", "0.5507019", "0.549461",...
0.0
-1
COMPOSITE FLEXURAL CAPAPCITY SHEARFLEX SCREWS
TensionBottomChord(){ return Math.max(0.5*this.phi_t*this.Abc*this.Fy, this.Mu_c()*12/this.deff_c()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CompositePattern()\r\n{\r\n\t//WARNING! do not add anything here, it will never be called\r\n}", "function CompositePattern()\r\n{\r\n\t//WARNING! do not add anything here, it will never be called\r\n}", "function composite(src, ops) {\n console.log('composite operations');\n console.log...
[ "0.5591928", "0.5591928", "0.5532733", "0.5390509", "0.5339676", "0.5081441", "0.5081441", "0.5081441", "0.5081441", "0.50381255", "0.50109595", "0.49673313", "0.49537098", "0.49390882", "0.48964328", "0.48758164", "0.48585895", "0.4815701", "0.48087218", "0.48051843", "0.480...
0.0
-1
MAXIMUM TENSION IN JOIST BOTTOM CHORD
Qn(){ if(this.hd == 1.5){ switch(true){ case (this.Ttc<=0.113) : return 4.34 case (this.Ttc<=0.155) : return 4.51 case (this.Ttc<=0.187) : return 4.83 case (this.Ttc<=0.212) : return 4.78 case (this.Ttc<=0.25) : return 4.73 case (this.Ttc<=0.313) : return 4.58 default: return 4.1 } } else{ return 4.4 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TensionBottomChord(){\n return Math.max(0.5*this.phi_t*this.Abc*this.Fy, this.Mu_c()*12/this.deff_c())\n }", "getMaxHeightUnit(){return this.__maxHeightUnit}", "get maxHeight() {}", "getUpperLimit(occupiedTiles) {\n\t\tvar i = this.getTopTile();\t\t\n\t\tif (this.canGoUp(occupiedTiles)) {\n\t\t\twh...
[ "0.6879636", "0.6729693", "0.66597277", "0.6573439", "0.6315071", "0.6303107", "0.62706184", "0.6241134", "0.6229424", "0.62006044", "0.61840993", "0.61646485", "0.6157823", "0.61016595", "0.6085138", "0.60609865", "0.60609865", "0.6037276", "0.60263574", "0.5996353", "0.5985...
0.0
-1
SHEARFLEX SCREW SHEAR CAPACITY
Ns(){ return this.TensionBottomChord()/(this.phi_s*this.Qn()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get legStretch() {}", "set legStretch(value) {}", "set armStretch(value) {}", "get armStretch() {}", "function hp() {\n return (ctx.lineWidth / 2) % 1;\n}", "function scaleValue(value){\n //Assuming army size is between \n}", "function updateSwatch() {\n $(\"#swatch\").css(\"background-color...
[ "0.6106417", "0.595235", "0.59514636", "0.5855478", "0.57878345", "0.56574374", "0.56347436", "0.56178254", "0.5610166", "0.5590585", "0.5570016", "0.55666435", "0.55261546", "0.5513696", "0.5513696", "0.54958767", "0.54958767", "0.54958767", "0.54562014", "0.54345495", "0.54...
0.0
-1
NUMBER OF SHEARFLEX SCREWS REQUIRED FOR HALF SPAN
Nr(){ return this.Lj*12/6+1 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawLeftStars(num) {\n var str = '';\n for(var i = 0; i < num; i++) {\n str = str + \"*\";\n }\n for(var i = num; i < 75; i++) {\n str += \" \";\n }\n return str;\n}", "function howManyStars() {\n\tif (Number(movesMade.innerText) < 20) {\n\t\treturn \"3 stars\";\n\t}\n\tif (Number(movesMade....
[ "0.5779347", "0.57044184", "0.55851483", "0.5562804", "0.55172926", "0.549701", "0.54910976", "0.5453777", "0.54336375", "0.53997326", "0.5368172", "0.53667265", "0.5364144", "0.53525025", "0.53465265", "0.5343491", "0.53408235", "0.53225666", "0.53153276", "0.5315216", "0.53...
0.0
-1
TOTAL NUMBER OF DECK RIBS IN SPAN DEAD LOAD NONCOMPOSITE DEFLECTION
Ij_chords(){ let A_chord = this.Atc + this.Abc let De = this.Dj - this.Ytc - this.Ybc return this.Atc*this.Abc*Math.pow(De,2)/A_chord + this.Itc + this.Ibc }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadFactor() {\n return this.elements / this.capacity;\n }", "loadFactor() {\n return this.elements / this.capacity;\n }", "getItemCount() {\n let count = 0;\n for (const data of this.facetBatches.values()) {\n count += data.length;\n }\n return count;...
[ "0.6544292", "0.6544292", "0.5912205", "0.5777186", "0.5644072", "0.5567885", "0.5548198", "0.547524", "0.5451637", "0.54385155", "0.5420233", "0.5392416", "0.53916514", "0.5385511", "0.53751624", "0.5372095", "0.53694236", "0.53570336", "0.5356629", "0.53317666", "0.53317666...
0.0
-1
MOMENT OF INERTIA DUE TO JOIST CHORDS ONLY
Cr(){ return 0.721 + 0.00725*(this.Lj*12/this.Dj) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "imprimirMayorAMenor() {\n\t\tthis.vehiculos.sort((v1, v2) => {\n\t\t\treturn v2.precio - v1.precio\n\t\t})\n\n\t\tconsole.log('Vehiculos ordenados de mayor a menor:')\n\n\t\tthis.vehiculos.forEach(vehiculo => {\n\t\t\tconsole.log(`${vehiculo.marca} ${vehiculo.modelo}`)\n\t\t});\n\t}", "function Maisons(){\n ...
[ "0.60646623", "0.6022679", "0.59067726", "0.5822207", "0.58007336", "0.5775825", "0.57528806", "0.5673377", "0.5641583", "0.5629102", "0.56190675", "0.5605998", "0.560377", "0.55973643", "0.5568433", "0.55676144", "0.55631924", "0.55429137", "0.5531235", "0.54835206", "0.5481...
0.0
-1
MODIFIED MOMENT OF INERTIA
Deflection_DL_NonComposite(){ return 5*(this.DL*this.Sj/(12*12))*Math.pow(this.Lj,4)*Math.pow(12,4)/(384*29000000*this.Ij_modified()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "alterRenteninfo (person) {\n const geburtsjahr = person.geburtstag.getFullYear()\n return person.jahrRenteninfo - 1 - geburtsjahr\n }", "get modified() {\n return this.data.modified;\n }", "function cumpleanosModificadonObjeto(persona) {\n persona.edad += 1;\n}", "function edadEvil (persona...
[ "0.590018", "0.5824616", "0.57529455", "0.56413937", "0.56320065", "0.562661", "0.555354", "0.55300367", "0.5475902", "0.5413611", "0.5405245", "0.53656423", "0.53523844", "0.5342806", "0.523851", "0.52292275", "0.5191202", "0.51876336", "0.51618177", "0.5155467", "0.5152009"...
0.0
-1
LIVE LOAD COMPOSITE DEFLECTION
Ec(){ return 1.35*Math.pow(145,1.5)*Math.pow(this.Fc,0.5) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "lateLoad() {\n\n }", "loaded() {}", "function forceLoad() {}", "load() {}", "load() {}", "load() {\r\n\r\n }", "load () {\n\t\tthis.instanciable = false;\n\t\tconsole.log(this.name + \" loaded\");\n\t}", "function forceLoad() {\n\t // Noop\n\t}", "load() {\n\n }", "async load () {}", "fun...
[ "0.6854409", "0.68128", "0.6809117", "0.66983587", "0.66983587", "0.6637859", "0.64689547", "0.645681", "0.6451884", "0.64461017", "0.6443149", "0.6344516", "0.63348323", "0.6231554", "0.6226932", "0.61864084", "0.6178532", "0.6176171", "0.6162337", "0.6127077", "0.612579", ...
0.0
-1
TOTAL LOAD FOR VIBRATION CONSIDERATION
Deff(){ return 5*(this.wt()*this.Sj/(12*12))*Math.pow(this.Lj,4)*Math.pow(12,4)/(384*29000000*this.Ieff()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshTotalCount() {\n\t\t\tconsole.log(\"refreshTotalCount()\");\n LDBTotalCountAPI.get(function(data){\n vm.total_count = data.total_count;\n });\n }", "addTotalFetched() { this.totalFetched.value++; this.upda...
[ "0.64561725", "0.62312335", "0.61257005", "0.6058167", "0.6058167", "0.6051023", "0.60311735", "0.602524", "0.5995588", "0.5911692", "0.5893923", "0.5847231", "0.58361655", "0.5805507", "0.5743682", "0.5728614", "0.57093376", "0.56558025", "0.5642105", "0.56297183", "0.562685...
0.0
-1
DEFLECTION DUE TO Ieff
Fj(){ return 0.18*Math.pow(386/this.Deff(),0.5) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function UISelection(){\n\n }", "function SelectionChange() { }", "function SelectionChange() { }", "function SelectionUtil() {\n}", "function _autoselect() {\n ...
[ "0.5867442", "0.5867442", "0.5867442", "0.5867442", "0.5830722", "0.5673178", "0.5673178", "0.5633165", "0.55106086", "0.54410684", "0.5408361", "0.53562015", "0.5352319", "0.53439444", "0.53275955", "0.53146034", "0.5293706", "0.5281818", "0.5267992", "0.5262857", "0.5229977...
0.0
-1
JOIST PANEL MODE FREQUENCY
Ds(){ return (12*Math.pow(this.hc+this.hd/2,3))/(12*this.n()) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get mode(): number {\n if(this.alpha >= 1) {\n return (this.alpha - 1) / (this.beta + 1);\n }\n return 0;\n }", "get mode(): number {\n return this.xm;\n }", "modeBtnAction() {\n console.log('Toggling scale mode/unit')\n this._unit = trickler.TricklerUnits.GRA...
[ "0.6471912", "0.6092762", "0.5794371", "0.55437225", "0.5479068", "0.5469111", "0.5445043", "0.5440247", "0.54318887", "0.5429381", "0.5426631", "0.5418192", "0.5417382", "0.5391021", "0.53611696", "0.53361905", "0.5319592", "0.52992195", "0.5293107", "0.5285574", "0.5273278"...
0.0
-1
async call with callback handler function
function getData(data, callback) { setTimeout(() => console.log('JS reading data from DB'), 2000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function someAsyncApiCall(callback) { callback(); }", "function callback(){}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "async method(){}", "function fetchAsync(callback) {\n setTimeout(() => {\n callba...
[ "0.74743956", "0.71961886", "0.7181294", "0.7181294", "0.7181294", "0.7181294", "0.7181294", "0.67841697", "0.6782818", "0.67765427", "0.6761118", "0.66922796", "0.6670164", "0.6664339", "0.6658391", "0.6610528", "0.6610528", "0.6590483", "0.6581958", "0.6576084", "0.6560493"...
0.0
-1
gets index of array based on random draw weighted by value of each element
function getIndex(_array){ var sumOfValues = 0; var num = Math.random(); var index = -1; _array.forEach(function(ele) { sumOfValues += ele.value; }); for(var i = 0; i < _array.length; i++) { if (i === _array.length - 1) { index = i; break; } else if (num < _array[i].value / sumOfValues) { index = i; break; } else { num = num - _array[i].value / sumOfValues; } } return index; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomValueByWeight(objArray) {\n let rand = Math.floor(Math.random() * getTotalPoints(objArray)) + 1;\n\n // Subtract the points from the random number until we reach 0\n for (let i = 0; i < objArray.length; i++){\n rand -= objArray[i].points;\n \n\n // when we reach 0, w...
[ "0.6687079", "0.6569633", "0.645539", "0.64526594", "0.64434093", "0.64245975", "0.638839", "0.6384222", "0.63735205", "0.63533676", "0.633832", "0.6328794", "0.6284582", "0.6269779", "0.6254403", "0.6241771", "0.6241771", "0.6241771", "0.6230832", "0.62125516", "0.6199055", ...
0.68194574
0
24 Membuat Fungsi buat fungsi dibawah ini
function greetings(){ console.log('Selamat belajar Javascript!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function karinaFaarNotifikation() {\n\n\n\n}", "function trolaicautruoc(){\n\tconsole.log(\"Trở lại câu trước.\");\n\tif (Number(localStorage.caumayEn_SG_17) > 0){\n\t\tlocalStorage.caumayEn_SG_17 = Number(localStorage.caumayEn_SG_17) - 1\n\t}\n\tdoicau(Number(localStorage.caumayEn_SG_17))\n\tlocalStorage.dang ...
[ "0.65474564", "0.6149081", "0.6147393", "0.61168015", "0.61077005", "0.59285593", "0.59008247", "0.5867267", "0.5865246", "0.57832396", "0.56820065", "0.5675707", "0.5657452", "0.55996865", "0.558476", "0.55823797", "0.5563597", "0.5552179", "0.5537085", "0.5537085", "0.55370...
0.0
-1
27.skup variabel pada fungsi
function profil(nama, kota, lahir) { console.log('Nama saya ' + nama + '<br/>'); console.log('Saya berasal dari kota ' + kota + '<br/>'); console.log('Lahir pada tahun '+ lahir + '<br/>'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fuctionPanier(){\n\n}", "function ucapSalam() {\n return \"Selamat Siang\"; //return nilai harus membuat satu variable utk meyimpan nilai yang akan di return\n}", "function lalalala() {\n\n}", "function cetakPesan(nama, bahasa='id')\n{\n var pesan = 'Selamat datang, ' + nama;\n if(bahas...
[ "0.64322364", "0.6332965", "0.6263854", "0.6228572", "0.62035304", "0.61941713", "0.61395746", "0.6075827", "0.6071371", "0.59952164", "0.59894586", "0.5949339", "0.5949339", "0.5949339", "0.59423846", "0.5862675", "0.5844992", "0.58328986", "0.5819558", "0.5808047", "0.58046...
0.5647354
47
28. Argumen referensi pada fungsi
function cetakPesan(nama, bahasa='id') { var pesan = 'Selamat datang, ' + nama; if(bahasa == 'en') { pesan = 'Welcome, ' + nama; } else if(bahasa=='id'){ console.log(pesan); } console.log('Mohon maaf bahasa yang diminta belum terdaftar'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saludarArgumentos(referencia){\n console.log(arguments);\n}", "function example4() {\n\n var me = {\n name: \"Vlad\",\n surname: \"Argentum\"\n };\n\n function hi(_ref) {\n var _ref$name = _ref.name;\n var name = _ref$name === undefined ? \"Guest\" : _ref$name;\n var _ref$surname = ...
[ "0.65033376", "0.6096314", "0.6016148", "0.6003371", "0.589173", "0.5852196", "0.58397096", "0.582534", "0.5794307", "0.57870114", "0.5777681", "0.57664746", "0.57450473", "0.57440597", "0.57399464", "0.5738436", "0.56987035", "0.5650792", "0.56403136", "0.56367195", "0.56309...
0.0
-1
29. Mengembalikan nilai fungsi fungsi untuk menghitung luas lingkaran
function luasLingkaran(length) { return 1/4 * 3.14 * length * length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lalalala() {\n\n}", "function karinaFaarNotifikation() {\n\n\n\n}", "function hitungLuasPersegiPanjang (panjang,lebar){\n //tidak ada nilai balik\n var luas = panjang * lebar\n return luas\n}", "fungsiMakan() {\n return `Blubuk kelas parent di ambil alih blubuk ini`;\n }", "func...
[ "0.67988694", "0.6504913", "0.6493955", "0.64808935", "0.64238983", "0.6305628", "0.62205225", "0.6219264", "0.6119034", "0.6087615", "0.6069984", "0.6060339", "0.6060339", "0.6060339", "0.6024977", "0.6000924", "0.5977805", "0.5963935", "0.59573096", "0.59476304", "0.5905083...
0.0
-1
Setpember 29, 2017 Credit to Daniel Shiffman Source Video: Source Code:
function Cell(i, j, w) { this.i = i; this.j = j; this.x = i * w; this.y = j * w; this.w = w; this.neighborCount = 0 // randomize each cell to either have a mine or not this.mine = false; this.revealed = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "static private internal function m121() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "transient private internal fun...
[ "0.6818895", "0.66263264", "0.65006065", "0.63601816", "0.623416", "0.605049", "0.596176", "0.59535635", "0.5941524", "0.59306353", "0.5921483", "0.5830079", "0.58213127", "0.5798532", "0.57905495", "0.5699049", "0.563988", "0.5629676", "0.5626539", "0.56081647", "0.5598158",...
0.0
-1
get the number of questions
function getNumberOfQuestions() { //QuerySelectorAll has better browser support in exchange for being slightly slower than gEBCN. var totalQuestions = document.querySelectorAll('.question').length; return totalQuestions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberOfQuestions () {\n return quiz.questions.length\n}", "function numberOfQuestions () {\n return quiz.questions.length\n}", "function numberOfQuestions () {\n return quiz.questions.length\n}", "function getTotalQuestions() {\n var totalQuestions = questions.length;\n return totalQuestio...
[ "0.8672922", "0.8672922", "0.8672922", "0.8176095", "0.80032235", "0.80032235", "0.79872924", "0.77535206", "0.75808924", "0.7268318", "0.7256829", "0.7233575", "0.7208823", "0.7126429", "0.69538635", "0.6945594", "0.69435525", "0.68967384", "0.6796744", "0.6791251", "0.67248...
0.8146406
4
function to calculate the result of the survey initialize variables for each choice's score If you add more choices and outcomes, you must add another variable here.
function calculateResults() { document.getElementById('answer').style.display = 'block'; document.getElementById('loading').style.display = 'none'; document.getElementById('calc').style.display = 'none'; inputProgress.style.display = 'none'; progress.style.display = 'none'; var showTable = document.getElementById('table'); showTable.classList.remove('invisible'); caclRiskProfile(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tabulateAnswers() {\n // initialize variables for each choice's score\n // If you add more choices and outcomes, you must add another variable here.\n var yes1score = 0;\n var no1score = 0;\n var yes2score = 0;\n var no2score = 0;\n var yes3score = 0;\n var no3score = 0;\n var yes4score = 0;\n v...
[ "0.69529206", "0.6812489", "0.6739765", "0.660667", "0.658801", "0.6580189", "0.647715", "0.6439481", "0.6417482", "0.6347581", "0.6314834", "0.62986904", "0.629216", "0.6291693", "0.6270063", "0.6256722", "0.6206869", "0.6194857", "0.6182095", "0.61617374", "0.6160131", "0...
0.0
-1
program the reset button
function resetAnswer() { var ele = document.getElementById('riskProfile'); window.scrollTo(ele.offsetLeft, ele.offsetTop); window.location.reload(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetButtonPressed() {\n reset();\n}", "function reset() {\n reset_butt.click();\n}", "function pressReset(){\n events.emit('resetBtn', true);\n }", "function actionOnResetClick () {\n gameRestart();\n }", "function reset() {\n\n }", "function reset(e){\n ...
[ "0.85235846", "0.8444661", "0.83487165", "0.78616506", "0.78010255", "0.77509665", "0.7739108", "0.77288103", "0.7703846", "0.7667002", "0.7590134", "0.75833684", "0.7576136", "0.7573686", "0.7551632", "0.7543608", "0.75134486", "0.74861866", "0.74801373", "0.7455764", "0.742...
0.0
-1
Make the given changes to the state and perform any required housekeeping
function setState(changes) { Object.assign(state, changes); const props = Object.assign({}, state, { value: state.newSearch, onChange: updateSearch, }); ReactDOM.render( <div><App /><CitiesForm {...props} /> </div>, document.getElementById('app') ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changes(state,payload){\n state.commit(\"addSomeName\",payload.name);\n state.commit(\"changeCity\",payload.city);\n }", "changeState(state) {\r\n if (!this.states[state]) {\r\n throw new Error(\"This state doesn't exist.\");\r\n }\r\n this.statesDone.push(state);\r\n...
[ "0.6556796", "0.6505756", "0.64642066", "0.6459441", "0.64084727", "0.63686955", "0.6356907", "0.6345751", "0.63426995", "0.6329245", "0.6318044", "0.6308926", "0.6267514", "0.6263355", "0.6216957", "0.6210426", "0.6186654", "0.6185856", "0.61777806", "0.6150122", "0.6135519"...
0.0
-1
Example: "Vec.of( 1,0,0 ).equals( Vec.of( 1,0,0 ) )" returns true.
plus(b) { return this.map((x, i) => x + b[i]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "equals(vector) {\n \n // Check that the vectors equal the same value\n return (this.toString() === vector.toString());\n }", "equals(vec){\n return this.x === vec.x && this.y === vec.y;\n }", "equals(...args) \r\n {\r\n let a, b;\r\n if (args[0] instanceof Vector2D) \r\n {\r...
[ "0.7469338", "0.70202494", "0.6979374", "0.6764572", "0.65684056", "0.6421915", "0.6421915", "0.6325276", "0.6200986", "0.6184199", "0.61605537", "0.6107802", "0.6091598", "0.6032227", "0.6017362", "0.5985649", "0.59706223", "0.59529936", "0.59414196", "0.59239614", "0.592113...
0.0
-1
Example: "Vec.of( 1,0,0 ).plus ( Vec.of( 1,0,0 ) )" returns the Vec [ 2,0,0 ].
minus(b) { return this.map((x, i) => x - b[i]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vectorAdd(a, b) {\n\treturn [ a[0] + b[0], a[1] + b[1] ];\n}", "function vadd(a,b) { return [a[0]+b[0], a[1]+b[1]] }", "function add( v1, v2 ) { return [ v1[0] + v2[0], v1[1] + v2[1], v1[2] + v2[2] ]; }", "plus(other) {\n return new Vector(this.x + other.x, this.y + other.y);\n ...
[ "0.71344256", "0.6986896", "0.69495577", "0.68993694", "0.6852878", "0.6852878", "0.6847386", "0.6814459", "0.67967516", "0.67937165", "0.6750764", "0.6750764", "0.6735317", "0.6707938", "0.66939896", "0.6654446", "0.6654446", "0.6643855", "0.6637022", "0.6616922", "0.6506429...
0.0
-1
Example: "Vec.of( 1,0,0 ).minus ( Vec.of( 1,0,0 ) )" returns the Vec [ 0,0,0 ].
mult_pairs(b) { return this.map((x, i) => x * b[i]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static subtract(v1,v2) {\n try {\n if (!(v1 instanceof Vector) || !(v2 instanceof Vector))\n throw \"Vector.subtract: non-vector parameter\";\n else {\n var v = new Vector(v1.x-v2.x,v1.y-v2.y,v1.z-v2.z);\n //v.toConsole(\"Vector.subtract: \"...
[ "0.7363974", "0.7347908", "0.6944243", "0.6944243", "0.6912665", "0.6904948", "0.6895335", "0.6875109", "0.6811959", "0.6805193", "0.67930955", "0.669519", "0.669519", "0.6663241", "0.6642289", "0.66279656", "0.6615471", "0.65880257", "0.65880257", "0.6580789", "0.656407", ...
0.0
-1
Example: "Vec.of( 1,2,3 ).mult_pairs( Vec.of( 3,2,0 ) )" returns the Vec [ 3,4,0 ].
scale(s) { this.forEach((x, i, a) => a[i] *= s); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mult_pairs(b) {\r\n return this.map((x, i) => x * b[i]);\r\n }", "function multip_2(param) {\n return param.map((cur) => {\n return cur * 2;\n })\n}", "function pairProduct(arr, num)\n{\n\tvar multiples = [];\n\n\tfor(var i = 0; i<= arr.length - 1; i++)\n\t{\n\t\tvar outerNum = arr[i];\n...
[ "0.70968187", "0.6269477", "0.610745", "0.6060162", "0.5912525", "0.5838945", "0.57401896", "0.56858623", "0.56832975", "0.56680566", "0.5546273", "0.5542164", "0.5542164", "0.55360013", "0.5515135", "0.55020374", "0.54868454", "0.54580104", "0.54580104", "0.54431266", "0.543...
0.0
-1
Example: "Vec.of( 1,2,3 ).scale( 2 )" overwrites the Vec with [ 2,4,6 ].
times(s) { return this.map(x => s * x); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scale(vec, setTo) {\n\t\tthis.transform(this.transformation.scale, vec, setTo);\n\t}", "scale(s) {\r\n this.forEach((x, i, a) => a[i] *= s);\r\n }", "scale (vec, m) {\n\t return [vec[0] * m, vec[1] * m];\n\t }", "scale (vec, m) {\n return [vec[0] * m, vec[1] * m];\n }", "scale (v...
[ "0.70159477", "0.68541026", "0.6731656", "0.6703979", "0.6703979", "0.6703979", "0.6703979", "0.66489094", "0.66489094", "0.6631511", "0.6631511", "0.6631511", "0.6631511", "0.6631511", "0.66061157", "0.6575169", "0.6559048", "0.6556549", "0.6525036", "0.6464183", "0.64539045...
0.0
-1
Example: "Vec.of( 1,2,3 ).times( 2 )" returns the Vec [ 2,4,6 ].
randomized(s) { return this.map(x => x + s * (Math.random() - .5)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "times(s) {\r\n return this.map(x => s * x);\r\n }", "multiply(times) {\n\n }", "times(n) {\n return (f) => {\n Array(n).fill().map((_, i) => f(i));\n }\n }", "function multiplyVect(vector, scalar) {\n return [ scalar * vector[0],\n scalar * vector[1],\n scalar * ...
[ "0.72596514", "0.651514", "0.6272121", "0.61160016", "0.6052396", "0.602342", "0.60102385", "0.59674436", "0.59518516", "0.59286743", "0.59191066", "0.59023744", "0.58929795", "0.588914", "0.5885915", "0.5868397", "0.58527833", "0.5833305", "0.58274454", "0.5791359", "0.57750...
0.0
-1
Returns this Vec with a random vector added, with a maximum scale of s.
mix(b, s) { return this.map((x, i) => (1 - s) * x + s * b[i]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "randomized(s) {\r\n return this.map(x => x + s * (Math.random() - .5));\r\n }", "static Random() {\n return new Vector((Math.random() - 0.5) * 2, (Math.random() - 0.5) * 2)\n }", "randomVec (length) {\n\t var deg = 2 * Math.PI * Math.random();\n\t return Util.scale([Math.sin(deg), Math.cos(...
[ "0.6278749", "0.6252497", "0.59347826", "0.5928888", "0.58153677", "0.5807317", "0.5807317", "0.57961226", "0.57961226", "0.5764685", "0.5728931", "0.5721706", "0.57060975", "0.56630707", "0.56488216", "0.5622429", "0.5584743", "0.55751705", "0.5566001", "0.5497217", "0.54924...
0.0
-1
Example: "Vec.of( 0,2,4 ).mix( Vec.of( 10,10,10 ), .5 )" returns the Vec [ 5,6,7 ].
norm() { return Math.sqrt(this.dot(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mix(b, s) {\r\n return this.map((x, i) => (1 - s) * x + s * b[i]);\r\n }", "function sumMix(x){\r\n var y = x.map(Number)\r\n var sum=0\r\n for(i=0;i<y.length;i++){\r\n sum+=y[i]\r\n }\r\n return sum\r\n\r\n }", "function sumMix(x){\n let total = 0;\n\n for (var i = 0; i < ...
[ "0.643299", "0.58676636", "0.5793314", "0.56544244", "0.5643713", "0.56258416", "0.56170255", "0.5395045", "0.5245507", "0.5243923", "0.5231821", "0.51956356", "0.50920385", "0.5029485", "0.5029485", "0.5029485", "0.5029485", "0.49778426", "0.4976851", "0.49745685", "0.497456...
0.0
-1
Example: "Vec.of( 1,2,3 ).norm()" returns the square root of 15.
normalized() { return this.times(1 / this.norm()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function norm(a){return dot(a, a);}", "norm() {\r\n return Math.sqrt(this.dot(this));\r\n }", "norm( v ){\n\t\tvar i\n\t\tvar norm = 0\n\t\tfor( i = 0; i < v.length; i++ ){\n\t\t\tnorm += v[i]*v[i]\n\t\t}\n\t\tnorm = Math.sqrt( norm )\n\t\treturn norm\n\t}", "function normSquare (v) {return scalar...
[ "0.7542385", "0.7480259", "0.74163264", "0.7403365", "0.7375341", "0.7218477", "0.719705", "0.71663624", "0.70061", "0.68845624", "0.68305975", "0.6648328", "0.6648156", "0.66436046", "0.661312", "0.6530234", "0.6526697", "0.6461827", "0.6304456", "0.62906593", "0.62856007", ...
0.59617466
41
Example: "Vec.of( 4,4,4 ).normalized()" returns the Vec [ sqrt(3), sqrt(3), sqrt(3) ]
normalize() { this.scale(1 / this.norm()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "normalized () {\n return Vector.normalize(this);\n }", "normalized () {\n return Vector.normalize(this);\n }", "static Normalized(vec) {\n vec = new VecX(vec);\n if (vec.Magnitude() === 0)\n return vec.Multiply(0);\n return vec.Divide(vec.Magnitude());\n }", "normal...
[ "0.75587344", "0.75587344", "0.7331945", "0.72905034", "0.71814275", "0.7149609", "0.7135719", "0.71272594", "0.7097993", "0.70924044", "0.7055217", "0.7049542", "0.69635206", "0.693609", "0.6922648", "0.69141155", "0.6909233", "0.6897788", "0.68697476", "0.686928", "0.686789...
0.59704435
61
Example: "Vec.of( 4,4,4 ).normalize()" overwrites the Vec with [ sqrt(3), sqrt(3), sqrt(3) ].
dot(b) // Example: "Vec.of( 1,2,3 ).dot( Vec.of( 1,2,3 ) )" returns 15. { if (this.length == 3) return this[0] * b[0] + this[1] * b[1] + this[2] * b[2]; // Optimized to do the arithmatic manually for array lengths less than 4. if (this.length == 4) return this[0] * b[0] + this[1] * b[1] + this[2] * b[2] + this[3] * b[3]; if (this.length > 4) return this.reduce((acc, x, i) => { return acc + x * b[i]; }, 0); return this[0] * b[0] + this[1] * b[1]; // Assume length 2 otherwise. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "normalize(vec) {\n const norm = Util.magnitude(vec);\n return Util.scale(vec, 1 / norm);\n }", "static Normalized(vec) {\n vec = new VecX(vec);\n if (vec.Magnitude() === 0)\n return vec.Multiply(0);\n return vec.Divide(vec.Magnitude());\n }", "normalized () {\n retu...
[ "0.7825508", "0.76664144", "0.7553512", "0.7553512", "0.75097775", "0.7507168", "0.7476836", "0.74660647", "0.7400076", "0.7397837", "0.7378309", "0.73022765", "0.7270133", "0.725188", "0.72281075", "0.71421283", "0.7139801", "0.71324384", "0.710753", "0.7081092", "0.70685524...
0.0
-1
Using cast() saves having to type Vec.of so many times:
static cast(...args) { return args.map(x => Vec.from(x)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function castToArray(cast) {\n\t\t\treturn cast && cast.length ? Array.prototype.slice.call(cast) : null;\n\t\t}", "function cast(){\n\t//nothing\n}", "function handleArray (val) {\n\t\tvar self = this;\n\t\treturn val.map(function (m) {\n\t\t\treturn self.cast(m);\n\t\t});\n\t}", "function castAsArray(arg) ...
[ "0.6700853", "0.5798919", "0.5644212", "0.55916095", "0.53920156", "0.5374692", "0.5354472", "0.53221154", "0.5297637", "0.5292541", "0.52922386", "0.5266621", "0.5266621", "0.5266621", "0.5216886", "0.5146566", "0.51124585", "0.51119965", "0.5102854", "0.5095158", "0.5077500...
0.771221
0
Convert a list of Array literals into a list of Vecs. Usage: "Vec.cast( [1,1,0], [1,1,0], [1,1,0] )"
to3() { return Vec.of(this[0], this[1], this[2]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static cast(...args) {\r\n return args.map(x => Vec.from(x));\r\n }", "function _arrayToVec(array) {\n var len = array.length;\n return 'vec' + len + '(' + array.join(',') + ')';\n}", "function toVector(arr) {\n return concat.apply([], arr);\n}", "function toVector(arr) {\n return concat.a...
[ "0.73320806", "0.6376138", "0.6324265", "0.6324265", "0.62814724", "0.6196814", "0.61602837", "0.6156954", "0.6108235", "0.60046405", "0.59912413", "0.5958344", "0.5874739", "0.5819045", "0.5790934", "0.57662743", "0.5735635", "0.5735635", "0.56867915", "0.5685139", "0.566819...
0.0
-1
Use only on 4x1 Vecs to truncate them. Example: "Vec.of( 1,2,3,4 ).to3()" returns the Vec [ 1,2,3 ].
to4(isPoint) { return Vec.of(this[0], this[1], this[2], +isPoint); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cutIt(arr){\n var min = Math.min(...arr.map(({ length }) => length));\n //map over array slice it by min.\n<<<<<<< HEAD\n \n \n}", "to3() {\r\n return Vec.of(this[0], this[1], this[2]);\r\n }", "function truncate(float32ArrayIn, len) {\n\t if(Float32Array.slice === undefined) {\n\t ...
[ "0.58088136", "0.58009976", "0.5743571", "0.571794", "0.55108404", "0.54483247", "0.5434133", "0.52625185", "0.52498", "0.5236089", "0.52322483", "0.52292186", "0.518845", "0.5150317", "0.5148313", "0.51468205", "0.5138621", "0.51290596", "0.5120419", "0.5107938", "0.5107067"...
0.48013616
63
Use only on 3x1 Vecs to homogenize them. Example: "Vec.of( 1,2,3 ).to4( true or false )" returns the Vec [ 1,2,3, 1 or 0 ].
cross(b) // Use only on 3x1 Vecs. Example: "Vec.of( 1,0,0 ).cross( Vec.of( 0,1,0 ) )" returns the Vec [ 0,0,1 ]. { return Vec.of(this[1] * b[2] - this[2] * b[1], this[2] * b[0] - this[0] * b[2], this[0] * b[1] - this[1] * b[0]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "to3() {\r\n return Vec.of(this[0], this[1], this[2]);\r\n }", "to4(isPoint) {\r\n return Vec.of(this[0], this[1], this[2], +isPoint);\r\n }", "static ones() {\n\n // Return a Vector with 1, 1, 1\n return new Vector([1, 1, 1]);\n }", "static make4Vec() {\nreturn new Float32Array(4);...
[ "0.5919878", "0.58700734", "0.57981265", "0.56932217", "0.56930447", "0.5520572", "0.5387481", "0.5381846", "0.5360216", "0.5337002", "0.523858", "0.52362084", "0.52151406", "0.5203394", "0.5198301", "0.51878494", "0.51607394", "0.51368564", "0.51310474", "0.5126837", "0.5125...
0.0
-1
Pass in rows (which can be arrays).
set_identity(m, n) { this.length = 0; for (let i = 0; i < m; i++) { this.push(new Array(n).fill(0)); if (i < n) this[i][i] = 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseRows(rows) {\n if (this.options.fields === false) {\n const fakeRows = [];\n\n if (this.options.first) {\n fakeRows.push(null);\n }\n\n return fakeRows;\n }\n\n return rows.map(this.parseRow, this);\n }", "toRow(row) {\n this.columns.map(col => row[col.index]);\n ...
[ "0.6616887", "0.65492505", "0.63403636", "0.6272839", "0.62343156", "0.6188844", "0.6132762", "0.6121672", "0.6069596", "0.60468477", "0.60302037", "0.6016578", "0.5994211", "0.59853107", "0.595452", "0.5930018", "0.59257287", "0.58879346", "0.5882947", "0.5848878", "0.584064...
0.0
-1
Returns an m by n identity matrix.
sub_block(start, end) { return Mat.from(this.slice(start[0], end[0]).map(r => r.slice(start[1], end[1]))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function IdentityMatrix(n) {\n this.height = n;\n this.width = n;\n this.mtx = [];\n for (var i = 0; i < n; i++) {\n this.mtx[i] = [];\n for (var j = 0; j < n; j++) {\n this.mtx[i][j] = (i == j ? 1 : 0);\n }\n }\n}", "function identityMatrix() {\n\treturn [\n\t\t1, ...
[ "0.81995034", "0.8109431", "0.7978642", "0.7962778", "0.7782223", "0.7689949", "0.7592319", "0.7516685", "0.6977204", "0.69322807", "0.6842713", "0.6738116", "0.67309666", "0.6685566", "0.66797876", "0.66033643", "0.6519174", "0.64781916", "0.6400401", "0.6381071", "0.6340766...
0.0
-1
Both of start and end must be a [ row, column ].
copy() { return this.map(r => Vec.of(...r)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInRange(pos, start, end) {\n if (typeof pos != 'number') {\n // Assume it is a cursor position. Get the line number.\n pos = pos.line;\n }\n if (start instanceof Array) {\n return inArray(pos, start);\n } else {\n if (typeof end == 'number') {\n r...
[ "0.6415549", "0.6395434", "0.63818276", "0.63800603", "0.6367474", "0.62553483", "0.62053293", "0.6145948", "0.613062", "0.6127228", "0.6118138", "0.61091846", "0.60666275", "0.606555", "0.5982297", "0.5980037", "0.5977609", "0.5977609", "0.5948912", "0.59420526", "0.5929933"...
0.0
-1
Transposing turns all rows into columns and vice versa.
times(b) { const len = b.length; // Usage: M.times(b) where b can be a scalar, a Vec, or another Mat. Returns a new Mat. if (typeof len === "undefined") return this.map(r => r.map(x => b * x)); // Mat * scalar case. const len2 = b[0].length; if (typeof len2 === "undefined") { let result = Vec.of(...new Array(this.length)); // Mat * Vec case. for (var r = 0; r < len; r++) result[r] = b.dot(this[r]); return result; } let result = Mat.from(new Array(this.length)); for (let r = 0; r < this.length; r++) // Mat * Mat case. { result[r] = new Array(len2); for (let c = 0, sum = 0; c < len2; c++) { result[r][c] = 0; for (let r2 = 0; r2 < len; r2++) result[r][c] += this[r][r2] * b[r2][c]; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "transpose(arr) {\n\t\tif (Array.isArray(arr[0])) {\n\t\t\treturn arr[0].map((col, i) => arr.map(row => row[i]));\n\t\t} else {\n\t\t\tlet t = new Array(arr.length);\n\t\t\tfor (let i = 0; i < this.size; i++) {\n\t\t\t\tfor (let j = 0; j < this.size; j++) {\n\t\t\t\t\tt[i + this.size * j] = arr[j + this.size * i];\...
[ "0.6924914", "0.6873821", "0.6788616", "0.6686729", "0.6667833", "0.663993", "0.65830195", "0.6568882", "0.6568607", "0.6485466", "0.64818954", "0.6475725", "0.6464204", "0.6460248", "0.6456923", "0.6417554", "0.6354245", "0.6331179", "0.63195205", "0.6308992", "0.6208569", ...
0.0
-1
Overwrites the matrix with the new product.
post_multiply(b) { var new_value = this.times(b); this.length = 0; this.push(...new_value); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matrixMultiply() {\n \"use strict\";\n\n var i;\n var j;\n var k;\n\n newComposite = new Array(composite.length);\n\n for (i = 0; i < newComposite.length; i += 1) {\n newComposite[i] = new Array(newTransform[i].length);\n for (j = 0; j < composite.length; j += 1) {\n ...
[ "0.67409146", "0.6665142", "0.654001", "0.6426403", "0.6324648", "0.6292943", "0.6289421", "0.6254326", "0.62039304", "0.6148832", "0.61286926", "0.60649693", "0.6057378", "0.6042743", "0.6018566", "0.6016008", "0.59839904", "0.5978976", "0.5917901", "0.589189", "0.58882535",...
0.5225647
96
Overwrites the matrix with the new product.
static flatten_2D_to_1D(M) // Turn any 2D Array into a row-major 1D array of raw floats. { var index = 0, floats = new Float32Array(M.length && M.length * M[0].length); for (let i = 0; i < M.length; i++) for (let j = 0; j < M[i].length; j++) floats[index++] = M[i][j]; return floats; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matrixMultiply() {\n \"use strict\";\n\n var i;\n var j;\n var k;\n\n newComposite = new Array(composite.length);\n\n for (i = 0; i < newComposite.length; i += 1) {\n newComposite[i] = new Array(newTransform[i].length);\n for (j = 0; j < composite.length; j += 1) {\n ...
[ "0.67409146", "0.6665142", "0.654001", "0.6426403", "0.6324648", "0.6292943", "0.6289421", "0.6254326", "0.62039304", "0.6148832", "0.61286926", "0.60649693", "0.6057378", "0.6042743", "0.6018566", "0.6016008", "0.59839904", "0.5978976", "0.5917901", "0.589189", "0.58882535",...
0.0
-1
inverse space. You can also use it to point the basis of any object towards Note: look_at() assumes the result will used for a camera and stores its result in inverse space. You can also use it to point the basis of any object towards
static look_at(eye, at, up) { let z = at.minus(eye).normalized(), // anything but you must re-invert it first. Each input must be 3x1 Vec. x = z.cross(up).normalized(), // Compute vectors along the requested coordinate axes. y = x.cross(z).normalized(); // (y is the "updated" and orthogonalized local y axis.) if (!x.every(i => i == i)) throw "Two parallel vectors were given"; // Check for NaN, indicating a degenerate cross product, which z.scale(-1); // happens if eye == at, or if at minus eye is parallel to up. return Mat4.translation([-x.dot(eye), -y.dot(eye), -z.dot(eye)]).times(Mat.of(x.to4(0), y.to4(0), z.to4(0), Vec.of(0, 0, 0, 1))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "applyInverse(){\n scale(p5.Vector.div(new p5.Vector(1,1,1), this.scale));\n angleMode(RADIANS);\n rotate(-this.rotation);\n translate(p5.Vector.sub(new p5.Vector(0,0,0), this.position));\n }", "function lookAt(eyePos, target, up) {\n let dir = normalize(subVec(target, eyePos));\n let side = normal...
[ "0.6838796", "0.63511145", "0.627761", "0.6254232", "0.6179638", "0.60985196", "0.6071428", "0.60674334", "0.6023386", "0.5991383", "0.5900661", "0.58671105", "0.58531076", "0.58490586", "0.57882106", "0.57679313", "0.57453734", "0.570905", "0.57036304", "0.5691103", "0.56554...
0.6678622
1
define abstract Group class
function Group() { this.cells = []; //array of cell objects }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Group(/* null | group */)\n{\n this.internals = []; \t\t\t\t // a list of internal objects\n\tthis.transformationMarker = new Transformation(); // transformation marker\n\tthis.axes = [];\n\tGroup.count++;\n\tthis.name = \"Group\"+Group.count;\n\tthis.viewPoint = new Transformation();\n\t...
[ "0.7075827", "0.697077", "0.67892027", "0.6725062", "0.66630876", "0.6498547", "0.6426286", "0.6401402", "0.6363222", "0.6347624", "0.62811255", "0.62530875", "0.6207667", "0.6083013", "0.60417217", "0.60373396", "0.60295516", "0.60295516", "0.60139614", "0.5997739", "0.59895...
0.5740905
31
define sudoku grid class
function Grid() { //repositories this.cells = []; this.rows = []; this.columns = []; this.halls = []; this.cubes = []; //build the grid structure for (var i=0; i<(base*base); i++) { this.rows.push(new Group()); this.columns.push(new Group()); this.halls.push(new Group()); this.cubes.push(new Group()); } //generate cells var base2 = base*base; for (var i=0; i<(base*base*base); i++) { //determine the indexes var columnIndex = i % base + 8 * Math.floor(i/(base2)); var hallIndex = i - base2 * Math.floor(i/(base2)); var rowIndex = Math.floor(i/base); var cubeIndex = Math.floor(columnIndex % base / Math.cbrt(base)) + Math.floor(rowIndex % base / Math.cbrt(base)) * Math.pow(Math.cbrt(base),2) + Math.floor(i / (base2 * Math.cbrt(base))) * Math.pow(Math.pow(Math.cbrt(base),2),2); //create the cell var cell = new Cell(this.rows[rowIndex], this.columns[columnIndex], this.halls[hallIndex], this.cubes[cubeIndex], this); this.cells.push(cell); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init_grid() {\n this.grid_default = new Array(8);\n\n for (let i = 0; i < 8; ++i) {\n this.grid_default[i] = new Array(8);\n }\n this.grid_default[0][0] = new Tour(1, 0, 0);\n this.grid_default[0][1] = new Cavalier(1, 1, 0);\n this.grid_default[0][2] = new Fou(1...
[ "0.7397928", "0.72089326", "0.6896276", "0.6834267", "0.6834267", "0.6824819", "0.6777383", "0.6760057", "0.67417264", "0.6734718", "0.66933763", "0.66845614", "0.666444", "0.66487044", "0.66487044", "0.66487044", "0.6598362", "0.65879214", "0.6566051", "0.65462947", "0.65445...
0.70695287
2
Determines what icon library to use based on global and local props
configureIconLib() { if (this.preserveDefaults) { this.iconLibrary = this.$thisvui.iconLib; } else { let parent = this.$parent; let pIconLib = parent && parent.$props ? parent.$props.iconLib : null; this.iconLibrary = this.iconLib ? this.iconLib : parent && pIconLib ? pIconLib : this.$thisvui.iconLib; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getIcon(val, context) {\n let ary = val.replaceAll(\"/\", \"-\").split(\":\");\n // legacy API used to fill in icons: for lazy devs so let's mirror\n if (ary.length === 1) {\n ary = [\"icons\", val];\n }\n if (ary.length == 2 && this.iconsets[ary[0]]) {\n if (\n typeof this.iconsets...
[ "0.6401513", "0.6260129", "0.6250962", "0.6234241", "0.6216329", "0.6195067", "0.6183047", "0.6177531", "0.6177531", "0.6177531", "0.6131964", "0.6131964", "0.6131964", "0.6123578", "0.6123578", "0.6120065", "0.6120065", "0.60722744", "0.60722744", "0.6066072", "0.6062497", ...
0.74498
0
If the first parameter is an object, it should loop over the object's properties and call the callback for each one. The property value should be the first parameter passed to the callback and the property name should be the second. If the first parameter is an array, it should loop over the array's elements and call the callback for each one. The array element should be the first parameter passed to the callback and the index should be the second.
function each(list, calling) { for (var thing in list) { calling(list[thing], thing); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function each(objOrArr, callBack) {\n\n\n}", "function each(arr1, callBack) {\n for (var i = 0; i < arr1.length; i++) {\n var item = arr1[i];\n var indice = i;\n callBack(item, indice);\n }\n}", "function forEach(obj, callback, thisObject) {\n var keys = Object.keys(obj);\n for (var i = 0, l = key...
[ "0.682296", "0.65221745", "0.6321434", "0.62480694", "0.6215558", "0.62066424", "0.6002798", "0.59701455", "0.5941176", "0.5941176", "0.5933658", "0.59194165", "0.590782", "0.5900983", "0.5899266", "0.58979326", "0.5897203", "0.5865748", "0.58479834", "0.58479834", "0.5847886...
0.0
-1
Write a function that takes an array as a parameter and returns a new array containing all of the items that are in the array that was passed in but in reverse order. Unlike the reverse method that all arrays have, this function should leave the original array unchanged.
function mirrow(anArray) { var mirrowing = anArray.slice(0, anArray.length); mirrowing.reverse(); return mirrowing; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reverse(array){\n\tresult =[];\n\tiLen = array.length-1;\n\tarray.forEach(function(item,i){\n\t\tresult[i]=array[iLen-i];\n\t});\n\treturn result;\n}", "function reverseArray(array) {\n return array.reverse();\n}", "function reverseArray (array) {\n array.reverse();\n}", "function inverseArray...
[ "0.7796307", "0.7734009", "0.7733826", "0.77236414", "0.7668135", "0.76587033", "0.7610862", "0.75761604", "0.75675845", "0.7514727", "0.7502639", "0.74758756", "0.74538773", "0.74402124", "0.7438041", "0.74185896", "0.74056756", "0.7401416", "0.73763126", "0.7374274", "0.736...
0.7075305
68
Write a function called getLessThanZero that expects an array of numbers to be passed to it and returns a new array containing only those numbers from the array that was passed in that are less than zero.
function getLessThanZero(bunchOfNumbers) { var onlyLow = []; // bunchOfNumbers.slice(0, bunchOfNumbers.length); for (var i = 0; i < bunchOfNumbers.length; i++) { if (bunchOfNumbers[i] <= 0) { onlyLow.push(bunchOfNumbers[i]); } } return onlyLow; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLessThanZero(arr) {\n if (!Array.isArray(arr)) {\n return console.log(\"Not an Array\");\n }\n\n var filtered = arr.filter(function(num) {\n return num < 0;\n });\n\n return filtered;\n}", "function getPositiveNum(array) {\n return array.filter(num => num >= 0)\n}", "...
[ "0.8288536", "0.79483676", "0.7675818", "0.74729955", "0.70672005", "0.69478786", "0.69185185", "0.6916036", "0.68330497", "0.68042225", "0.67699873", "0.67229503", "0.671991", "0.67122924", "0.66578543", "0.6624909", "0.6608879", "0.65871596", "0.65754306", "0.6573117", "0.6...
0.804976
1
Lifecycle hook for when the component mounts, occurs once
componentDidMount() { const { bankId } = this.props; // Add an event listener to the document for 'keydown' events document.addEventListener('keydown', this.handleKeyDown); // Use the API to get an array of sounds for the currently selected bank const sounds = api.getSounds(bankId); // Set the component state with the current bank and sounds // This will force a rerender this.setState(() => ({ currentBank: bankId, sounds })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n this.componentLoaded = true;\n }", "componenetWillMount() { }", "createdCallback() {\n\t // component will mount only if part of the active document\n\t this.componentWillMount();\n\t}", "componenetDidMount() { }", "onComponentMount() {\n\n }", "componentDidMount() ...
[ "0.75422895", "0.75409794", "0.7534624", "0.7500269", "0.73533684", "0.7334906", "0.73205936", "0.71976966", "0.7192735", "0.7192735", "0.7192735", "0.71896046", "0.7143916", "0.712866", "0.71196586", "0.71196586", "0.7066945", "0.705905", "0.7054449", "0.70331347", "0.700944...
0.0
-1
Lifecycle hook for when the component receives updated props This will occur any time the props are updated through Redux
componentWillReceiveProps(nextProps) { // Check if the updated bank is equal to the current bank if (nextProps.bankId !== this.state.currentBank) { // If so, then get an updated list of sounds const sounds = api.getSounds(nextProps.bankId); this.audioRefs = []; // reset the refs array // Set the new state of the component and rerender this.setState(() => ({ currentBank: nextProps.bankId, sounds })); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidUpdate(props_) {}", "componentDidUpdate(oldProps) {\n const newProps = this.props;\n // TODO: support batch updates\n for (const prop in pick(newProps, attributesToStore)) {\n if (!isEqual(oldProps[prop], newProps[prop])) {\n if (prop in reduxActions) {\n let...
[ "0.7401416", "0.7212571", "0.71723986", "0.70731694", "0.70092875", "0.69884443", "0.69810486", "0.6951394", "0.6927628", "0.69176555", "0.6885189", "0.68430763", "0.68293977", "0.6823547", "0.6812054", "0.68036604", "0.67877126", "0.6771834", "0.67638624", "0.6724362", "0.66...
0.0
-1
Lifecycle hook for when the component unmounts
componentWillUnmount() { // Remove the event listener for 'keydown' as it is no longer needed document.removeEventListener('keydown', this.handleKeyDown); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentWillUnmount() {\n // console.log('Unmounted');\n base.removeBinding(this.ref);\n }", "componentWillUnmount() {\n console.log('component is being removed')\n }", "componentWillUnmount() {\n\t\tthis._isMounted = false;\n\t}", "componentWillUnmount() {\n\t\tthis._isMounted = false;\n\t}", ...
[ "0.76786494", "0.76753104", "0.7670251", "0.7670251", "0.7660515", "0.76491576", "0.75940335", "0.75703806", "0.75703806", "0.75703806", "0.75703806", "0.75703806", "0.75703806", "0.75703806", "0.75703806", "0.7551948", "0.75490254", "0.7542401", "0.75366336", "0.75366336", "...
0.0
-1
Find the node containing the book title
function getTitleNode() { var nodes = document.evaluate("//span[@id='" + titleNodeId + "']", document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null); if(!nodes){ return null; } var thisNode = nodes.iterateNext(); var titleNode; // Get the last node while(thisNode){ //GM_log( thisNode.textContent ); titleNode = thisNode; thisNode = nodes.iterateNext(); } //was (titleValue == null) if (titleNode == null) { GM_log("can't find title node"); return null; } else { GM_log("Found title node: " + titleNode.textContent); } return titleNode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTitleNode()\r\n{\r\n\t// Amazon has a number of different page layouts that put the title in different tags\r\n // This is an array of xpaths that can contain an item's title\r\n var titlePaths = [\r\n \t\"//span[@id='btAsinTitle']/node()[not(self::span)]\",\r\n \"//h1[@id='title']/node...
[ "0.7295673", "0.63078415", "0.61382735", "0.61244047", "0.6074707", "0.596701", "0.59222865", "0.59111446", "0.5890053", "0.5882683", "0.5882683", "0.5882683", "0.5882683", "0.5882683", "0.5877939", "0.58768195", "0.58464646", "0.583462", "0.5785628", "0.5783641", "0.57817686...
0.7280169
1
Setting the component's initial state
constructor(props) { super(props); this.sizes = [ {letters: "1 To 3 Letters", width: "12 Inches", cost: "$14.99"}, {letters: "1 To 3 Letters", width: "24 Inches", cost: "$39.99"}, {letters: "1 To 3 Letters", width: "36 Inches", cost: "$54.99"}, {letters: "4 To 8 Letters", width: "24 Inches", cost: "$39.99"}, {letters: "4 To 8 Letters", width: "36 Inches", cost: "$49.99"}, {letters: "4 To 8 Letters", width: "42 Inches", cost: "$74.99"}, {letters: "4 To 8 Letters", width: "48 Inches", cost: "$109.99"}, {letters: "4 To 8 Letters", width: "55 Inches", cost: "$139.99"}, {letters: "9 To 12 Letters", width: "36 Inches", cost: "$49.99"}, {letters: "9 To 12 Letters", width: "42 Inches", cost: "$74.99"}, {letters: "9 To 12 Letters", width: "48 Inches", cost: "$109.99"}, {letters: "9 To 12 Letters", width: "55 Inches", cost: "$139.99"} ] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setInitialState(initialState) {\n\t\tObject.assign(this.state, initialState);\n\t\tthis.setInitialState = noop;\n\t}", "setInitialState () {\n if (this.skipInitial) {\n this.showChooseOrSignIn();\n } else {\n this.setState('initial');\n }\n }", "reset() {\r\n this.state = this.initia...
[ "0.7777291", "0.75898796", "0.75260437", "0.74451834", "0.74425143", "0.7115009", "0.7040495", "0.69914377", "0.69743794", "0.687511", "0.6858313", "0.6848639", "0.68469185", "0.6821949", "0.6798306", "0.67922413", "0.6788096", "0.67723995", "0.67582625", "0.67201436", "0.671...
0.0
-1
THIS FNCTION CREATES A GRAPHICAL INIDICATOR FOR THE NUMBER OF FREESPINS
function CFreespinIndicatorPO(my, parentGroup, iX, iY) { var _oTextNumberFS; var _oContainer; this._init = function (iX, iY) { _oContainer = my.add.group(); _oContainer.visible = false; _oContainer.x = iX; _oContainer.y = iY; parentGroup.add(_oContainer); var oBgFS = my.add.sprite( 0 + ManagerForScale.offsetOutOfBounce_1920/2, 0 - ManagerForScale.offsetOutOfBounce_1080/2 ,'box-freespins-bonus', null, _oContainer); oBgFS.anchor.setTo(0.5); //if(ManagerForScale.is3x4resolution()){ // oBgFS.x+=100; // oBgFS.y+=100; //} var oTextFS = my.add.sprite(oBgFS.x,oBgFS.y + 94,'freespins-en', null, _oContainer); oTextFS.anchor.setTo(0.5); _oTextNumberFS = my.add.text(oBgFS.x, oBgFS.y, "0", { //font: "50px dinbold", font: "50px dinbold", fill: "#FFFFFF", fontWeight:'bold' }, _oContainer); _oTextNumberFS.anchor.setTo(0.5); }; /** * Show Free Spin Indication UI * @param szTextNumFS: number Of Free Spin * @param szTextMulti: number of Multiplier */ this.show = function ( szTextNumFS, szTextMulti) { _oTextNumberFS.text = szTextNumFS; _oContainer.visible = true; }; /** * Hide Free spin Indicator */ this.hide = function () { _oContainer.visible = false; }; /** * Set Position of Object * @param iNewX: x pos * @param iNewY: y pos */ this.setPosition = function (iNewX, iNewY) { _oContainer.x = iNewX; _oContainer.y = iNewY; }; this._init(iX, iY); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Factory(n){\r\n\r\n }", "function infil_create(n)\n//\n// Purpose: creates an array of infiltration objects.\n// Input: n = number of subcatchments\n// Output: none\n//\n{\n //Infil = (TInfil *) calloc(n, sizeof(TInfil));\n Infil = [];\n for(let i = 0; i < n; i++){Infil.push(new TInfil...
[ "0.5670638", "0.5602842", "0.5364419", "0.5184261", "0.5162812", "0.5128901", "0.5103546", "0.50182694", "0.50043964", "0.50035965", "0.5002532", "0.49856", "0.4982811", "0.49702147", "0.49640307", "0.4961909", "0.49585372", "0.49457848", "0.49424556", "0.49369362", "0.492904...
0.0
-1
Extract data from a table with headers
function tableDataExtract(tableSelector){ var cols = [], rows = []; $(tableSelector).each(function(){ var tbl = $(this); tbl.find('th').each(function(){ var col = $(this), txt = $.trim(col.text()); cols.push({ heading: txt, fit: parseInt(col.css('width')) / parseInt(col.parent().css('width')), dataItem: txt.replace(/[^\w]+/g,'_').toLowerCase() }) }); tbl.children('tbody').children('tr').each(function(){ var rw = $(this), obj = {}; for(var i = 0; i < cols.length; i++){ try{ obj[cols[i].dataItem] = JSON.parse($.trim(rw.children('td:eq(' + i +')').text())); }catch(e){ obj[cols[i].dataItem] = $.trim(rw.children('td:eq(' + i +')').text()); } } rows.push(obj); }); }); return {data:rows, columns:cols}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrape_table() {\n var $rows = $TABLE.find('tr:not(:hidden)');\n var headers = [];\n var data = [];\n // Get the headers (add special header logic here)\n $($rows.shift()).find('th:not(:empty)').each(function () {\n headers.push($(this).text());\n });\n // Turn all existing row...
[ "0.6755725", "0.6660549", "0.6615501", "0.6600753", "0.653872", "0.6427637", "0.6416424", "0.6361329", "0.63338953", "0.63226104", "0.63095945", "0.6306508", "0.6280461", "0.627503", "0.62679166", "0.6257289", "0.62274337", "0.6186178", "0.617706", "0.6145965", "0.6140219", ...
0.70123553
0
Load extra spellings/cases from
function loadAdditionalIso2Mappings () { const variants = { 'Kuna Yala': 'Guna Yala', 'Comarca Guna Yala': 'Guna Yala', 'Darien': 'Darién', 'Emberá': 'Embera Wounaan', 'Ngäbe-Buglé': 'Ngöbe-Buglé', 'Comarca Ngäbe Buglé': 'Ngöbe-Buglé' } Object.keys(variants).forEach(k => { provinceIso2[k] = provinceIso2[variants[k]] }) Object.keys(provinceIso2).forEach(k => { provinceIso2[k.toUpperCase()] = provinceIso2[k] }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadVocabulary() {\n gun.get('wordbook-extension').get('unkonw-words').map().on(function(data){\n if(data.status != 'unknow')return;\n\n UI(data);\n })\n}", "function loadWords() {\n clearWordsContainerFirst();\n var randomWords = shuffle(basicEnglishWords);\n generateWordsInsideContainer(ran...
[ "0.62156194", "0.60387975", "0.6002819", "0.58165956", "0.5753264", "0.566721", "0.5615092", "0.56116134", "0.56103224", "0.56025773", "0.559135", "0.5572904", "0.54946935", "0.5381474", "0.5335144", "0.5325937", "0.53169036", "0.5286734", "0.5253538", "0.52510047", "0.525071...
0.561719
6
They report dates as epoch ms, eg 1584532800000 = 20200318.
function toYYYYMMDD (n) { const d = new Date(n) return d.toISOString().split('T')[0] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function epoch() {\n\tvar date = new Date();\n\tvar time = Math.round(date.getTime() / 1000);\n\treturn time;\n}", "function epochSeconds() { return new Date().getTime() / 1000 }", "function convertDate(date){\n var epochDate = new Date(date);\n epochDate = epochDate.getTime()/1000;\n console.log(epochDate...
[ "0.73687714", "0.73176455", "0.73060364", "0.7030363", "0.70046705", "0.69443166", "0.6932222", "0.6835519", "0.66248167", "0.65397555", "0.6492493", "0.645624", "0.6318535", "0.630241", "0.6264407", "0.6242819", "0.62016594", "0.62016594", "0.6197361", "0.6161978", "0.613980...
0.0
-1
Compare the current version of the app against whatever we retrieved from the remote URL.
function newVersion(localVersion, pollingResult) { // If we go for the default versioning system which npm seems happiest the versions will be major.minor.build. // We first need to break up both the local version number and the pollingResult version number into their constituent // parts. var localVersionParts = localVersion.split("."); var localMajor = parseInt(localVersionParts[0]); var localMinor = parseInt(localVersionParts[1]); var localBuild = parseInt(localVersionParts[2]); var remoteVersionParts = pollingResult.version.split("."); var remoteMajor = parseInt(remoteVersionParts[0]); var remoteMinor = parseInt(remoteVersionParts[1]); var remoteBuild = parseInt(remoteVersionParts[2]); if (remoteMajor > localMajor) { return true; } else if (remoteMajor == localMajor) { if (remoteMinor > localMinor) { return true; } else if (remoteMinor == localMinor) { if (remoteBuild > localBuild) { return true; } } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkForUpdate() {\n superagent.get(packageJson).end((error, response) => {\n if (error) return;\n const actualVersion = JSON.parse(response.text).version; // TODO: case without internet connection\n console.log('Actual app version: ' + actualVersion + '. Current app version: ' + c...
[ "0.6689376", "0.6504957", "0.6478063", "0.64308894", "0.63481754", "0.6334512", "0.6219885", "0.60806215", "0.6040118", "0.6033393", "0.6004373", "0.59375024", "0.5901214", "0.588981", "0.5833234", "0.5772903", "0.57481194", "0.56661963", "0.56480545", "0.56480545", "0.556052...
0.54831374
25
This is the top of the component stack for our bottom navbar
function Cabinet () { return ( <div className="cabinet"> {/* Tray holds our Tack menu, will eventually hold both CreateMenu and TackMenu */} <Tray data={testData} /> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Top() {\n const navbarStyle = { backgroundColor: ColorCode.darkBlue, color: ColorCode.background, fontWeight: 'bold' };\n const navbarItemStyle = { backgroundColor: ColorCode.darkBlue, color: ColorCode.background, fontWeight: 'bold' };\n return (\n <div>\n <Navbar style={navbarStyle}>\n ...
[ "0.65073913", "0.6320684", "0.622693", "0.62074596", "0.6191734", "0.6152528", "0.6138343", "0.60917044", "0.6075352", "0.60191756", "0.59331375", "0.58423066", "0.58316565", "0.5807646", "0.5802807", "0.57790804", "0.57781416", "0.57698154", "0.57695895", "0.57548934", "0.57...
0.0
-1
separate plaintext into words
function separateText() { var $curNode = $(this); $curNode.html($curNode.text().replace(/\b(\w+)\b/g, "<span text=\"word\">$1</span>")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function extractWords(text) {\n // creating an array of words by splitting the raw text with non-letter characters\n let words = text.split(/[(\\s!?*\\n:.,/)]+/);\n // loop to transfer all words to lower case, to count them precisely\n // (otherwise \"User\" in the beginning of the sentence is different as \"u...
[ "0.7002636", "0.68876207", "0.68833154", "0.68235725", "0.67349845", "0.66979", "0.6560445", "0.6557298", "0.6555657", "0.6555313", "0.6553292", "0.6547584", "0.6533861", "0.6516551", "0.6498533", "0.6488295", "0.64778006", "0.6469596", "0.6444394", "0.6410113", "0.63893044",...
0.599513
47
translates a word asynchronously using Glosbe API
function translate(wordToTranslate, origin, destination) { $.getJSON("http://glosbe.com/gapi/translate?from=" + origin + "&dest=" + destination + "&format=json&phrase=" + wordToTranslate.text() + "&pretty=true&callback=?", function (json) { if (json !== "Nothing found.") { if (json.tuc !== null && json.tuc.length !== 0 && json.tuc[0].phrase !== null) { // alert("phrase " + json.tuc[0].phrase.text); wordToTranslate.attr("translation", json.tuc[0].phrase.text); wordToTranslate.attr("original", wordToTranslate.text()) .css('color', 'blue') .text(wordToTranslate.attr("translation")) .attr("language", "translated"); } } }).done(function () { console.log('success', arguments); }).fail(function () { console.log('failure', arguments); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translate() {\n fetch('https://www.googleapis.com/language/translate/v2?key=' +\n config.apiKey +\n '&q=' + snap.val().text +\n '&target=' + select_dialect.value.substring(0, 2),\n {\n method: 'get'\n }).then(function(response) {\n return response.jso...
[ "0.6967398", "0.6781205", "0.673177", "0.6663395", "0.6585976", "0.6551727", "0.6538346", "0.642911", "0.642798", "0.6401345", "0.6400396", "0.6395564", "0.63945574", "0.63221025", "0.6307756", "0.6268592", "0.6268172", "0.6261275", "0.6248904", "0.6214733", "0.61789936", "...
0.7156341
0
switches the display language of a word
function changeState(wordToChange) { var $wordToChange = $(wordToChange); if ($wordToChange.attr("language") === "original") { $wordToChange.css('color', 'blue') .text($wordToChange.attr("translation")) .attr("language", "translated"); } else { $wordToChange.css('color', 'blue') .text($wordToChange.attr("original")) .attr("language", "original"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLocaleWording() {\n _D(\"Set locale wording...\");\n\n pn = options[\"lang\"] || G_DEFAULT_LANG;\n \n if( pn=='' ) {\n // use by system default.\n \n } else if( pn in _locale) {\n loc_list = {\n \"#dlist a\" : \"dlist\",\n \"#general a\...
[ "0.7148451", "0.68377733", "0.6835672", "0.6736805", "0.670282", "0.66835505", "0.65934473", "0.6586981", "0.6477629", "0.64731365", "0.64653915", "0.64454484", "0.64031863", "0.63860494", "0.63707656", "0.6362499", "0.6357453", "0.6346612", "0.63309205", "0.63240415", "0.630...
0.6450211
11
turns mcoking off and resets mocks
off() { this.mocking = false; this.clear(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset(){\n this.enable();\n this.init();\n this.buildAll();\n }", "setMotorOff () {\n this._parent._send('motorOff', {motorIndex: this._index});\n this._isOn = false;\n }", "function reset() {\n capsLockOn = null;\n }", "function resetWatch() {\n resetDown();\n...
[ "0.66187733", "0.6540692", "0.6463519", "0.6429335", "0.6376521", "0.63013595", "0.62871045", "0.6257249", "0.6227747", "0.6189839", "0.6173765", "0.6130498", "0.6126883", "0.6123331", "0.61067927", "0.61061543", "0.60834837", "0.6061484", "0.6028081", "0.60145617", "0.600980...
0.803098
0
returns an array of mocks not called
validate() { let notCalled = []; Object.getOwnPropertyNames(this.mocks).forEach(url => { Object.getOwnPropertyNames(this.mocks[url]).forEach(method => { if (!(url in this.run) || !(method in this.run[url])) { this.mocks[url][method].forEach(payload => notCalled.push({ url, method, payload })); } else if (this.mocks[url][method].length > this.run[url][method]) { for (let i = this.run[url][method]; i < this.mocks[url][method].length; i++) { notCalled.push({ url, method, payload: this.mocks[url][method][i] }); } } }); }); return notCalled; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMockPromises() {\n var responses = Array.prototype.slice.call(arguments);\n var calls = 0;\n return function() {\n return responses[calls++];\n };\n }", "function getMockDependencies() {\n MOCKS.navigateToNextstate = function(){\n ...
[ "0.64944243", "0.6159523", "0.60004187", "0.5723858", "0.56097364", "0.55798805", "0.55535805", "0.55510527", "0.547419", "0.54648226", "0.5379082", "0.5379082", "0.5379082", "0.5379082", "0.5350653", "0.53479636", "0.53231883", "0.5319353", "0.53137904", "0.5284947", "0.5264...
0.6893146
0
get stop ID for destination
function getStopID(query) { return axios .get(`${stopFinderURI}?${query}`, requestHeaderJSON) .then(response => { const stopLocation = response.data["locations"].filter( location => location.type === "stop" ); //console.log(stopLocation[0].id); return [stopLocation[0].id, stopLocation[0].coord]; }) .catch(err => console.log(err)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStartingStop(route) {\n const busses = _.filter(route[0].legs, { type: '1'} );\n return busses[0].locs[0].name;\n }", "getStartingStop(route) {\n const busses = _.filter(route[0].legs, { type: '1'} );\n return busses[0].locs[0].name;\n }", "function getStoppedBreakpointId() {\n ...
[ "0.6499473", "0.6499473", "0.64105576", "0.6347544", "0.6148803", "0.5954251", "0.5951451", "0.56309366", "0.5544059", "0.5454567", "0.5435922", "0.5413313", "0.54036015", "0.53176564", "0.52864325", "0.5261183", "0.5259369", "0.52584827", "0.5214114", "0.5191862", "0.5177936...
0.6398417
3
this function is used to retry a store when records are not found
function retryStore(){ //console.log('retrying store: '+targetStore.storeId+' for field :'+field.name); this.addInheritanceListeners(store, meta, field) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveShoppingResults(arr_enriched_transactions, key){\n\n let transactions_to_save = this.prepResultsToSave(arr_enriched_transactions, key) //massage data into our couchdb format\n\n console.log(\"attempting to save these transactions\", transactions_to_save);\n let startTime = new Date().getTime()\n\n ...
[ "0.5950579", "0.5898285", "0.58275133", "0.5569923", "0.55664915", "0.55436784", "0.54918206", "0.545611", "0.5455618", "0.54379696", "0.5436282", "0.53875566", "0.5375296", "0.5357101", "0.534239", "0.5321858", "0.5313009", "0.5301955", "0.5296614", "0.52749556", "0.52633125...
0.68995273
0
Find the first block level element, as we need the containing element, not just the next one up
function findParentRatio(jqObject) { var p = jqObject.parent(), displayType = p.css('display'); if (displayType == 'block' || displayType == '-webkit-box' && p.width() > 0) { return { obj: p, width: p.width(), height: p.height(), ratio: (p.width() / p.height()) }; } else { return findParentRatio(p); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFirstBlockElement(rootNode) {\n return getFirstLastBlockElement(rootNode, true /*isFirst*/);\n}", "function getAncestor(el) {\n var temp = el;\n while (el) {\n if ($(el).attr('_pf_ele_id') === undefined) {\n var curEleID = _pf_eleCnt++;\n ...
[ "0.73988456", "0.6648049", "0.6624329", "0.6550227", "0.6535015", "0.65293753", "0.65207654", "0.6516398", "0.650746", "0.6506341", "0.6506341", "0.6506341", "0.6506341", "0.64794606", "0.64739", "0.64739", "0.6472377", "0.6465381", "0.6465381", "0.6465381", "0.6465381", "0...
0.0
-1
inheritance || direct field || aggregations given
if (!this.inheritedPath) { return isDirectField(this.field) ? wrapPlainDirectLeave.call(this, aggregation) : wrapPlainIndirectLeave.call(this, aggregation); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function aggsFromFields() {\n // Remove current query from queries list (do not react to self)\n function withoutOwnQueries() {\n const q = new Map(queries);\n q.delete(id);\n return q;\n }\n // Transform...
[ "0.63202894", "0.6128981", "0.5986252", "0.57403654", "0.56460834", "0.5632795", "0.5631248", "0.5631248", "0.5556685", "0.54278696", "0.5410894", "0.52608454", "0.5249738", "0.52352643", "0.5223279", "0.51731145", "0.51703495", "0.5125121", "0.5121008", "0.511709", "0.511301...
0.46818218
46
takes in json returned object
function petProcessor (petObj) { // assigning raw data properties to new properties let newPet; let name = petObj.name; let species = petObj.species; let sex = petObj.sex; let birthMonth = petObj.birthMonth; let birthYear = petObj.birthYear; let imgSrc = petObj.imgSrc; let id = petObj.id; // if (!imgSrc) { // // imgSrc = 'media/cat.png'; // } let breed = petObj.breed; // creating new pet objects if (species === 'dog') { newPet = new Dog(name, species, sex, birthMonth, birthYear, imgSrc, id, breed); } else if (species === 'cat') { newPet = new Cat(name, species, sex, birthMonth, birthYear, imgSrc, id, breed); } else { newPet = new Pet(name, species, sex, birthMonth, birthYear, imgSrc, id, breed); } return newPet; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "parseJsonResult(result) {\n return result;\n }", "function json(response){\n return response.json();\n}", "json() {\r\n return this.data;\r\n }", "function json(response) {\n return response.json();\n console.log(response.json());\n}", "loadJsonData() {\n }", "function gotJSON...
[ "0.6684731", "0.64854175", "0.62922853", "0.6283423", "0.6219725", "0.62073183", "0.6156808", "0.6155376", "0.6155376", "0.6155376", "0.6155376", "0.61455584", "0.6145217", "0.6123735", "0.61139816", "0.60813856", "0.60813856", "0.60813856", "0.60813856", "0.60813856", "0.608...
0.0
-1
Throws errors and warns if the parameters passed to the constructor aren't sufficient.
static validateParams(token) { if (token === undefined) { throw Error("client requires a 'token'"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n throw new Error(`${this.constructor.name} class cannot be instantiated`);\n }", "constructor() {\n\t\tthrow new Error('Sorry, this class can`t be instanciated, it is only for static methods');\n\t}", "constructor(isValid, ...errors) {\n if (typeof isValid === 'boolean') {\n ...
[ "0.62111604", "0.6107194", "0.60503215", "0.6022229", "0.6007274", "0.59949195", "0.59926856", "0.59879637", "0.59526867", "0.59331465", "0.59022886", "0.5899285", "0.58757496", "0.5840904", "0.5840904", "0.5840904", "0.5835152", "0.5811561", "0.5769571", "0.57468307", "0.572...
0.0
-1
Binds `this` to the event functions defined in a separate file.
bindEventFunctions() { Utils.bindFunctionsFromFile(this, require('./eventFuncs')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _bindEventHandlers() {\n\t\t\n helper.bindEventHandlers();\n }", "bindEvents() {\n }", "_events() {\n \tthis._addKeyHandler();\n \tthis._addClickHandler();\n }", "_bindEvents() {\n\t\t_.bindAll(\n\t\t\tthis,\n\t\t\t'_onClickPlay',\n\t\t\t'_onPlayerReceived',\n\t\t\t'_onInterval...
[ "0.7104218", "0.69508535", "0.69203305", "0.6826828", "0.6809967", "0.6764793", "0.6732952", "0.67166483", "0.6696847", "0.6693317", "0.6652087", "0.6646623", "0.6646623", "0.6646623", "0.6646623", "0.6646623", "0.6646623", "0.6646623", "0.6646623", "0.6646623", "0.6646623", ...
0.8006878
0