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
Copyright 2010 TeamF1, Inc. / modification history 01b,29Jul14,mnr Modified file permisssions to work in RU image. 01a,10Jul10,vds written. Checks if the field is empty or not
function isFieldEmpty(fieldId, alertFlag, errMsg){ var obj = document.getElementById(fieldId); if (!obj || obj.disabled) return false; if (!obj.value.length) { if (alertFlag) alert(errMsg); obj.focus(); return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkFieldEmpty(FieldData,cntErrField)\n{\n if(FieldData.length) \n {\n return false;\n } \n else\n {\n cntErrField.value=\"\";\n return true;\n }\n}", "function is_field_empty(field) {\n if (field == undefined || field == '')\n return true;\n else\n...
[ "0.67805403", "0.65139616", "0.64352226", "0.6323832", "0.62994754", "0.6280428", "0.61840963", "0.61788064", "0.61063135", "0.6100342", "0.60857785", "0.6041276", "0.6022246", "0.6010678", "0.59952116", "0.5945921", "0.5912554", "0.59101266", "0.5902817", "0.5870253", "0.586...
0.5510432
70
getRequestObject Function to get Http request object. This function should be used to get an ajax related object RETURNS: HTTP request object
function getRequestObject () { var request = null; try { // Firefox, Opera 8.0+, Safari request=new XMLHttpRequest(); } catch (e) {// Internet Explorer try { request=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { request=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { window.status = "Browser does not support Ajax!!"; return false; } } } return request; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRequestObject() {\n if (window.XMLHttpRequest) {\n return (new XMLHttpRequest());\n } else if (window.ActiveXObject) {\n // For very old IE browsers (optional)\n return (new ActiveXObject(\"Microsoft.XMLHTTP\"));\n } else {\n global.alert...
[ "0.7902557", "0.7805019", "0.77419615", "0.76887256", "0.7684224", "0.76676077", "0.7629478", "0.76106644", "0.7432232", "0.742832", "0.7119281", "0.7109553", "0.71002656", "0.7100215", "0.7047592", "0.70065147", "0.6985473", "0.69163126", "0.6826565", "0.67448205", "0.674370...
0.7469837
8
changeScreen Used to change screen RETURNS: NA
function changeScreen ( hideScreenId, // Id of the screen that we need to hide showScreenId // Id of the screen that we need to show ) { displayOrHideFields (hideScreenId, showScreenId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeScreen(screen) {\n activeScreen = screen;\n}", "function setCurrentScreen( newScreenKey ) { return hwc.setCurrentScreen(newScreenKey);\t}", "function changeScreen(){\n if (state === `menu`){\n state = `main`;\n }\n else if (state === `end`){\n state = `menu`;\n count = 0;\n ...
[ "0.8347594", "0.7711797", "0.6837765", "0.6798506", "0.6752409", "0.66370434", "0.65340674", "0.65289205", "0.6520974", "0.64588356", "0.63924086", "0.63295805", "0.63295805", "0.63242406", "0.630339", "0.6298966", "0.62590355", "0.62289673", "0.6221121", "0.6202702", "0.6196...
0.739258
2
loginValidate Used to validate login name and password RETURNS: true or false
function loginValidate () { var txtFieldIdArr = new Array (); txtFieldIdArr[0] = "txtUserName,"+LANG_LOCALE['12144']; txtFieldIdArr[1] = "txtPwd,"+LANG_LOCALE['12074']; if (txtFieldArrayCheck (txtFieldIdArr) == false) return false; if (document.getElementById ('hdUserAgent')) document.getElementById ('hdUserAgent').value = navigator.userAgent; return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static validateLogin (userName, password) {\n return ((userName.length > 1 && password.length > 1) &&\n (userName.indexOf(\" \") == -1 && password.indexOf(\" \") == -1)) ? true : false;\n }", "function validateLogin() {\n if (loginEmailValid === true && loginPassValid === true) {\n retur...
[ "0.7971406", "0.7930901", "0.7514838", "0.72683114", "0.72584236", "0.7246935", "0.7232897", "0.7205282", "0.71808326", "0.7132682", "0.7103756", "0.7028776", "0.69962656", "0.6975787", "0.69558734", "0.693075", "0.6863204", "0.6812484", "0.680309", "0.67842793", "0.6716569",...
0.6664057
26
loginInit Used to show and hide screens based on from which action we are coming to the page
function loginInit () { var usrObj = document.getElementById ('txtUserName'); var screenShowObj = document.getElementById ('hdSreenVal'); if(screenShowObj) { var screenVal = parseInt(screenShowObj.value, 10); switch (screenVal) { case 1: fieldStateChangeWr ('txtUserName txtPwd txtNewPassWd txtCnfPwd', '', '', ''); changeScreen ('LoginTbl PasswordChengeTbl ForcedLoginTbl', 'LoggedinTbl'); var requestObj = getRequestObject (); var accessType = document.getElementById ('hdAccessType').value; if(parseInt (accessType,10) == 3) { runUserLoginCount (requestObj, document.getElementById ('hdUsrName').value,document.getElementById ('hdAlertType').value,document.getElementById ('hdMaxValue').value,document.getElementById ('hdAlertValue').value); } break; case 2: fieldStateChangeWr ('txtUserName txtPwd txtNewPassWd txtCnfPwd', '', '', ''); changeScreen ('LoginTbl PasswordChengeTbl LoggedinTbl', 'ForcedLoginTbl'); break; case 4: fieldStateChangeWr ('txtNewPassWd txtCnfPwd', '', 'txtUserName txtPwd', ''); changeScreen ('LoginTbl PasswordChengeTbl LoggedinTbl ForcedLoginTbl', ''); var chkAuthObj = document.getElementById ('chkAuthTypeEnable'); if (chkAuthObj) { if (chkAuthObj.checked) { fieldStateChangeWr ('', '', 'loginBtSla', ''); } else { fieldStateChangeWr ('loginBtSla', '', '', '') ; } } break; case 0: default: fieldStateChangeWr ('txtNewPassWd txtCnfPwd', '', 'txtUserName txtPwd', ''); changeScreen ('PasswordChengeTbl LoggedinTbl ForcedLoginTbl', 'LoginTbl'); if (!usrObj) return; usrObj.focus (); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beforeLogin() {\n $('#home-page').hide()\n $('#login-page').show()\n $('#register-page').hide()\n}", "function switchToLogin(){\n\t\tturnService.closeWaitingAlert();\n\t\t$userLoginArea.show();\t\t\n\t\t$pageWrapper.hide();\n\t}", "function startScreen() {\n if (loggedIn === false) {\n ...
[ "0.7146391", "0.69947225", "0.6938189", "0.6928058", "0.69170886", "0.69007355", "0.6897488", "0.68077344", "0.67957294", "0.6781249", "0.677194", "0.6731106", "0.658534", "0.65834314", "0.65594697", "0.65250635", "0.65002495", "0.64770234", "0.6467131", "0.64533824", "0.6440...
0.7021855
1
changeScreenOnPassClick Used to change screen RETURNS: NA
function changeScreenOnPass ( hideScreenId, // Id of the screen that we need to hide showScreenId // Id of the screen that we need to show ) { fieldStateChangeWr ('txtUserName txtPwd', '', 'txtNewPassWd txtCnfPwd', ''); displayOrHideFields (hideScreenId, showScreenId); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeScreen(screen) {\n activeScreen = screen;\n}", "function setCurrentScreen( newScreenKey ) { return hwc.setCurrentScreen(newScreenKey);\t}", "function chngScreen (id, type, screen) {\n onEvent(id, \"click\", function() {\n setScreen(screen);\n });\n \n}", "onActiveScreenChanged_() {}", ...
[ "0.67999077", "0.6470941", "0.63647103", "0.63482195", "0.63223046", "0.62815374", "0.6213224", "0.6075855", "0.60387415", "0.5955761", "0.58550906", "0.5852999", "0.5834303", "0.5809652", "0.57897246", "0.5748731", "0.57356054", "0.57296765", "0.5706829", "0.5702314", "0.566...
0.7196818
0
runUserLoginCount query is sent to server to find out the user login timeout. It alerts user when minimum time is left and stops
function runUserLoginCount (requestObj, userName,alertType,maxValue,alertValue) { // Clear timer id if it exists if (timerId) { clearTimeout (timerId); } if (requestObj) { requestObj.onreadystatechange = function () { if (requestObj.readyState == 4) { var current = requestObj.responseText; left =parseInt (maxValue, 10) - parseInt (current, 10) if((left < parseInt(alertValue,10)) && left != 0) { if(alertType==0){ // Seconds to Hours left=left/(60*60) } else if(alertType==1){ // Seconds to Days left=left/(60*60*24) } else if(alertType==2){ // into MB left=left } else if(alertType==3){ // into GB left=left/1024 } left=left.toFixed(2) alert ("Quota remaining is " + left + " " + showAlertArr[parseInt (alertType, 10)]); return; } else { // send query again setTimeout (function () {runUserLoginCount (requestObj, userName,alertType,maxValue,alertValue)}, 60000) } } } requestObj.open("GET","?page=cpAccAlertCheck.html&userName=" + userName + "&alertType=" + alertType + "&time=" + new Date(),true); requestObj.send(null); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scheduleLoginRequestTimeout(timeoutInSec) {\r\n return setTimeout(function() {\r\n if (!loggedIn) {\r\n con.end(util.format(\"No login request received in %d seconds...Terminating connection.\", timeoutInSec));\r\n }\r\n }, timeoutInSec * 1000);\r\n}", "function timeoutIfNoAction() {\n var...
[ "0.58704007", "0.5852177", "0.5852177", "0.5766983", "0.55703044", "0.5565933", "0.5486627", "0.5478873", "0.5430567", "0.5426814", "0.53959286", "0.5383948", "0.5357124", "0.5313751", "0.5277653", "0.52571034", "0.525516", "0.52508175", "0.5213346", "0.52082473", "0.52081054...
0.7374226
0
Call the Will Mount to set the auth Flag to false
componentWillMount(){ this.setState({ authFlag : false }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentWillMount() {\r\n this.setState({\r\n authFlag: false\r\n })\r\n }", "componentWillMount() {\n this.setState({\n authFlag: false\n });\n }", "componentWillMount() {\n this.setState({\n authFlag: false\n });\n }", "componentWillMount() {\n this.setState({\n ...
[ "0.62727404", "0.6257303", "0.6257303", "0.6257303", "0.62294865", "0.6215816", "0.6198193", "0.6198193", "0.6163447", "0.6163447", "0.6163447", "0.6163447", "0.6104157", "0.58736676", "0.5744775", "0.56929594", "0.56440467", "0.5640474", "0.56115484", "0.5599078", "0.5548919...
0.6154269
15
console.log(friends[0]); var para = document.createElement('mybtn'); var text = document.createTextNode('Hello World!'); para.appendChild(text);
function sing() { for (var i = 0; i < friends.length; i++) { // console.log(friends[i].toUpperCase() + ":"); // var div = div.class friend h3 friend(i) // <div id="friend">h3</div> // Create a div in code, store in variable called div var div = document.createElement('div'); // Sets the class name of the newly created div to be "friend" e.g. <div class="friend"></div> div.className = "friend"; // creating an h3 and storing in variable called heading var heading = document.createElement('h3'); // creating a text node (container) that contains our "current friend"'s name, store in variable headingText var headingText = document.createTextNode(friends[i]); // Add the text container as a child of the h3 (sets the text of the h3) heading.appendChild(headingText); // Then, add the h3 (that now has text inside it) to the div we created earlier div.appendChild(heading); for (var j = 99; j > 0; j--) { // in here, j is first 99, then it will be 98, then it will be 97 // check as you go along. start with consoling just 'j' if (j > 2) { // create a paragraph var para = document.createElement('p'); // then create text for the paragraph var paraText = document.createTextNode(j + " lines of code in the file, " + j + " lines of code, " + friends[i] + " strikes one out, clears it all out, " + (j - 1) + " lines of code in the file."); // then add that text to the paragraph para.appendChild(paraText); // then add that paragraph to the div from above div.appendChild(para); // console.log(); } else if (j === 2) { // console.log(j + " lines of code in the file, " + j + " lines of code, " + friends[i] + " strikes one out, clears it all out, " + (j - 1) + " line of code in the file."); var para = document.createElement('p'); var paraText = document.createTextNode(j + " lines of code in the file, " + j + " lines of code, " + friends[i] + " strikes one out, clears it all out, " + (j - 1) + " line of code in the file."); para.appendChild(paraText); div.appendChild(para); } else { //console.log("1 line of code in the file, 1 line of code, " + friends[i] + " strikes one out, clears it all out, no lines of code in the file."); var para = document.createElement('p'); var paraText = document.createTextNode("1 line of code in the file, 1 line of code, " + friends[i] + " strikes one out, clears it all out, no lines of code in the file."); para.appendChild(paraText); div.appendChild(para); } } // at this point, we have created a div for our "current friend", added an h3 for their name // and added 99 paragraphs singing the song // Now, we need to add the div to the document body document.body.appendChild(div); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function friendButton(){\n var makeContainer=document.createElement('div');\n var makeButton=document.createElement('button');\n var textFriend=document.createTextNode(\"Friends!\");\n var makeFriendButton= makeButton.appendChild(textFriend);\n makeContainer.appendChild(makeButton);\n document.bo...
[ "0.7919152", "0.6865912", "0.68615806", "0.6631465", "0.6537372", "0.64609146", "0.64243454", "0.6397245", "0.63299173", "0.6323784", "0.63055325", "0.6259336", "0.6248759", "0.6238472", "0.6176064", "0.61743337", "0.61659783", "0.6150877", "0.61428595", "0.61315274", "0.6107...
0.0
-1
Partly hashed key is used for config display
function hashPartKey(key) { if (typeof (key) === 'undefined' || (!typeof (key) === 'string' && !typeof (key) === 'number')) { return; } key = key.toString(); if (key === '') { return; } let firstDigit = key[0]; let lastDigit = key[key.length - 1]; return firstDigit + 'xxxxx' + lastDigit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function make_key() {\n return Math.random().toString(36).substring(2,8);\n }", "static $config(){\n\t\treturn {\n\t\t\tkey: '_id'\n\t\t}\n\t}", "function makeKey () {\n var r = Math.floor(Math.random() * options.num)\n , k = keyTmpl + r\n return k.substr(k.length - 16)\n}", "getKey(key) {\n\t...
[ "0.65376884", "0.6240739", "0.62196124", "0.61223894", "0.608432", "0.60831136", "0.60697824", "0.60674745", "0.60672814", "0.6062199", "0.6062199", "0.6039069", "0.6031088", "0.6027331", "0.5980955", "0.5959495", "0.5944055", "0.5910152", "0.59084845", "0.5866349", "0.585464...
0.60703295
6
Trimp Average Attack Trimp Attack Speed Plaguebringer Percent Starting Poison Stack Weapon Levels True False Poison Zone OUT OF ORDER Experimental feature, discord bhad0931 for suggestions/commentsDoesn't increase MMM bonus along with the game. Probably best to import your save while you're in the BW.Alternatively, you can check damage after you start BW to see if its similar to the calculator SEE FIRST RUN TIMES(AFTER PASTING SAVE)
function getPoisonModifier() { return ((game.empowerments.Poison.level)) * 0.01; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function autoLevelEquipment() {\n //if((game.jobs.Miner.locked && game.global.challengeActive != 'Metal') || (game.jobs.Scientist.locked && game.global.challengeActive != \"Scientist\"))\n //return;\n var Best = {\n 'healthwood': {\n Factor: 0,\n Name: '',\n Wal...
[ "0.6279798", "0.62463737", "0.6188117", "0.616579", "0.6125994", "0.6121925", "0.60819197", "0.6078118", "0.6031175", "0.59934616", "0.59853715", "0.5982683", "0.5969862", "0.59676903", "0.59607697", "0.5959098", "0.5957863", "0.5947611", "0.59306884", "0.592888", "0.5928043"...
0.0
-1
| | Events | | | These are the events that the component uses | and can be overridden by assigning it as a prop. | It is suggested that you override onEnd. | When load starts we display a loading icon and show the controls.
_onLoadStart() { let state = this.state; state.loading = true; this.loadAnimation() this.setState( state ); if ( typeof this.props.onLoadStart === 'function' ) { this.props.onLoadStart(...arguments); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "notifyLoading(isLoading) { \n if(isLoading){\n const doneloadingEvent = new CustomEvent('doneloading');\n this.dispatchEvent(doneloadingEvent);\n }else{\n const doneloadingEvent = new CustomEvent('loading');\n this.dispatchEvent(doneloadingEvent);\n ...
[ "0.69246083", "0.6852701", "0.68240553", "0.6705781", "0.64388233", "0.63910407", "0.6328545", "0.6316912", "0.6306137", "0.630008", "0.628113", "0.6280549", "0.62657404", "0.61800855", "0.6161229", "0.6152097", "0.6147751", "0.6146702", "0.61420715", "0.6135863", "0.6116742"...
0.6326296
7
Loop animation to spin loader icon. If not loading then stop loop.
loadAnimation() { if ( this.state.loading ) { Animated.sequence([ Animated.timing( this.animations.loader.rotate, { toValue: this.animations.loader.MAX_VALUE, duration: 1500, easing: Easing.linear, } ), Animated.timing( this.animations.loader.rotate, { toValue: 0, duration: 0, easing: Easing.linear, } ), ]).start( this.loadAnimation.bind( this ) ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loading(value) {\n if (value) {\n //this.buttonElements.prop('disabled', true);\n //this.loadingContainer.fadeIn(250);\n console.log('animation start!');\n console.log(this.loadingContainer);\n this.spinner.spin(this.loadingContainer);\n }\n ...
[ "0.6457803", "0.6409191", "0.6398446", "0.63387847", "0.6307463", "0.62619674", "0.62479", "0.6202175", "0.6189488", "0.61680615", "0.6150103", "0.61257815", "0.6096432", "0.60805404", "0.6063055", "0.60618746", "0.6027622", "0.6018462", "0.60152066", "0.6011059", "0.60094863...
0.6146792
11
It is suggested that you override this command so your app knows what to do. Either close the video or go to a new page.
_onEnd() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showLocalVideo() {}", "function skipVideo() {\r\n\tchrome.runtime.sendMessage({\r\n\t\tgreeting: \"Pop\"\r\n\t}, function () {});\r\n}", "open () {\n super.open('')\n browser.pause(3000)\n }", "open () {\n super.open('')\n browser.pause(3000)\n }", "function actionViewVideo(url){\n\twindow.op...
[ "0.66527086", "0.65438664", "0.624869", "0.624869", "0.620419", "0.61338973", "0.61311805", "0.6087266", "0.60543436", "0.6043913", "0.60428584", "0.5954856", "0.59334517", "0.59113675", "0.5895139", "0.58907324", "0.5878368", "0.5867316", "0.58417284", "0.5835855", "0.583524...
0.0
-1
This is a single and double tap listener when the user taps the screen anywhere. One tap toggles controls, two toggles fullscreen mode.
_onScreenTouch() { let state = this.state; const time = new Date().getTime(); const delta = time - state.lastScreenPress; if ( delta < 300 ) { // this.methods.toggleFullscreen(); } state.lastScreenPress = time; this.setState( state ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fullscreenClicked () {\n if (this.isFullScreen() === false) {\n this.enterFullScreen()\n } else {\n this.exitFullScreen()\n }\n }", "onFullScreenModeChanged(is_fullscreen) {}", "function attachEvents (){\n \n $( document ).on( 'fullscreenchange', toggleFullScreen );\n $( document ).on...
[ "0.73980105", "0.6876921", "0.6826565", "0.6773983", "0.676641", "0.6759469", "0.6754833", "0.6736036", "0.6718997", "0.66484493", "0.66265386", "0.66208726", "0.6572127", "0.64718026", "0.6471276", "0.64681077", "0.645995", "0.6456893", "0.64481944", "0.6444159", "0.6412087"...
0.64894336
13
| | React Component functions | | | Here we're initializing our listeners and getting | the component ready using the builtin React | Component methods | To allow basic playback management from the outside we have to handle possible props changes to state changes
componentWillReceiveProps(nextProps) { if (this.state.paused !== nextProps.paused ) { this.setState({ paused: nextProps.paused }) } if(this.styles.videoStyle !== nextProps.videoStyle){ this.styles.videoStyle = nextProps.videoStyle; } if(this.styles.containerStyle !== nextProps.style){ this.styles.containerStyle = nextProps.style; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props) {\n super(props);\n this.audio = React.createRef();\n this.state = {\n playing: null,\n currentTimePercentage: 0,\n key: 0, // To force remounting if an error occurs\n };\n }", "componentDidMount(){\r\n this.props.playPauseAudio(this.props.screen, this.props....
[ "0.7392765", "0.70051396", "0.6864921", "0.6779041", "0.66828483", "0.6681948", "0.6621052", "0.66161716", "0.6601684", "0.6516871", "0.65002203", "0.6480445", "0.64434206", "0.6442551", "0.64411724", "0.6426644", "0.6408989", "0.6397036", "0.6369812", "0.6351861", "0.6346336...
0.0
-1
Upon mounting, calculate the position of the volume bar based on the volume property supplied to it.
componentDidMount() { let state = this.state; this.mounted = true; this.setState( state ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateVolumeBar()\n {\n\n // get volume percentage as a whole number\n var volumePercentage = (getVolume() * 100).toFixed(0);\n\n // apply percentage to the width of volume bar\n // update text below bar to match percentage\n $(\".volume .volume-bar-percentage\").c...
[ "0.68592757", "0.6577442", "0.6514513", "0.6471517", "0.64637816", "0.63961804", "0.6393405", "0.62452394", "0.62004775", "0.61778563", "0.6163917", "0.6156663", "0.6029563", "0.60257256", "0.6004793", "0.59758914", "0.5959688", "0.5941073", "0.5927048", "0.59238625", "0.5916...
0.0
-1
When the component is about to unmount kill the timeout less it fire in the prev/next scene
componentWillUnmount() { this.mounted = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentWillUnmount() {\n this.timer && clearTimeout(this.timer)\n }", "componentWillUnmount() {\n window.clearTimeout(this.fadeTimer);\n }", "componentWillUnmount() {\n clearTimeout(this._removeTimer);\n }", "componentWillUnmount() {\n clearTimeout(this.timer);\n }", "componentWillUnmount...
[ "0.77263856", "0.77054936", "0.7695103", "0.7694919", "0.76865375", "0.76865375", "0.76734716", "0.7657855", "0.7610813", "0.76055586", "0.756848", "0.746116", "0.7458002", "0.7455903", "0.7454256", "0.7390738", "0.7364829", "0.73128533", "0.73102045", "0.7294409", "0.7276732...
0.0
-1
Provide all of our options and render the whole component.
render() { return ( <TouchableWithoutFeedback onPress={ this.events.onScreenTouch } style={[ styles.player.container, this.styles.containerStyle ]} > <View style={[ styles.player.container, this.styles.containerStyle ]}> <Video { ...this.props } ref={ videoPlayer => this.player.ref = videoPlayer } resizeMode={ this.state.resizeMode } volume={ this.state.volume } paused={ this.state.paused } muted={ this.state.muted } rate={ this.state.rate } onLoadStart={ this.events.onLoadStart } onProgress={ this.events.onProgress } onError={ this.events.onError } onLoad={ this.events.onLoad } onEnd={ this.events.onEnd } style={[ styles.player.video, this.styles.videoStyle ]} source={ this.props.source } /> { this.renderError() } { this.renderLoader() } </View> </TouchableWithoutFeedback> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n\t\treturn `\n\t\t\t<div id=\"toolbar\" class=\"box\">\n\t\t\t\t${this.optionAll.render()}\n\t\t\t\t${this.options.map((option)=>{\n\t\t\t\t\treturn this['option'+option.id].render()\n\t\t\t\t}).join('')}\n\t\t\t</div>\n\t\t`;\n\t}", "_register_view_options() {\n let current_renderers = renderers....
[ "0.6809021", "0.6689128", "0.62993443", "0.621608", "0.61788005", "0.60748917", "0.6066807", "0.600097", "0.5998717", "0.5998016", "0.5985904", "0.5956673", "0.59470606", "0.59275556", "0.59254086", "0.59251356", "0.58700824", "0.5857772", "0.5848618", "0.5831519", "0.5794475...
0.0
-1
Will display a standard styled login screen
render () { const navigation = this.props.navigation return ( <View style={styles.container}> <TextInput style={styles.InputText} placeholder='Email: ' onChangeText={(email) => this.setState({ email })} value={this.state.email} /> <TextInput style={styles.InputText} placeholder='Password: ' onChangeText={(password) => this.setState({ password })} secureTextEntry value={this.state.password} /> <TouchableOpacity style={styles.button} onPress={() => this.handleLogin(this.state.email, this.state.password)}> <Text style={styles.boldText}>Login</Text> </TouchableOpacity> <TouchableOpacity style={styles.button} onPress={() => navigation.navigate('Create account screen')}> <Text style={styles.boldText}>Create an account</Text> </TouchableOpacity> </View> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayLogin() {\n hide(\"logout\");\n display(\"login\");\n circle.setColor(\"rgb(212, 29, 140)\");\n}", "function showLogin() {\n clearErrorMsg();\n showView('loginForm');\n showLinks(['registerLink']);\n}", "function initLogin() {\n // Show the page (it acts like a tab, followi...
[ "0.73674077", "0.73077273", "0.71662587", "0.70975816", "0.7069011", "0.70138603", "0.68112934", "0.6788068", "0.67765397", "0.6755964", "0.6748159", "0.66947514", "0.6690679", "0.66872644", "0.6681355", "0.6679588", "0.66749626", "0.6673524", "0.66258377", "0.6621513", "0.65...
0.0
-1
Private methods fetch client name (or create name from current timestamp) and host name from URL
_getClientDetails() { // parse search parameters in URL let query = location.search.substr(location.search.indexOf("?") + 1).split("&"), queries = {}; for (let i = 0; i < query.length; i++) { queries[query[i].substr(0, query[i].indexOf("="))] = query[i].substr(query[i].indexOf("=") + 1); } this.playerName = queries.name || "p" + Date.now(); this.hostName = queries.join; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getHostName() {\n // UNIMPLEMENTED: complete this function!\n\n return `${this.url}`;\n }", "getHostName() {\n // UNIMPLEMENTED: complete this function!\n return \"hostname.com\";\n }", "getHostName() {\n try {\n let url = new URL(this.url);\n return url.origin;\n } catch (e) {\n ...
[ "0.64941424", "0.643013", "0.6376294", "0.63535464", "0.6284471", "0.61787325", "0.61316335", "0.61316335", "0.61316335", "0.61316335", "0.61316335", "0.61316335", "0.61316335", "0.610243", "0.5973098", "0.59680194", "0.5958073", "0.5957245", "0.5885701", "0.58646953", "0.584...
0.6531847
0
update player list; triggered when a new player joins the session
_updatePlayerList (players) { // add all new players, including host, to playersData Object.keys(players).forEach(playerId => { if (!this.playersData[playerId]) { players[playerId].name = playerId; players[playerId].color = this.playerColorCodes.shift(); let playerDetails = new Player(players[playerId]); this.playersData[playerId] = playerDetails; this.uiService.updatePlayerList(playerDetails); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateRoomPlayersList(room) {\n _room.in(room.id).emit('update-player-list', room);\n}", "function updatePlayers(listOfPlayers) {\n allPlayers = listOfPlayers;\n}", "updatePlayersList(players) {\n if (players.length > 0) {\n const updatedPlayersList = [];\n players.for...
[ "0.76182735", "0.75254625", "0.74255943", "0.70701647", "0.6994814", "0.6925713", "0.6716648", "0.6680828", "0.66456974", "0.6631983", "0.6621529", "0.6591376", "0.65909415", "0.6542924", "0.65345895", "0.65134543", "0.6501398", "0.649291", "0.64830375", "0.6479344", "0.64702...
0.7166668
3
move a player to position
_movePlayerToPosition (data) { if (this.playersData[data.player]) { this.playersData[data.player].moveToPosition(data.position); } else { console.log("Player not found", data.player); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move_player()\n{\t\t\t\n\tif (player['position'][0] < 0)\n\t{\n\t\twarp.currentTime = 0;\n\t\twarp.play();\n\t\tplayer['position'][0] = 392;\n\t} \n\telse if (player['position'][0] > 392)\n\t{\n\t\twarp.currentTime = 0;\n\t\twarp.play();\n\t\tplayer['position'][0] = 0;\n\t} \n\telse if (player['position']...
[ "0.7749234", "0.75864947", "0.74751544", "0.7444892", "0.7440322", "0.7415892", "0.73557186", "0.73293364", "0.7326058", "0.73237973", "0.7304555", "0.72857404", "0.7265208", "0.7235056", "0.7209513", "0.72060126", "0.71968347", "0.7177859", "0.7169875", "0.714402", "0.714143...
0.70913136
24
offer current player the chance to buy property at data.squareId
_offerBuyProperty (data) { let propertyName = this.mapData.squares[data.squareId].propertyName; let propertyPrice = this.mapData.squares[data.squareId].price; this.uiService.offerBuyProperty(propertyName, propertyPrice); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_propertyPurchased (data) {\n // exit if player not found in player list\n if (!this.playersData[data.playerId]) {\n return;\n }\n\n // deduct price of property from playerId\n let price = this.mapData.squares[data.squareId].price;\n this.playersData[data.player...
[ "0.71582264", "0.69712096", "0.66127354", "0.6351925", "0.6225397", "0.6190807", "0.6128114", "0.61027247", "0.6061695", "0.6059912", "0.60574204", "0.6022423", "0.6021196", "0.5969335", "0.59498024", "0.5945948", "0.5945697", "0.5943696", "0.59408456", "0.5929691", "0.592817...
0.6592421
3
assign property square to player
_propertyPurchased (data) { // exit if player not found in player list if (!this.playersData[data.playerId]) { return; } // deduct price of property from playerId let price = this.mapData.squares[data.squareId].price; this.playersData[data.playerId].removeFunds(price); // assign square to player this.playersData[data.playerId].assignSquare(data.squareId); this.uiService.updatePlayerList({ name: data.playerId, cash: this.playersData[data.playerId].getCurrentCash(), squares: this.playersData[data.playerId].getCurrentSquares() }); let color = this.playersData[data.playerId].getColor(); this.uiService.updateSquareOwner(data.squareId, color); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "choosePlayer() {\n player.sprite = document.formular.player.value;\n player.moves = true;\n }", "function setupPlayer() {\n playerX = 4 * width / 5;\n playerY = height / 2;\n playerHealth = playerMaxHealth;\n playerStamina = playerMaxStamina;\n}", "function setupPlayer() {\n playerX = 4 *...
[ "0.6502474", "0.6486051", "0.63023347", "0.63023347", "0.63023347", "0.62957686", "0.6286231", "0.627234", "0.6220844", "0.61068875", "0.6086874", "0.6079589", "0.59759074", "0.592104", "0.59175575", "0.59175575", "0.59175575", "0.59175575", "0.5915131", "0.58898634", "0.5884...
0.0
-1
rent paid by payee to owner
_rentPaid (data) { this.playersData[data.owner].addFunds(data.rent); this.playersData[data.payee].removeFunds(data.rent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function payVirtuo() {\n rentals.forEach(element => {\n var returnDate = new Date(element.returnDate);\n var pickup = new Date(element.pickupDate)\n var duration = parseInt(dayDiff(pickup, returnDate));\n if (duration == 0)\n duration += 1\n element.commission = element.price * 0.3\n elemen...
[ "0.67810404", "0.63998324", "0.6295716", "0.62102276", "0.6002293", "0.59406227", "0.5924721", "0.5908003", "0.58783543", "0.5796043", "0.5794382", "0.5768551", "0.57539886", "0.57513976", "0.5724812", "0.5649724", "0.5615837", "0.5613544", "0.56077164", "0.5585439", "0.55697...
0.74287665
0
open trade modal, showing available players
_uiOpenTradeModal () { this.uiService.openTradeModal(this.mapData, this.playersData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showTrade() {\n clearErrorMsg();\n showLinks(['logoutLink', 'transferLink', 'portfolioLink']);\n showView('tradeForm');\n}", "function playersOnClick () {\n module.exports.internal.stateManager.showState('main-branch', 'pick-a-player')\n}", "function showPlayer(id) {\n $(\"#modPlayerInfoT...
[ "0.673612", "0.64609057", "0.6258288", "0.6243512", "0.6190697", "0.6099122", "0.601314", "0.59712934", "0.59712934", "0.5969044", "0.5955057", "0.59263253", "0.5912423", "0.5889807", "0.5872167", "0.58637875", "0.58617437", "0.5840048", "0.5830143", "0.58194345", "0.58088386...
0.71131784
0
open mortgage modal, showing current player's properties
_uiOpenMortgageModal () { this.uiService.openMortgageModal(this.mapData, this.playersData[this.playerName]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "show() {\n const panel = this.modal.makePanel(`settings`);\n panel.innerHTML = `<h3>Change the game theme</h3>`;\n const options = this.getOptions();\n const table = this.modal.buildPanelContent(options);\n this.addFormControls(panel, table, options);\n this.modal.addFooter(panel, \"Close\");\n ...
[ "0.65887785", "0.62971264", "0.6288181", "0.62680393", "0.6202967", "0.6200174", "0.6189904", "0.6155654", "0.60902745", "0.60827637", "0.6065019", "0.6053847", "0.6030211", "0.60223633", "0.60180247", "0.60150653", "0.5980403", "0.59333664", "0.59203607", "0.590879", "0.5888...
0.7352005
0
open unmortgage modal, showing current player's properties
_uiOpenUnmortgageModal () { this.uiService.openUnmortgageModal(this.mapData, this.playersData[this.playerName]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_uiOpenMortgageModal () {\n this.uiService.openMortgageModal(this.mapData, this.playersData[this.playerName]);\n }", "modalHide(myModal) {\n myModal.style.display = \"none\";\n player.choosePlayer();\n }", "function showModal() {\n setVisible(true);\n setSignUp(false);\n }", ...
[ "0.63167435", "0.61904943", "0.5988887", "0.5839464", "0.57439905", "0.5731278", "0.57302856", "0.5729457", "0.57211053", "0.5619354", "0.5573847", "0.5561921", "0.5546904", "0.54765695", "0.54553306", "0.54489505", "0.54339147", "0.5424051", "0.5421515", "0.5412376", "0.5404...
0.7312502
0
mark properties as mortgaged, add funds to player, update bottom list
_uiPropertyMortgaged (data) { this.uiService.propertyMortgaged(data.squares); // mark each square as mortgaged data.squares.forEach(squareId => { this.mapData.squares[squareId].isMortgaged = true }) // add funds from mortgaging to player this.playersData[data.playerId].addFunds(data.cash); this.uiService.updatePlayerList({ name: data.playerId, cash: this.playersData[data.playerId].getCurrentCash(), squares: this.playersData[data.playerId].getCurrentSquares() }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPropertyToPlayerWallet(player, property){\n\n\n\n let propertyColor = property.color;\n\n\n player.propertiesCount += 1;\n\n\n \n player.propertiesByColor[propertyColor.index].properties.push(property);\n\n property.landLord = player;\n\n player.cash -= property.value;\n\n \n if...
[ "0.6655345", "0.57389086", "0.57131857", "0.5676389", "0.5642936", "0.55863166", "0.5555092", "0.5479884", "0.545654", "0.5455141", "0.5383317", "0.533643", "0.53153324", "0.53104144", "0.5304395", "0.5303098", "0.52759755", "0.52757746", "0.52152514", "0.5212012", "0.5165387...
0.69010323
0
unmark properties as mortgaged, remove funds from player, update bottom list
_uiPropertyUnmortgaged (data) { this.uiService.propertyUnmortgaged(data.squares); // mark each square as unmortgaged data.squares.forEach(squareId => { this.mapData.squares[squareId].isMortgaged = false }) // remove funds for paying off mortgage from player this.playersData[data.playerId].removeFunds(data.cash); this.uiService.updatePlayerList({ name: data.playerId, cash: this.playersData[data.playerId].getCurrentCash(), squares: this.playersData[data.playerId].getCurrentSquares() }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_uiPropertyMortgaged (data) {\n this.uiService.propertyMortgaged(data.squares);\n\n // mark each square as mortgaged\n data.squares.forEach(squareId => {\n this.mapData.squares[squareId].isMortgaged = true\n })\n\n // add funds from mortgaging to player\n\t\tthis.playe...
[ "0.61763775", "0.5999527", "0.59193707", "0.56798553", "0.56033695", "0.55903983", "0.5587485", "0.5529904", "0.54973084", "0.5490873", "0.54837143", "0.5460226", "0.54361755", "0.54142505", "0.5334361", "0.53087336", "0.52976656", "0.5292087", "0.5264593", "0.5264593", "0.52...
0.68408656
0
mandrill controller object Cont
function mandrill( $, key ) { this.$ = $; this.request = mandrillRequest; this.request.key = key; this.url = 'https://mandrillapp.com/api/1.0/messages/send.json'; this.sendToType = 'to'; this.sendError = false; this.response = null; this.setToEmail = function (email) { this.request.message.to = this.emailListParser(email); }; this.emailListParser = function ( email ){ var pattern = /,/g; if ( pattern.test(email) ){ var returnList = []; var emailListArray = email.split(','); emailListArray.forEach(function(email){ var sendTo = jQuery.extend(true, {}, mandrillRequestTo); sendTo.email = email.trim(); sendTo.type = this.sendToType; returnList.push(sendTo); }); return returnList; } else { var sendTo = mandrillRequestTo; sendTo.email = email; sendTo.type = this.sendToType; return [ sendTo ]; } }; this.setFromEmail = function (email) { this.request.message.from_email = email; }; this.setFromName = function (name) { this.request.message.from_name = name; }; this.setMessage = function( message ){ this.request.message.html = message; this.request.message.text = message; }; this.setSubject = function( subject ){ this.request.message.subject = subject; }; this.setReplyTo = function ( email ){ this.request.message.headers['Reply-to'] = email; }; this.send = function( callback, failCallback ){ this.$.post(this.url, this.request, function(data){ $(data).each(function(){ if ( this.status == 'invalid' ){ failCallback(); } }); callback(); }).fail(function(){ if ( failCallback ){ failCallback(); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Controller(){} //Extends Class (at bottom of page).", "function Controller() { }", "function Controller() {\n\n }", "function Controller() {\n \n }", "function Controller() {\n \n }", "function ViewController(){}//Extends Controller (at bottom of page).", "function MainController() {\...
[ "0.6810015", "0.6660228", "0.65949476", "0.6503596", "0.6503596", "0.63247013", "0.6305611", "0.63027036", "0.62922424", "0.61173904", "0.6065554", "0.60318905", "0.60318905", "0.6020305", "0.60124546", "0.60061324", "0.59717995", "0.59061676", "0.58749187", "0.58607894", "0....
0.0
-1
TODO: trigger this with a test, yeah?
emptyStruct(ref); } else { if (p.typeBits === 0x03) { cap(p.hi, ref); } else { nonpreallocated(arena, ref, p.object, p.typeBits, p.hi); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "static final private intern...
[ "0.6914707", "0.6840076", "0.63901913", "0.6335757", "0.61553407", "0.61000836", "0.6087832", "0.6077409", "0.5986329", "0.59507746", "0.5902613", "0.5849031", "0.5795407", "0.57744", "0.57401896", "0.5659154", "0.5647651", "0.55681956", "0.55572355", "0.5530648", "0.5458619"...
0.0
-1
function fcnRegistrationTCG This function adds the new player to the Player's List and calls other functions to create its complete profile
function fcnRegistrationTCG(ss, shtResponse, RowResponse){ var shtConfig = ss.getSheetByName('Config'); var shtPlayers = ss.getSheetByName('Players'); var ssWeekBstrID = shtConfig.getRange(40, 2).getValue(); var PlayerData = new Array(7); PlayerData[0] = 0 ; // Function Status PlayerData[1] = ''; // Number of Players PlayerData[2] = ''; // New Player Full Name PlayerData[3] = ''; // New Player First Name PlayerData[4] = ''; // New Player Email PlayerData[5] = ''; // New Player Language PlayerData[6] = ''; // New Player DCI Number // Add Player to Player List PlayerData = fcnAddPlayerTCG(shtConfig, shtPlayers, shtResponse, RowResponse, PlayerData); var NbPlayers = PlayerData[1]; var PlayerName = PlayerData[2]; // If Player was succesfully added, Generate Card DB, Generate Card Pool, Modify Match Report Form and Add Player to Weekly Booster if(PlayerData[0] == 1) { fcnGenPlayerCardDB(); Logger.log('Card Database Generated'); fcnGenPlayerCardPool(); Logger.log('Card Pool Generated'); fcnModifyReportFormTCG(ss, shtConfig, shtPlayers); // If Weekly Booster is used, add Player to the list if(ssWeekBstrID != ''){ fcnAddPlayerWeeklyBooster(ssWeekBstrID, NbPlayers, PlayerName); Logger.log('Player Added to Weekly Booster'); } // Execute Ranking function in Standing tab fcnUpdateStandings(ss, shtConfig); // Copy all data to Standing League Spreadsheet fcnCopyStandingsResults(ss, shtConfig, 0, 1); // Send Confirmation to New Player fcnSendNewPlayerConf(shtConfig, PlayerData); Logger.log('Confirmation Email Sent'); } // Send Log for new Registration var recipient = Session.getActiveUser().getEmail(); var subject = 'Form Log Test'; var body = Logger.getLog(); MailApp.sendEmail(recipient, subject, body); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register(playerObj){\n //for registering\n //the person already registered can switch if there is only one player\n if(Players.length < 2){\n if(Players.includes(playerObj.Player)){\n sendObj.info = \"that colour is taken\";\n sendObj.Player = null;\n }else{\n ...
[ "0.6341696", "0.62561613", "0.6117104", "0.59831154", "0.5932346", "0.59059685", "0.58696425", "0.5828408", "0.5801", "0.57961595", "0.57847", "0.57489717", "0.56878805", "0.5683046", "0.56664467", "0.56531864", "0.5605753", "0.55950224", "0.558309", "0.5563754", "0.5529538",...
0.61185247
2
function fcnAddPlayerTCG_Master This function adds the new player to the Player's List
function fcnAddPlayerTCG(shtConfig, shtPlayers, shtResponse, RowResponse, PlayerData) { // Get All Values from Response Sheet var EmailAddress = shtResponse.getRange(RowResponse,2).getValue(); var FirstName = shtResponse.getRange(RowResponse,3).getValue(); var LastName = shtResponse.getRange(RowResponse,4).getValue(); var PlayerName = FirstName + ' ' + LastName; var Language = shtResponse.getRange(RowResponse,5).getValue(); var DCINum = shtResponse.getRange(RowResponse,6).getValue(); var NbPlayers = shtPlayers.getRange(2, 6).getValue(); // Copy Values to Players Sheet at the Next Empty Spot (Number of Players + 3) var NextPlayerRow = NbPlayers + 3; // Name shtPlayers.getRange(NextPlayerRow, 2).setValue(PlayerName); Logger.log('Player Name: %s',PlayerName); // Email Address shtPlayers.getRange(NextPlayerRow, 3).setValue(EmailAddress); Logger.log('Email Address: %s',EmailAddress); // Language shtPlayers.getRange(NextPlayerRow, 4).setValue(Language); Logger.log('Language: %s',Language); // DCI Number shtPlayers.getRange(NextPlayerRow, 5).setValue(DCINum); Logger.log('DCI: %s',DCINum); Logger.log('-----------------------------'); PlayerData[0] = 1; PlayerData[1] = NbPlayers + 1; PlayerData[2] = PlayerName; PlayerData[3] = FirstName; PlayerData[4] = EmailAddress; PlayerData[5] = Language; PlayerData[6] = DCINum; return PlayerData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async onPlayerAdded(player) {}", "addPlayer(player){\n\t\tthis.addSquare(player);\n\t\tthis.players[player.id] = player;\n\t}", "function addNewPlayer() {\n addPlayerText = document.getElementById(\"add-player-text\");\n listPlayers.push(new Player(addPlayerText.value, 0));\n addPlayerText.value = \"\";\n ...
[ "0.6579237", "0.6437255", "0.64241683", "0.6321825", "0.6298169", "0.6265488", "0.6219077", "0.61619365", "0.6130313", "0.6070199", "0.6058914", "0.6056035", "0.5993726", "0.5982168", "0.5978173", "0.5926276", "0.5909214", "0.5892129", "0.58904", "0.58875024", "0.5863951", ...
0.58252406
23
function fcnModifyReportFormTCG_Master This function modifies the Match Report Form to add new added players
function fcnModifyReportFormTCG(ss, shtConfig, shtPlayers) { var MatchFormEN = FormApp.openById(shtConfig.getRange(36, 2).getValue()); var FormItemEN = MatchFormEN.getItems(); var NbFormItem = FormItemEN.length; var MatchFormFR = FormApp.openById(shtConfig.getRange(37, 2).getValue()); var FormItemFR = MatchFormFR.getItems(); // Function Variables var ItemTitle; var ItemPlayerListEN; var ItemPlayerListFR; var ItemPlayerChoice; var NbPlayers = shtPlayers.getRange(2, 6).getValue(); var Players = shtPlayers.getRange(3, 2, NbPlayers, 1).getValues(); var ListPlayers = []; // Loops to Find Players List for(var item = 0; item < NbFormItem; item++){ ItemTitle = FormItemEN[item].getTitle(); if(ItemTitle == 'Winning Player' || ItemTitle == 'Losing Player'){ // Get the List Item from the Match Report Form ItemPlayerListEN = FormItemEN[item].asListItem(); ItemPlayerListFR = FormItemFR[item].asListItem(); // Build the Player List from the Players Sheet for (i = 0; i < NbPlayers; i++){ ListPlayers[i] = Players[i][0]; } // Set the Player List to the Match Report Forms ItemPlayerListEN.setChoiceValues(ListPlayers); ItemPlayerListFR.setChoiceValues(ListPlayers); // ItemPlayerChoice = ItemPlayerListEN.getChoices(); // Logger.log(ItemTitle); // for(var choice = 0; choice < ItemPlayerChoice.length; choice++){ // Logger.log('Player: %s',ItemPlayerChoice[choice].getValue()); // } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildAddPlayer() {\n var pane = buildBaseForm(\"Add a new player account\", \"javascript: addPlayer()\");\n var form = pane.children[0];\n\n form.appendChild(buildBasicInput(\"player_username\", \"Username\"));\n form.appendChild(buildPasswordInput(\"player_password\", \"Password\"));\n for...
[ "0.609101", "0.5933444", "0.58078146", "0.5791987", "0.564021", "0.5498164", "0.5462399", "0.54152656", "0.5370998", "0.53058696", "0.52330256", "0.5225751", "0.5210808", "0.5199664", "0.5166566", "0.5143256", "0.5139137", "0.5096545", "0.5092762", "0.5077827", "0.50754136", ...
0.6936727
0
function fcnAddPlayerWeeklyBooster This function adds the new player to the Weekly Booster Spreadsheet
function fcnAddPlayerWeeklyBooster(ssWeekBstrID, NbPlayers, PlayerName){ var ssWeekBstr = SpreadsheetApp.openById(ssWeekBstrID); var Sheets = ssWeekBstr.getSheets(); var NumSheets = ssWeekBstr.getNumSheets(); // Function Variables var shtWeekBstr; var MaxCols; var MaxRows; var NewCol; var Player; var PlayerSlots; var ColumnAdded = 0; // Check in first sheet to find where to add the player // Get Sheet Data shtWeekBstr = Sheets[0]; MaxCols = shtWeekBstr.getMaxColumns(); PlayerSlots = MaxCols - 1; Logger.log('Nb Player : %s',NbPlayers); Logger.log('Player Slots: %s',PlayerSlots); // If Number of Players is less or equal to Number of Columns, find the first unused column if(NbPlayers <= PlayerSlots){ for(var col = 2; col <= 9; col++){ Player = shtWeekBstr.getRange(3, col).getValue(); if(Player == '') { NewCol = col; col = 10; Logger.log('Existing Column Found: %s', NewCol); } } } // If Number of Players is greater than Number of Columns, add a Column if(NbPlayers > PlayerSlots){ NewCol = MaxCols + 1; ColumnAdded = 1; Logger.log('New Player added at Column: %s',NewCol); } // Loop through all sheets to add the player at the appropriate column for(var sheet = 0; sheet < NumSheets; sheet++){ shtWeekBstr = Sheets[sheet]; MaxCols = shtWeekBstr.getMaxColumns(); MaxRows = shtWeekBstr.getMaxRows(); // Copy the last Column as template if(ColumnAdded == 1) { shtWeekBstr.insertColumnAfter(MaxCols); shtWeekBstr.getRange(1, MaxCols, MaxRows, 1).copyTo(shtWeekBstr.getRange(1, NewCol, MaxRows, 1)); } // Set Player Name shtWeekBstr.getRange(3, NewCol).setValue(PlayerName); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fcnRegistrationTCG(ss, shtResponse, RowResponse){\n\n var shtConfig = ss.getSheetByName('Config');\n var shtPlayers = ss.getSheetByName('Players');\n var ssWeekBstrID = shtConfig.getRange(40, 2).getValue();\n \n var PlayerData = new Array(7);\n PlayerData[0] = 0 ; // Function Status\n PlayerData[1]...
[ "0.6348452", "0.615527", "0.60130733", "0.58805275", "0.5873181", "0.5790995", "0.57865757", "0.56743497", "0.56690246", "0.5659357", "0.5656915", "0.56544244", "0.5647521", "0.5616858", "0.56126034", "0.5609683", "0.56006104", "0.55754876", "0.5545492", "0.5539052", "0.55159...
0.77432865
0
Load the ball,paddle,brick,start button assets
function preload() { game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; game.scale.pageAlignHorizontally = true; game.scale.pageAlignVertically = true; game.stage.backgroundColor = 'grey'; ASSETS.foreach((asset, index) => { game.load.image(ASSET_NAME[index], asset); }); // add button separately game.load.spritesheet('button', 'assets/button.png', 120, 40); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preload() {\n \n//image for the ball\n ballImage = loadAnimation(\"ball.png\");\n \n//image for paddle\n paddleImage = loadAnimation(\"paddle.png\");\n}", "preload() {\n\n // loading assets\n this.load.image(\"wheel\", Utils.UrlRoot + \"minigame/wheel/wheel.png\");\n this.load.i...
[ "0.73980296", "0.7092614", "0.70433056", "0.7034422", "0.6921859", "0.68803257", "0.68745524", "0.68432754", "0.6828663", "0.6781207", "0.6774017", "0.6772125", "0.6768625", "0.6751903", "0.6742336", "0.6733382", "0.67217207", "0.6719111", "0.6666985", "0.66325974", "0.663231...
0.67186373
18
little bit of tweem and ball bounce calcs
function ballHitPaddle(ball, paddle) { ball.animations.play('wobble'); ball.body.velocity.x = -1 * 5 * (paddle.x - ball.x) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gameBounce(state) {\r\n if (!state) {\r\n return;\r\n }\r\n\r\n for (let ball of state.balls) {\r\n var bax = ball.pos.x;\r\n var bay = ball.pos.y;\r\n var rad = ball.rad;\r\n\r\n // Rebonds sur les bords horizontaux\r\n if (bay + rad + ball.vel.y > BOARD_HEIGHT || bay - rad + ball.ve...
[ "0.77034175", "0.75526214", "0.7493649", "0.7469598", "0.74571943", "0.741914", "0.73911613", "0.73538023", "0.7314833", "0.729274", "0.7241612", "0.719821", "0.7196478", "0.71281415", "0.7112665", "0.71048456", "0.7072535", "0.7043456", "0.70275867", "0.700277", "0.687186", ...
0.6419989
49
deviceready Event Handler Bind any cordova events here. Common events are: 'pause', 'resume', etc.
onDeviceReady() { /** * initialize all different stuff here: * e.g. * - sentry * - firebase * - adjust * - push notifications * - fabric * - custom url schema * - facebook * - universal links * - google analytics * - ... * * context to "app" is avaialble, but beware only the app scope of a plugin (which means if any other plugin * extends the app scope, it could be that it is not available yet) */ try { this.initStatusBar() } catch (err) { // console.error('status bar failed', err) } try { this.initWKWebView() } catch (err) { // console.error('init WKWebView failed', err) } try { this.initCustomUrlScheme() } catch (err) {} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "bindEvents() {\n document.addEventListener('deviceready', this.onDeviceReady, false);\n }", "function bindEvents() {\r\n document.addEventListener('deviceready', onDeviceReady, false);\r\n }", "function bindEvents() {\n document.addEventListener('deviceready', onDeviceReady, false);\n }...
[ "0.80479974", "0.80048454", "0.7985096", "0.7950209", "0.7552961", "0.7466272", "0.7457214", "0.74373513", "0.7406414", "0.7386873", "0.73639977", "0.73639977", "0.7314735", "0.7290568", "0.7097092", "0.70870525", "0.7075807", "0.7051338", "0.70315146", "0.7010601", "0.700169...
0.5579737
78
Deauthenticate a user by emoving the jwt token from Local Storage.
static deauthenticateUser() { localStorage.removeItem('token'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static deauthenticateUser() {\n console.log(\"de-authenticate\")\n localStorage.removeItem('token');\n }", "static deauthenticateUser() {\n localStorage.removeItem('token');\n localStorage.removeItem('role');\n localStorage.removeItem('username');\n Auth.onAuthenticationStatusChange(false);\n ...
[ "0.8327065", "0.8241062", "0.82245535", "0.7538964", "0.7383013", "0.73423487", "0.7187966", "0.71713483", "0.7162293", "0.70170015", "0.69836324", "0.6939891", "0.6934355", "0.6930052", "0.69078827", "0.6895025", "0.6892186", "0.6887307", "0.6872921", "0.6857856", "0.6836157...
0.82245064
7
There will always be only one integer that appears an odd number of times.
function findOdd(array) { //happy coding! for (let i = 0; i < array.length; i++) { let counter = 0; for (let j = 0; j < array.length; j++) { if (array[i] === array[j]) { counter++; } } if (counter % 2 !== 0) { return array[i]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findOdd(A) {\n var occurrences = { };\n for (var i = 0; i < A.length; i++) {\n var num = A[i];\n occurrences[num] = occurrences[num] ? occurrences[num] + 1 : 1;\n }\n for (num in occurrences) {\n let count = occurrences[num]\n if (count % 2 == 1) {\n return parseInt(...
[ "0.6796345", "0.67563814", "0.67455596", "0.67249495", "0.67129797", "0.6670634", "0.6646096", "0.66383344", "0.66227305", "0.6597218", "0.6595738", "0.659543", "0.6593663", "0.65841866", "0.6578948", "0.6478675", "0.6453071", "0.64482296", "0.6447972", "0.64461267", "0.64417...
0.63940924
29
Return a calMoment representing (the next half hour) starting from Date.now()
function getNewStartDate() { var now = calMoment(); var minute = now.minute(); now.endOf('hour'); if (minute < 30) { now.subtract(30, 'minute'); } return now.add(1, 'seconds'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentTime () {\n var currentHour = parseInt(moment().format(\"hh\"));\n var currentPeriod = moment().format(\"A\");\n\n if (currentPeriod == \"PM\"){\n currentHour = currentHour + 12;\n }\n return currentHour;\n}", "get currentHour(){\n //returning in the format 01 ...
[ "0.6525404", "0.6361811", "0.6306318", "0.6206453", "0.6067614", "0.5958979", "0.59486336", "0.5929497", "0.5927677", "0.5889807", "0.58598804", "0.5855314", "0.5841721", "0.5778578", "0.57724583", "0.5750501", "0.57503164", "0.5746794", "0.5724402", "0.5718404", "0.57165116"...
0.6521425
1
Return a calMoment representing the result of getNewStartDate + one hour
function getNewEndDate() { return getNewStartDate().add(1, 'hours'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNewStartDate() {\n var now = calMoment();\n var minute = now.minute();\n\n now.endOf('hour');\n\n if (minute < 30) {\n now.subtract(30, 'minute');\n }\n\n return now.add(1, 'seconds');\n }", "get startMoment() {\n if (!this._startMoment) \n ...
[ "0.76565385", "0.6056773", "0.60089374", "0.5849125", "0.58417356", "0.5822076", "0.58006495", "0.5768834", "0.575351", "0.57080936", "0.5703788", "0.56907606", "0.5650221", "0.56397086", "0.5613651", "0.56058943", "0.55725425", "0.5569285", "0.55528045", "0.5542279", "0.5541...
0.6862029
1
eventos do modal Fechando o modal
function closeModal() { const modal = c(".pizza--modal-area"); let timerCloser = 500; modal.style.opacity = 0; setTimeout(() => { modal.style.display = "none"; }, timerCloser); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ouvrir() {\n creationModal();\n }", "function AbrirModalConsulta(){\n $(\"#modal_consultas\").modal({ backdrop: 'static', keyboard: false })\n $(\"#modal_consultas\").modal('show');\n listar_consulta_historial() ;\n}", "function modal(data) {\n // Set modal title\n $('...
[ "0.75163025", "0.7275819", "0.7236432", "0.7177598", "0.7161867", "0.71581167", "0.7152288", "0.70896226", "0.7060185", "0.70539457", "0.7052506", "0.7049469", "0.70388347", "0.7022091", "0.7006534", "0.69970477", "0.6981353", "0.6974079", "0.6933098", "0.6931839", "0.6931813...
0.0
-1
Raw String Access Access the raw template string content (backslashes are not interpreted).
function quux (strings, ...values) { strings[0] === "foo\n" strings[1] === "bar" strings.raw[0] === "foo\\n" strings.raw[1] === "bar" values[0] === 42 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function escapeForTemplate(raw) {\n return raw\n .replace(/^['\"]|['\"]$/g, '')\n .replace(/`/g, '\\\\`')\n .replace(/\\\\(['\"])/g, '$1');\n}", "function TemplateStrings() {\n\n\n // Basic literal string creation\n console.log(`Normal string`);\n\n // Multiline strings\n var multiLineStrin...
[ "0.68351024", "0.64215416", "0.6358289", "0.6198038", "0.6185401", "0.61701775", "0.6161564", "0.6161564", "0.6161564", "0.61571735", "0.61451995", "0.61245126", "0.6116789", "0.6116789", "0.6116789", "0.582129", "0.5740879", "0.5701149", "0.5693991", "0.56711936", "0.5671193...
0.0
-1
Movement / get unicode
function getUni(e){ var unicode=e.keyCode? e.keyCode : e.charCode alert(unicode) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extractCode () {\n return ((((this.text.charCodeAt(0)-0xD800)*0x400) + (this.text.charCodeAt(1)-0xDC00) + 0x10000));\n }", "function getchar(position){\n return $(position).text();\n}", "function ctl(ch){return String.fromCharCode(ch.charCodeAt(0)-64);}", "function getUnicodeChar(name){\n return String...
[ "0.61611944", "0.6030061", "0.600287", "0.5977516", "0.58052295", "0.5764298", "0.5748095", "0.57366574", "0.5726957", "0.57213473", "0.57043254", "0.56486565", "0.5635536", "0.55671585", "0.556525", "0.55626273", "0.55407006", "0.5410333", "0.53996176", "0.5390983", "0.53880...
0.5967818
4
switch to assign keybools true
function switchT(key){ var keyUni = retUni(key); switch(keyUni){ case 87: // W keyBool[0] = true; break; case 65: // A keyBool[1] = true; break; case 68: // D keyBool[2] = true; break; case 83: // S keyBool[3] = true; break; case 32: // Space Bar keyBool[4] = true; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _Sets(bytes32 version, uint256 key, bytes32 index, bool value, bool boolNull) public\n {\n if(value != boolNull)\n {\n BoolKeys[msg.sender][version][key][index] = value;\n }\n else\n {\n BoolKeys[msg.sender][version][key][index] = boolNull;\n ...
[ "0.63824165", "0.63740647", "0.6342601", "0.6189027", "0.6159728", "0.60867774", "0.60867774", "0.60607886", "0.6039177", "0.59641147", "0.593509", "0.5920654", "0.59129626", "0.58974934", "0.58857465", "0.5881369", "0.58171517", "0.5785219", "0.5765264", "0.57418317", "0.574...
0.6066026
7
swith to assign keybools false
function switchF(key){ var keyUni = retUni(key); switch(keyUni){ case 87: // W keyBool[0] = false; break; case 65: // A keyBool[1] = false; break; case 68: // D keyBool[2] = false; break; case 83: // S keyBool[3] = false; break; case 32: // Space Bar keyBool[4] = false; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.keys = [];\n\n for(var i = 0; i < 222; i++) {\n this.keys.push(false);\n }\n }", "resetKeys(){\n for (let key of Object.keys(this.keyAssignment)) {\n // set property pressed to false for each key\n this.keyAssignme...
[ "0.6122975", "0.61014724", "0.6097937", "0.598527", "0.598527", "0.598044", "0.5914269", "0.5793068", "0.5764926", "0.5713044", "0.5588082", "0.5543628", "0.5477344", "0.5454908", "0.54263514", "0.5342621", "0.5322913", "0.53038365", "0.5285698", "0.52488154", "0.52455604", ...
0.0
-1
Start Classes Wrapper Class
function Wrapper(width, height, target) { this.element = document.createElement("div"); this.element.id = "wrapper"; this.element.style.overflow = "hidden"; this.element.style.position = "relative"; this.element.style.height = height + "px"; this.element.style.width = width + "px"; this.element.zIndex = "9"; this.left = 0; this.innerLeft = this.left+200; this.innerRight = this.left + 800; this.bottom = 0; this.innerBottom = this.bottom + 200; this.innerTop = this.bottom + 400; this.coinCount = document.createElement("div"); this.element.appendChild(this.coinCount); this.coinCount.style.position = "fixed"; this.coinCount.style.color = "midnightblue"; this.coinCount.style.fontFamily = "Impact"; this.coinCount.style.fontSize = "xx-large"; this.coinCount.style.fontWeight = "900"; this.coinCount.style.zIndex = "10"; this.coinCount.style.fontStyle = "bold"; this.coinCount.style.left = "5px"; this.energy = document.createElement("div"); this.element.appendChild(this.energy); this.energy.style.position = "fixed"; this.energy.style.backgroundColor="goldenrod"; this.energy.style.opacity = 0.7; this.energy.style.zIndex = "9"; this.energy.style.height = "40px"; this.energy.style.borderRadius = "5px"; this.energy.style.left = "0px"; this.appendBody = function(){ document.body.appendChild(this.element); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Class() {\n // use the init method to define your constructor's content.\n if (start && this.init.apply) {\n this.init.apply(this, arguments);\n }\n }", "function ClassHandle() {\n}", "function Class(){}", "function Class(){}", "function Class(){}", "static sta...
[ "0.6998217", "0.6684294", "0.6628008", "0.6628008", "0.6628008", "0.65813595", "0.63804656", "0.6380416", "0.6284885", "0.62494874", "0.62331355", "0.62117296", "0.6190021", "0.6190021", "0.6190021", "0.6190021", "0.6190021", "0.6190021", "0.61679834", "0.61416197", "0.614161...
0.0
-1
create world in wrapper function
function createWorld(width,height){ myWorld = new World(width,height); myWorld.append(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createWorld (x, y) {\n world = generateGrid(x, y);\n specialWorldGen();\n saveWorld();\n}", "function createWorld() {\n\t \t\t// Define the gravity\n\t \t\tvar gravity = new b2Vec2(0, 10);\n\n\n\t \t\t// set to allow sleeping object\n\t \t\tvar allowSleep = true;\n\n\t \t\t// finally creat...
[ "0.7320178", "0.72575486", "0.72061986", "0.7164693", "0.7046567", "0.70033735", "0.681893", "0.67794156", "0.65938157", "0.65897804", "0.6548006", "0.6456398", "0.63739514", "0.6313655", "0.62996346", "0.62373483", "0.6235594", "0.61616486", "0.6153973", "0.6148855", "0.6132...
0.72375226
2
Level Object Constructor /test level /mElement Class
function MElement(x,y,width,height,id,topRange,bottomRange,vy) { this.type = "moving"; this.setUp(id); this.setXandY(x,y); this.setWandH(width,height); this.vy = vy; this.topRange = topRange; this.bottomRange = bottomRange; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(level, bounds){\n\t\tthis.nodes = new Array(4);\n\t\tthis.objects = [];\n\t\tthis.bounds = bounds;\n\t\tthis.level = level;\n\t}", "constructor(level, bounds){\n\t\t\tthis.nodes = new Array(4);\n\t\t\tthis.objects = [];\n\t\t\tthis.bounds = bounds;\n\t\t\tthis.level = level;\n\t\t}", "function Le...
[ "0.67690283", "0.6720994", "0.66934335", "0.6478937", "0.64462584", "0.6374736", "0.6245696", "0.6209994", "0.61982155", "0.6188072", "0.6154728", "0.60869366", "0.608237", "0.60548717", "0.5946717", "0.59429896", "0.59220535", "0.58605826", "0.58459014", "0.58144385", "0.577...
0.0
-1
The first line of input contains an integer, NN. The next NN lines each contain an above mentioned query. (It is guaranteed that each query is valid.) Sample Input 10 1 97 2 1 20 2 1 26 1 20 2 3 1 91 3 Output Format For each type 3 query, print the maximum element in the stack on a new line. Sample Output 26 91 each element in the passed in array is a string
function printMaxElement(arr) { var stack = []; for(var i = 0; i < arr.length; i++){ var current = arr[i].split(' '); if(current[0] === '1') { stack.push(current[1]); } if(current[0] === '2') { stack.pop(); } if(current[0] === '3') { console.log(stack[stack.length - 1]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processData(input) {\n input = input.split('\\n');\n for (var j = 0; j < parseInt(input[0], 10); j++) {\n var max = 0;\n var n = parseInt(input[j + 1], 10);\n for (var i = 1; i <= n; i++) {\n if (n === 1) {\n max = 0;\n break;\n }\n var tmpMax = getMax(i);\n ma...
[ "0.65481645", "0.64638466", "0.6207753", "0.6178542", "0.61130583", "0.60413617", "0.6040064", "0.60099363", "0.60098046", "0.59461147", "0.5930973", "0.58993566", "0.5874305", "0.5840145", "0.58059734", "0.5803936", "0.58005583", "0.5799661", "0.5786462", "0.57642776", "0.57...
0.68640405
0
Implement del function to our code
async del(itemId) { return this.model.deleteOne({ _id: itemId }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Remove() {}", "remove () {\n // cleanup\n }", "function delme() { this.parentNode.removeChild(this);\t}", "delete() {\n\n }", "removed() {}", "removed() {}", "remove(){\n //\n }", "delete() {\n this.deleted = true;\n }", "delete() {\n\t\tthis.data.delete();\n\t}", "...
[ "0.7166468", "0.7150518", "0.71426", "0.7113718", "0.6903498", "0.6903498", "0.69033456", "0.69003904", "0.6881454", "0.6875801", "0.6875801", "0.68311554", "0.68251806", "0.67887807", "0.6780288", "0.6763683", "0.67572945", "0.67416507", "0.67416507", "0.67416507", "0.674155...
0.0
-1
These constructor args are important! Do not modify them.
constructor(...args) { super(...args); this.lolhacked(false); this.registerCommand({ name: 'experihax', info: 'haaaxxxxxx', func: this.lolhacked.bind(this) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor( args ) {\n\t\t\t\tsuper( args );\n\t\t\t}", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super(args);\n }", "constructor (){}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6ed02538;\n this.SUBCLASS_OF_ID ...
[ "0.7689411", "0.75021094", "0.75021094", "0.7331928", "0.72153527", "0.72101146", "0.72095555", "0.7208134", "0.7202237", "0.7184934", "0.71818817", "0.7168034", "0.71661127", "0.71635354", "0.7158275", "0.71568984", "0.71555275", "0.71521306", "0.71392465", "0.71382624", "0....
0.0
-1
This is what the config file will contain when it gets generated (first use)
get configTemplate() { return { // The color is used for the `this.log()` function and also custom command help color: '1af463', // The optional icon to use with the `this.sendLocalMessage` function. If left blank, a default one will be used instead iconURL: 'https://i.ytimg.com/vi/KEkrWRHCDQU/maxresdefault.jpg' }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getConfig () {}", "function sampleConfig() {\n return \"\\\n---\\n\\\n# Configuration sample file for Jingo (YAML)\\n\\\napplication:\\n\\\n title: \\\"CartoWiki\\\"\\n\\\nserver:\\n\\\n hostname: \\\"localhost\\\"\\n\\\n port: 6067\\n\\\n localOnly: false\\n\\\n baseUrl: \\\"http://localho...
[ "0.73458004", "0.6934312", "0.6563225", "0.65525264", "0.6506017", "0.64272946", "0.64272946", "0.6345515", "0.63296664", "0.6311455", "0.6303662", "0.6278554", "0.6269312", "0.6259762", "0.62575185", "0.623667", "0.6137559", "0.61310315", "0.6094538", "0.6087077", "0.6079470...
0.62550527
15
functions the value of returned val is string type
function returnMyName() { return myName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function str_val(str) {\n\n \n}", "handler(value) { return String(value); }", "get stringValue() {}", "function string(val) {\n return {value: val, type: 'string'};\n}", "function validateStringValue(val){\r\n if(TypeUtils.isString(val)){\r\n return val;\r\n }else if(TypeUtils.isNumber(v...
[ "0.78046274", "0.7665289", "0.7579847", "0.7404571", "0.7066283", "0.6982311", "0.6895214", "0.68566054", "0.6842107", "0.6835883", "0.68268675", "0.6821592", "0.68084675", "0.67239904", "0.6719458", "0.66907054", "0.667951", "0.667951", "0.667951", "0.667951", "0.667951", ...
0.0
-1
if pass something not a string get error if a function returns nothing then set return type to void
function sayHello() { console.log('hello'); // no return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exOh(str)\n{\n // Function code goes here\n // Don't forget to return something!\n}", "myTestFunction1(str){\r\n return str;\r\n\r\n }", "handler(value) { return String(value); }", "function run(a, success, error) {\n\n if (success && typeof success === 'function') {\n if (a ==...
[ "0.6092155", "0.59888095", "0.58990663", "0.5832865", "0.5794364", "0.5739811", "0.56698227", "0.5655498", "0.56463504", "0.562429", "0.5623562", "0.55814207", "0.5568662", "0.5556977", "0.5525886", "0.5525886", "0.55229944", "0.55200094", "0.5498638", "0.54881614", "0.546502...
0.0
-1
NEVER TYPE function that never finishes
function neverReturns() { throw new Error('an error!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doNothing() {}", "function doNothing() {}", "function doNothing() {}", "function doNothing() {}", "function doNothing() {}", "function done() {}", "complete() {}", "function doNothing() { }", "function doNothing() { /* empty */ }", "_postProcessing() {\n // None yet...\n }", "funct...
[ "0.6578813", "0.6578813", "0.6578813", "0.6578813", "0.6578813", "0.6514313", "0.6365786", "0.6360283", "0.6319669", "0.6312227", "0.63099116", "0.6304332", "0.62903965", "0.6266682", "0.62508804", "0.62410706", "0.623806", "0.623806", "0.623806", "0.62189543", "0.62189543", ...
0.0
-1
spreads out the array into single values Rest parameter good if you don't know how many args you want
function makeArray(name) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } return args; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "unspread(args) {\n return args;\n }", "function arrayMake(args) {\n return Array.prototype.slice.call(args);\n }", "function doubleAndReturnArgs(arr, ...args) {\n let doubled = args.map((n) => {\n return n * 2;\n });\n let newArr = [...arr, ...doubled];\n return newArr;\n}", "function imprimir...
[ "0.7455621", "0.73688406", "0.7057596", "0.6861607", "0.68534225", "0.6784037", "0.6773926", "0.6697679", "0.6693169", "0.66858864", "0.6657073", "0.6611739", "0.66017747", "0.6589839", "0.65436405", "0.6543399", "0.65422946", "0.65422946", "0.65422946", "0.65422946", "0.6542...
0.0
-1
All functions for displaying and calculating the shopping cart section
findById(id) { let product = shoppingCart.products.find((p) => { return id == p.id; }); return product; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayCartItems () {\r\n // get cart items div and clear it\r\n const cartItemsDiv = document.getElementById('cartItems')\r\n cartItemsDiv.innerHTML = ''\r\n\r\n // retrive the cart and the catalogue fro storage\r\n const cart = JSON.parse(sessionStorage.getItem('cart'))\r\n const catalogue = JSON....
[ "0.80365324", "0.7880756", "0.78600556", "0.78503424", "0.7847819", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", "0.7844407", ...
0.0
-1
Gets ID of the item that shall be removed from shopping cart
removeProduct(id) { this.products = this.products.filter((p) => { return p.id != id; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeItemFromCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(14, itemID.length);\n cartItems.splice(positionInCart, 1);\n updateCartDetails();\n}", "function minusItem() {\n const productId = this.name;\n const cartList = JSON.parse(sessionStorage.getItem(\"s...
[ "0.7695938", "0.7408457", "0.73978704", "0.73633504", "0.7264766", "0.7239877", "0.70878476", "0.70760834", "0.7045863", "0.69680953", "0.69628656", "0.6953446", "0.68804747", "0.68753153", "0.68632096", "0.6856301", "0.68450326", "0.6835681", "0.6830892", "0.6781893", "0.672...
0.0
-1
Instance which should be added
addProduct(product) { let productClone = JSON.parse(JSON.stringify(product)); // Check if product exists in shopping cart already let productInCart = this.products.find((p) => { return p.id == product.id; }); if (productInCart) { // Just refresh amount productInCart.amount = productInCart.amount + productClone.amount; } else { // Regulary add selected product to cart shoppingCart.products.push(productClone); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n\t\tif (!instance) { instance = this }\n\n\t\treturn instance\n\t}", "get instance() {\n\t\treturn this.__instance;\n\t}", "push( com ){\r\n\t\t//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n\t\t// User Created Component Instance, Check if its registered\r\n\t\tlet cname\t= com.const...
[ "0.62892646", "0.62826496", "0.6162884", "0.608083", "0.60761124", "0.59488094", "0.5921292", "0.59122026", "0.5901048", "0.5901048", "0.5900065", "0.58445686", "0.5827403", "0.57778114", "0.57658416", "0.57371426", "0.57293457", "0.5707786", "0.56842667", "0.5658762", "0.561...
0.0
-1
Increases amount. Gets ID of the product that shoud be increased
addProductAmount(id) { let product = shoppingCart.findById(id); product.amount++; document.getElementById('foodAmountCart-' + product.id).innerHTML = product.amount + 'x'; document.getElementById('overall-shopping-cart-price-' + product.id).innerHTML = printPrice(product) + '€'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function increaseAmount(id) {\n var curVal = parseInt($('#product_amount' + id).val());\n var maxVal = parseInt($('#max_amount' + id).val());\n if (curVal < maxVal) $('#product_amount' + id).val(curVal + 1);\n else $('#product_amount' + id).val(maxVal);\n}", "function increaseAmount(id) {\n dispat...
[ "0.68387", "0.67617345", "0.6699461", "0.6688628", "0.66218334", "0.6512062", "0.6502809", "0.64914566", "0.6470512", "0.64393646", "0.6413621", "0.6366604", "0.6317673", "0.63151914", "0.63041407", "0.6293955", "0.6190196", "0.6185377", "0.6184523", "0.6178408", "0.6174464",...
0.6986853
0
Decreases amount. Gets ID of the product that shoud be decreased
removeProductAmount(id) { let product = this.findById(id); if (product.amount > 0) { product.amount--; } document.getElementById('foodAmountCart-' + product.id).innerHTML = product.amount + 'x'; document.getElementById('overall-shopping-cart-price-' + product.id).innerHTML = printPrice(product) + '€'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decreaseAmount(id) {\n var curVal = parseInt($('#product_amount' + id).val());\n var minVal = parseInt($('#min_amount' + id).val());\n if (curVal > minVal) $('#product_amount' + id).val(curVal - 1);\n else $('#product_amount' + id).val(minVal);\n}", "cartMinusOne(product, id) {\r\n if (...
[ "0.6996927", "0.69315934", "0.6905409", "0.688752", "0.679881", "0.6749045", "0.6746687", "0.6678215", "0.65957206", "0.65455496", "0.6532839", "0.6450564", "0.63403994", "0.6245274", "0.6212531", "0.62121147", "0.6194126", "0.61738485", "0.61255366", "0.61039144", "0.6063564...
0.70594066
0
Calculates all numbers and the total bill
updateCosts() { let subtotal = 0; let total_bill = 0; let discount_value = 0; let voucher = this.voucher; this.products.forEach((product) => { subtotal += product.price * product.amount; }); let delivery_costs = 4.00; if (subtotal != 0) { total_bill = subtotal + delivery_costs; discount_value = this.discount * total_bill; total_bill -= discount_value; total_bill -= voucher; } else { voucher = 0; } document.getElementById('current-discount').innerHTML = (this.discount * 100) + '%'; document.getElementById('costs-subtotal').innerHTML = subtotal.toFixed(2) + '€'; document.getElementById('costs-delivery').innerHTML = delivery_costs.toFixed(2) + '€'; document.getElementById('costs-discount').innerHTML = discount_value.toFixed(2) + '€'; if (voucher != 0) { document.getElementById('costs-voucher').innerHTML = '-' + voucher.toFixed(2) + '€'; } else { document.getElementById('costs-voucher').innerHTML = voucher.toFixed(2) + '€'; } document.getElementById('costs-total').innerHTML = total_bill.toFixed(2) + '€'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcBill() {\n // get the bill\n let totalBill = bill.value;\n\n // number of people\n let totalPeople = people.value;\n let total = totalBill / totalPeople;\n\n // tip per person\n document.querySelector('#amount').value = (total * (tipAmount / 100)).toFixed(2);\n\n // show total per person\n do...
[ "0.7539316", "0.73425275", "0.71503717", "0.69986105", "0.6986813", "0.69738615", "0.6916377", "0.68920547", "0.6881699", "0.687064", "0.6861184", "0.68568283", "0.6789469", "0.676143", "0.66831625", "0.6679584", "0.6642736", "0.6630644", "0.6608618", "0.658988", "0.6580646",...
0.0
-1
1 you lost 2 you win
function KeyListener() { this.pressedKeys = []; this.keydown = function(e) { this.pressedKeys[e.keyCode] = true }; this.keyup = function(e) { this.pressedKeys[e.keyCode] = false }; document.addEventListener("keydown", this.keydown.bind(this)); document.addEventListener("keyup", this.keyup.bind(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function winLose(){\n if(guessThisNumber === playerCounter){\n alert('you win');\n crystalReset();\n winCounter++;\n $('#wins').text(winCounter);\n }else if(playerCounter > guessThisNumber){\n alert('You lost');\n crystalReset();\n lossCounter++;\n $('#...
[ "0.75734925", "0.74208766", "0.7294771", "0.7222149", "0.7176271", "0.712104", "0.70904154", "0.70796037", "0.70782435", "0.7065549", "0.7065388", "0.705201", "0.7019464", "0.7017151", "0.6997852", "0.6987983", "0.69877136", "0.69860834", "0.69818914", "0.697369", "0.6965209"...
0.0
-1
create array 60 bricks
function createBricks(){ let brickX = 2,brickY=10,j=0,a=0; for(var i=0;i<60;i++){ let brick={ x: brickX, y: brickY, w: brickWidth, h: 10, color: colors[j] } bricks.push(brick); brickX+=brickWidth+2; if(brickX+brickWidth+2>Width){ brickY+=12; brickX=2; j++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBricksL2() {\n brick.rows = 6;\n for (r = 0; r <brick.rows; r++) {\n bricks[r]=[];\n for (c = 0; c < brick.columns; c++) {\n bricks[r][c]={\n x: c*brick.x + 70,\n y: r*brick.y + 20,\n unbroken:true\n };\n }\n }\n}", "function createBricksL1() {\n ...
[ "0.7971576", "0.7956809", "0.7924039", "0.7653508", "0.7543526", "0.751359", "0.7431014", "0.7393234", "0.70830315", "0.6905838", "0.6887849", "0.67483854", "0.6709779", "0.6589996", "0.6497046", "0.6468152", "0.6407837", "0.63589364", "0.633822", "0.6336908", "0.6291859", ...
0.81138176
0
check collision !!ball must be first!!
function checkCollision(obj1,obj2){ if(obj1 != ball){ if(obj1.y >= obj2.y && obj1.y <= obj2.y+obj2.h && obj1.x >= obj2.x && obj1.x <= obj2.x+obj2.w){ return true } }else{ if(obj1.y+obj1.radius >= obj2.y && obj1.y-obj1.radius <= obj2.y+obj2.h && obj1.x-obj1.radius >= obj2.x && obj1.x+obj1.radius <= obj2.x+obj2.w){ return true } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collision(ball, player) {\n ball.top = ball.y - ball.radius;\n ball.bottom = ball.y + ball.radius;\n ball.left = ball.x - ball.radius;\n ball.right = ball.x + ball.radius;\n\n player.top = player.y;\n player.bottom = player.y + player.height;\n player.left = player.x;\n player.right = player.x + p...
[ "0.7677731", "0.7590627", "0.75230706", "0.7475806", "0.7472956", "0.7461991", "0.74539065", "0.74401456", "0.7440004", "0.7435546", "0.7403892", "0.73792267", "0.73730737", "0.73730737", "0.7368114", "0.7363345", "0.73619306", "0.73492444", "0.7331834", "0.7324271", "0.73232...
0.7133521
42
if ball touch brick destroy
function destroyBrick(){ for(var i=0;i<bricks.length;i++){ if(checkCollision(ball,bricks[i])){ ball.speedY = -ball.speedY; createBonus(bricks[i]); bricks.splice(i,1); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hit(ball, brick)\n{\n brick.kill();\n // update the score\n score += scoreIncrement;\n scoreText.setText('Points: ' + score);\n\n // check if all the bricks are destroyed\n var count_alive = 0;\n for (i = 0; i < bricks.children.length; i++)\n {\n if (bricks.children[i].alive...
[ "0.7118904", "0.7065659", "0.70068055", "0.70028275", "0.69618946", "0.6773931", "0.6724299", "0.65217745", "0.646548", "0.6416167", "0.63575494", "0.63409567", "0.6328438", "0.6215102", "0.620665", "0.6188818", "0.6184045", "0.6170064", "0.61612284", "0.61570835", "0.6139101...
0.7635378
0
reset everything for a new gme
function newGame(){ bricks=[]; bonuses=[]; createBricks(); ball.x = (Width/2)-3; ball.y = (Height/2)-3; ball.speedX = 0; ballOn = false; ball = { x: (Width/2)-3, y: (Height/2)-3, radius: 6, speedX: 0, speedY: 6 }; paddle1 = { w: 100, h: 10, x: Width / 2 - (100/2),// 100 is paddle.w y: Height-10, speed: 6 }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetEverything() {\n coords = [];\n cellMap = new Map();\n showMaze = false;\n showSoln = false;\n solnSet = [];\n countMoves = 0;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n user = new User();\n}", "function gameReset(){\n\n\t\t// clear instances\n\t\tHead.resetInstanceList();\n\t\tB...
[ "0.7186912", "0.7133546", "0.71267503", "0.70060605", "0.69786286", "0.6952973", "0.69526434", "0.69425523", "0.6936493", "0.69317245", "0.6931617", "0.69307566", "0.6912244", "0.6892289", "0.68604636", "0.68462497", "0.68278587", "0.68193656", "0.6791143", "0.6783423", "0.67...
0.0
-1
called before the action start. It will also set the target.
startWithTarget(target) { this.originalTarget = target; this.target = target; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "startWithTarget(target) {\n this.originalTarget = target;\n this.target = target;\n }", "@action setMoveTarget() {\n this.act = (nextLocation) => {\n this.clearHit()\n this.moveXAndY(nextLocation.x, nextLocation.y)\n this.handleEffects()\n }\n if (this.movementId)...
[ "0.7111189", "0.6704741", "0.6436806", "0.63615024", "0.6290741", "0.626852", "0.6180175", "0.61565393", "0.61421233", "0.6007083", "0.5984383", "0.59192896", "0.58961564", "0.58723104", "0.58463836", "0.57779115", "0.5772795", "0.57581246", "0.57553476", "0.5748875", "0.5747...
0.70241475
1
called after the action has finished. It will set the 'target' to nil.
stop() { this.target = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearTarget() {\n\thasTarget = false;\n}", "stop() {\n this.target = null;\n }", "discardTarget() {\n App.pathFinder.data.target_selected = false;\n App.pathFinder.data.target_type = App.targeting.target_types.none;\n App.pathFinder.data.target.id = null;\n App.path...
[ "0.7010954", "0.69439226", "0.66470546", "0.66339093", "0.63500184", "0.6188204", "0.61640143", "0.5950716", "0.5949419", "0.59470975", "0.59306145", "0.58857954", "0.584582", "0.5823234", "0.5823234", "0.5816791", "0.5781221", "0.5776719", "0.5774732", "0.5772408", "0.575859...
0.6953759
1
called every frame with it's delta time.
step(t) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateFrame() {\n const nowTime = (new Date()).getTime();\n this.tick += 1;\n if (nowTime - this.beforeTime >= 1000) {\n console.log(`fps: ${this.tick}`);\n this.tick = 0;\n this.beforeTime = nowTime;\n }\n }", "onAnimFrame() {\n const now = Date.now();\n const delta ...
[ "0.767807", "0.73086053", "0.72408766", "0.70886874", "0.6975341", "0.6946913", "0.6931086", "0.6923097", "0.67909473", "0.6723573", "0.66969454", "0.6667269", "0.66671056", "0.66510856", "0.66427064", "0.6624162", "0.6607287", "0.66029453", "0.65977204", "0.65386045", "0.653...
0.0
-1
Set the original target, since target can be nil. Is the target that were used to run the action. Unless you are doing something complex, like cc.ActionManager, you should NOT call this method.
setOriginalTarget(originalTarget) { this.originalTarget = originalTarget; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setOriginalTarget(originalTarget) {\n this.originalTarget = originalTarget;\n }", "set target(value) {}", "function setTarget(target) {\n this.target = target;\n}", "startWithTarget(target) {\n this.originalTarget = target;\n this.target = target;\n }", "startWithTarget(ta...
[ "0.7977469", "0.69513845", "0.6939573", "0.67776155", "0.675079", "0.66353786", "0.6579191", "0.6506911", "0.649673", "0.6489419", "0.6434818", "0.64200616", "0.6375829", "0.6375829", "0.6375829", "0.6323753", "0.6290448", "0.6290448", "0.6223536", "0.62011063", "0.6187046", ...
0.7942127
1
Currently JavaScript Bindigns (JSB), in some cases, needs to use retain and release. This is a bug in JSB, and the ugly workaround is to use retain/release. So, these 2 methods were added to be compatible with JSB. This is a hack, and should be removed once JSB fixes the retain/release bug.
retain() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "retain() {}", "release() {}", "release() {}", "release() {}", "release() {\n }", "function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}", "function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}", "Release() {}", "func...
[ "0.6380655", "0.59832054", "0.59832054", "0.59832054", "0.5707686", "0.56996495", "0.56996495", "0.5680987", "0.54904836", "0.535352", "0.5309589", "0.52728033", "0.5195771", "0.5192672", "0.5174338", "0.51621246", "0.5074802", "0.50147283", "0.49950784", "0.49747738", "0.497...
0.6063539
1
Currently JavaScript Bindigns (JSB), in some cases, needs to use retain and release. This is a bug in JSB, and the ugly workaround is to use retain/release. So, these 2 methods were added to be compatible with JSB. This is a hack, and should be removed once JSB fixes the retain/release bug.
release() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "retain() {}", "retain() {\n }", "release() {}", "release() {}", "release() {}", "function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}", "function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}", "Release() {}", "funct...
[ "0.6379057", "0.6061895", "0.5981007", "0.5981007", "0.5981007", "0.56972873", "0.56972873", "0.567857", "0.54888546", "0.53512406", "0.530856", "0.52706736", "0.51949704", "0.5193601", "0.51733327", "0.51598257", "0.5074679", "0.5014613", "0.49949554", "0.49759394", "0.49759...
0.5705501
5
then return the array with each string capitalized
function mutate (cargoItemsArray) { const mutatedArray = cargoItemsArray.map(item => item.toUpperCase()); return mutatedArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function capMe(arr){\n return arr.map(name => name[0].toUpperCase()+name.slice(1).toLowerCase())\n}", "function capMe(arr) {\n for (var i = 0; i < arr.length; i++) {\n arr[i] = arr[i].substring(0,1).toUpperCase() + arr[i].substring(1).toLowerCase()\n ;\n }\n return arr;\n}", "function...
[ "0.80264986", "0.7979839", "0.7921228", "0.78320235", "0.7739455", "0.7730299", "0.77223635", "0.7709283", "0.7702612", "0.770116", "0.76802003", "0.76119596", "0.75927967", "0.7570336", "0.75505877", "0.754117", "0.75394195", "0.75296706", "0.752897", "0.7523811", "0.7517622...
0.0
-1
show the rule of input info
function showMess(event) { var $input = $(event); var div = $input.parent().parent(); $('.title-3').hide(); //div.find('.title-3').show(); //when info of alert or ok is hidden, the title-3 info will show if($input.attr('id') === 'name') { if(div.find('.alert').is(':hidden') && div.find('.glyphicon-ok').is(':hidden')&& div.find('#alert-2').is(':hidden')&& div.find('#alert-1').is(':hidden')) div.find('.title-3').show(); } else{ if(div.find('.alert').is(':hidden') && div.find('.glyphicon-ok').is(':hidden')) div.find('.title-3').show(); } //$('.glyphicon-ok').hide(); // $input.parent().parent().find('.title-3').show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showRule(rule) {\n let hidden = document.getElementById(rule.on);\n let show = document.getElementById(rule.from).children[rule.from];\n\n hidden.classList.add('hidden');\n\n show.addEventListener('keyup', showInputChange);\n}", "get ruleInput() {\n return this._rule;\n }", "func...
[ "0.64753157", "0.6113998", "0.57206327", "0.56531966", "0.54881305", "0.54601663", "0.5391173", "0.53877217", "0.5365625", "0.5310586", "0.5261976", "0.5190371", "0.51629966", "0.5146944", "0.51167035", "0.5086196", "0.50760174", "0.50535315", "0.5027363", "0.49829105", "0.49...
0.0
-1
check the username is legal
function userid(event) { var id = $(event).val(); var input = $(event); var div = input.parent().parent(); var reg=/^[a-zA-Z0-9_]{3,10}$/; if(!reg.test(id)) { console.log('have illegal char'); div.find('.title-3').hide(); div.find('.alert').hide(); div.find('.glyphicon-ok').hide(); div.find('#alert-2').show(); } else{ /*$.ajax({ type : "post", data : { name : id }, dataType : "text", url : "/register/checkId", success : function(data){ if(data == 'success'){ // console.log('success'); console.log(div.find('.title3').text()); div.find('.title-3').hide(); div.find('.alert').hide(); div.find('.glyphicon-ok').show(); }else{ // console.log("fail"); div.find('.glyphicon-ok').hide(); div.find('.title-3').hide(); div.find('#alert-1').show(); } } });*/ console.log('success'); console.log(div.find('.title3').text()); div.find('.title-3').hide(); div.find('.alert').hide(); div.find('.glyphicon-ok').show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateUsername() {\n\n\t// Comprobamos si esta vacio\n\tif (checkIfEmpty(username)) return;\n\n\t// Comprobamos RegEx\n\tif (!checkUsername(username)) return;\n\t\n\treturn true;\n}", "function validate_username(username) {\n\treturn (username != \"\");\n}", "function isValidUsername(username){\n ...
[ "0.8391113", "0.83700943", "0.8281038", "0.81581324", "0.8141676", "0.8078996", "0.8036582", "0.80266666", "0.802607", "0.79715997", "0.7970111", "0.7948005", "0.7942511", "0.7942499", "0.79063267", "0.789479", "0.78419703", "0.7821432", "0.78158617", "0.77989286", "0.7797355...
0.0
-1
to judge the email is legal or not
function email(event) { let email = $(event).val(); let div = $(event).parent().parent(); let judge=/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/; if(!judge.test(email)) { console.log('email have illegal char'); div.find('.title-3').hide(); div.find('.glyphicon-ok').hide(); div.find('.alert').show(); }else{ div.find('.title-3').hide(); div.find('.alert').hide(); div.find('.glyphicon-ok').show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmail() {}", "function emailIsValid(email) {\n return /\\S+@\\S+\\.\\S+/.test(email);\n }", "function checkEmail(n)\r\n{\r\n\treturn n.search(/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$/)!=-1?!0:!1\r\n\t\r\n}", "function verifyemail(addr){\n//\tif (do...
[ "0.7873235", "0.7778837", "0.770207", "0.76960886", "0.7680958", "0.7675497", "0.7675497", "0.76689595", "0.7642758", "0.7600109", "0.7599424", "0.7578488", "0.7573618", "0.7573563", "0.7516749", "0.7497436", "0.74957037", "0.749177", "0.74726343", "0.74670833", "0.7455725", ...
0.0
-1
to judge the length of password is legal or not
function passLen(event) { var password = $(event).val(); var input = $(event); var div = input.parent().parent(); if($(event).val().length < 6 || $(event).val().length > 16) { div.find('.title-3').hide(); div.find('.glyphicon-ok').hide(); div.find('.alert').show(); } else { div.find('.title-3').hide(); div.find('.alert').hide(); div.find('.glyphicon-ok').show(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPasswordLength(password) {\n return password.length > 0;\n}", "function idPassLength(user, pw) {\n\treturn user.length >= 6 && pw.length >= 6;\n}", "function checkPassLength(pass) {\n if (pass.length >= 8 && pass.length <= 16) {\n return true;\n } else {\n return false;\n ...
[ "0.82770693", "0.82059586", "0.8172414", "0.81496745", "0.8128282", "0.80889964", "0.80581963", "0.80445564", "0.794488", "0.7921227", "0.7894617", "0.7870168", "0.7863016", "0.78530926", "0.77913713", "0.7782009", "0.77619183", "0.7746618", "0.77143365", "0.76697", "0.766515...
0.0
-1
to judge the repassword input is the same as password
function passwordRe(event) { let password = $('#password').val(); let passwordRe = $(event).val(); let div = $(event).parent().parent(); if(passwordRe.length>=6 && passwordRe.length<=16) { if(password == passwordRe) { div.find('.title-3').hide(); div.find('.alert').hide(); div.find('.glyphicon-ok').show(); } else{ div.find('.title-3').hide(); div.find('.glyphicon-ok').hide(); div.find('.alert').show(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkPwd() {\n const pwd = document.getElementById('newPwd').value,\n rpt = document.getElementById('repeatPwd').value;\n\n if (pwd !== rpt) {\n alert(getLang('SAME_PWD'));\n return false;\n }\n }", "function isValidPassword(password) {\n\n\n}", "function passwordMatch(password) {\...
[ "0.79128385", "0.7818971", "0.7813683", "0.77087057", "0.7704043", "0.7698872", "0.76698995", "0.75104254", "0.7494809", "0.74160653", "0.7402041", "0.73914117", "0.73759115", "0.7341302", "0.7321302", "0.727368", "0.72674876", "0.72669506", "0.726547", "0.72652555", "0.72641...
0.0
-1
to upload the register info if all the info are right
function upRegInfo(){ //to check all the info are right var right = true; $('.info-s').find('.glyphicon-ok').each(function(){ if($(this).is(':hidden')) { right = false; //break; } }); if(right === true) { let name = $('#name').val(); let email = $('#email').val(); let password = $('#password').val(); $.post('/register/upInfo', {username : name, email : email, password : password}, function(info){ //console.log('register success, url is '+url); if(info.error){ alert('注册失败!请重新注册。'); }else{ //success console.log('registe success'); alert('注册成功!'); window.location.href = '/login'; } }); }else{ alert('请输入合法信息!'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register()\n {\n validateRegisterInput();\n registerInfoToSite();\n\n\n \n \n }", "function isRegister(request, response, fromPost) {\r\n\tfromPost = queryString.parse(fromPost);\r\n var userInfo = fs.readFileSync(\"../user.txt\", \"utf-8\");\r\n \tvar users = ...
[ "0.68410003", "0.67484134", "0.6689855", "0.66365075", "0.6454121", "0.645028", "0.6375402", "0.63307494", "0.63285315", "0.63136476", "0.63117135", "0.6279671", "0.6253359", "0.6247692", "0.6231059", "0.6176608", "0.61653286", "0.61468273", "0.6145808", "0.61272913", "0.6114...
0.6702937
2
Find the sum of all the multiples of 3 or 5 below 1000.
function multOf3And5(n) { result = 0; for(let i= 0; i<n; i++) { if(i % 3 == 0 || i % 5 == 0) { result += i; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function multiplesOf3And5() {\r\n var total = 0;\r\n for (var i = 3; i < 1000; i += 1) {\r\n if (i%3 === 0 || i%5 === 0) {\r\n total += i;\r\n }\r\n }\r\n return total;\r\n}", "function sum(limit) {\n\t// find all multiples of 3 under limit\n let result = 0;\n \n\tfor (let i = 0; i < limit; ...
[ "0.7900781", "0.7769558", "0.76871395", "0.76420355", "0.7623201", "0.750215", "0.745474", "0.7452819", "0.73829556", "0.7375634", "0.73635125", "0.7345404", "0.7329589", "0.72742325", "0.7263983", "0.7255051", "0.72248054", "0.7220996", "0.7181776", "0.716628", "0.71579844",...
0.71534693
21
Copyright (c) 2013present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function _inheritsLoose$1(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the s...
[ "0.5825987", "0.56372195", "0.55575734", "0.5491102", "0.5401295", "0.53869206", "0.53641313", "0.5329602", "0.5323104", "0.5316228", "0.5316228", "0.5295301", "0.52686304", "0.5219148", "0.52003515", "0.5193797", "0.51936084", "0.51571286", "0.51420885", "0.5129062", "0.5128...
0.0
-1
Copyright (c) 2013present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
function unwrapExports (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n // if this is the first time the home screen is loading\n // we must initialize Facebook\n if (!window.FB) {\n window.fbAsyncInit = function() {\n window.FB.init({\n appId : '280945375708713',\n cookie : true, // enable cookies to allow the s...
[ "0.582302", "0.56352496", "0.55549705", "0.54886013", "0.5398446", "0.5384924", "0.53627056", "0.53269863", "0.5322178", "0.53158647", "0.53158647", "0.5293647", "0.5266638", "0.52168524", "0.5198115", "0.51917535", "0.5191675", "0.5155282", "0.5140739", "0.5130987", "0.51252...
0.0
-1
Both rdflib and 's 2waybinding return strings, so we convert everything to numbers
convertInputValuesToNumbers() { this.currentRange = !isNaN(parseFloat(this.currentRange)) ? parseFloat(this.currentRange) : 0; this.plannedRange = !isNaN(parseFloat(this.plannedRange)) ? parseFloat(this.plannedRange) : 0; this.priority = !isNaN(parseFloat(this.priority)) ? parseFloat(this.priority) : 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function conversion_function() {\n for (const key in Ledger) {\n // AccountIDs to integer\n let ID_value = Ledger[key].AccountID;\n ID_value = Number(ID_value);\n Ledger[key].AccountID = ID_value;\n\n // TransactionValues to 2dec...
[ "0.5303464", "0.5246124", "0.5214738", "0.5191272", "0.51880723", "0.51817816", "0.51579267", "0.5148394", "0.50483054", "0.5039459", "0.5039459", "0.5039459", "0.5038595", "0.50038767", "0.5002994", "0.4982816", "0.49598926", "0.49577475", "0.49555236", "0.49223137", "0.4918...
0.0
-1
game clock set to 15 seconds
function timer() { clock = setInterval(countDown, 1000); function countDown() { if (time < 1) { clearInterval(clock); userTimeout(); } if (time > 0) { time--; } $("#timer").html("<strong>" + time + "</strong>"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clock() {\n\t\tconst d = new Date();\n\t\tlet hour = d.getHours();\n\t\tlet min = d.getMinutes();\n\t\tlet sec = d.getSeconds();\n\t\tif(hour > 12) {\n\t\t\thour-=12;\t\t\t\n\t\t}\n\t\tif(min < 10) {\n\t\t\tmin=\"0\"+min;\n\t\t}\n\t\tif(sec < 10) {\n\t\t\tsec=\"0\"+sec;\n\t\t}\n\t\t$(\"#clock-time\").html...
[ "0.75830287", "0.7455059", "0.74289596", "0.7213298", "0.71589434", "0.71097594", "0.70561045", "0.6966133", "0.69440764", "0.694188", "0.6939748", "0.6925241", "0.68856317", "0.68830585", "0.6881158", "0.6872046", "0.6859181", "0.68564415", "0.6849802", "0.6847046", "0.68463...
0.0
-1
moves question counter forward to show next question
function nextQuestion() { if (questionCounter < questions.length) { time = 15; $("#gameScreen").html("<p>You have <span id='timer'>" + time + "</span> seconds left!</p>"); questionContent(); timer(); userTimeout(); } else { resultsScreen(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextQuestion() {\n if (currentQuestion + 1 < questions.length) {\n setCurrentQuestion(prevCurrent => prevCurrent+1);\n }\n }", "function nextQuestion() {\r\n if (STORE.questionNumber < STORE.questions.length - 1) {\r\n STORE.submittedAnswer = false;\r\n STORE.view = 'q...
[ "0.8036201", "0.8028294", "0.7978342", "0.7956746", "0.7940073", "0.79076946", "0.7888305", "0.78797865", "0.78743935", "0.7861432", "0.78598845", "0.7844408", "0.7835811", "0.78245544", "0.7819629", "0.7812107", "0.78065175", "0.78052807", "0.7791301", "0.77855664", "0.77689...
0.7422078
73
reset score and counter parameters on restart
function gameReset() { questionCounter = 0; correctGuesses = 0; incorrectGuesses = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetScore() {\n this.score = INITIAL_SCORE;\n }", "reset(){\n this.live = 3;\n this.score = 0;\n this.init();\n }", "reset(){\r\n \tconsole.log(\"reset\");\r\n \tthis.score=0;\r\n }", "function resetScore() {\n DATA['score'] = 0;\n}", "function reset(){\n ...
[ "0.79612046", "0.7862891", "0.7795189", "0.7650461", "0.75275844", "0.749768", "0.7483818", "0.7443196", "0.7424567", "0.7401543", "0.73128307", "0.72958785", "0.7287901", "0.72673506", "0.72520757", "0.72043884", "0.7191061", "0.7187988", "0.71848553", "0.7183833", "0.718336...
0.67130303
75
FILL A INPUT WITH ANOTHER FIELDS
function add_column_to_export_strucure(idtofill , stringtoadd, text_separator){ var input_to_fill = document.getElementById(idtofill); var checkbox = document.getElementById(stringtoadd); var box_is_checked = checkbox.checked; if(box_is_checked) { input_to_fill.value += text_separator + checkbox.value + text_separator + ","; } else { input_to_fill.value = input_to_fill.value.replace(text_separator + checkbox.value + text_separator + ",",''); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillField(event){\n\t\tvar inputVal = $.trim($(this).val());\n\t\tif(inputVal === 0){\n\t\t\t$(this).val($(this).data(\"defaultValue\"));\n\t\t}\n\t}", "function fill_values(name,value) {\n var cur_input_val = $('#'+name).val();\n\n // Init value (yeah... each time not optimized)\n $('input[name=i...
[ "0.6651946", "0.6620041", "0.6562384", "0.6422948", "0.6309082", "0.62843484", "0.62547433", "0.6200976", "0.6170242", "0.6152066", "0.61380446", "0.60699326", "0.6059478", "0.605711", "0.604971", "0.60317564", "0.6008863", "0.60016596", "0.5973675", "0.59424114", "0.59417844...
0.0
-1
alternative to using Object.keys for old browsers
function copyProps (src, dst) { for (var key in src) { dst[key] = src[key] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getKeys(obj) {\n return Object.keys(obj); // Yes it is builtin!\n }", "function Object_keys(obj) {\n\t if (Object.keys) return Object.keys(obj)\n\t else {\n\t var res = [];\n\t for (var key in obj) res.push(key);\n\t return res;\n\t }\n\t}", "function keys(obj){\n return Object....
[ "0.7384008", "0.731263", "0.7241272", "0.7200854", "0.7200854", "0.7200854", "0.7200854", "0.7200854", "0.7200854", "0.7200854", "0.7200854", "0.7200854", "0.71108866", "0.6997259", "0.6959686", "0.6932814", "0.69273907", "0.6917455", "0.6880489", "0.68795663", "0.6870773", ...
0.0
-1
Spaceseparated functional color notations Allow floats in rgb() and rgba()
function Color(v){ var _rgb = false; var _hsl = false; var _a = 0; var self = this; function _checkRGB(){ if(!_rgb){ _rgb = Color.hsl2rgb(self.h, self.s, self.l); delete _rgb.a; } } function _checkHSL(){ if(!_hsl){ _hsl = Color.rgb2hsl(self.r, self.g, self.b); delete _hsl.a; } } Object.defineProperties(this, { "h" : { "get": function(){ _checkHSL(); return _hsl.h; }, "set": function(v){ if(typeof v !== 'number') throw new TypeError("Not a numeric"); _checkHSL(); _rgb = false; v = v % 360; if(v<0) v += 360; _hsl.h = v; } }, "s" : { "get": function(){ _checkHSL(); return _hsl.s; }, "set": function(v){ if(typeof v !== 'number') throw new TypeError("Not a numeric"); _checkHSL(); _rgb = false; v = Math.max(0, Math.min(v, 100)); _hsl.s = v; } }, "l" : { "get": function(){ _checkHSL(); return _hsl.l; }, "set": function(v){ if(typeof v !== 'number') throw new TypeError("Not a numeric"); _checkHSL(); _rgb = false; v = Math.max(0, Math.min(v, 100)); _hsl.l = v; } }, "r" : { "get": function(){ _checkRGB(); return _rgb.r; }, "set": function(v){ if(typeof v !== 'number') throw new TypeError("Not a numeric"); _checkRGB(); _hsl = false; v = Math.max(0, Math.min(v, 255)); _rgb.r = Math.round(v); } }, "g" : { "get": function(){ _checkRGB(); return _rgb.g; }, "set": function(v){ if(typeof v !== 'number') throw new TypeError("Not a numeric"); _checkRGB(); _hsl = false; v = Math.max(0, Math.min(v, 255)); _rgb.g = Math.round(v); } }, "b" : { "get": function(){ _checkRGB(); return _rgb.b; }, "set": function(v){ if(typeof v !== 'number') throw new TypeError("Not a numeric"); _checkRGB(); _hsl = false; v = Math.max(0, Math.min(v, 255)); _rgb.b = Math.round(v); } }, "a" : { "get": function(){ return _a; }, "set": function(v){ if(typeof v !== 'number') throw new TypeError("Not a numeric"); v = Math.max(0, Math.min(v, 1)); _a = v; } }, "r_1": { "get": function(){ return this.r / 255; }, "set": function(v){ this.r = v * 255; } }, "g_1": { "get": function(){ return this.g / 255; }, "set": function(v){ this.g = v * 255; } }, "b_1": { "get": function(){ return this.b / 255; }, "set": function(v){ this.b = v * 255; } }, "h_1": { "get": function(){ return this.h / 360; }, "set": function(v){ this.h = v * 360; } }, "s_1": { "get": function(){ return this.s / 100; }, "set": function(v){ this.s = v * 100; } }, "l_1": { "get": function(){ return this.l / 100; }, "set": function(v){ this.l = v * 100; } }, "a_1": { "get": function(){ return this.a; }, "set": function(v){ this.a = v; } } }); if(v){ if(typeof v == 'string'){ if(v.length > 0 && v[0] == "#"){ _rgb = Color.parse.hex(v, true); _a = _rgb && _rgb.a || 0; delete _rgb.a; }else if(v.length > 4 && v.substring(0, 4) == "hsla"){ _hsl = Color.parse.hsla(v, true); _a = _hsl && _hsl.a || 0; delete _hsl.a; }else if(v.length > 4 && v.substring(0, 4) == "rgba"){ _rgb = Color.parse.rgba(v, true); _a = _rgb && _rgb.a || 0; delete _rgb.a; }else if(v.length > 3 && v.substring(0, 3) == "hsl"){ _hsl = Color.parse.hsl(v, true); _a = _hsl && _hsl.a || 0; delete _hsl.a; }else if(v.length > 4 && v.substring(0, 3) == "rgb"){ _rgb = Color.parse.rgb(v, true); _a = _rgb && _rgb.a || 0; delete _rgb.a; }else{ _rgb = Color.byName(v, true); _a = _rgb && _rgb.a || 0; delete _rgb.a; } }else{ if(typeof v.r == 'number' && typeof v.g == 'number' && typeof v.b == 'number'){ _rgb = { r: v.r, g: v.g, b: v.b, a: v.a }; if(typeof v.a == 'number'){ _a = Math.max(0, Math.min(1, v.a)); }else{ _a = 1; } }else if(typeof v.h == 'number' && typeof v.s == 'number' && typeof v.l == 'number'){ var hh = v.h % 360; if(v < 0) hh += 360; _hsl = { h: hh, s: Math.max(0, Math.min(100, v.s)), l: Math.max(0, Math.min(100, v.l)) } if(typeof v.a == 'number'){ _a = Math.max(0, Math.min(1, v.a)); }else{ _a = 1; } } } } if(!_hsl && !_rgb){ _rgb = {r:0, g: 0, b:0}; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parseColor(str){\n\t\tvar result;\n\t\n\t\t/**\n\t\t * rgb(num,num,num)\n\t\t */\n\t\tif((result = /rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\)/.exec(str)))\n\t\t\treturn new Color(parseInt(result[1]), parseInt(result[2]), parseInt(result[3]));\n\t\n\t\t/**\n\t\t * rgba(num,num...
[ "0.68736136", "0.64480925", "0.6402394", "0.6398517", "0.6386428", "0.6380699", "0.63483334", "0.63363945", "0.6330343", "0.6312706", "0.6275911", "0.6258901", "0.62490773", "0.6244074", "0.61886734", "0.6184747", "0.6184743", "0.61814386", "0.616568", "0.61569005", "0.615082...
0.0
-1
Sets the MediaStream as the media device source.
function setupMediaDevice(mediaStream) { trace('Etablish stream preview.'); localVideo.srcObject = mediaStream; localStream = mediaStream; trace('Add video stream to peerConnection.'); peerConnection.addStream(localStream); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function selectMediaStream() {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n videoEl.srcObject = mediaStream;\n videoEl.onloadedmetadata = () => {\n videoEl.play();\n };\n } catch (error) {\n throw new Error('Error loading Media Stream', error);\n }\n}...
[ "0.6343179", "0.6337519", "0.62395203", "0.6180132", "0.61714447", "0.6167933", "0.6022694", "0.598007", "0.5978762", "0.5932415", "0.5922955", "0.5859471", "0.5857685", "0.58161694", "0.58104247", "0.5799999", "0.57677454", "0.57623637", "0.57501775", "0.5705827", "0.5697079...
0.7196978
0
Define RTC peer connection behavior.
function handleNegotiation() { trace('Negotiation Needed'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shimPeerConnection$1(window) {\n\t const browserDetails = detectBrowser(window);\n\n\t if (window.RTCIceGatherer) {\n\t if (!window.RTCIceCandidate) {\n\t window.RTCIceCandidate = function RTCIceCandidate(args) {\n\t return args;\n\t };\n\t }\n\n\t if (!window.RTCSessionDescrip...
[ "0.68838584", "0.68786556", "0.68213713", "0.6773525", "0.67378515", "0.671546", "0.6497297", "0.64574593", "0.64245033", "0.6415956", "0.64054143", "0.63890684", "0.6373462", "0.63544583", "0.6343044", "0.63344723", "0.6317407", "0.6246947", "0.6240865", "0.62359285", "0.621...
0.0
-1
Connects with new peer candidate.
function handleConnection(desc) { if (desc && desc.candidate && desc.candidate.candidate) { trace(`ICE Canditate Update : ${desc.candidate.candidate}`); socket.emit('ice update', { username: username.value , candidate: desc.candidate.toJSON() }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connect () {\n console.log('called connect');\n // loop over the queue of waiting peers and\n while (queue.length>0) {\n // TODO: Check if peer already exists before re-doing\n // for each peer get pid\n var pid = queue.shift();\n\n var peer = createRTC(pid);\n peers.status = 'connecting...
[ "0.69137836", "0.6879661", "0.67273355", "0.66672707", "0.66170573", "0.65936434", "0.65894234", "0.6567867", "0.65312123", "0.6500851", "0.645229", "0.64442", "0.6434561", "0.6426878", "0.64038247", "0.63837665", "0.63380754", "0.63284177", "0.6316709", "0.6299712", "0.62910...
0.0
-1
Logs error when setting session description fails.
function setSessionDescriptionError(error) { trace(`Failed to create session description: ${error.toString()}.`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setSessionDescriptionError(error) {\n console.log(`Failed to create session description: ${error.toString()}.`);\n}", "function setSessionDescriptionError(error) {\n trace(`Failed to create session description: ${error.toString()}.`);\n}", "setSessionDescriptionError(error) {\n trace(`Failed to c...
[ "0.84459037", "0.8271544", "0.8223749", "0.6161287", "0.6030216", "0.6023733", "0.5954899", "0.58861923", "0.57695264", "0.5733875", "0.57293993", "0.56691843", "0.5643769", "0.5602531", "0.55228037", "0.54873335", "0.54863596", "0.54526204", "0.5450701", "0.54293203", "0.542...
0.83130884
1
Loads a command into the collection and lexes the instructions.
function load(command) { const file = readFileSync(`./commands/${command}.bf`, "utf8"); commands.set(command, { name: command, instructions: lex(file) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadCommand(name) {\n const cmd = commands[name];\n\n if (!cmd) {\n return null;\n }\n\n return {\n signature: cmd.signature,\n description: cmd.description,\n examples: cmd.examples || [],\n args: applyArgExtras(parseSignature(cmd.signature), cmd.arguments),\n op...
[ "0.60844356", "0.6024398", "0.5965803", "0.582239", "0.5803942", "0.579992", "0.57427776", "0.56633073", "0.56287473", "0.56258607", "0.5498165", "0.5488054", "0.5428416", "0.54209846", "0.53757775", "0.53177327", "0.52887446", "0.52886736", "0.5276817", "0.5256306", "0.52526...
0.73140603
0
Extract the existence document info
extractDocumentExistenceInfo(arr) { return this.chooseDocumentsDuplicate(arr.map(item => item.existenceInfo)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isDocumentQuery(dbQuery){return dbQuery.documents!==undefined;}", "isDocumentStored(documentName) {\n var pathToDocument = config.documentStorageLocation + '/' + documentName\n return new Promise((resolve, reject) => {\n var checkDocumentStoragePro = fs.stat(pathToDocument, (err, stats) => {\...
[ "0.6216803", "0.6098276", "0.6069723", "0.5881155", "0.5767274", "0.5761703", "0.57600796", "0.57302743", "0.56649655", "0.5637939", "0.5637939", "0.5637939", "0.557244", "0.5560685", "0.5560685", "0.5560685", "0.5560685", "0.5560685", "0.5560685", "0.5560685", "0.5551014", ...
0.7016437
0