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
pour supprimer une ligne manuellement items = JSON.parse(localStorage.getItem("Business")); items.splice(4,1); localStorage.setItem("Business", JSON.stringify(items));
function onConnect(){ var login=document.getElementById("login").value; var passWord= document.getElementById("password").value; direction(login,passWord); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeItem() {\nlet id = $(this).parent().attr('id');\nlet arr = JSON.parse(localStorage.getItem('transactions'));\narr.forEach((e, i) => {\nif(id == e.id) {\narr.splice(i, 1);\n}\n});\n// Push new array to local storage\nlocalStorage.setItem('transactions', JSON.stringify(arr));\n// Clean History Field\n...
[ "0.7596621", "0.745728", "0.7423483", "0.7410875", "0.739466", "0.7370081", "0.7370008", "0.73557967", "0.7307887", "0.7290829", "0.7286613", "0.7257068", "0.7254782", "0.72445923", "0.7234836", "0.72248477", "0.72214556", "0.7219268", "0.71734667", "0.7162025", "0.7155825", ...
0.0
-1
avoiding old IEbug Calculates whether log level passes the given treshold
function _passingTreshold(logLevels, logTreshold, logLevel) { var tresholdValue = _.isNumber(logTreshold) ? logTreshold : logLevels[logTreshold] , logValue = logLevels[logLevel]; // when 'console' log requested, allow for any treshold greater than 0 return ('console' === logLevel) ? (logTreshold > 0) : logValue >= tresholdValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static toLog(param) {\n const restrictionNum = this.LOG_LEVELS[this.logLevel];\n const requiredNum = this.LOG_LEVELS[param];\n return requiredNum > restrictionNum;\n }", "function is_level( level ) {\n return log_level > 0\n ? log_level > level\n : log_methods.length + log_le...
[ "0.7078592", "0.6772465", "0.67403865", "0.6683781", "0.6357224", "0.6217686", "0.61500543", "0.60483897", "0.59366786", "0.59135354", "0.5868117", "0.5868117", "0.58139783", "0.5813451", "0.5775238", "0.57187974", "0.5695288", "0.5695288", "0.5657519", "0.5653344", "0.565334...
0.78095204
0
logs to console if passing log level treshold
function _logToConsole(logLevel, message) { var logConfig = app.config && app.config.logConfig , logLevels = logConfig && logConfig.logLevels , logTreshold = logConfig && logConfig.browserLogTreshold , shouldLogToConsole = logLevels && logTreshold , writeLog; // NOTE: 'log' level - special case always logged to console, if logging to console enabled in general // used to log AJAX requests, responses & errors to console only // (otherwise it triggers the endless loop logging via AJAX POST which triggers logging of AJAX requests) if (shouldLogToConsole && ('console' === logLevel || true === _passingTreshold(logLevels, logTreshold, logLevel))) { writeLog = consoleWrapper.log; message = [_getLogDate(), message].join(' '); writeLog(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _passingTreshold(logLevels, logTreshold, logLevel) {\n var tresholdValue = _.isNumber(logTreshold) ? logTreshold : logLevels[logTreshold]\n , logValue = logLevels[logLevel];\n\n // when 'console' log requested, allow for any treshold greater than 0\n return ('console' === logLevel) ? (logTre...
[ "0.7439479", "0.717772", "0.7114075", "0.68671894", "0.67454404", "0.6675245", "0.6635942", "0.662115", "0.66020495", "0.6595696", "0.6557402", "0.6527667", "0.6478416", "0.64368135", "0.6369496", "0.63677603", "0.63635105", "0.6348583", "0.6347433", "0.6347433", "0.6331852",...
0.0
-1
logs back to server & logentries if passing log level treshold
function _logToServer(logLevel, message, flush) { var logConfig = app.config && app.config.logConfig , logLevels = logConfig && logConfig.logLevels , logTreshold = logConfig && logConfig.clientAppLogTreshold , loggingUrl = logConfig && logConfig.loggingUrl , shouldLogToServer = logLevels && logTreshold && loggingUrl && 'console' !== logLevel , timeoutValue = 10 *1000 , logLengthFlushTreshold = 30 , logCacheLength , shouldFlush; if (shouldLogToServer && true === _passingTreshold(logLevels, logTreshold, logLevel)) { logCacheLength = app.cache.logData.length; message = [_getLogDate(), message].join(' '); app.cache.logData.push(['[', logCacheLength, '] ', message].join('')); window.clearTimeout(app.cache.logTimer); shouldFlush = logCacheLength > logLengthFlushTreshold || true === flush; if (true === shouldFlush) { _writeLogsToServer(logLevel, loggingUrl); } else { app.cache.logTimer = window.setTimeout(function() { _writeLogsToServer(logLevel, loggingUrl); }, timeoutValue); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function log(aktlvl, msg) {\r\n\t\tlogArr[logArr.length] = msg;\r\n\t\t\r\n\t\tif (logLevels.indexOf(aktlvl) <= efConfig.log) { \r\n\t\t\tdisplayMessage(msg);\r\n\t\t}\r\n\t\tif (aktlvl == \"tiddler\"){ \r\n\t\t\tcreateTiddler(logName, {responseText:logArr.join(\"\\n\")})\r\n\t\t}\r\n\t} // function log()", "fun...
[ "0.64833283", "0.6260117", "0.6069757", "0.58928674", "0.58473223", "0.5846645", "0.57930946", "0.5783275", "0.5696909", "0.56920475", "0.5689787", "0.56826085", "0.56512886", "0.5605627", "0.56037414", "0.5518557", "0.5498102", "0.54952943", "0.5493032", "0.5493032", "0.5482...
0.6031689
3
sends log cache to the server side logger
function _writeLogsToServer(logLevel, loggingUrl) { var dataToSend; dataToSend = { logLevel: logLevel , logData : app.cache.logData }; app.cache.logData = []; $.ajax({ type: 'POST' , url: loggingUrl , data: dataToSend }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function queueLog(log) {\n\n logCache.add(log);\n while (logCache.length() > 1000) {\n const oldestLog = logCache.remove();\n logger.log(oldestLog.severity, oldestLog);\n }\n\n}", "function sendData() {\n if (logQueue.length === 0) { return; }\n\n var baseUrl = loggerConfig.a...
[ "0.6405307", "0.6376967", "0.6295099", "0.61457807", "0.60091144", "0.60043174", "0.59848076", "0.59594107", "0.5888953", "0.5842822", "0.58364433", "0.5818091", "0.5817487", "0.5787537", "0.57789475", "0.575589", "0.5711394", "0.56921595", "0.5670618", "0.564355", "0.5635953...
0.6037193
4
Saves logged message to the logging URL/server
function _saveLog(logLevel, message, flush) { var voidLogging = (!logLevel || !message); if (true === voidLogging) { return; } _logToConsole(logLevel, message); _logToServer(logLevel, message, flush); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _writeLogsToServer(logLevel, loggingUrl) {\n var dataToSend;\n\n dataToSend = {\n logLevel: logLevel\n , logData : app.cache.logData\n };\n app.cache.logData = [];\n $.ajax({\n type: 'POST'\n , url: loggingUrl\n , data: dataToSend\n });\...
[ "0.6926584", "0.6887182", "0.63915145", "0.6350084", "0.63223106", "0.62875396", "0.6270809", "0.62093645", "0.6179677", "0.61468315", "0.61127514", "0.6097059", "0.6073327", "0.6060821", "0.605587", "0.60324955", "0.59994054", "0.5962099", "0.5902836", "0.5884365", "0.587937...
0.676562
2
gets current date as string in the format used for logging
function _getLogDate() { var date = new Date() , year = date.getFullYear() , month = ["0", (date.getMonth() + 1)].join('').substr(-2) , day = ["0", date.getDate()].join('').substr(-2) , hours = ["0", date.getHours()].join('').substr(-2) , minutes = ["0", date.getMinutes()].join('').substr(-2) , seconds = ["0", date.getSeconds()].join('').substr(-2) ; return [ [year, month, day].join('-') , [hours, minutes, seconds].join(':') ].join(' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCurrentDateString() {\n return dataUtils_1.formatDate.bind(new Date())('yyyy-MM-dd-hhmm');\n}", "function getCurrentDateString() {\n\t\tlet date = new Date();\n\t\tlet dateString = \"\" + date.getFullYear() + \"-\" + (date.getMonth() + 1) + \"-\" + date.getDate() + \"-\" + \n\t\t\t(date.getHours()...
[ "0.8167107", "0.81571275", "0.7892863", "0.7817666", "0.7658069", "0.75566417", "0.7548325", "0.7542989", "0.752024", "0.7511584", "0.7461424", "0.74475205", "0.7443938", "0.74351466", "0.74282503", "0.74241674", "0.73647475", "0.73635495", "0.73525167", "0.73227614", "0.7322...
0.7319823
21
Function with default value for parameters
function displayStars2(nr = 4) { var line = ""; for (var i = 0; i < nr; i++) { line += "*"; console.log(line); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function default_val(arg, val) {\n\treturn typeof arg === \"undefined\" ? val : arg;\n} // default_val()", "function defaultValue(a,b,c=10)\n{\n console.log(a+\" \"+b+\" \"+c);\n}", "function defaultParams(a, b, c = 0) {\n console.log(a, b, c);\n}", "function functionName(param = value) {\n //codes\n}...
[ "0.75550795", "0.7539978", "0.7457728", "0.7411537", "0.72163695", "0.7205764", "0.71646106", "0.7074297", "0.70729846", "0.70634437", "0.7047585", "0.704401", "0.70314825", "0.69784015", "0.69525", "0.69519174", "0.6938717", "0.6935913", "0.69104004", "0.6879523", "0.6868612...
0.0
-1
Am modificat si caracterul
function displayStars3(nr = 4, char = "*") { // se respecta ordinea parametrilor si trebuie definite toate valorie chiar daca nu se schimba var line = ""; for (var i = 0; i < nr; i++) { line += char; console.log(line); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "atualizaNome() //controler\r\n {\r\n this._elemento.textContent = `[${this._idade}] ${this._nome}`;\r\n }", "replacerChangNiveau(){\n this.viderLaFile();\n this.cellule = this.jeu.labyrinthe.cellule(0,0);\n this.direction = 1;\n\t\t\t\tthis.vitesse = 0;\n }", "function letr...
[ "0.6440903", "0.6160613", "0.6102996", "0.6064726", "0.5894387", "0.58638525", "0.58527774", "0.5785966", "0.5753966", "0.57209444", "0.5717911", "0.5690156", "0.5688827", "0.56878036", "0.5671609", "0.5654149", "0.5648903", "0.5609282", "0.5596887", "0.5579981", "0.5567882",...
0.0
-1
se pune fct intre () apoi ca sa se autoapeleze se mai pun (); Function with function as parameter
function testFunction() { alert("Exec from another function"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fuctionPanier(){\n\n}", "function miFuncion (){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function funcionParametro(fn) {\n\tfn();\n}", "function fieMetFunctionAlsParameter(eenFunctie){\n console.log(\"zo meteen wordt de doorgegeven function uitgevoer...
[ "0.749152", "0.74317986", "0.7373698", "0.7373698", "0.7373698", "0.72726965", "0.71698695", "0.70301735", "0.70177954", "0.694629", "0.6833677", "0.676632", "0.6703324", "0.6621192", "0.65922624", "0.6556764", "0.65446204", "0.65215355", "0.651996", "0.6480593", "0.64726704"...
0.0
-1
Check the logged in user status. If any point in time, the user is logged in then he can not able to see the login or register route. For that, a componentDidMount method has been added. If the current user is logged in user and trying to register the new user, then it prevents it and redirects to a home route.
componentWillReceiveProps(nextProps) { if (nextProps.auth.isAuthenticated) { this.props.history.push("/"); } if (nextProps.errors) { this.setState({ errors: nextProps.errors, }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n getCurrentUser().then((data) => {\n if (typeof data.error !== 'undefined') {\n data.isAuth = false\n } else if(typeof data.isAuth === 'undefined') {\n data.isAuth = true\n }\n\n // Update current user state since this can't be done in class\n // con...
[ "0.741374", "0.7395984", "0.7139761", "0.69564575", "0.691879", "0.679675", "0.67255414", "0.67246497", "0.6704702", "0.66541594", "0.66535926", "0.6607667", "0.6605635", "0.6595049", "0.6582313", "0.65817094", "0.6576838", "0.64852655", "0.6480433", "0.6473142", "0.6471758",...
0.0
-1
Retrieves a custom parameter of a Run user. The Run user is identified by the token in the constructor.
async getItem(tagoRunURL, key) { const result = await this.doRequest({ path: `/run/${tagoRunURL}/sdb/${key}`, method: "GET", }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserToken(){\n\t\treturn $cookies.get('user.token');\n\t}", "function getUserToken(sID, rID){\n\tvar parametersCall = {\n\t\tproviderID : provId,\n\t\tapplicationID : appId,\n\t\tsessionID : sID,\n\t\trunaID : rID\n\t}\n\tnoTokenCall('GET','https://'+VAR_STAG_URL+'runaservices.corriere.it/runaClientE...
[ "0.60146457", "0.60011286", "0.59449434", "0.59265804", "0.59265804", "0.5763001", "0.57525164", "0.5682561", "0.5519784", "0.54956114", "0.5481193", "0.54747146", "0.5414321", "0.5368675", "0.53433096", "0.5335118", "0.5329753", "0.5293172", "0.5277713", "0.5223708", "0.5215...
0.0
-1
Creates or updates a custom parameter of a Run user. The Run user is identified by the token in the constructor.
async setItem(tagoRunURL, key, value) { const result = await this.doRequest({ path: `/run/${tagoRunURL}/sdb/${key}`, method: "POST", body: value, }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUserId(value) {\n __params['uid'] = value;\n}", "token(payload, done) {\n User().setToken(payload, done)\n }", "assignToken() {\n this.token = `${this.username}-${new Date().toISOString()}-${Math.floor(Math.random() * 1000000)}`;\n }", "function addCustomTokenToRequest(uid, req) {\n r...
[ "0.5659154", "0.56403583", "0.56177485", "0.5595903", "0.5546379", "0.5506581", "0.54361624", "0.541964", "0.5378096", "0.5339057", "0.5331473", "0.52860504", "0.5226598", "0.51550525", "0.51489383", "0.5125288", "0.5108242", "0.5106016", "0.5095631", "0.5087242", "0.50839734...
0.0
-1
Delete a custom parameter of a Run user. The Run user is identified by the token in the constructor.
async removeItem(tagoRunURL, key) { const result = await this.doRequest({ path: `/run/${tagoRunURL}/sdb/${key}`, method: "DELETE", }); return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeToken() {\n setValue(\"token\", null);\n}", "delete() {\n if (typeof this.ctxPtr !== 'undefined' && this.ctxPtr !== null) {\n Module._vscf_message_info_custom_params_delete(this.ctxPtr);\n this.ctxPtr = null;\n }\n }", "function rawRemo...
[ "0.6025758", "0.59553814", "0.5855822", "0.57763153", "0.57763153", "0.57756644", "0.57037055", "0.5489108", "0.545625", "0.54480624", "0.5437034", "0.5437001", "0.5437001", "0.5435975", "0.5423958", "0.53701913", "0.5350273", "0.53465235", "0.5316363", "0.5305241", "0.529936...
0.0
-1
given (lowNum, highNum, mult), print the numbers in multiples of mult from highNum down to lowNum, using a FOR loop. Example: For (2,9,3), print 9 6 3 (on successive lines).
function flexCountdown(lowNum, highNum, mult) { for (var i=highNum; i >= lowNum; i -= mult) { console.log(i); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countByFourFl (highNum, lowNum, mult) {\n\tif (highNum<lowNum || mult == 0){\n\t\tconsole.log(\"Error\")\n\t\treturn\n\t}\n\twhile (highNum>=lowNum){\n\t\tif (highNum%mult==0){\n\t\t\tconsole.log(highNum)\n\t\t\thighNum-=mult\n\t\t} else {\n\t\t\thighNum--\n\t\t}\n\t}\n}", "function flexCount(lowNum,hig...
[ "0.7144257", "0.7115182", "0.7066724", "0.691936", "0.67184705", "0.67080945", "0.6486981", "0.61510456", "0.61046696", "0.6058054", "0.603332", "0.6027762", "0.59837687", "0.59557974", "0.5905807", "0.5901794", "0.58650833", "0.5852761", "0.5834222", "0.57884115", "0.5757513...
0.69407684
3
Takes a buffer of bytes and splits it into chunks, each of which starts with a MSG_TOKEN_START An array of these chunks is returned
splitBuffer( buf ) { let chunks = []; // discard any bytes at the front before the START let position = buf.indexOf( MSG_TOKEN_START ); if( position > 0 ) { // Clear the bytes before the start buf = buf.slice( position ); } else if( position < 0 ) { // no START at all... invalid message return []; } // we know buf[0] is a start, so look for another START let index = 1; while( (position = buf.indexOf( MSG_TOKEN_START, index )) > -1) { // If there are no bytes between START bytes, don't put an empty element in the array // This shouldn't happen based on the protocol design anyway if( index === position ) { chunks.push( Buffer.from([])); } else { chunks.push( buf.slice( index-1, position ) ); } // continue searching at the next byte index = position + 1; } if( index <= buf.length ) { //console.log('index:', index, 'left: ', buf.slice( index-1 ) ); chunks.push( buf.slice( index-1 )); } return chunks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getChunk(i, message){\n\tvar m = [];\n\tfor(let j = 0; j < 16; ++j){\n\t\tm[j] = message[(i * 64) + (j * 4) + 0] << 0 |\n\t\t message[(i * 64) + (j * 4) + 1] << 8 |\n\t\t message[(i * 64) + (j * 4) + 2] << 16 |\n\t\t message[(i * 64) + (j * 4) + 3] << 24;\n\t}\n\treturn m;\n}", "func...
[ "0.61869943", "0.60298955", "0.59152037", "0.5880399", "0.5838884", "0.581013", "0.57597834", "0.5655488", "0.5653349", "0.56403196", "0.5609602", "0.5604847", "0.5600512", "0.5567884", "0.5562531", "0.55203986", "0.55201626", "0.5433067", "0.543182", "0.54123884", "0.5411549...
0.8727454
0
Remove stuff characters from a buffer of data returns an array of bytes that may be shorter than the buffer passed in.
decodePdu( encoded ) { let values = []; let index = 0; while( index < encoded.length ) { if( encoded[index] === MSG_TOKEN_ESC && index < encoded.length-1 ) { index++; if( encoded[index] === MSG_START_STUFF ){ values.push( MSG_TOKEN_START ); } else if( encoded[index] === MSG_ESC_STUFF ){ values.push( MSG_TOKEN_ESC ); } } else { values.push( encoded[index] ); } index++; } return values; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeByteStuffing(buffer) {\n var ff = buffer.indexOf(0xFF, 0);\n if (ff === -1 || buffer[ff+1] !== 0)\n return buffer; /* Nothing to remove */\n var searchIndex = ff+2; /* Where to start next search for 0xFF */\n\n while (true) {\n var ff2 = buffer.indexOf(0xFF, searchIndex);\n\n if (f...
[ "0.72799224", "0.59373635", "0.58751345", "0.5865399", "0.5865399", "0.57607377", "0.56863314", "0.56645143", "0.54388666", "0.543472", "0.540566", "0.5281841", "0.52608776", "0.52426165", "0.521595", "0.5185043", "0.516576", "0.5163557", "0.51568216", "0.5126668", "0.5086598...
0.0
-1
Called on a checksum error For future use...
onReceiveError( pdu ) { //console.log( 'JCOM1939 RX Error'); this.rxErrors++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "error(error) {}", "hasCrcError() {\n return (this.flags & Flags.BAD_CRC) !== 0;\n }", "_onSerialError(err) {\n // not really sure how to handle this in a more elegant way\n\n this.emit('error', err);\n }", "function updateErrHandler(error, result) {\n\tif (error) {\n\t\tlog(\"cannot update d...
[ "0.6060786", "0.58355683", "0.57289815", "0.5688048", "0.5679692", "0.5659649", "0.5659649", "0.56430244", "0.5633417", "0.56287223", "0.5615648", "0.5584703", "0.55632716", "0.5562714", "0.55573773", "0.5553348", "0.55457026", "0.55332917", "0.55122864", "0.5490127", "0.5476...
0.0
-1
Called to handle a received, validated PDU.
onReceive( pdu ) { // We push it to the Transform object, which spits it out // the Readable side of the stream as a 'data' event this.push( Buffer.from( pdu.slice(3, pdu.length-1 ))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_transform(chunk, encoding, cb) {\n\n var me = this;\n //console.log('Chunk: ', chunk );\n\n // Concatenate any previous data, and split into an array of\n // encoded PDUs that start with a MSG_START byte\n let encodedPdus = this.splitBuffer( Buffer.concat([this.buffer, chunk]) );\n\n // Now we l...
[ "0.5652895", "0.55782306", "0.5489844", "0.5383237", "0.52497417", "0.5247988", "0.51484007", "0.5133036", "0.5129151", "0.51179457", "0.5115272", "0.50902283", "0.5064763", "0.4984619", "0.49633747", "0.49563098", "0.49541304", "0.49541304", "0.4942457", "0.49421838", "0.494...
0.5923784
0
calculate 2s complement checksum over a buffer, starting with a byte index
checksum( buf, start, length ) { let sum = 0; for( var i = start; i < start+length; i++ ) { sum = sum + buf[i]; } return ((~sum)+1) & 0xFF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function crc(buf){return(updateCrc(-1,buf,buf.length)^-1)>>>0;// u32\n}", "checksum_buf(com){\n\tvar cs=0;\n\tvar cl=com.length;\n\tfor(var b=0; b<cl-1; b++){\n\t var by=com.readUInt8(b);\n\t var csb = ~by & 0x7F;\n\t cs = cs ^ csb;\n\t}\n\tcom.writeUInt8(cs,cl-1);\n\treturn String.fromCharCode(cs);\n ...
[ "0.71113706", "0.69702226", "0.69534045", "0.66330284", "0.6595845", "0.63730997", "0.6250073", "0.6237258", "0.6106878", "0.59434587", "0.5887493", "0.57834655", "0.57324564", "0.5727105", "0.57150084", "0.57025385", "0.5680195", "0.5680195", "0.566878", "0.56614137", "0.564...
0.77874213
0
Required function for a Transform. Called when a chunk of data arrives. we have no idea what data this is, or if it is even from a JCOM board.
_transform(chunk, encoding, cb) { var me = this; //console.log('Chunk: ', chunk ); // Concatenate any previous data, and split into an array of // encoded PDUs that start with a MSG_START byte let encodedPdus = this.splitBuffer( Buffer.concat([this.buffer, chunk]) ); // Now we look through each of the encoded PDUs (which have not // yet been validated for length or checksum) encodedPdus.forEach( function( encodedPdu, pduIndex ){ // Unstuff the PDU (remove escape codes) let pdu = me.decodePdu( encodedPdu ); if( pdu.length >= MIN_MSG_LEN ) { // it is at least long enough to possibly be complete let msgLength = pdu[1]*256 + pdu[2]; // If it's too long, truncate it. This shouldn't really happen // under normal circumstances, but no reason to keep extra bytes around. if(pdu.length + 3 > msgLength ) { pdu = pdu.slice(0, msgLength+3 ); } // If it (now) has the expected number of bytes... if( msgLength === pdu.length-3 ) { // check the checksum let checksum = me.checksum( pdu, 1, msgLength +1 ); if( checksum === pdu[ msgLength+2 ] ) { // Process the received PDU me.onReceive( pdu ); } else { // report an incorrect checksum me.onReceiveError( pdu ); } } else if( pduIndex === encodedPdu.length-1 ) { // if last PDU is incomplete, save it for later me.buffer = Buffer.from( encodedPdu ); } } else if( pduIndex === encodedPdu.length-1 ) { // if last PDU is incomplete, save it for later me.buffer = Buffer.from( encodedPdu ); } }); // notify the caller that we are done processing the chunk cb(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onControlSocketData(chunk) {\n this.log(`< ${chunk}`);\n // This chunk might complete an earlier partial response.\n const completeResponse = this._partialResponse + chunk;\n const parsed = (0, parseControlResponse_1.parseControlResponse)(completeResponse);\n // Remember any inc...
[ "0.6130932", "0.60954756", "0.60954756", "0.60510135", "0.6021035", "0.60027194", "0.5997786", "0.59267116", "0.5899183", "0.5859819", "0.58546245", "0.5820652", "0.5782869", "0.577706", "0.575896", "0.57556176", "0.5725306", "0.57047975", "0.56978667", "0.56972957", "0.56829...
0.5893429
9
range of parameters frequency : <=2000 MHz hb : l0m to 80m radius : lkm to 10 km
function SUI_old_MathLab(frequency, hb, hm, place, radius){ var d0 = 100 var Xrho = 6 var Y = function(i,hb) { var a = [0, 4.6, 4, 3.6] var b = [0, 0.0075, 0.0065, 0.005] var c = [0, 12.6, 17.1, 20] return a[i]-(b[i]*hb)+(c[i]/hb) } var PL = 20*Math.log10(4*Math.PI*d0*frequency/300) + 10*Y(place,hb)*Math.log10(radius/d0) + Xrho; return PL; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gettuning(){\r\n\tvar alf = ['C','C#','D','D#','E','F','F#','G','G#','A','A#','B'];\r\n\tfor(var j=0; j<11; j++){\r\n\t\tfor(var i=0; i<12; i++){\r\n\t\t\ttuning[ (alf[i]+j) ] = notetofreq( 261.6255653, (j-4)*12+i ); // C4 = 261.6255653 Hz\r\n\t\t}\r\n\t}\r\n}", "setFilterFrequency(y) {\n // min ...
[ "0.6157781", "0.5879051", "0.57531595", "0.5646891", "0.5584785", "0.5546938", "0.5502213", "0.5456374", "0.54341197", "0.5429051", "0.5425801", "0.5417713", "0.54076415", "0.5388575", "0.53035706", "0.5292342", "0.5277931", "0.5267409", "0.5265492", "0.52610594", "0.52610594...
0.57203805
3
set the speed at which the cloud mesh rotates to give the illusions
function setWindSpeed(weather : int){ //create an array of weather types from the config script var weatherTypes = config.getListOfWeatherTypes(); //loop through the array and compare each value to the weather code (wCode) //returned from the config, if it matches assign the value to xSpeed for(var i = 0; i < weatherTypes.length; i++){ if(weatherTypes[i].weatherIndex == weather){ xSpeed = weatherTypes[i].windSpeed; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function speedUpdate() {\n\tvar r = this.rotation;\n\tif (r < 0) {\n\t\tspeed = 1+(r/150);\n\t} else {\n\t\tspeed = (r/25)+1;\n\t} \n\ttl.timeScale(speed.toFixed(2));\n}", "setSpeed(speed) {\r\n this.lottieAnimation.setSpeed(speed);\r\n }", "setSpeed(speed) {\n this.speed = speed;\n }", "...
[ "0.69495416", "0.68622595", "0.6854482", "0.678654", "0.6752351", "0.66771483", "0.66432995", "0.6567167", "0.65196073", "0.6512822", "0.6498465", "0.6483163", "0.6458865", "0.6434865", "0.6420968", "0.6418876", "0.6388937", "0.6385226", "0.63510114", "0.6288792", "0.62805206...
0.0
-1
update the rotation of the sky box everyframe based upon the value from config.js
function Update () { if(!manual){ transform.RotateAround( transform.position, Vector3.right, ySpeed * Time.deltaTime ); transform.RotateAround( transform.position, Vector3.up, xSpeed * Time.deltaTime ); transform.RotateAround( transform.position, Vector3.forward, zSpeed * Time.deltaTime ); Debug.Log(xSpeed); }else{ if( Input.GetAxis("Horizontal") != 0 ){ transform.RotateAround( transform.position, Vector3.up, Input.GetAxis("Horizontal")*xSpeed * Time.deltaTime ); } if( Input.GetAxis("Vertical") != 0 ){ transform.RotateAround( transform.position, Vector3.right, Input.GetAxis("Vertical")*ySpeed * Time.deltaTime ); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateForFrame() {\r\n rotatingComponents.rotation.y += rotateSpeed;\r\n}", "animate() {\n this.renderScene()\n this.frameId = window.requestAnimationFrame(this.animate)\n this.camera.rotation.z -= .0004;\n this.clouds1.rotation.y += .001;\n this.clouds2.rotation.y ...
[ "0.6966053", "0.667083", "0.661385", "0.65150744", "0.6345125", "0.63376653", "0.63134", "0.6274141", "0.6220295", "0.6199728", "0.6194611", "0.6165083", "0.61649996", "0.61605453", "0.6153311", "0.61508816", "0.6149095", "0.6132585", "0.6102875", "0.6077865", "0.60760814", ...
0.0
-1
Constructor Point // //
function Point (ax, ay) { // Auto instantiate the Point if (!(this instanceof Point)) return new Point (ax, ay); var p = Point.normalize (ax, ay); this.x = p.x; this.y = p.y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Point() { }", "function Point() {}", "function Point() {}", "function Point(x,y){\n this.x = x;\n this.y = y;\n}", "function Point(x,y) {\n this.x = x;\n this.y = y;\n}", "function Point(x, y){\r\n\tthis.x = x;\r\n\tthis.y = y;\r\n}", "function point(x,y){\n this.x = x;\n this.y ...
[ "0.87243503", "0.8684048", "0.8684048", "0.8326572", "0.8202281", "0.8180334", "0.81000197", "0.80835843", "0.8042891", "0.8021262", "0.8020421", "0.800725", "0.800725", "0.8001731", "0.7980481", "0.78866786", "0.78672385", "0.78351146", "0.78063434", "0.7773964", "0.7751798"...
0.68212175
91
Puts file into S3.
static putFile (bucketName, objectKey, objectBody) { const s3 = Storage._getS3Instance(); const params = { Bucket: bucketName, Key: objectKey, Body: objectBody }; return new Promise((resolve, reject) => { s3.upload(params, (err, data) => err ? reject(err) : resolve(data.Location)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uploadToS3(file_path, s3_file_path, cb)\n{\n\tconsole.log(\"Uploading to S3 file: \" + file_path, \"to: \" + s3_file_path);\n\n\theaders = {'x-amz-acl': 'public-read'};\n\ts3Client.putFile(file_path, s3_file_path, headers, function(err, s3Response) {\n\t if (err)\n \t{\n \t\tconsole.log(\"ERROR: ...
[ "0.7673945", "0.75913644", "0.7589262", "0.7492384", "0.7367182", "0.736684", "0.70898944", "0.7041086", "0.7035906", "0.70140254", "0.69770247", "0.6970791", "0.6788525", "0.67842907", "0.67517614", "0.67470556", "0.6729776", "0.66821146", "0.6642838", "0.66102046", "0.65272...
0.69167966
12
Gets file from S3.
static getFile (bucketName, objectKey) { const s3 = Storage._getS3Instance(); const params = { Bucket: bucketName, Key: objectKey }; return new Promise((resolve, reject) => { s3.getObject(params, (err, data) => { if (err) { reject(err); } else { resolve({ content: data.Body, // buffer type: data.ContentType, // string encoding: data.ContentEncoding, // string size: data.ContentLength // integer }); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getFile(params) {\n try {\n console.log(\"s3.getObject Params: \", params);\n var s3 = new this.AWS.S3();\n let file = await s3.getObject(params).promise();\n return (file);\n } catch (error) {\n console.error('S3.getObject error: ', error)...
[ "0.78079504", "0.7776254", "0.7768614", "0.7666587", "0.75503224", "0.7482117", "0.7363299", "0.7182902", "0.7181803", "0.688952", "0.6852944", "0.6791557", "0.67521936", "0.6731061", "0.6689846", "0.6646522", "0.6614215", "0.6455275", "0.64538085", "0.64111936", "0.6358914",...
0.78494304
0
Deletes file from S3.
static deleteFile (bucketName, objectKey) { const s3 = Storage._getS3Instance(); const params = { Bucket: bucketName, Key: objectKey }; return new Promise((resolve, reject) => { s3.deleteObject(params, (err, data) => err ? reject(err) : resolve()); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteFile(fileKey) {\n var params = {\n Bucket: bucketName,\n Key: fileKey,\n };\n\n s3.deleteObject(params, function (err, data) {\n if (err) console.log(err, err.stack);\n console.log('deleted!');\n });\n}", "function deleteFileFromS3(key) {\n const deleteParams = {\n Bucket: 'wee...
[ "0.81347305", "0.7730284", "0.7537082", "0.7485254", "0.7221009", "0.6973603", "0.66631436", "0.6617493", "0.6594941", "0.65811527", "0.63809514", "0.630079", "0.6252118", "0.62352514", "0.62222856", "0.6163191", "0.61492425", "0.61306375", "0.605849", "0.6029425", "0.6025653...
0.7448886
4
Gets the single S3 instance.
static _getS3Instance () { s3instance = s3instance || new AWS.S3({ apiVersion: S3_API_VERSION }); return s3instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getS3(awsAccessKey, awsSecretKey) {\n return new AWS.S3({\n accessKeyId: awsAccessKey,\n secretAccessKey: awsSecretKey\n });\n}", "async get(){\n try {\n let objectResult = await s3.getObject({\n Bucket: this.bucket,\n Key: this.key\n }).promise();\n \n ...
[ "0.6656993", "0.6265979", "0.59003764", "0.5823779", "0.57539546", "0.5641354", "0.5605176", "0.5571959", "0.5543661", "0.5536765", "0.54907435", "0.54037434", "0.5251508", "0.52197915", "0.5178293", "0.51291525", "0.5107308", "0.50706774", "0.50539833", "0.50228333", "0.4990...
0.8515359
0
! vuex v3.6.2 (c) 2021 Evan You
function r(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:r});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[r].concat(e.init):r,n.call(this,e)}}function r(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.par...
[ "0.6759831", "0.67032593", "0.6644306", "0.62890977", "0.6276258", "0.6252346", "0.6231344", "0.6231344", "0.6231344", "0.6225691", "0.6143966", "0.6115739", "0.6100471", "0.6061475", "0.6061475", "0.6061475", "0.6061475", "0.6061475", "0.6060739", "0.6055024", "0.60186625", ...
0.0
-1
! vuerouter v3.5.2 (c) 2021 Evan You
function r(e,t){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function version(){ return \"0.13.0\" }", "...
[ "0.57978964", "0.5790024", "0.57673717", "0.57367384", "0.57008004", "0.5652785", "0.5652413", "0.5597215", "0.55714834", "0.5547185", "0.5527301", "0.5518198", "0.55119205", "0.5460645", "0.54499424", "0.5382621", "0.53720886", "0.5364847", "0.53620136", "0.5353226", "0.5353...
0.0
-1
post errors to error / warning div
function postErrorsAndResetErrorMessage(){ $("#errors").html(errorMessage); $("#errors").show(); // errorMessage = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onerror(e){\n\t\t$('#errors').text(e.message);\n\t}", "function puterrors(error) {\n\tvar errBox = document.getElementById(\"reg-body\");\n\t// set the error box border to solid (from unset/hidden)\n\terrBox.style.borderStyle = \"solid\";\n\t// create a br (line break) element\n\tvar br = document.creat...
[ "0.7345106", "0.7003722", "0.70031124", "0.69754785", "0.6937411", "0.6910826", "0.69068384", "0.6904859", "0.6883177", "0.6868487", "0.6841011", "0.68354553", "0.6824967", "0.6816095", "0.67859614", "0.67851627", "0.6778072", "0.67690885", "0.6754595", "0.6752317", "0.673353...
0.7158374
1
function for progress bar
function ProgressBar({ session, focusDuration, breakDuration }) { //calculations for progress bar for focus duration const focusDurationSec = focusDuration * 60; const focusDecimal = 1 - session?.timeRemaining / focusDurationSec; const focusPercentage = focusDecimal * 100 || 0; //calculations for progress bar for break duration const breakDurationSec = breakDuration * 60; const breakDecimal = 1 - session?.timeRemaining / breakDurationSec; const breakPercentage = breakDecimal * 100; //return jsx for progress bar return ( <> <div className="col"> <div className="progress" style={{ height: "20px" }}> <div className="progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow={ session?.label === "Focusing" ? focusPercentage : breakPercentage } // TODO: Increase aria-valuenow as elapsed time increases style={{ width: session?.label === "Focusing" ? focusPercentage + "%" : breakPercentage + "%", }} // TODO: Increase width % as elapsed time increases /> </div> </div> </> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateBar(){\n var bar = $('#progress');\n\tif (variables.progress < 100){\n\t\tvariables.progress += 5;\n\t\tbar.width(variables.progress + '%');\n\t} else {\n\t\tvariables.progress = 0;\n\t\tvariables.videos += 1;\n\t\tbar.width(\"0%\");\n\t\tclearKeys();\n\t\tloadRound();\n\t}\n}", "function progr...
[ "0.77998906", "0.7763853", "0.77528125", "0.77528125", "0.77528125", "0.77528125", "0.77430546", "0.77279574", "0.7724621", "0.77222145", "0.77161944", "0.76999706", "0.7697292", "0.762673", "0.76198626", "0.76121026", "0.75798887", "0.756265", "0.7535744", "0.7533914", "0.75...
0.0
-1
import private key with type = P2PKH or P2SH, default P2PKH
static importPrivateWallet(options) { if (!options.privateKey) { throw new Error(`Invalid privateKey=${options.privateKey}`); } return new PrivateWallet(options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor (p2pKey: P2PSigningPrivateKey) { // eslint-disable-line no-undef\n this._key = p2pKey\n this.publicKey = new PublicSigningKey(p2pKey.public)\n }", "static import(publicKey, privateKey) {\n return Promise.resolve().then(() => {\n if (!(publicKey instanceof ArrayBuffer) && !(publicKey in...
[ "0.6694426", "0.6645192", "0.6567904", "0.6410843", "0.62710726", "0.62514967", "0.6201318", "0.6169805", "0.6130574", "0.611025", "0.6065543", "0.60107416", "0.5978088", "0.59642583", "0.58969975", "0.5873396", "0.57982737", "0.57964855", "0.57964855", "0.57964855", "0.57673...
0.5716543
22
MAKE IT SO THAT EVENT LISTS ARE TIED TO PLAYERS, I.E THEY HAVE PLAYER NUMBER EMBEDED WITHIN THEM. DO THIS BECAUSE WHEN THE HOST SENDS PLAYER DATA TO CLIENTS THEY NEED TO KNOW WHAT PLAYER DID WHAT ANYWAYS, ALSO THIS MAKES ORGANIZATION MUCH EASIER
function FrameData(stageData) { this.stageData = stageData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "playersReceived(p) {\n for(let i=0;i<p.players.length;i++) {\n let exists = false;\n for(let x=0;x<players.length;x++) {\n if(players[x].pid == p.players[i].pid) {\n exists = true;\n }\n }\n //only add new player if...
[ "0.68262", "0.62577367", "0.62517947", "0.617915", "0.596874", "0.5946202", "0.59154826", "0.59124744", "0.58594", "0.5856943", "0.583706", "0.58368593", "0.5819056", "0.5796714", "0.57942486", "0.579394", "0.57818526", "0.57740915", "0.57698494", "0.57602006", "0.5748225", ...
0.0
-1
We will consider a, e, i, o, and u as vowels for this Kata. The input string will only consist of lower case letters and/or spaces.
function getCount(str) { var vowelsCount = 0; let pos = { A : str.indexOf("a"), E : str.indexOf("e"), I : str.indexOf("i"), O : str.indexOf("o"), U : str.indexOf("u") } while ( pos.A != -1 ) { vowelsCount++; pos.A = str.indexOf( "a", pos.A + 1 ); } while ( pos.E != -1 ) { vowelsCount++; pos.E = str.indexOf( "e", pos.E + 1 ); } while ( pos.I != -1 ) { vowelsCount++; pos.I = str.indexOf( "i", pos.I + 1 ); } while ( pos.O != -1 ) { vowelsCount++; pos.O = str.indexOf( "o", pos.O + 1 ); } while ( pos.U != -1 ) { vowelsCount++; pos.U = str.indexOf( "u", pos.U + 1 ); } return vowelsCount; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vowels(string) {\n var stringArr = string.split('');\n var newString = \"\";\n for(var i =0; i < stringArr.length; i ++) {\n if(stringArr[i] === \"a\" || stringArr[i] === \"e\" || stringArr[i] === \"i\" || stringArr[i] === \"o\" || stringArr[i] === \"u\") {\n newString = newString + stringArr[i...
[ "0.7497796", "0.7387954", "0.7287353", "0.7276527", "0.7273266", "0.72594506", "0.7253078", "0.7246158", "0.7206349", "0.7148782", "0.7117476", "0.70991534", "0.708415", "0.7076679", "0.70739627", "0.70650125", "0.7055043", "0.7050538", "0.7039139", "0.70216256", "0.7006375",...
0.0
-1
mask cpf event => object return void
cpf(event){ let isObj = typeof event == 'object', isEmpty = event.target.value.length <= 0; event.target.setAttribute('maxLength', 14); if(!isObj || isEmpty){ throw new Error('Bad format object'); } let v = event.target.value; event.target.value = v .replace(/\D/g, '') .replace(/(\d{3})(\d)/, '$1.$2') .replace(/(\d{3})(\d)/, '$1.$2') .replace(/(\d{3})(\d{1,2})/, '$1-$2') .replace(/(-\d{2})\d+?$/, '$1'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cancelEvent() {\n }", "off(event) { // TODO\n\n }", "off(event) { // TODO\n\n }", "_evtChange(event) { }", "pcBindEvent(){ return false }", "handleEvent() {}", "handleEvent() {}", "onEvent() {\n \n }", "function calibrationEvent(event){}", "ignoreEvent(event) { return true; }", "funct...
[ "0.6373487", "0.63611615", "0.63611615", "0.6060489", "0.6045444", "0.5886854", "0.5886854", "0.58657736", "0.5735761", "0.57088494", "0.5656955", "0.5656955", "0.56511617", "0.5632864", "0.5632864", "0.56286216", "0.5614322", "0.56023324", "0.56001896", "0.5550384", "0.55310...
0.0
-1
mask cnpj event => object return void
cnpj(event){ let isObj = typeof event == 'object', isEmpty = event.target.value.length <= 0; event.target.setAttribute('maxLength', 18); if(!isObj || isEmpty){ throw new Error('Bad format object'); } let v = event.target.value; event.target.value = v .replace(/\D/g, '') .replace(/(\d{2})(\d)/, "$1.$2") .replace(/(\d{3})(\d)/, "$1.$2") .replace(/(\d{3})(\d)/, "$1/$2") .replace(/(\d{4})(\d)/, "$1-$2") .replace(/(-\d{2})\d+?$/, "$1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "pcBindEvent(){ return false }", "off(event) { // TODO\n\n }", "off(event) { // TODO\n\n }", "handleEvent() {}", "handleEvent() {}", "cancelEvent() {\n }", "onEvent() {\n \n }", "function InternalEvent() {}", "function InternalEvent() { }", "function InternalEvent() { }", "function Int...
[ "0.6668219", "0.65903574", "0.65903574", "0.6519867", "0.6519867", "0.6497433", "0.6435944", "0.6423412", "0.6326642", "0.6326642", "0.6326642", "0.6326642", "0.6326642", "0.63048786", "0.61810344", "0.60681367", "0.60681367", "0.6038464", "0.6000863", "0.59667486", "0.596208...
0.0
-1
Format static value value => string lang => language by default is ptBR currency => coin local of your country
moneyBr(value, lang = 'pt-BR', currency = 'BRL'){ return new Intl.NumberFormat(lang, { style: 'currency', currency: currency }).format(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatUSCurrency(val) {\r\n return val.toLocaleString('en-US',\r\n {style: \"currency\", currency: \"USD\"});\r\n}", "callback(value) {\n return formatCurrency(value, 4);\n }", "formatCurrency(value) {\n // get signal\n const signal = Number(value) < 0 ? '-' :...
[ "0.651506", "0.64985025", "0.6482709", "0.62792337", "0.6258011", "0.6253429", "0.62495065", "0.6238753", "0.62161463", "0.62109095", "0.62088484", "0.61990064", "0.60094863", "0.5987913", "0.5980939", "0.59350103", "0.59262705", "0.5908184", "0.5867833", "0.5865651", "0.5821...
0.70016795
0
mask money event => object d = decimal point (string) sm = separator milhar (string) sd = separator decimal (string) return void
money(event, d = 2, sm = '.', sd = ','){ let decimal = d, separator_milhar = sd, separator_decimal = sd, decimal_potention = Math.pow(10, decimal), separator_thousend = `$1` + separator_milhar, override_value, value_pointer, blocks, parts, isObj = typeof event == 'object', isEmpty = event.target.value.length <= 0; if(!isObj || isEmpty){ throw new Error('Bad format object'); } event.target.setAttribute('maxLength', 20); override_value = event.target.value.replace(/\D/g, ''); value_pointer = (override_value / decimal_potention).toFixed(decimal); blocks = value_pointer.split('.'); parts = blocks[0] .toString() .replace(/(\d)(?=(\d{3})+(?!\d))/g, separator_thousend); event.target.value = `R$ ${typeof blocks[1] === 'undefined' ? parts : parts + separator_decimal + blocks[1]}`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inputuang(e) {\n $(e).maskMoney({\n precision:0,\n prefix:'Rp. ', \n // allowNegative: true, \n thousands:'.', \n // decimal:',', \n affixesStay: true\n });\n }", "function format_amount(e)\r\n {\r\n var keyUnicod...
[ "0.6767298", "0.6744517", "0.67332816", "0.65413684", "0.62796265", "0.6259652", "0.6182066", "0.61473644", "0.6076687", "0.6056442", "0.604357", "0.60005164", "0.6000347", "0.59704", "0.59254843", "0.58790016", "0.5857714", "0.5849423", "0.58411807", "0.5815827", "0.57933676...
0.8255722
0
mask phone event => object return void
phone(event){ let isObj = typeof event == 'object', isEmpty = event.target.value.length <= 0; if(!isObj || isEmpty){ throw new Error('Bad format object'); } event.target.setAttribute('maxLength', 17); let v = event.target.value.replace(/\D/g, '').match(/(\d{0,2})(\d{0,5})(\d{0,4})/); event.target.value = !v[2] ? v[1] : '( ' + v[1] + ' ) ' + v[2] + (v[3] ? '-' + v[3] : ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MascaraTelefone(tel, event){ \n if(mascaraInteiro(tel, event)==false){\n event.returnValue = false;\n return false;\n } \n return formataCampo(tel, '(00) 0000-0000', event);\n}", "function maskTelefone(){\r\n $(\".telefoneMask\").mask(\"(99) 9...
[ "0.6531493", "0.634636", "0.5933209", "0.59231174", "0.59092224", "0.5791241", "0.57479745", "0.5736936", "0.5721405", "0.5721405", "0.57115054", "0.5506195", "0.5476668", "0.54755825", "0.54755825", "0.54608375", "0.54166406", "0.53920096", "0.53920096", "0.5381847", "0.5379...
0.5108995
33
mask postal event => object return void
postal(event){ let isObj = typeof event == 'object', isEmpty = event.target.value.length <= 0; if(!isObj || isEmpty){ throw new Error('Bad format object'); } event.target.setAttribute('maxLength', 9); let v = event.target.value; event.target.value = v .replace(/\D/g, '') .replace(/(\d{5})(\d)/, "$1-$2") .replace(/(-\d{3})\d+?$/, "$1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MaskMarkerVisitor() {\n}", "onStoreAfterRequest(event) {\n if (this.activeMask && !event.exception) {\n this.unmaskBody();\n }\n }", "function mask_cpfcnpj(obj, event)\n{\n if ( obj.value.length > 14 )\n MascaraCNPJ(obj, event);\n else\n MascaraCPF(obj, event);\n}", "func...
[ "0.5835061", "0.56395924", "0.5594026", "0.5395339", "0.5369281", "0.5360633", "0.5350389", "0.53418493", "0.53418493", "0.53011334", "0.52943146", "0.5264602", "0.5187621", "0.5172707", "0.51695657", "0.50957537", "0.50862104", "0.50561285", "0.50167686", "0.50034493", "0.49...
0.56837326
1
This attribute create a cookie cname is name of your cookie cvalue is the value of cookie exdays is total days
setCookie(cname, cvalue, exdays){ let d = new Date(); exdays = exdays ?? 30; d.setTime(d.getTime() + (exdays*24*60*60*1000)); let expires = "expires="+d.toUTCString(); document.cookie = `${cname}=${cvalue};${expires};path=/` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCookie(cname,cvalue,exdays){var d=new Date();d.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);var expires=\"expires=\" + d.toUTCString();document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";}", "setCookie(cname, cvalue, exdays) {\n var d = new Date();\n d.setTime(d....
[ "0.7987817", "0.79419273", "0.79051435", "0.7886888", "0.7867747", "0.7867051", "0.78637856", "0.78447634", "0.7819961", "0.78096455", "0.78079915", "0.7806359", "0.7795146", "0.7794914", "0.77932507", "0.7793025", "0.7785268", "0.7785268", "0.77834415", "0.77827555", "0.7780...
0.78442466
8
This function return a cookie
getCookie(cname){ if(!cname) throw new Error('name cookie not specified'); let decodedCookie = decodeURIComponent(document.cookie); let ca = decodedCookie.split(';'); for(let i of ca){ let c = i.trim(); let explode = c.split('='); if(explode[0] && explode[0] == cname){ return `${explode[0]}=${explode[1]}`; } } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCookieReturn() \r\n{\r\n\treturn docCookies.getItem('Host'); //Get the cookie\r\n}", "function getCookie(cname) {\n\treturn $.cookie(cname);\n}", "static get(name) \r\n\t{\r\n\t if (document.cookie.length > 0) {\r\n\t let c_start = document.cookie.indexOf(name + \"=\");\r\n\t \r\n\...
[ "0.75577796", "0.75126994", "0.745378", "0.73576266", "0.72957355", "0.72703475", "0.72050947", "0.7131531", "0.70899665", "0.70876807", "0.70647365", "0.7039872", "0.7032067", "0.7029981", "0.70242894", "0.7007412", "0.69868994", "0.6945645", "0.6924816", "0.6923778", "0.692...
0.6818729
44
This function check cookie el => (string) return bool
checkCookie(el){ let status = this.getCookie(el); if(status == "" || status == null){ return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chkcookies(){\n\tvar NameOfCookie=\"userID\";\n\tvar c = document.cookie.indexOf(NameOfCookie+\"=\"); \n\tif (c != -1){\n\t\treturn(true);\n\t}\n\telse{\n\t\treturn (false);\n\t}\n}", "function checkCookie(cname) {\r\n if (getCookie(cname)==\"\") {return false;}\r\n else {return true;}\r\n}", "f...
[ "0.73606443", "0.72911894", "0.7180929", "0.71735245", "0.71650785", "0.70307887", "0.6869332", "0.68459654", "0.6831618", "0.6825115", "0.67239934", "0.66806513", "0.6665405", "0.6634839", "0.6592151", "0.6562246", "0.65170187", "0.6499462", "0.64911544", "0.64473623", "0.64...
0.84635955
0
This attribute delete a cookie especific
delCookie(cname){ document.cookie = `"${cname}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;";`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteCookie(nombre){\n setCookie(nombre,\"\",0);\n }", "function CookieDelete() {\n var cookie = this.$name+'='\n if (this.$path) cookie+='; path='+this.$path\n if (this.$domain) cookie+='; domain='+this.$domain\n cookie+='; expires=Fri, 02-Jan-1970 00:00:00 GMT' // MAKE IT EXPIRE!\n ...
[ "0.82916725", "0.8238889", "0.80935127", "0.795698", "0.7950102", "0.7918675", "0.7915504", "0.7909354", "0.7888002", "0.788007", "0.7870467", "0.7867997", "0.7858775", "0.78446335", "0.783574", "0.78317606", "0.7823664", "0.7794561", "0.77668893", "0.77474403", "0.77438724",...
0.7958248
3
function for time and date showing using Moment.js
function time() { $('#currentDay').text(moment().format('LLLL')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayTime() {\n var rightNow = moment().format(\"MMM DD, YYYY [:] hh:mm:ss a\");\n timeDisplayEl.text(rightNow);\n}", "function time() {\n $('span').html(moment().format());\n}", "function displayTime() {\n var curr = moment().format(\"MM-DD-YYYY HH:mm:ss\");\n currentDayEl.text(curr);\n}...
[ "0.73030645", "0.72945946", "0.72613907", "0.7187141", "0.7167462", "0.7119221", "0.7063596", "0.7029903", "0.6876256", "0.6823548", "0.67528963", "0.6738201", "0.67371815", "0.6736008", "0.6722044", "0.6691734", "0.665026", "0.66279733", "0.66225696", "0.660743", "0.6586442"...
0.663714
17
generate time blocks dynamically when page loads
function generateBlocks(){ for(let i = 9; i<18 ;i++){ $(".container").append(` <div class="row time-block"> <h2 class="hour col-2">${i<12 ? i+":00AM" : i>12? i-12+":00PM" : "12:00PM"}</h2> <textarea class="description col-8 ${i>hour ? "future" : i<hour ? "past" : "present"}" type="text">${todo[i] || ""}</textarea> <button id="${i}" class="saveBtn col-2">Save</button> </div>`) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUpBlocks(start, end, thisDate) {\n // console.log(thisDate.format(\"M\"));\n for (var i = start; i <= end; i++) {\n var timeOfDay = i;\n var displayTime = timeOfDay;\n var suff = \"<span class='time-suffix'>a.m.</span>\";\n if (displayTime > 12) {\n displayT...
[ "0.75794035", "0.74038005", "0.7341512", "0.73205024", "0.7091409", "0.69319344", "0.68342084", "0.68321145", "0.6806659", "0.6770378", "0.674901", "0.6626801", "0.6596864", "0.6593662", "0.65730083", "0.6553637", "0.64862704", "0.6468854", "0.6459464", "0.64409274", "0.64297...
0.6504124
16
You can explore the builtin icon families and icons on the web at:
function TabBarIcon(props: { name: string; color: string }) { return <MaterialIcons size={30} style={{ marginBottom: -3 }} {...props} />; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MatIconLocation() {}", "function Icon(n,s,c,callback){\n\texecute(\"gsettings get org.gnome.desktop.interface icon-theme\",function(stdout){\n\t\tif(stdout != \"\"){theme_name=decodeURIComponent(stdout.replace(/[\"']/g, \"\"));IconFinder(theme_name,n,s,c,callback,true);}else{\n\t\t\texecute(\"grep '^gtk...
[ "0.7022685", "0.6987905", "0.6862808", "0.6845584", "0.67316145", "0.6693436", "0.660245", "0.6580989", "0.6570295", "0.6570295", "0.65496427", "0.65496427", "0.65430087", "0.65430087", "0.65259886", "0.65188533", "0.65188533", "0.65053725", "0.65053725", "0.6476853", "0.6476...
0.0
-1
React navigation tab stack for Playlist Analyser.
function TabOneNavigator() { return ( <TabOneStack.Navigator> <TabOneStack.Screen name="PlaylistAnalyserHome" component={PlaylistAnalyser} options={{ headerTitle: 'Playlist Analyser' }} /> <TabOneStack.Screen name="SearchSong" component={SearchSong} options={{ headerTitle: 'Playlist Analyser' }} /> <TabOneStack.Screen name="SearchPlaylist" component={SearchPlaylist} options={{ headerTitle: 'Playlist Analyser' }} /> <TabOneStack.Screen name="SearchPlaylistResults" component={SearchPlaylistResults} options={{ headerTitle: 'Playlist Analyser' }} /> <TabOneStack.Screen name="PlaylistResults" component={PlaylistResults} options={{ headerTitle: 'Playlist Analyser' }} /> </TabOneStack.Navigator> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render(){\n var trackers_list = get_top_trackers()\n\n return (\n <div className=\"flex-container\">\n <Tab.Container id=\"tracker-tabs\" defaultActiveKey=\"first\">\n <Row class=\"tracker-list-box\">\n <Col sm={3}>\n <Nav variant=\"pills\" className=\"flex-column...
[ "0.66776645", "0.6347059", "0.62501615", "0.60769594", "0.6051393", "0.59929645", "0.59875596", "0.59699994", "0.5966047", "0.5892641", "0.58367765", "0.58248866", "0.58224255", "0.580555", "0.57718146", "0.5764554", "0.574374", "0.5736207", "0.57299453", "0.57164484", "0.571...
0.64225847
1
React navigation tab stack for Song Analyser.
function TabTwoNavigator() { return ( <TabTwoStack.Navigator> <TabTwoStack.Screen name="SongAnalyserHome" component={SongAnalyser} options={{ headerTitle: 'Song Analyser' }} /> <TabTwoStack.Screen name="SearchSong" component={SearchSong} options={{ headerTitle: 'Song Analyser' }} /> <TabTwoStack.Screen name="SongResults" component={SongResults} options={{ headerTitle: 'Song Analyser' }} /> </TabTwoStack.Navigator> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TabOneNavigator() {\n return (\n <TabOneStack.Navigator>\n <TabOneStack.Screen\n name=\"PlaylistAnalyserHome\"\n component={PlaylistAnalyser}\n options={{ headerTitle: 'Playlist Analyser' }}\n />\n <TabOneStack.Screen\...
[ "0.6475666", "0.6468039", "0.63124937", "0.60596925", "0.60255635", "0.5970851", "0.5945669", "0.59344715", "0.58610266", "0.5822944", "0.58227867", "0.5788462", "0.576454", "0.5754998", "0.57089555", "0.56597733", "0.56468105", "0.5641285", "0.56297016", "0.56173426", "0.561...
0.6485928
0
React navigation tab stack for About.
function TabThreeNavigator() { return ( <TabThreeStack.Navigator> <TabThreeStack.Screen name="AboutHome" component={About} options={{ headerTitle: 'About' }} /> </TabThreeStack.Navigator> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AboutStackNavigator() {\n\treturn (\n\t\t<Stack.Navigator>\n\t\t\t<Stack.Screen name=\"About\" component={AboutScreen} />\n\t\t</Stack.Navigator>\n\t);\n}", "function TabStack(props) {\n const tabPress = (e) => {\n global.currenRouter = e.target.split(\"-\")[0];\n };\n return (\n <Tab.Navigator...
[ "0.70132256", "0.66482043", "0.63314754", "0.63214475", "0.6297563", "0.6234316", "0.6162473", "0.61617774", "0.6129372", "0.606334", "0.6059632", "0.6044198", "0.59987694", "0.5944048", "0.5923726", "0.58679473", "0.58668506", "0.58446765", "0.5799544", "0.57880574", "0.5787...
0.688706
1
saveTestDriveInfo(null, name, company, phone,address,payment_type, car_name,car_company ,car_version,car_color, hopeTime, null,
function createTestDrive(testDrive){ var item = $('<div/>', { class: 'col-md-12 col-sm-12 col-xs-12 col-lg-12' }).appendTo($('#content')); item.css('width', '100%'); item.css('margin-top', '1%'); var titleName = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titleName.html("姓名: ") var name = $('<input/>', { type: 'text', value: testDrive.name, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); var titlePhone = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titlePhone.html("電話: ") var phone = $('<input/>', { type: 'text', value: testDrive.phone, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); var titleCompany = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titleCompany.html("公司&機構: ") var company = $('<input/>', { type: 'text', value: testDrive.company, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); var titleCarCompany = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titleCarCompany.html("車廠: ") var carCompany = $('<input/>', { type: 'text', value: testDrive.car_company, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); var titleCarName = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titleCarName.html("車型: ") var carName = $('<input/>', { type: 'text', value: testDrive.car_name, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); var titleColor = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); titleColor.html("車色: ") var color = $('<input/>', { type: 'text', value: testDrive.car_color, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item); // paymentType.append($("<option></option>").attr("value", "刷卡").text("刷卡")); var item2 = $('<div/>', { class: 'col-md-12 col-sm-12 col-xs-12 col-lg-12' }).appendTo($('#content')); item2.css('width', '100%'); item2.css('margin-top', '1%'); var titlePaymentType = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); titlePaymentType.html("付款方式: ") var paymentType = $('<select/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); for(var j=0;j<paymentTypeValue.length;j++){ paymentType.append($("<option></option>").attr("value", paymentTypeValue[j]).text(paymentTypeValue[j])); if(paymentTypeValue[j] == testDrive.payment_type){ paymentType.val(paymentTypeValue[j]); // paymentType.attr(paymentTypeValue[j],true); } } var titleAddress = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); titleAddress.html("地址: ") var address = $('<input/>', { type: 'text', value: testDrive.address, class: 'col-md-3 col-sm-3 col-xs-3 col-lg-3' }).appendTo(item2); var titleHopeTime = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); titleHopeTime.html("試乘時間: ") var hopeTime = $('<input/>', { type: 'text', value: testDrive.hopeTime, class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); var titleStatus = $('<div/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); titleStatus.html("狀態: ") let orderReceive = 'receive'; let orderPending = 'pending'; let orderFailure = 'failure'; let orderSuccess = 'success'; var status = $('<select/>', { class: 'col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); for(var j=0;j<statusValue.length;j++){ status.append($("<option></option>").attr("value", statusValue[j]).text(statusValue[j])); if(statusValue[j] == testDrive.status){ status.val(statusValue[j]); // status.attr(statusValue[j],true); } } // status.append($("<option></option>").attr("value", "receive").text("receive")); // status.append($("<option></option>").attr("value", "pending").text("pending")); // status.append($("<option></option>").attr("value", "failure").text("failure")); // status.append($("<option></option>").attr("value", "success").text("success")); var change = $('<button/>', { class: 'btn btn-success col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); change.html("修改") var remove = $('<button/>', { id: testDrive._id, class: 'btn btn-danger col-md-1 col-sm-1 col-xs-1 col-lg-1' }).appendTo(item2); remove.html("刪除") setChangeClick(change, testDrive._id, name, phone, company,carCompany, carName, color, paymentType,address,hopeTime,status) setRemoveClick(remove, testDrive._id) // setAddClick(add, name, company, color, price, special_price, description) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createTestDrive()\n {\n console.log('Inside createTestDrive');\n createTestDriveSF({data:JSON.stringify(this.testDriveData)})\n .then(result1 =>{\n console.log('Inside result');\n if(result1.code===200)\n {\n\n this.testDriveId=result1.createdId;\n ...
[ "0.5880701", "0.5599724", "0.5544241", "0.5538065", "0.5532087", "0.55165386", "0.5492696", "0.5472051", "0.5414778", "0.5405292", "0.53951526", "0.53929895", "0.5342391", "0.5330448", "0.5291325", "0.5285189", "0.52817065", "0.5269957", "0.5267587", "0.52499443", "0.524883",...
0.4938808
69
returns true if some array alement is true
function some(arr, pred){ for(var i = 0; i < arr.length; i++){ if(pred(arr[i])) return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testArray(array) {\n if (\n (array[0] === 1 || array[0] === 3) &&\n (array[1] === 1 || array[1] === 3)\n ) {\n return true;\n } else {\n return false;\n }\n}", "function some(array, test) {\n for (let element of array) {\n if (test(element)) {\n return true;\n }\n }\n\n ret...
[ "0.7653934", "0.71862906", "0.715384", "0.71526366", "0.71422756", "0.7062995", "0.7021746", "0.7004266", "0.7001492", "0.7001492", "0.6984746", "0.6948215", "0.6933439", "0.6933439", "0.6933439", "0.6933439", "0.6917598", "0.6902217", "0.68888503", "0.6875712", "0.6872005", ...
0.6836547
24
Scroll to Event Spaces section and set nav menu item as active
function goToSpaces() { var $spacesLink = $('a#link_to_spaces'); $('body, html').animate({ scrollTop: eventSpacesDest }, 800, function() { $spacesLink.addClass('site-nav-menu__link--active'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrNav() {\n var sTop = $(window).scrollTop();\n $('section').each(function () {\n var id = $(this).attr('id'),\n offset = $(this).offset().top - 1,\n height = $(this).height();\n if (sTop >= ...
[ "0.71987575", "0.71234435", "0.7111826", "0.6995709", "0.6981383", "0.6973248", "0.69674563", "0.6956668", "0.69434655", "0.69379705", "0.69060916", "0.6904358", "0.68921554", "0.6879294", "0.6870658", "0.68653095", "0.6838673", "0.6837361", "0.68306917", "0.679816", "0.67849...
0.64135677
71
Load each set of carousel photos for all event spaces
function fetchPhotos(id) { // console.log('fetchPhotos',id) var directory = ''; var filePath = 'content/spaces/' + directory + '/carousel.php'; console.log('fetchPhotos',id,directory,filePath); // Load Stage photos if (id === 'thestage') { directory = 'stage'; filePath = 'content/spaces/' + directory + '/carousel.php'; if (stagePicsInPlace === 0) { loadCarousel(filePath, id); stagePicsInPlace++; } } // Load Hall photos else if (id === 'thehall') { directory = 'hall'; filePath = 'content/spaces/' + directory + '/carousel.php'; if (hallPicsInPlace === 0) { loadCarousel(filePath, id); hallPicsInPlace++; } } // Load Gallery photos else if (id === 'thegallery') { directory = 'lobby'; filePath = 'content/spaces/' + directory + '/carousel.php'; if (galleryPicsInPlace === 0) { loadCarousel(filePath, id); galleryPicsInPlace++; } } // Load Screening room photos else if (id === 'thescreeningroom') { directory = 'screening'; filePath = 'content/spaces/' + directory + '/carousel.php'; if (screeningPicsInPlace === 0) { loadCarousel(filePath, id); screeningPicsInPlace++; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadCarouselImages() \n{\n\n\tIMAGES = randomizeArray(IMAGES);\n\t\n\t//Imported IMAGES & CAPTIONS\n\t//From images.js\n\tSTART_INDEX = 0;\n\n\tfor(var i=0; i < IMAGES.length; i++)\n\t\taddImageWithCaption(IMAGES[i][1], IMAGES[i][2], IMAGES[i][0], START_INDEX == i);\n}", "function loadFurtherCarouselSli...
[ "0.69375914", "0.6784285", "0.6733166", "0.673027", "0.67277676", "0.6722266", "0.66847664", "0.6637117", "0.6633724", "0.6549185", "0.6547319", "0.6505008", "0.64773405", "0.6472952", "0.64249736", "0.6421355", "0.642083", "0.6407476", "0.64026946", "0.64008904", "0.63908917...
0.63630664
26
Make nav sticky once user scrolls past intro section Set Event Spaces menu item have active appearance based on scroll position (above or below intro section)
function makeNavStickyOnScroll() { var $window = $(window); var $spacesLink = $('a#link_to_spaces'); // Override the standard nav bar by giving it id "homecoming-float" and removing "fixed" class $('.site-nav') .attr('id', 'homecoming-float') .removeClass('navbar-fixed-top'); // find the Y position of the intro section var intro_offset = $('section.intro').offset().top; $window.scroll(function windowScroll() { if ($window.scrollTop() >= intro_offset) { // Make site nav sticky once we scroll past intro section $('.site-nav') .attr('id', 'siteNav') .addClass('navbar-fixed-top'); // Add active class to Event Spaces menu item once we scroll past intro section $spacesLink.addClass('site-nav-menu__link--active'); } // un-sticky site nav and remove active class from Event Space menu item once we scroll above intro section if ($window.scrollTop() < intro_offset) { $('.site-nav') .attr('id', 'homecoming-float') .removeClass('navbar-fixed-top'); $spacesLink.removeClass('site-nav-menu__link--active'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeSectionActive(){\n if (window.scrollY > navbarList.offsetTop){\n navbarList.classList.add('sticky');\n }else {\n\n navbarList.classList.remove('sticky');\n }\n for (let i =0; i < allSections.length; i++){\n if ( (window.scrollY+70 > allSections[i].offsetTop && i !== al...
[ "0.7465809", "0.7365849", "0.7274808", "0.72692376", "0.72230685", "0.7198198", "0.71392465", "0.713246", "0.71000737", "0.709192", "0.70879257", "0.7043844", "0.70255977", "0.7004943", "0.69803566", "0.6876572", "0.68671125", "0.6852047", "0.6847967", "0.68453306", "0.683881...
0.71677256
6
Debouncing function. Rate limits the function calls
function debounce(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function debouncer( func , timeout ) {\nvar timeoutID , timeout = timeout || 200;\nreturn function () {\nvar scope = this , args = arguments;\nclearTimeout( timeoutID );\ntimeoutID = setTimeout( function () {\n func.apply( scope , Array.prototype.slice.call( args ) );\n} , timeout );\n}\n}", "static Debounce(fu...
[ "0.7666417", "0.7353457", "0.71261024", "0.7053938", "0.70075107", "0.70075107", "0.692892", "0.67667377", "0.6740276", "0.67399776", "0.670116", "0.670116", "0.6700426", "0.6692834", "0.6687424", "0.6655648", "0.66498077", "0.66437876", "0.6636098", "0.6636098", "0.6624735",...
0.0
-1
'GET' request an url, and call callback with JSON data
function request(url, callback) { var xmlhttp = new XMLHttpRequest(); xmlhttp.open('GET', url, true); xmlhttp.send(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { var data = JSON.parse(xmlhttp.responseText); callback(data); } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get(url, callback) {}", "function jsonGet(url, callback) {\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', url, true);\r\n xhr.setRequestHeader('Content-Type', 'application/json');\r\n\r\n xhr.onreadystatechange = callback;\r\n\r\n xhr.send();\r\n}", "function getData(url, callback) ...
[ "0.78543854", "0.78474337", "0.7731454", "0.7632696", "0.7539297", "0.7533426", "0.7480702", "0.74681365", "0.7466682", "0.74615675", "0.7448217", "0.7424495", "0.74029636", "0.7398302", "0.7366457", "0.7339989", "0.73132175", "0.72810423", "0.7279093", "0.72603595", "0.72539...
0.7996012
0
make a horizon chart
function horizon() { var hrz = context.horizon(); if (type === 'm') { return hrz.extent([0, 2]) .colors(['black', 'black', 'teal', '#dd1144']); } else if (type === 'v') { return hrz; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initHorizontalChart() {\n console.log(\"initHorizontalChart\");\n\n // ordinal.rangeRoundBands(interval, padding, outerPadding)\n // computes range values so as to divide the chart area into evenly-spaced, evenly-sized bands\n // assures integers for pixel; values (avoids aliasing)\n...
[ "0.6576366", "0.6515155", "0.6300424", "0.6260759", "0.61928976", "0.6131376", "0.6125039", "0.6079667", "0.6016706", "0.60162926", "0.60162246", "0.6012936", "0.5994601", "0.5994601", "0.5994601", "0.5994601", "0.5994601", "0.5994601", "0.5935575", "0.59330875", "0.5905058",...
0.71342796
0
sample output: ['enUS', 'enGB']
function getBrowserLocales(options = {}) { const defaultOptions = { languageCodeOnly: false } const opt = { ...defaultOptions, ...options } const browserLocales = navigator.languages === undefined ? [navigator.language] : navigator.languages if (!browserLocales) { return undefined } return browserLocales.map((locale) => { const trimmedLocale = locale.trim() return opt.languageCodeOnly ? trimmedLocale.split(/-|_/)[0] : trimmedLocale }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDropDownStrings(){\n\tlet ret=dropDownStrings['en']\n\tlet lang = document.documentElement.lang.split('-')[0]||'en'\n\tif( lang!='en' && !!dropDownStrings[lang] ){\n\t\tfor(let [k,v] of Object.entries(dropDownStrings[ lang ])){\n\t\t\tret[k]=v\n\t\t}\n\t}\n\twrite2log('Using drop down strings for ' + l...
[ "0.66592526", "0.6597174", "0.6582076", "0.6476799", "0.6366767", "0.6334615", "0.6235662", "0.62213993", "0.6158191", "0.6158191", "0.612126", "0.612126", "0.612126", "0.612126", "0.610048", "0.610048", "0.610048", "0.610048", "0.610048", "0.610048", "0.610048", "0.6095584...
0.0
-1
Message will only be produced if there is an issue with the username/email attempt
render() { return ( <div> <h2>{this.state.message}</h2> <form onSubmit={this.handleSubmit} className='registration-form'> <div className='username'> <label htmlFor='username'>Username</label> <input type='text' className='input-words' name='username' onChange={this.handleChange} placeholder='Enter Username' /> </div> <div className='email'> <label htmlFor='email'>Email</label> <input type='email' className='input-words' name='email' onChange={this.handleChange} placeholder='Enter Email' /> </div> <div className='password'> <label htmlFor='password'>Password</label> <input type='password' className='input-words' name='password' onChange={this.handleChange} placeholder='Enter Password' /> </div> <div className='currentZip'> <label htmlFor='currentZip'>Zip Code</label> <input type='number' className='input-words' name='currentZip' onChange={this.handleChange} placeholder='Current Zip' /> </div> <div className='walkabilityImportance'> <label htmlFor='walkabilityImportance'>Importance of Walkability</label> <input type='number' className='input-numbers' name='walkabilityImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <div className='medianDesiredAge'> <label htmlFor='medianDesiredAge'>Desired Median Age</label> <input type='number' className='input-words' name='medianDesiredAge' onChange={this.handleChange} placeholder='Desired Age of Neighbors' /> </div> <div className='medianAgeImportance'> <label htmlFor='medianAgeImportance'>Importance of Neighborhood Age</label> <input type='number' className='input-numbers' name='medianAgeImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <div className='diversityImportance'> <label htmlFor='diversityImportance'>Importance of Diversity</label> <input type='number' className='input-numbers' name='diversityImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <div className='houseValueImportance'> <label htmlFor='houseValueImportance'>Importance of House Costs to Income</label> <input type='number' className='input-numbers' name='houseValueImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <div className='desiredWeather'> <label htmlFor='desiredWeather'>Desired Weather: 1 for Colder, 2 for the Same, 3 for Warmer</label> <input type='number' className='input-numbers' name='desiredWeather' onChange={this.handleChange} placeholder='1, 2, or 3' /> </div> <div className='weatherImportance'> <label htmlFor='weatherImportance'>Importance of Weather</label> <input type='number' className='input-numbers' name='weatherImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <div className='nearbyAmenities'> <label htmlFor='nearbyAmenities'>Important Things Nearby</label> <input type='text' className='input-words' name='nearbyAmenities' min='1' max='5' onChange={this.handleChange} placeholder='What Do You Want To Live Near' /> </div> <div className='amenitiesImportance'> <label htmlFor='amenitiesImportance'>Importance of Those Things</label> <input type='number' className='input-numbers' name='amenitiesImportance' min='1' max='5' onChange={this.handleChange} placeholder='1 - 5' /> </div> <button>Register</button> </form> <button onClick={this.props.hideReg}>Already Registered?</button> </div> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function accountCreationMessage (req, res, next) {\n let registeredUser = req.registeredUser\n let status = registeredUser.admin ? 'admin' : registeredUser.company.host ? 'staff' : 'user'\n req.resJson.message = !registeredUser.hashedPassword\n ? `Contact record for '${registeredUser.email}' without login pr...
[ "0.64434016", "0.6386315", "0.6381213", "0.632322", "0.6307758", "0.6225147", "0.6188439", "0.61776865", "0.6166889", "0.6166889", "0.6166889", "0.6166889", "0.61600834", "0.61356026", "0.6121422", "0.6086535", "0.6084098", "0.6079379", "0.606915", "0.6032477", "0.6031461", ...
0.0
-1
This command remove 1 or more Tasks
function action(args, env) { // Prompt for tasks if ( args.length === 0 ) { prompt('Task:', _promptFinished); } // Process Tasks else { for ( let i = 0; i < args[0].length; i++ ) { _process(args[0][i], i+1, args[0].length); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteTask(tasks, uuid)\n {\n var i = 0;\n console.error('tasks', tasks);\n\n for (; i < tasks.length; i++)\n {\n if (uuid == tasks[i].uuid)\n {\n tasks.splice(i, 1);\n i--;\n }\n ...
[ "0.7358061", "0.72974175", "0.71213925", "0.70832986", "0.6977794", "0.69294983", "0.69193834", "0.69031036", "0.68707055", "0.6836908", "0.68129915", "0.6802903", "0.6799288", "0.67796594", "0.6774586", "0.6758109", "0.6710263", "0.6707952", "0.67012024", "0.6701122", "0.669...
0.0
-1
Process the returned answers
function _promptFinished(answers) { for ( let i = 0; i < answers.length; i++ ) { let answer = answers[i]; _process(answer[0], i+1, answers.length); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processAnswers(answers) {\n\tconsole.log(\"Does this look right?\", answers);\n}", "function process_answer_submission(){\n answer = given_answer();\n correct = is_correct_answer(answer,question_on_screen);\n update_question_result(correct);\n counter++;\n}", "function processResponse(inQuestion, ...
[ "0.70424396", "0.6909091", "0.6893842", "0.66537166", "0.6636547", "0.64825463", "0.6337962", "0.6301394", "0.6291362", "0.62783444", "0.6265152", "0.6256019", "0.62528723", "0.62388945", "0.6196289", "0.6033688", "0.60149693", "0.6010346", "0.59981894", "0.59913087", "0.5986...
0.6168534
15
the string contains (ie. "All cows eat grass and moo" would return 8). Do not count y as a vowel for this challenge.
function VowelCount(str) { let count = 0; for (let i = 0; i < str.length; i++) { if (str[i] === 'a' || str[i] === 'e' || str[i] === 'i' || str[i] === 'o' || str[i] === 'u') { count++; } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCount(str) {\n return (str.match(/[aeiou]/ig)||[]).length;\n }", "function countVowelConsonant(str) {\n\n return str.split(\"\").reduce(function (accumulator, currentValue) {\n let i=2;\n if(\"aeiou\".indexOf(currentValue) != -1) i=1; \n return accumulator +i;\n }, 0);\n }"...
[ "0.6963035", "0.6923765", "0.69180024", "0.69065416", "0.68987006", "0.689386", "0.68740726", "0.68611586", "0.68381166", "0.68208677", "0.6783065", "0.67584926", "0.6738229", "0.6737461", "0.67345434", "0.6732355", "0.6732281", "0.67241216", "0.6693089", "0.66694736", "0.666...
0.64890075
48
draw matrix cells /////////////////////////////////////// set up offset array for buffer
function offset_function(_, i){ var x = -0.5 + ( Math.floor(i / num_cell) ) / num_cell ; var y = -0.5 + (i % num_cell) / num_cell ; return [x, y]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawMatrix(matrix, offset, Grid){ // offset used to move the block around // Grid used so i can use this function for both canvas\r\n matrix.forEach((row, y) => { // x and y here are the indexes\r\n row.forEach((value, x) => {\r\n if(value !== 0){\r\n Grid.fillStyle = colors[value]...
[ "0.7344852", "0.711648", "0.7114928", "0.705269", "0.7050805", "0.6993967", "0.6512643", "0.62977177", "0.62860906", "0.6273997", "0.62422884", "0.62270874", "0.62022066", "0.6097551", "0.6079596", "0.6067703", "0.6043228", "0.59734", "0.597086", "0.595872", "0.5955974", "0...
0.57246244
39
Returns true if the supplies object has no properties.
function isEmpty(obj) { for (var key in obj) { if (obj.hasOwnProperty(key)) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isEmptyProperties( props ) {\n for (var k in props) {\n if (!props.hasOwnProperty(k)) {\n continue;\n }\n return false;\n }\n return true;\n}", "_emptyProp (propName) {\n return !this[propName] || (typeof this[propName] === 'object' && Object.keys(this[propNam...
[ "0.74720997", "0.7298551", "0.7027249", "0.6921188", "0.6897622", "0.68790996", "0.6873961", "0.6828858", "0.6828858", "0.68222195", "0.68222195", "0.68206567", "0.6760268", "0.6751869", "0.6751688", "0.6738281", "0.6736219", "0.6730328", "0.67226195", "0.6711692", "0.6688229...
0.0
-1
Resizes the window to the current dimensions of this page's body.
function resizeWindow() { window.setTimeout(function() { chrome.tabs.getCurrent(function (tab) { var newHeight = Math.min(document.body.offsetHeight + 140, 700); chrome.windows.update(tab.windowId, { height: newHeight, width: 520 }); }); }, 150); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function windowResized() {\n\n getWrapperWidth();\n resizeCanvas(wrapperWide, wrapperWide);\n\n widthVar = (width - 40) / 100;\n drawArea = (width - 40);\n\n switchBox();\n}", "function windowResized() {\n\twindowW = window.innerWidth;\n\twindowH = window.innerHeight;\n resizeCanvas(window.innerWidth, wind...
[ "0.71591026", "0.6864512", "0.68576", "0.68494874", "0.6844306", "0.68431675", "0.6832591", "0.6832591", "0.6832013", "0.6799786", "0.6799288", "0.6786279", "0.6786279", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", "0.6785724", ...
0.66747314
57
Called directly by the background page with information about the image. Outputs image data to the DOM.
function renderImageInfo(imageinfo) { console.log('imageinfo', imageinfo); var divloader = document.querySelector('#loader'); var divoutput = document.querySelector('#output'); divloader.style.display = "none"; divoutput.style.display = "block"; var divinfo = document.querySelector('#info'); var divexif = document.querySelector('#exif'); // Render general image data. var datacells = divinfo.querySelectorAll('td'); renderCells(datacells, imageinfo); // If EXIF data exists, unhide the EXIF table and render. if (imageinfo['exif'] && !isEmpty(imageinfo['exif'])) { divexif.style.display = 'block'; var exifcells = divexif.querySelectorAll('td'); renderCells(exifcells, imageinfo['exif']); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function image_display() {\r\n\r\n}", "draw() {\n // Displaying the background\n image(hubImage, 0, 0, width, height);\n }", "function drawImage() {\n document.body.style.backgroundImage = `url(${ store.State.image.large_url})`\n document.body.classList.add('bg-image')\n}", "function _drawBackgr...
[ "0.66021895", "0.64751923", "0.64181393", "0.6318622", "0.6300253", "0.6294994", "0.6287033", "0.628028", "0.62594223", "0.6163313", "0.6161639", "0.61614597", "0.6104169", "0.6088577", "0.6073676", "0.6073315", "0.6044414", "0.6040513", "0.60336167", "0.60294414", "0.6009472...
0.0
-1
Renders the URL for the image, trimming if the length is too long.
function renderUrl(url) { var divurl = document.querySelector('#url'); var urltext = (url.length < 45) ? url : url.substr(0, 42) + '...'; var anchor = document.createElement('a'); anchor.href = url; anchor.innerText = urltext; divurl.appendChild(anchor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TrimLength(text, maxLength) {\n var shortURL = text.substring(0, maxLength) + '...';\n return shortURL;\n}", "function urlFor(source) {\n return builder.image(source)\n }", "placeholderArtwork(url) {\n if(!url) return \"http://placehold.it/100x100\";\n\n // const regx = /(-large)/;\n ...
[ "0.58814675", "0.5874486", "0.5849954", "0.58483356", "0.5749398", "0.574464", "0.57118964", "0.5703574", "0.568112", "0.5611665", "0.5597645", "0.55876744", "0.5550715", "0.5543544", "0.55422634", "0.5535454", "0.54782176", "0.5475347", "0.54525286", "0.54496557", "0.5444438...
0.58346325
4
Renders a thumbnail view of the image.
function renderThumbnail(url) { var canvas = document.querySelector('#thumbnail'); var context = canvas.getContext('2d'); canvas.width = 100; canvas.height = 100; var image = new Image(); image.addEventListener('load', function() { var src_w = image.width; var src_h = image.height; var new_w = canvas.width; var new_h = canvas.height; var ratio = src_w / src_h; if (src_w > src_h) { new_h /= ratio; } else { new_w *= ratio; } canvas.width = new_w; canvas.height = new_h; context.drawImage(image, 0, 0, src_w, src_h, 0, 0, new_w, new_h); }); image.src = url; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display() {\n var content = this.getContent();\n var root = Freemix.getTemplate(\"thumbnail-view-template\");\n\n content.empty();\n content.append(root);\n this._setupViewForm();\n this._setupLabelEditor();\n\n var images = Freemix.property.getPrope...
[ "0.70654005", "0.6743225", "0.66222453", "0.6562471", "0.6522311", "0.6441667", "0.6409667", "0.64059156", "0.6402615", "0.63581777", "0.62729055", "0.6243776", "0.62026244", "0.61985946", "0.61974347", "0.6117547", "0.6112769", "0.60977876", "0.6074607", "0.6050965", "0.6002...
0.7134303
0
this is my click function
function click() { /* i need to check if the current color is the last object in the array. If it is, i set the value back to 0 (the first color in the array. Otherwise, i have to increment the current color by 1. */ if (presentColor == colors.length-1) presentColor = 0; else presentColor++; // here now i can set the body's style - backgroundColor to the new color. document.body.style.backgroundColor = colors[presentColor]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _click(d){\n \n }", "function click(el){\n \n \n}", "click() { }", "click_extra() {\r\n }", "handleClick() {}", "function clicked(d,i) {\n\n}", "function clicked(d,i) {\n\n}", "function cb_beforeClick(cb, pos) { }", "function handleClick() {\n\t\t window.ctaClick();\n\t\t}", ...
[ "0.7632426", "0.74783105", "0.7440332", "0.7157805", "0.6946124", "0.6902624", "0.6902624", "0.68999004", "0.68989044", "0.68989044", "0.689625", "0.68536013", "0.6851835", "0.6823585", "0.6820775", "0.6816985", "0.68127924", "0.67819476", "0.6745895", "0.6734091", "0.6705798...
0.0
-1
TREE FOR IBN SINA COLOR
function avicenna (treeData){ // assigns the data to a hierarchy using parent-child relationships var nodes = d3.hierarchy(treeData); var treemap = d3.tree().size([400,400]) // maps the node data to the tree layout nodes = treemap(nodes); // append the svg object to the body of the page // appends a 'group' element to 'svg' // moves the 'group' element to the top left margin var svg = d3.select("#avicenna").append("svg") .attr("width", Awidth + margin.left + margin.right) .attr("height", Aheight + margin.top + margin.bottom), g = svg.append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); // adds the links between the nodes var link = g.selectAll(".link") .data( nodes.descendants().slice(1)) .enter().append("path") .attr("class", "link") .attr("d", function(d) { return "M" + d.x + "," + d.y + "C" + d.x + "," + (d.y + d.parent.y) / 2 + " " + d.parent.x + "," + (d.y + d.parent.y) / 2 + " " + d.parent.x + "," + d.parent.y; }); // adds each node as a group var node = g.selectAll(".node") .data(nodes.descendants()) .enter().append("g") .attr("class", function(d) { return "node" + (d.children ? " node--internal" : " node--leaf"); }) .attr("transform", function(d) { return "translate(" + d.x + "," + d.y + ")"; }) .attr("name", function(d) { return d.data.name }).attr("description", function(d){ return d.data.description }); var base = g.selectAll(".node").data(nodes.descendants()) .enter().append("g").attr("class",function(d) { return "node" }) .attr("transform",function(d){ return "translate(" + 100 + "," + 100 + ")"; }); base.append("circle").attr("r",20).attr("name", function() {return "BLACK"}) base.append("text") .attr("dy", ".15em") .attr("y", function(d) { return d.children ? -100 : -100; }) .style("text-anchor", "middle") .text(function(d) { return d.data.name; }); // adds the circle to the node node.append("circle") .attr("r", 35) .attr("name", function(d) { return d.data.name }) .style("fill",function(d) { return d.data.color;}) // adds the text to the node // node.append("text") // .attr("dy", ".25em") // .attr("y", function(d) { return d.children ? 5 : 5; }) // .style("text-anchor", "middle") // .text(function(d) { return d.data.name; }); node.attr("fill",function(d) { return d.data.color;}) node.on("click", function () { d3.select("#a_d").remove() d3.select(this).select("circle").style("stroke","#123fff"); var current = d3.select(this).attr('name') var content = d3.select(this).attr('description') d3.select("#a_details").append("g").attr("id","a_d").style("width",200).style("height",300).html(function(){return "<p class='content'>" + "<style='text-decoration:underline'>"+current + "</style>"+"<br>" + content + "</p>"}) }) node.on("mouseover",function() { d3.select(this).select("circle").style("stroke","#888") tooltip .style("left", d3.event.pageX + 50 +"px") .style("top", d3.event.pageY + "px") .style("display", "inline-block") .html(d3.select(this).attr('name') ); }) .on("mouseout",function() { d3.select(this).select("circle").style("stroke","#fff") tooltip.style("display", "none"); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "colorTreeDefault() {\n let i, color = this.getDefaultColor();\n for(i in this.metadata) {\n this.metadata[i]['branch_color'] = color;\n }\n }", "function color_assign(d) {\n\t\tvar greenClassList = [];\n\t\t\n\t\tif(treeFlag == \"STATIC\"){\n\t\t\tgreenClassList = staticKPIList;\t\t\t\n\t\t}else...
[ "0.6946722", "0.6577069", "0.6361758", "0.6277365", "0.6266196", "0.62410915", "0.6092731", "0.6043756", "0.59976643", "0.5976792", "0.59511584", "0.5934329", "0.5933131", "0.59271365", "0.5926198", "0.5875297", "0.58534205", "0.58452004", "0.5839276", "0.58094513", "0.580945...
0.0
-1
draw your cirlce with the changing colors
function draw() { circle(250, 250, 450); strokeWeight(3); text("Click me to change color!", 100, 200, 350, 300); textSize(28); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rainbowColor() {\n updatePenMode(\"random\");\n}", "function changeColorFaded() {\n\n temp = 330;\n cont1 = 0;\n cont2 = 125;\n cont3 = 254;\n\n function cycler(cont) {\n if(cont >= 255) \n op = 'decr';\n else\n op = 'incr';\n\n switch(op) {\n...
[ "0.6903112", "0.68646705", "0.6826152", "0.67670554", "0.67198145", "0.6673409", "0.6670136", "0.6663968", "0.66530085", "0.6643956", "0.6628434", "0.65776885", "0.6567765", "0.6561271", "0.6554733", "0.65501", "0.653363", "0.65150607", "0.65150255", "0.65147173", "0.6505295"...
0.0
-1
create function when mouse is clicked, the circle will change colors
function mouseClicked() { var randomColor = colors[Math.floor(Math.random() * colors.length)]; if(randomColor == "purple") { fill(colors[0]); }else if(randomColor == "red") { fill(colors[1]); }else if(randomColor == "orange") { fill(colors[2]); }else { fill(colors[3]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mouseClicked() {\n colorindex = ((colorindex+1)%colors.length)\n bgColor = colors[2][1]\n circleColor = colors[2][0];\n}", "function my_mousedown(e)//e is an event which has relation with mousedown\r\n{\r\n //taking color from input box\r\n color = document.getElementById(\"input1\").value;\r\n...
[ "0.79036605", "0.73699594", "0.7361039", "0.7254562", "0.72188544", "0.7134071", "0.7116854", "0.70512164", "0.7038741", "0.7017429", "0.6928681", "0.6914697", "0.6912164", "0.6903515", "0.688787", "0.68528533", "0.6838384", "0.68348575", "0.6834563", "0.6782425", "0.67741406...
0.68567854
15
5 ways to customize the infowindow 2015 en.marnoto.com
function getSellNearby(positon) { latitude = positon.latitude; longitude = positon.longitude; jQuery.ajax({ url:baseURL + 'json/mapsjson', type:'POST', data: {lat: latitude, lng: longitude ,form : form}, error: function(xhr, status, err) { //console.log('error'); //console.log(xhr, status, err); }, success:function(data){ var i = 1; clearMarkers(); jQuery.each(data, function(key,value){ if( value.price != 'Thương lượng' ) { var html = '<div class="modal-content '+value.ads+'">\n'; html += '<div class="modal-header">\n'; value.ads == "hot" ? html += '<div class="hot"><p>HOT</p></div>\n' : null; html += '<button type="button" class="close" data-dismiss="modal" title="Đóng">&times;</button>\n'; html += '<a href="'+value.link+'" target="_blank"><img data-src="'+value.image+'"></a>\n'; html += '</div>\n'; html += '<div class="modal-body">\n'; html += '<h4><a href="'+value.link+'" target="_blank">'+value.title+'</a></h4>\n'; html += '<br/>\n'; html += '<p class="gia">\n'; html += '<span class="price_top">'+value.pricediv+'/</span>\n'; html += '<span class="area_top">'+value.sqft+'</span>\n'; html += '</p>\n'; html += '<p class="giadientich">Giá/ diện tích '+value.price_app+'</p>\n'; html += '<p class="location"><i class="fa fa-map-marker"></i> '+value.adress+'</p>\n'; html += '<table>\n'; html += '<tr>\n'; html += '<td style="width: 20%;"><i class="fa fa-home"></i></td>\n'; html += '<td style="width: 40%;">Diện tích </td>\n'; html += '<td style="width: 40%;">'+value.sqft+'</td>\n'; html += '</tr>\n'; html += '<tr>\n'; html += '<td><i class="fa fa-bed"></i></td>\n'; html += '<td>Phòng ngủ </td>\n'; html += '<td>'+value.user+'</td>\n'; html += '</tr>\n'; html += '<tr>\n'; html += '<td><i class="fa fa-calendar"></i></td>\n'; html += '<td>Ngày đăng </td>\n'; html += '<td>'+value.date+'</td>\n'; html += '</tr>\n'; html += '</table>\n'; html += '<p class="content">'+value.content+'</p>\n'; html += '</div>\n'; html += '<div class="modal-footer">\n'; html += '<a class="btn btn-succes" target="_blank" href="'+value.link+'">Xem</a>\n'; html += '</div>\n'; html += '</div>\n'; createMarker(new google.maps.LatLng(value.latitude, value.longitude), i, html, value.price, value._class, value.link); i = i + 1; } }); var image = baseURL + 'frontend/images/icon-map.png'; marker = new MarkerWithLabel({ position: new google.maps.LatLng( latitude, longitude ), map: map, icon: image, zIndex: -9, optimized: false, }); markers.push(marker); jQuery('#basic').sly('reload'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setInfowindowMarkup(info) {\n return '<h4>'+ info['name'] +'</h4>' +\n '<p>'+ info['street'] + ' ' + info['city'] + ' ' + info['state'] + '</p>';\n}", "function modifyInfoWindowCss() {\n\tvar c = document.querySelector(\".gm-style-iw\");\n\n\t//these lines change the right and width css e...
[ "0.75189227", "0.7462796", "0.72227335", "0.7085148", "0.69793844", "0.69731957", "0.69239324", "0.69016284", "0.68652046", "0.68544126", "0.68542325", "0.68365407", "0.68193793", "0.68162847", "0.68126047", "0.68051314", "0.67933226", "0.6792738", "0.6780027", "0.67756647", ...
0.0
-1
Bias the autocomplete object to the user's geographical location, as supplied by the browser's 'navigator.geolocation' object.
function geolocate() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(function(position) { var geolocation = { lat: position.coords.latitude, lng: position.coords.longitude }; var circle = new google.maps.Circle({ center: geolocation, radius: position.coords.accuracy }); autocomplete.setBounds(circle.getBounds()); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "biasAutocompleteLocation () {\n if (this.enableGeolocation) {\n this.updateGeolocation((geolocation, position) => {\n let circle = new google.maps.Circle({\n center: geolocation,\n radius: position.coords...
[ "0.75768244", "0.71500534", "0.7034972", "0.6981597", "0.6909035", "0.6877536", "0.6877536", "0.68604773", "0.6839155", "0.68207216", "0.67982835", "0.67982835", "0.67982835", "0.67975265", "0.67975265", "0.67974573", "0.6784004", "0.67660946", "0.67501795", "0.67501795", "0....
0.6729638
25
DISPLAY HAIKU ON WEBSITE
generate() { this.post = document.createElement("div"); this.post.setAttribute("id", "haiku"+this.id); this.post.setAttribute("class", "posts " + this.gridClass); let postElements = []; let post_header = document.createElement("div"); post_header.setAttribute("class", "post-header"); post_header.setAttribute("style", "background-image: url('../uploads/background/" + this.background + "');"); let posts_haiku = document.createElement("div"); posts_haiku.setAttribute("class", "posts-haiku"); let post_haiku = document.createElement("div"); post_haiku.setAttribute("class", "post-haiku"); post_haiku.innerHTML = this.content; posts_haiku.appendChild(post_haiku); post_header.appendChild(posts_haiku); postElements.push(post_header); if(this.contentNative != "NO") { let lang_switch = document.createElement("div"); lang_switch.setAttribute("class", "lang-switch"); let lang_switcher = document.createElement("label"); lang_switcher.setAttribute("class", "lang-switcher"); let lang_input = document.createElement("input"); lang_input.setAttribute("type", "checkbox"); lang_input.setAttribute("class", "language-value"); let lang_slider = document.createElement("span"); lang_slider.setAttribute("class", "lang-slider"); lang_switcher.appendChild(lang_input); lang_switcher.appendChild(lang_slider); lang_switch.appendChild(lang_switcher); postElements.push(lang_switch); } let post_nav = document.createElement("div"); post_nav.setAttribute("class", "post-nav"); var post_nav_dot = document.createElement("div"); post_nav_dot.setAttribute("class", "post-nav-dot"); post_nav.appendChild(post_nav_dot); let post_nav_handwriting = document.createElement("div"); post_nav_handwriting.setAttribute("class", "post-nav-handwriting"); post_nav_handwriting.setAttribute("id", "post-nav-handwriting"); post_nav_handwriting.setAttribute("style", "background-image: url(../uploads/handwriting/"+ this.handwriting +")"); let post_nav_handwriting_close = document.createElement("div"); post_nav_handwriting_close.setAttribute("class", "post-nav-handwriting-close"); post_nav_handwriting_close.setAttribute("id", "post-nav-handwriting-close"); post_nav_handwriting.appendChild(post_nav_handwriting_close); post_nav.appendChild(post_nav_handwriting); var post_nav_sub = document.createElement("div"); post_nav_sub.setAttribute("class", "post-nav-sub"); let options = ["Handwriting", "Report"]; if(this.loggedIn == true) options = ["Handwriting", "Edit", "Delete"]; options.forEach(option => { let post_nav_sub_option = document.createElement("div"); post_nav_sub_option.setAttribute("class", "post-nav-sub-option"); post_nav_sub_option.textContent = option; post_nav_sub.appendChild(post_nav_sub_option); }); post_nav.appendChild(post_nav_sub); postElements.push(post_nav); let post_footer = document.createElement('div'); post_footer.setAttribute("class", "post-footer"); let post_author = document.createElement('div'); post_author.setAttribute("class", "post-author"); post_author.textContent = this.authorName; post_footer.appendChild(post_author); let post_country = document.createElement('div'); post_country.setAttribute("class", "post-country"); post_country.textContent = this.authorCountry; post_footer.appendChild(post_country); let post_like = document.createElement('div'); post_like.setAttribute("class", "post-like"); if(this.likeStatus == true) post_like.style.backgroundImage = "url('img/icons/heart_full_normal.svg')"; let post_like_counter = document.createElement('span'); post_like_counter.textContent = this.likes; post_like.appendChild(post_like_counter); post_footer.appendChild(post_like); postElements.push(post_footer); postElements.forEach(element => { this.post.appendChild(element); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createHaiku () {\n outputHaiku();\n }", "function outputHaiku () {\n var start = '<p>&gt;&gt; ';\n var end = '</p><hr/>';\n\n // Turn off button function while working:\n unbindEventHandlers();\n\n // Append a new poem to the output window, calling the haiku API method:\n $('#outpu...
[ "0.6880327", "0.5804156", "0.5489704", "0.53743845", "0.5319809", "0.5255089", "0.517453", "0.51510435", "0.5038686", "0.5033053", "0.4988563", "0.49569926", "0.49349216", "0.49086455", "0.48765478", "0.48379108", "0.480791", "0.47908065", "0.47840333", "0.47663835", "0.47653...
0.0
-1
LIKE OR DISLIKE HAIKU, DEPENDS ON CURRENT LIKE STATUS
likeOrdislike() { const dbChange = new XMLHttpRequest; dbChange.onreadystatechange = () => { if (dbChange.readyState == 4 && dbChange.status == 200) { const result = JSON.parse(dbChange.responseText); if(result[0] == true) { const icon = document.querySelector("#haiku"+this.id+" .post-like"); switch(this.likeStatus) { case true: { this.likeStatus = false; this.likes--; icon.style.backgroundImage = "url('img/icons/heart_normal.svg')"; saveLikesData(this.id, "remove"); break; } case false: { this.likeStatus = true; this.likes++; icon.style.backgroundImage = "url('img/icons/heart_full_normal.svg')"; saveLikesData(this.id, "add"); break; } } document.querySelector("#haiku"+this.id+" .post-like span").textContent = this.likes; } showCommunicate(result); } }; dbChange.open("POST", "../resources/haiku_like.php", true); dbChange.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); if(this.likeStatus == true) dbChange.send("like=false&hid="+this.id); else dbChange.send("like=true&hid="+this.id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkLIKE()\n\t\t{\n\t\t\t db_connection.query(query, function(err, result)\n\t \t\t{\n\t \t\t\tif (err) \n\t \t\t\t{\n\t \t\t\t\tres.send(\"A database error occurred: \" + err);\n\t \t\t\t}\n\t \t\t\telse\n\t \t\t\t{\n\t \t\t\t\tif (result.length < 1)\n\t \t\t\t\t{\n\t \t\t\t\t\taddLIKE();\n\t \t\t\t\t}\...
[ "0.6668786", "0.6520516", "0.54066104", "0.5209519", "0.51465327", "0.49282894", "0.47131824", "0.46957508", "0.46890873", "0.46882218", "0.46877024", "0.4685029", "0.46770513", "0.46724275", "0.46634877", "0.46395558", "0.4604136", "0.4587301", "0.45797825", "0.4569413", "0....
0.0
-1
import Video from "./SaranyuPlayer/Video";
function App() { return ( <span> {/* <VideoPlayer src="https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4" /> */} <SaranyuVideoPlayer /> {/* <Video /> */} </span> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function VideoPlayer(){}", "function onPlayerReady(event) {\n //event.target.playVideo();\n}", "function onPlayerReady(event) {\n //event.target.playVideo();\n}", "function onPlayerReady(event) {\r\n //event.target.playVideo();\r\n}", "function onPlayerReady(event) {\nevent.target.playVideo();\n}", ...
[ "0.67883414", "0.628995", "0.628995", "0.626998", "0.62494785", "0.62154454", "0.6121657", "0.6107251", "0.6103174", "0.6102647", "0.60809976", "0.60392433", "0.6021456", "0.60100764", "0.5986119", "0.5975372", "0.5967229", "0.59636736", "0.5937823", "0.5931005", "0.5924925",...
0.7422757
0
/ / This cheeky function just grabs the first part of the url after the first forward slash It will return just the 'v1' or 'v5' depending on what is passed to it This means there is no need for duplicate code for each iteration oh and it only works up to to v9
function getVersion(a) { var secondBracket = a.url.indexOf('/', 1); return a.url.substring(1, secondBracket) || "v1"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFirstPart(url) {\n var indexOfTS = url.indexOf(\"//\");\n if(indexOfTS==-1) {\n return url.split(\"/\")[0];\n }\n else {\n var fp = url.substring(indexOfTS+2);\n ...
[ "0.629994", "0.6248497", "0.6241973", "0.6241973", "0.6169043", "0.5998651", "0.58641255", "0.5807509", "0.577553", "0.57436085", "0.573082", "0.57080716", "0.5697199", "0.56947345", "0.56690013", "0.5661327", "0.5617613", "0.560411", "0.55708545", "0.5549006", "0.55392975", ...
0.74001163
0
Here is a helper function to populate info windows
function populateInfoWindow(marker, infowindow) { // Check to make sure the infowindow is not already opened on this marker. if (infowindow.marker != marker) { infowindow.marker = marker; infowindow.setContent('<div>' + marker.title + '</div>'); infowindow.open(map, marker); // Make sure the marker property is cleared if the infowindow is closed. infowindow.addListener('closeclick', function() { infowindow.marker = null; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setInfoWindowContents() {\n for (const store of brewData) {\n coordObj.lat = store.latitude;\n coordObj.lng = store.longitude;\n createMarker(store, coordObj);\n\n loc = new google.maps.LatLng(marker.position.lat(), marker.position.lng());\n bounds.extend(loc);\n\n hours =...
[ "0.70738375", "0.7036141", "0.70106614", "0.6887406", "0.6834321", "0.67894465", "0.67829996", "0.67723346", "0.66904205", "0.6652281", "0.6643724", "0.6637937", "0.6592185", "0.6585021", "0.6573603", "0.654398", "0.6534161", "0.6527184", "0.6511927", "0.6489387", "0.6471036"...
0.6472697
20
This function will loop through the markers array and display them all.
function showListings() { var bounds = new google.maps.LatLngBounds(); // Extend the boundaries of the map for each marker and display the marker for (var i = 0; i < markers.length; i++) { markers[i].setMap(map); bounds.extend(markers[i].position); } map.fitBounds(bounds); map.setCenter(markers[0].location) var mapOptions = {styles: mapStyles.default} map.setOptions(mapOptions); map.setZoom(14); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showMarkers (marker_array, map) {\n for (var j in marker_array) {\n marker_array[j].marker.setMap(map);\n }\n}", "function showMarkers(markers) {\n for (var i = 0; i < markers.length; i++) {\n addMarker(markers[i]);\n }\n }", "function drawAllMarkers(){\n\tfor(...
[ "0.8040027", "0.80266863", "0.79570055", "0.79342085", "0.7777212", "0.7777212", "0.7773515", "0.77402323", "0.7708924", "0.7641455", "0.7548494", "0.75341374", "0.7511257", "0.74889493", "0.74577504", "0.74266666", "0.74018806", "0.7395818", "0.7395818", "0.7391396", "0.7390...
0.0
-1
This function will loop through the listings and hide them all.
function hideListings() { for (var i = 0; i < markers.length; i++) { markers[i].setMap(null); var bounds = new google.maps.LatLngBounds(); bounds.extend({lat:52.515919, lng:13.454574}); map.fitBounds(bounds); map.setZoom(13); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideListings() {\n for (var z = 0; z < markers.length; z++) {\n markers[z].setMap(null);\n }\n }", "function hideListings() {\r\n for (var i = 0; i < markers.length; i++) {\r\n markers[i].setMap(null);\r\n }\r\n }", "function hideListings() {\n ...
[ "0.75084364", "0.73898536", "0.7083239", "0.7083239", "0.7083239", "0.69783634", "0.696466", "0.6868263", "0.68675905", "0.6838958", "0.68072605", "0.6697919", "0.6673561", "0.6646163", "0.66455066", "0.66282815", "0.6608529", "0.6577435", "0.6565506", "0.65653145", "0.655099...
0.6837366
10
Event on button closeclick
function zoomToArea() { // Initialize the geocoder. var geocoder = new google.maps.Geocoder(); // Get the address or place that the user entered. var address = document.getElementById('address-input').value; // Make sure the address isn't blank. if (address == '') { window.alert('You must enter an area, or address.'); } else { // Geocode the address/area entered to get the center. Then, center the map // on it and zoom in geocoder.geocode( { address: address, componentRestrictions: {locality: 'Berlin'} }, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var position=results[0].geometry.location; var title=address; var marker=new google.maps.Marker({ position:position, title:title, animation:google.maps.Animation.DROP }); marker.addListener('click',function(){ populateInfoWindow(this,largeInfoWindow); }) markers.push(marker); showListings(); map.setCenter(results[0].geometry.location); map.setZoom(15); } else { window.alert('We could not find that location - try entering a more' + ' specific place.'); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_handleCloseClick() {\n\t\tthis.close();\n\t}", "function handleCloseClick(){\n handleClose()\n }", "function onCloseBtnClick() {\n ui.toggleClosePopup();\n }", "_onCloseButtonTap() {\n this.fireDataEvent(\"close\", this);\n }", "function onCloseButtonClick(){\n\t\tt.hide();\n\t...
[ "0.81372964", "0.8077299", "0.8055487", "0.8003884", "0.77704084", "0.7613444", "0.75654536", "0.75609225", "0.745435", "0.743126", "0.740943", "0.7404588", "0.739827", "0.73932004", "0.73738915", "0.73310226", "0.7314271", "0.72916704", "0.725016", "0.7228566", "0.72230667",...
0.0
-1
Defines a new person, their attributes, and their functions
function pawn(id, x, y, initialAngle) { //General characteristics this.id = id; this.width = 10; this.height = 10; this.color = "grey"; //Movement attributes this.x = x; this.y = y; this.speed = 1; //Angle is in radians. Neat. this.angle = initialAngle; //Health attributes this.health = "Healthy"; this.recoveryTime = 0; this.update = function() { ctx = cityArea.context; ctx.fillStyle = this.color; ctx.fillRect(this.x, this.y, this.width, this.height); //Infection status update if (this.recoveryTime > 0) { this.recoveryTime -= 1; if (this.recoveryTime == 0) { this.health = "Recovered"; } } if (this.health == "Infected") this.color = "red"; if (this.health == "Recovered") this.color = "blue"; if (this.health == "Protected") this.color = "purple"; if (this.health == "Healthy") this.color = "grey"; }, this.hitWall = function() { var collide = false; if (this.x <= 0 || this.x >= 790 || this.y <= 0 || this.y >= 390) collide = true; return collide; }, this.collideWith = function(otherobj) { var myleft = this.x; var myright = this.x + 10; var mytop = this.y; var mybottom = this.y + 10; var otherleft = otherobj.x; var otherright = otherobj.x + 10; var othertop = otherobj.y; var otherbottom = otherobj.y + 10; var collide = true; if ((mybottom < othertop) || (mytop > otherbottom) || (myright < otherleft) || (myleft > otherright)) { collide = false; } return collide; }, this.newPos = function() { this.x += this.speed * Math.sin(this.angle); this.y -= this.speed * Math.cos(this.angle); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Person(fname,lname){\n\tthis.fname = fname;\n\tthis.lname = lname;\n\tthis.create_ting = function(){\n\t\tthis.fname + this.lname ;\n\t}\n}", "function Person (){}", "function makePerson(name, age){\n var person = {};\n person.name = name;\n person.age = age;\n person.speak = function(){\n cons...
[ "0.7688492", "0.7538134", "0.7464108", "0.74461716", "0.7440062", "0.74346125", "0.73382473", "0.73341423", "0.7321965", "0.73120505", "0.7281405", "0.72570854", "0.72306174", "0.72051144", "0.7195276", "0.7195276", "0.71852493", "0.71852493", "0.71852493", "0.71852493", "0.7...
0.0
-1
Kick it all off
function startScript() { vaccinated = parseInt(document.getElementById("txtVaccinated").value); if (vaccinated >= 0 && vaccinated < 200) { cityArea.start(); popGraph.start(); initializePopulation(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "off() {\n this.mocking = false;\n this.clear();\n }", "function onDestruct () \n\t{\n\t\tself.allOff();\n\t}", "function off() {\n on[i] = false;\n finishTime = new Date().getTime();\n utregningTid();\n updateView();\n}", "off() {\n\t\tthis._lamps.off();\n\t}", "_reset()\n {\n ...
[ "0.70361555", "0.6912739", "0.68589693", "0.68545914", "0.6787951", "0.6773155", "0.6755101", "0.66357833", "0.6631631", "0.66117394", "0.6561549", "0.6540128", "0.6502704", "0.65010417", "0.6498189", "0.6484977", "0.64739746", "0.64739746", "0.64739746", "0.6431755", "0.6431...
0.0
-1
a function which renders new plots based on what is passed in
function renderPlotsType1() { new Chart(document.getElementById("line-chart"), { type: 'line', data: { labels: [1500,1600,1700,1750,1800,1850,1900,1950,1999,2050], datasets: [{ data: [86,114,106,106,107,111,133,221,783,2478], label: "Africa", borderColor: "#3e95cd", fill: false } ] }, options: { title: { display: true, text: 'World population per region (in millions)' } } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n renderPlots1D();\n renderPlots2D();\n}", "function generate_plot(args){\n var cohort_ids = [];\n //create list of actual cohort models\n for(var i in args.cohorts){\n cohort_ids.push(args.cohorts[i].cohort_id);\n }\n var plotFactory = Obje...
[ "0.66134816", "0.6451069", "0.63773733", "0.6355556", "0.6141025", "0.6090245", "0.60574174", "0.597779", "0.59466326", "0.5943686", "0.5914411", "0.59092647", "0.5820933", "0.5788699", "0.5763124", "0.5726114", "0.5703022", "0.56849223", "0.56828284", "0.56503814", "0.563071...
0.0
-1
a function which renders the dow/gold monthly change for a period of years divID is the id placeholder in the html div a function to render monthly deaths in some pandemics arguments are the id of the div and the data passed in
function renderDeathsMonthly(divId, data){ /** * {'_id': ObjectId('5ed5be86f621c1b0029d96b3'), 'Month': '2020/4', 'US_Deaths_per_100k': 21.6, 'dow_gold_change_next_month': 0.37} */ //chartData = myFunc({data}) console.log(data) Months = [] Deaths = [] data.forEach(e => { Months.push(e.Month) Deaths.push(e.US_Deaths_per_100k) }); let trace2 = { x: Months, y: Deaths, mode: 'lines+markers', type: 'scatter' }; let plotData2 = [trace2]; Plotly.newPlot(divId, plotData2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExpenseDate(purchaseData){\n\nvar expenseDate = new Date(purchaseData.date); //store the date prop in a new Date object because otherwise the call to the getFullYear method won't work and will crash the page\n\n// toLocaleString() is a built-in function that allows date objects to be parsed and output in ...
[ "0.61723626", "0.6149685", "0.6113361", "0.60393757", "0.60284746", "0.5987015", "0.5982454", "0.593505", "0.59121376", "0.584268", "0.5837797", "0.5827893", "0.5802713", "0.5801966", "0.57819754", "0.57818586", "0.577283", "0.57640415", "0.5739269", "0.57343", "0.5726877", ...
0.0
-1
TODO clear old items
renderInvitationList() { return ( <List> { this.props.invitations.map(invitation => <InvitationListItem key={invitation.id} joinChannel={this.props.joinChannel} deleteReceivedInvitation={this.props.deleteReceivedInvitation} {...invitation} />) } </List> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n this._items = {};\n }", "clear() {\n\t\t\tthis.items = []\n\t\t\tthis.saveToLocalStorage();\n\t\t}", "reset() {\n this._items = [];\n }", "refreshItems() {\n var self = this;\n self.lastQuery = null;\n\n if (self.isSetup) {\n self.addItems(self.items);\n }\n\n se...
[ "0.7485217", "0.73743623", "0.73567146", "0.7294889", "0.7196015", "0.7069311", "0.6989159", "0.67940485", "0.67940485", "0.6764755", "0.675427", "0.6753755", "0.67269295", "0.67134917", "0.6705442", "0.66676176", "0.66573215", "0.66570777", "0.6637358", "0.663179", "0.663013...
0.0
-1
Resize the JS9 window
function resizeJS9() { let wWidth = window.innerWidth / 1.2; let wHeight = window.innerHeight - 125; $('#JS9-canvas').css('margin-left', (window.innerWidth-wWidth)/2+'px'); $('.JS9Menubar').attr('data-width', wWidth); $('.JS9Toolbar').attr('data-width', wWidth); $('.JS9Toolbar').attr('data-height', '30px'); $('.JS9').attr('data-width', wWidth); $('.JS9').attr('data-height', wHeight); $('.JS9Colorbar').attr('data-width', wWidth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resize() {\n\twindowWidth = window.innerWidth;\n\twindowHeight = window.innerHeight;\n renderer.setSize(window.innerWidth,window.innerHeight);\n}", "function resize() {\n\twindowWidth = window.innerWidth;\n\twindowHeight = window.innerHeight;\n renderer.setSize(window.innerWidth,window.innerHeight);\n...
[ "0.7795323", "0.7795323", "0.7631124", "0.74740404", "0.74190325", "0.7363547", "0.7343962", "0.73046345", "0.7256016", "0.72354543", "0.7213926", "0.7203825", "0.7202177", "0.7186704", "0.71828043", "0.7175263", "0.71735", "0.71721643", "0.71721643", "0.7162295", "0.7162295"...
0.7360884
6
Resize JS9 in a div (id must be JS9canvas)
function resizeJS9InDiv() { let wWidth = $('#JS9-canvas').width(); let wHeight = window.innerHeight - 200; $('.JS9Menubar').attr('data-width', wWidth); $('.JS9Toolbar').attr('data-width', wWidth); $('.JS9Toolbar').attr('data-height', '30px'); $('.JS9').attr('data-width', wWidth); $('.JS9').attr('data-height', wHeight); $('.JS9Colorbar').attr('data-width', wWidth); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resizeJS9() {\n let wWidth = window.innerWidth / 1.2;\n let wHeight = window.innerHeight - 125;\n $('#JS9-canvas').css('margin-left', (window.innerWidth-wWidth)/2+'px');\n $('.JS9Menubar').attr('data-width', wWidth);\n $('.JS9Toolbar').attr('data-width', wWidth);\n $('.JS9Toolbar').attr(...
[ "0.730455", "0.68586385", "0.6810608", "0.67658746", "0.67411005", "0.67411005", "0.67367375", "0.6717239", "0.66893893", "0.6601592", "0.6598368", "0.65592873", "0.64905846", "0.6427998", "0.6384384", "0.6364894", "0.63329726", "0.6315134", "0.6311764", "0.6278579", "0.62772...
0.77290565
0
this toggles the visibility of our parent permission fields depending on the current selected value of the underAge field
function toggleFields() { if ($("#firstName").val() < 100) $("#formField2").show(); if ($("#middleName").val() > 0) $("#formField3").show(); else return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleAge (check) {\n let c = check\n if (c === true) {\n $('.aging').show()\n } else if (c === false) {\n $('.aging').hide()\n } else {\n c = !$('.aging').is(':visible')\n c ? $('.aging').show() : $('.aging').hide()\n }\n remote.Menu.getApplicationMenu().getMenuItemById('menu-task-age')...
[ "0.62752753", "0.58078927", "0.5662401", "0.56078213", "0.5468041", "0.53542644", "0.5337607", "0.5194896", "0.5190862", "0.5188004", "0.5187058", "0.51732653", "0.5163104", "0.51369697", "0.51289403", "0.5121273", "0.5087605", "0.5085158", "0.5084953", "0.5079718", "0.506835...
0.5126527
15
dynamically adjust heights of all regions
function adjustRowRegionsHeights() { // handle region areas for upper rows if ($(".upperRow").length) { var rows = $(".regions").find(".upperRow"); rows.each(adjustUpperRowRegionsHeight); } // handle region areas for the bottom row if ($(".bottomRow").length) { var row = $(".regions").find(".bottomRow"); adjustBottomRowRegionsHeight(row) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function adjustRowRegionsHeights() {\n // handle region areas for upper rows\n if ($(\".upperRow\").length) {\n var rows = $(\".regions\").find(\".upperRow\");\n rows.each(adjustUpperRowRegionsHeight);\n }\n\n // hand...
[ "0.767654", "0.6946048", "0.6924941", "0.6866327", "0.68433464", "0.68425596", "0.6821279", "0.68204063", "0.6752954", "0.6700764", "0.6660623", "0.6592755", "0.64511824", "0.64098984", "0.64033854", "0.636346", "0.63422424", "0.6335405", "0.63190836", "0.6309503", "0.6297684...
0.76559716
1
adjusts the paddingbottom value of all regions in bottom row to either fill the empty space or act as an upper row
function adjustBottomRowRegionsHeight(row) { resetRowsRegionsHeight(row); var bodyHeight = $('body').outerHeight(); var windowHeight = $(window).height(); // Instances where no scroll bar currently exists if (windowHeight >= bodyHeight) { var pageHeight = $("#pageContent").outerHeight(); var headerHeight = bodyHeight - pageHeight; var upperRegionsMaxHeights = 0; if ($(".upperRow").length) { var rows = $(".regions").find(".upperRow"); for (var x = 0; x < rows.length; x++) { var rowMaxHeight = getRowRegionsMaxHeight(rows.get(x)); upperRegionsMaxHeights = upperRegionsMaxHeights + rowMaxHeight; } } // determine maximum size possible for bottom region // 50 px of buffer also removed to prevent scroll-bar from appearing in any cases var bottomPadding = (windowHeight - 50) - (upperRegionsMaxHeights + headerHeight); setRowsRegionsHeight(row, bottomPadding); } // Instances where scroll bar currently exists, can default to upper row behavior else { adjustUpperRowRegionsHeight(row); } // refresh sortables cached positions getNonLockedRegions().sortable("refreshPositions"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get(x)).css(\"paddi...
[ "0.65102696", "0.64933133", "0.64693046", "0.6463907", "0.64283013", "0.61329925", "0.59519887", "0.594856", "0.5911237", "0.5834037", "0.58103055", "0.57260495", "0.56416744", "0.5638245", "0.5634252", "0.56075853", "0.56075853", "0.5583646", "0.5534791", "0.5528559", "0.552...
0.6462671
4
adjusts the paddingbottom value of all regions in upper rows to match the value of the tallest region in the row
function adjustUpperRowRegionsHeight(row) { // when called by each, first argument is a number instead of a row value var row = (typeof row === 'number') ? $(this) : row; resetRowsRegionsHeight(row); // sets total region height to the height of tallest region setRowsRegionsHeight(row, getRowRegionsMaxHeight(row)); // refresh sortables cached positions getNonLockedRegions().sortable("refreshPositions"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x+...
[ "0.6734675", "0.67031413", "0.6612243", "0.6594719", "0.65137684", "0.63773066", "0.63694626", "0.611576", "0.6112622", "0.6062946", "0.6025898", "0.5958627", "0.5836756", "0.5812848", "0.5802763", "0.56736296", "0.566447", "0.5613556", "0.5571031", "0.55584055", "0.55314", ...
0.59071386
12
Returns the height of the tallest region in row, minimum 100 px
function getRowRegionsMaxHeight(row) { var rowChildren = $(row).children(); var maxHeight = 100; for (var x = 0; x < rowChildren.length; x++) { if ($(rowChildren.get(x)).outerHeight() > maxHeight) { maxHeight = $(rowChildren.get(x)).outerHeight(); } } return maxHeight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get minHeight() {}", "function getRowRegionsMaxHeight(row) {\n var rowChildren = $(row).children();\n var maxHeight = 100;\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() > maxHeight) {\n ...
[ "0.7309251", "0.720936", "0.7061328", "0.6928029", "0.68662304", "0.6832829", "0.67522633", "0.6693658", "0.66890943", "0.6603465", "0.65717226", "0.6451369", "0.63987803", "0.6397883", "0.6378977", "0.63679737", "0.6314717", "0.62977296", "0.62957376", "0.6290153", "0.626327...
0.722758
1
Restores the paddingbottom value to the original for all regions in given row
function resetRowsRegionsHeight(row) { // when called by each, first argument is a number instead of a row value var row = (typeof row === 'number') ? $(this) : row; var rowChildren = $(row).children(); for (var x = 0; x < rowChildren.length; x++) { // reset to 5, the initial value before dragging $(rowChildren.get(x)).css("padding-bottom", 5); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetRowsRegionsHeight(row) {\n // when called by each, first argument is a number instead of a row value\n var row = (typeof row === 'number') ? $(this) : row;\n\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x+...
[ "0.74660003", "0.6997538", "0.6979533", "0.66051126", "0.6583506", "0.620614", "0.6187582", "0.6145343", "0.59674925", "0.5963164", "0.59057003", "0.5684015", "0.56322247", "0.55764294", "0.5542175", "0.5515858", "0.54533577", "0.5434285", "0.54274756", "0.54113954", "0.53829...
0.7457637
1
Sets the paddingbottom value, so that the total height is the given value for all regions in given row
function setRowsRegionsHeight(row, maxHeight) { var rowChildren = $(row).children(); for (var x = 0; x < rowChildren.length; x++) { if ($(rowChildren.get(x)).outerHeight() != maxHeight) { var defaultPadding = parseInt($(rowChildren.get(x)).css("padding-bottom").replace("px", "")); $(rowChildren.get(x)).css("padding-bottom", (defaultPadding + maxHeight - $(rowChildren.get(x)).outerHeight())); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setRowsRegionsHeight(row, maxHeight) {\n var rowChildren = $(row).children();\n for (var x = 0; x < rowChildren.length; x++) {\n if ($(rowChildren.get(x)).outerHeight() != maxHeight) {\n var defaultPadding = parseInt($(rowChildren.get...
[ "0.68334526", "0.6578797", "0.6561409", "0.630481", "0.6295874", "0.5793617", "0.56938", "0.5602352", "0.5601591", "0.55623657", "0.55230147", "0.55177695", "0.54822874", "0.54765254", "0.5461051", "0.5428732", "0.5417098", "0.5392952", "0.53739333", "0.5355399", "0.5340248",...
0.6856896
0
Takes care of the UI part of the widget rendering. Depends heavily on the HTML structure
function initWidgetUI() { $(".widget-wrapper").each(function () { var widgetId = extractObjectIdFromElementId($(this).attr("id")); styleWidgetButtons(widgetId); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initHtml () {\n\t\t\t$container.addClass(\"ibm-widget-processed\");\n\n\t\t\tif (config.type === \"simple\") {\n\t\t\t\t$hideables.addClass(\"ibm-hide\");\n\t\t\t}\n\n\t\t\tif (config.type === \"panel\") {\n\t\t\t\t$headings.removeClass(\"ibm-active\");\n\t\t\t\t$containers.slideUp(slideupSpeed);\n\t\t\t}...
[ "0.70765686", "0.6610348", "0.656258", "0.6483031", "0.6406047", "0.63583994", "0.62854594", "0.62382495", "0.6182108", "0.61615986", "0.61559427", "0.6122311", "0.61053365", "0.6097434", "0.6077922", "0.6069247", "0.6061592", "0.603879", "0.60316366", "0.6028217", "0.6028217...
0.6849971
1