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
const inquirer = require("inquirer");
function init(){ employeeData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEngineer() {\n\n inquirer \n .prompt([\n \n\n ])\n .then(answers =>{\n \n })\n\n}", "function getIntern() {\n\n inquirer \n .prompt([\n \n\n ])\n .then(answers =>{\n \n })\n\n}", "function mai...
[ "0.7869669", "0.76649946", "0.7618564", "0.75261885", "0.73980665", "0.72931045", "0.7265764", "0.71195155", "0.71069217", "0.71025544", "0.70956725", "0.70956725", "0.7090407", "0.70463085", "0.7024687", "0.70238453", "0.70059633", "0.6925302", "0.6917041", "0.68763286", "0....
0.0
-1
endregion region set controls state
_onSetIsLoading(status) { this.setState( update(this.state, { controls: { isLoading: { $set: status }, }, }) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setControlValues() {\n document.getElementById('highlight1').value = Common.Settings.Highlight1;\n document.getElementById('highlight2').value = Common.Settings.Highlight2;\n document.getElementById('highlight3').value = Common.Settings.Highlight3;\n setOption(document.getElementById('menuState'), Com...
[ "0.68861496", "0.6846803", "0.6661408", "0.64162815", "0.63930637", "0.6381234", "0.62064946", "0.61888", "0.61865354", "0.6165685", "0.6138722", "0.6051992", "0.60489887", "0.6047675", "0.60473883", "0.6015784", "0.6002894", "0.5997569", "0.59690654", "0.596625", "0.5946049"...
0.0
-1
Ajax action to api rest
function crear_planentrenamiento(){ $.ajax({ type : "POST", url : "api/planentrenamiento/crear", data : $('#crear_plan_form').serialize(), success : function(json) { alert(json.success); alert(json.message); if(json.success == 1) { setTimeout(function(){ location.reload(); },1000); } }, error : function(xhr, status) { alert('Ha ocurrido un problema.'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function post_action(obj){\r\n$.ajax({\r\n type:\"post\",\r\n url:\"https://5ef88b09ae8ccb0016fd725b.mockapi.io/data_to_do\",\r\n data:obj\r\n})\r\n}", "function ajax() {\r\n return $.ajax({\r\n url: 'http://127.0.0.1:5000/send_url',\r\n data: {\r\n ...
[ "0.6569265", "0.65426135", "0.64396966", "0.6433782", "0.64160824", "0.6371046", "0.6358922", "0.6345635", "0.6319251", "0.62896657", "0.62871003", "0.628553", "0.62767214", "0.62507397", "0.6250644", "0.62480867", "0.62454826", "0.622256", "0.6203932", "0.6196932", "0.619585...
0.0
-1
Write a function named greaterNum that: takes 2 arguments, both numbers. returns whichever number is the greater (higher) number. Test the function 2 times with different number pairs
function greaterNum(int1, int2){ if (int1, int2){ alert(int1 + " is the greater number!") } else{ alert(int2 + " is the greater number!") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function greaterNum(num1, num2) {\n if(num1 > num2){\n return num1;\n }\n else {\n return num2;\n }\n}", "function isBigger(firstNum, secondNum) {\r\n\treturn firstNum > secondNum;\r\n}", "function greaterThan (num1, num2) {\n // find out if second parameter is greater than first\n if (num2 > n...
[ "0.84525466", "0.8178372", "0.80397034", "0.78884226", "0.78743947", "0.7868445", "0.78683835", "0.7860759", "0.78140056", "0.78120476", "0.7779457", "0.77123344", "0.7577041", "0.75673634", "0.7559307", "0.75285834", "0.7483568", "0.74729633", "0.74680114", "0.74516636", "0....
0.76139
12
Hook para utilizar os metodos de ciclo de vida dos componentes: useEffect: Usado para DidMount DidUptade WillUnMount
function App() { /** useState() * [state, setState] = useState(estado inicial); */ const [repositorio, setRepositorio] = useState([]); //Equivale ao ComponentDidMount - executado apenas uma vez, na criação do componente //Muito utilizado para carregar dados de uma api useEffect(() => { const fetchData = async () => { const response = await fetch('https://api.github.com/users/Iann-rst/repos'); const data = await response.json(); setRepositorio(data); } fetchData(); }, []); //Equivale ao ComponentDidUpdate - disparar toda vez que a variável 'repositorio' mudar useEffect(()=>{ const filtered = repositorio.filter(repo => repo.favorite); document.title = `Você tem ${filtered.length} favoritos`; }, [repositorio]); function handleFavorite(id){ const novoRepositorio = repositorio.map(repo => { return repo.id === id ? {...repo, favorite: !repo.favorite} : repo }) setRepositorio(novoRepositorio); } return ( <> <ul> {repositorio.map(repo => ( <li key = {repo.id}>{repo.name} {repo.favorite && <span> (Favorito) </span>} <button onClick={() => handleFavorite(repo.id)}>Tornar Favorito</button> </li> ))} </ul> </> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useDidUpdateEffect(fn, inputs) {\n const didMountRef = React.useRef(false);\n React.useEffect(() => {\n if (didMountRef.current) fn();else didMountRef.current = true;\n }, inputs);\n}", "function useComponentDidMountWithLayout(callback) {\n useLayoutEffect(callback, []);\n}", "onComponentMount(...
[ "0.6134732", "0.6007351", "0.5890993", "0.58902526", "0.58073825", "0.5802395", "0.57612795", "0.57495606", "0.5726307", "0.57191217", "0.57180566", "0.5708187", "0.5704507", "0.56997055", "0.5693707", "0.5691038", "0.5678815", "0.56785023", "0.567761", "0.5657456", "0.563823...
0.5883528
4
Wrapper around core.getInput for inputs that always have a value. Also see getOptionalInput. This allows us to get stronger type checking of required/optional inputs and make behaviour more consistent between actions and the runner.
function getRequiredInput(name) { return core.getInput(name, { required: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getOptionalInput(name) {\n const value = core.getInput(name);\n return value.length > 0 ? value : undefined;\n}", "getInputVal(inp) {\r\n return inp.value;\r\n }", "function getInput(){\n let userInput = inputField.value\n return userInput\n}", "__getBypassedInput(input) {\n if ...
[ "0.63989705", "0.62055576", "0.61045855", "0.60059166", "0.59358", "0.59203", "0.5895129", "0.58578235", "0.58578235", "0.58578235", "0.58578235", "0.5847491", "0.5783075", "0.57829684", "0.5690116", "0.56746393", "0.56380635", "0.5625583", "0.5625583", "0.5623084", "0.561438...
0.588398
7
Wrapper around core.getInput that converts empty inputs to undefined. Also see getRequiredInput. This allows us to get stronger type checking of required/optional inputs and make behaviour more consistent between actions and the runner.
function getOptionalInput(name) { const value = core.getInput(name); return value.length > 0 ? value : undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filterInput(input) {\n if (!input) {\n return this.opt.default == null ? '' : this.opt.default;\n }\n\n return input;\n }", "filterInput(input) {\n if (!input) {\n return this.opt.default == null ? '' : this.opt.default;\n }\n\n return input;\n }", "filterInput(input) {\n if (!...
[ "0.6222355", "0.6222355", "0.6222355", "0.6222355", "0.60148025", "0.596077", "0.5873272", "0.5797735", "0.5786374", "0.57449204", "0.57005686", "0.56924444", "0.56924444", "0.56924444", "0.56924444", "0.56924444", "0.56924444", "0.56924444", "0.56924444", "0.56924444", "0.56...
0.664813
0
Get an environment parameter, but throw an error if it is not set.
function getRequiredEnvParam(paramName) { const value = process.env[paramName]; if (value === undefined || value.length === 0) { throw new Error(`${paramName} environment variable must be set`); } core.debug(`${paramName}=${value}`); return value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEnvVariable(params){\n let service;\n try{\n\n return process.env[params] || config[params];\n }\n catch(error){\n console.log(`getEnvVariable Could not get environment variable ${params} error- ${error}`);\n return null;\n }\n}", "function getparameter (param) // string\n{\n if (ty...
[ "0.6720966", "0.5845765", "0.5814944", "0.57505673", "0.5702291", "0.5702291", "0.560473", "0.55321205", "0.55314416", "0.5511907", "0.5448415", "0.5433357", "0.5411888", "0.5387748", "0.5352416", "0.53373533", "0.53338695", "0.52976185", "0.52976185", "0.52976185", "0.529032...
0.7499047
0
Ensures all required environment variables are set in the context of a local run.
function prepareLocalRunEnvironment() { if (!util_1.isLocalRun()) { return; } core.debug("Action is running locally."); if (!process.env.GITHUB_JOB) { core.exportVariable("GITHUB_JOB", "UNKNOWN-JOB"); } if (!process.env.CODEQL_ACTION_ANALYSIS_KEY) { core.exportVariable("CODEQL_ACTION_ANALYSIS_KEY", `LOCAL-RUN:${process.env.GITHUB_JOB}`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateRequiredEnvVars (){\n\tvar environmentReady = true;\n\tif (!process.env.REDIS_HOST){\n\t\tconsole.error(\"Redis host is missing!\");\n\t\tenvironmentReady = false;\n\t}\n\tif (!process.env.REDIS_PORT){\n console.error(\"Redis port is missing!\");\n\t\tenvironmentReady = false;\n\t}\n\tif (!...
[ "0.6784639", "0.6693313", "0.6602451", "0.6415556", "0.6273212", "0.6230218", "0.61898756", "0.60927814", "0.6089256", "0.6065677", "0.6041769", "0.603773", "0.6032633", "0.5871561", "0.5837289", "0.58201385", "0.5727231", "0.5724322", "0.5688387", "0.5627412", "0.5597465", ...
0.7160864
0
Get the path of the currently executing workflow.
async function getWorkflowPath() { const repo_nwo = getRequiredEnvParam("GITHUB_REPOSITORY").split("/"); const owner = repo_nwo[0]; const repo = repo_nwo[1]; const run_id = Number(getRequiredEnvParam("GITHUB_RUN_ID")); const apiClient = api.getActionsApiClient(); const runsResponse = await apiClient.request("GET /repos/:owner/:repo/actions/runs/:run_id", { owner, repo, run_id, }); const workflowUrl = runsResponse.data.workflow_url; const workflowResponse = await apiClient.request(`GET ${workflowUrl}`); return workflowResponse.data.path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scriptPath() {\n try {\n return app.activeScript;\n }\n catch (e) {\n return File(e.fileName);\n }\n}", "function getCurrentPathName() {\n pathName = window.location.pathname;\n return pathName;\n }", "get path() {\n return (this.parent || this).fullpath();\n ...
[ "0.64717853", "0.6244076", "0.61718434", "0.6170338", "0.6152112", "0.61512804", "0.6040975", "0.602712", "0.59697455", "0.59402", "0.59074104", "0.5905882", "0.5879443", "0.5869277", "0.5846465", "0.58364797", "0.57940483", "0.5781402", "0.5766695", "0.5747943", "0.5744659",...
0.7490412
0
Get the workflow run ID.
function getWorkflowRunID() { const workflowRunID = parseInt(getRequiredEnvParam("GITHUB_RUN_ID"), 10); if (Number.isNaN(workflowRunID)) { throw new Error("GITHUB_RUN_ID must define a non NaN workflow run ID"); } return workflowRunID; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkRunId() {\n const ret = db.runCommand({find: \"c\", filter: {_id: 'block_test'}});\n assert.commandWorked(ret);\n\n const doc = ret[\"cursor\"][\"firstBatch\"][0];\n return doc[\"run_id\"];\n}", "function workflow_key(wf_id) {\n return `workflows:${wf_id}`;\n}", "getId() {\n r...
[ "0.611608", "0.59667814", "0.59479725", "0.5905249", "0.57958996", "0.5742932", "0.54829866", "0.5449128", "0.54331094", "0.54331094", "0.5351629", "0.53217244", "0.53162134", "0.53141344", "0.5281783", "0.528088", "0.526071", "0.5259906", "0.52409977", "0.5163769", "0.515740...
0.8112037
0
Get the analysis key paramter for the current job. This will combine the workflow path and current job name. Computing this the first time requires making requests to the github API, but after that the result will be cached.
async function getAnalysisKey() { const analysisKeyEnvVar = "CODEQL_ACTION_ANALYSIS_KEY"; let analysisKey = process.env[analysisKeyEnvVar]; if (analysisKey !== undefined) { return analysisKey; } const workflowPath = await getWorkflowPath(); const jobName = getRequiredEnvParam("GITHUB_JOB"); analysisKey = `${workflowPath}:${jobName}`; core.exportVariable(analysisKeyEnvVar, analysisKey); return analysisKey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getCurrentJobId(){\n let jobId = localStorage.getItem('JOB_VIEW_ID');\n return jobId;\n }", "function workflow_key(wf_id) {\n return `workflows:${wf_id}`;\n}", "function getKey() {\r\n\treturn (window.location.search.substr(1).split(\"=\")[1]);\r\n}", "function getKey() {\r\n\treturn...
[ "0.5378238", "0.5286659", "0.5176701", "0.5176701", "0.51040924", "0.5077268", "0.49129438", "0.49118406", "0.48445395", "0.48075265", "0.48023075", "0.47947207", "0.4781693", "0.47514236", "0.47403872", "0.47290963", "0.47226033", "0.46845457", "0.46732897", "0.46472365", "0...
0.7351301
0
Get the ref currently being analyzed.
async function getRef() { // Will be in the form "refs/heads/master" on a push event // or in the form "refs/pull/N/merge" on a pull_request event const ref = getRequiredEnvParam("GITHUB_REF"); // For pull request refs we want to detect whether the workflow // has run `git checkout HEAD^2` to analyze the 'head' ref rather // than the 'merge' ref. If so, we want to convert the ref that // we report back. const pull_ref_regex = /refs\/pull\/(\d+)\/merge/; const checkoutSha = await exports.getCommitOid(); if (pull_ref_regex.test(ref) && checkoutSha !== getRequiredEnvParam("GITHUB_SHA")) { return ref.replace(pull_ref_regex, "refs/pull/$1/head"); } else { return ref; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ref() {\n return RTG_VCF_RECORD.getRefCall();\n }", "function getReference(){\n\t\treturn this.reference;\n\t}", "get reference() {\n\t\treturn this.__reference;\n\t}", "get localReference() {\n return this.localRef;\n }", "get reference () {\n\t\treturn this._reference;\n\t}",...
[ "0.72656727", "0.70406306", "0.6600375", "0.6491458", "0.6458944", "0.6458944", "0.6454647", "0.6428868", "0.59080625", "0.5801541", "0.5779713", "0.5757195", "0.57558364", "0.57345825", "0.57246715", "0.5719484", "0.57193244", "0.56946814", "0.5646858", "0.5618602", "0.56006...
0.64211315
8
Send a status report to the code_scanning/analysis/status endpoint. Optionally checks the response from the API endpoint and sets the action as failed if the status report failed. This is only expected to be used when sending a 'starting' report. Returns whether sending the status report was successful of not.
async function sendStatusReport(statusReport, ignoreFailures) { if (getRequiredEnvParam("GITHUB_SERVER_URL") !== util_1.GITHUB_DOTCOM_URL) { core.debug("Not sending status report to GitHub Enterprise"); return true; } if (util_1.isLocalRun()) { core.debug("Not sending status report because this is a local run"); return true; } const statusReportJSON = JSON.stringify(statusReport); core.debug(`Sending status report: ${statusReportJSON}`); const nwo = getRequiredEnvParam("GITHUB_REPOSITORY"); const [owner, repo] = nwo.split("/"); const client = api.getActionsApiClient(); const statusResponse = await client.request("PUT /repos/:owner/:repo/code-scanning/analysis/status", { owner, repo, data: statusReportJSON, }); if (!ignoreFailures) { // If the status report request fails with a 403 or a 404, then this is a deliberate // message from the endpoint that the SARIF upload can be expected to fail too, // so the action should fail to avoid wasting actions minutes. // // Other failure responses (or lack thereof) could be transitory and should not // cause the action to fail. if (statusResponse.status === 403) { core.setFailed("The repo on which this action is running is not opted-in to CodeQL code scanning."); return false; } if (statusResponse.status === 404) { core.setFailed("Not authorized to used the CodeQL code scanning feature on this repo."); return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statusCheck() {\n var statusLog = document.querySelector(\".status\");\n var status = response.status;\n console.log(status);\n\n statusLog.innerHTML += status;\n }", "function sendJobStatusRequest() {\n axios_1.default\n .get(opti...
[ "0.5334401", "0.5138639", "0.49841937", "0.48747033", "0.48105115", "0.4808223", "0.48045853", "0.47958702", "0.4774266", "0.47694856", "0.47673264", "0.47513995", "0.46961942", "0.46381515", "0.46285498", "0.46240294", "0.4610947", "0.4603394", "0.4595314", "0.4593442", "0.4...
0.749072
0
delete all nonletters symbols from text using regexes
function textTrim(str) { var cleanedText = str.replace(/[,.:;\-\!?<>"@#$%^&*|/'=]/gi, '').replace(/\n/ig, ' '); return cleanedText; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrub(txt){\r\n return txt.replace(/[^a-zA-Z ]/g, \"\")\r\n }", "function cleanUp(text) {\n var i;\n var textLength = text.length;\n var char;\n var ALPHABETS = 'abcdefghijklmnopqrstuvwxyz';\n var cleanText = '';\n\n for (i = 0; i < textLength; i += 1) {\n char = text[i];\n\n ...
[ "0.7798223", "0.7383775", "0.7277069", "0.70950717", "0.6939008", "0.69011164", "0.6868809", "0.6863614", "0.6786827", "0.6784168", "0.6726024", "0.67174125", "0.66825104", "0.6614816", "0.6602294", "0.65963924", "0.6559598", "0.65533686", "0.6538364", "0.65031105", "0.649178...
0.5949461
60
share globals vars with lichess
function injectScript(file, node) { var element = document.getElementsByTagName(node)[0]; var script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); script.setAttribute('src', file); element.appendChild(script); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _____SHARED_functions_____(){}", "set UseGlobal(value) {}", "get UseGlobal() {}", "function sharingIsCaring() {\n console.log(globalVar)\n}", "function setupGlobals(secrets) {\n SECRET_KEY = secrets.secretKey;\n CLIENT_ID = secrets.clientId;\n REDIRECT_URI = secrets.redirectUri;\n}", "...
[ "0.6976374", "0.68955857", "0.67717063", "0.6611052", "0.6594208", "0.65863484", "0.65420514", "0.65121293", "0.6459385", "0.6412006", "0.6410895", "0.63933814", "0.63559383", "0.632651", "0.6317099", "0.62995976", "0.62937015", "0.6271817", "0.62130845", "0.6212552", "0.6201...
0.0
-1
Loads images from the specified provider. Arguably, not terribly secure at all...
function loadImageSource(provider) { return new Promise(function(resolve, reject) { // Temporarily grab images from redditbooru require('./js/service-connectors/' + provider + '.js', function(provider) { provider().then(function(data) { images = data; lightbox.setData(data); imageGrid.render(images); }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadImages() {\n if (this._queue.length > 0) {\n let img = new Image();\n let src = this._queue.pop();\n\n let name = src.slice(src.lastIndexOf('/') + 1);\n img.src = src;\n img.onload = (function() {\n this.loadImages();\n }).bind(this);\n this.images[name] = img;\n ...
[ "0.61578953", "0.6154271", "0.6081619", "0.59264785", "0.58892906", "0.58532465", "0.58039707", "0.5798871", "0.57924664", "0.5780348", "0.5766889", "0.5754581", "0.5739024", "0.5737186", "0.5735025", "0.5702074", "0.5700421", "0.5667828", "0.5638439", "0.56173474", "0.561240...
0.7778581
0
index page article scroll In 20180127
function initArticleScroll(){ // get window params var wH = $(window).height(); var wScrollTop = $(window).scrollTop(); // get article var obj = $('.article'); var objH = $('.article').outerHeight(); // check (is null) if(obj.length <= 0 ) return ; // get top of article var num = []; for(var i = 0 ; i < obj.length ; i++ ){ num.push( obj.eq(i).offset().top + ( objH/3 )); } // the frist articles if( obj.eq(0) ){ obj.eq(0).addClass('scrollIn'); } // check (is visible in window ? ) function judgeScroll(){ for(var j= 1 ; j < num.length ; j++ ){ if ( num[j] < (wScrollTop + wH) ) { for ( var k = 0 ; k <= j ; k++){ obj.eq(k).addClass('scrollIn'); } } } }; // init judgeScroll(); // update window params $( window ).scroll( function() { wH = $(window).height(); wScrollTop = $(window).scrollTop(); judgeScroll(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAndScrollToLatestArticles() {\n shownArticlesCount = 0;\n $(\"#articleKeywordCategoryId\").val(\"\"); //get all articles of all categories\n $(\"#latestArticles\").hide(1000);\n $(\"#latestArticles\").html(\"\");\n showLatestArticles();\n $([document.documentElement, document.body])....
[ "0.6580148", "0.63732487", "0.6282553", "0.6266647", "0.6240119", "0.6212699", "0.6212699", "0.6198874", "0.6145166", "0.61352193", "0.6129691", "0.60798967", "0.6063895", "0.6057074", "0.6051181", "0.6038307", "0.6038307", "0.6038307", "0.6038307", "0.6036092", "0.60206586",...
0.62903506
2
check (is visible in window ? )
function judgeScroll(){ for(var j= 1 ; j < num.length ; j++ ){ if ( num[j] < (wScrollTop + wH) ) { for ( var k = 0 ; k <= j ; k++){ obj.eq(k).addClass('scrollIn'); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkWindowActive() {\n if (\"hidden\" in document) {\n return !document.hidden;\n } else if (\"webkitHidden\" in document) {\n return !document.webkitHidden;\n } else if (\"mozHidden\" in document) {\n return !document.mozHidden;\n }\n return true;\n}", "function isVisibleOnScreen()/*:Boo...
[ "0.7707192", "0.7617363", "0.746016", "0.74079585", "0.7309219", "0.72982377", "0.7254965", "0.72014606", "0.7101818", "0.7091399", "0.70676905", "0.7013765", "0.6951067", "0.6951067", "0.6951067", "0.69314635", "0.6921177", "0.6910527", "0.68992394", "0.68992394", "0.6897946...
0.0
-1
INITIALIZE Tests if smooth scrolling is allowed. Shuts down everything if not.
function initTest() { var disableKeyboard = false; // disable keyboard support if anything above requested it if (disableKeyboard) { removeEvent("keydown", keydown); } if (options.keyboardSupport && !disableKeyboard) { addEvent("keydown", keydown); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(){\n\tnew SmoothScroll(document,200,2)\n}", "function smoothScrollInit() {\r\n\r\n\t \t\t\t\t// Smooth scroll\r\n\t\t $('a[href^=\"#\"]').bind('click.smoothscroll',function (e) {\r\n\t\t e.preventDefault();\r\n\r\n\t\t var target = this.hash,\r\n\t\t ...
[ "0.6717258", "0.62701464", "0.61722434", "0.6083799", "0.6054541", "0.6043841", "0.604366", "0.6019213", "0.5999568", "0.5974034", "0.5910879", "0.5906997", "0.58943516", "0.587392", "0.58602786", "0.58303314", "0.5812308", "0.58113873", "0.57987183", "0.5781091", "0.5781091"...
0.0
-1
Sets up scrolls array, determines if frames are involved.
function init() { if (!document.body) return; var body = document.body; var html = document.documentElement; var windowHeight = window.innerHeight; var scrollHeight = body.scrollHeight; // check compat mode for root element root = (document.compatMode.indexOf('CSS') >= 0) ? html : body; activeElement = body; initTest(); initDone = true; // Checks if this script is running in a frame if (top != self) { isFrame = true; } /** * This fixes a bug where the areas left and right to * the content does not trigger the onmousewheel event * on some pages. e.g.: html, body { height: 100% } */ else if (scrollHeight > windowHeight && (body.offsetHeight <= windowHeight || html.offsetHeight <= windowHeight)) { html.style.height = 'auto'; setTimeout(function(){}, 10); // clearfix if (root.offsetHeight <= windowHeight) { var underlay = document.createElement("div"); underlay.style.clear = "both"; body.appendChild(underlay); } } // disable fixed background if (!options.fixedBackground && !isExcluded) { body.style.backgroundAttachment = "scroll"; html.style.backgroundAttachment = "scroll"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CameraCommand_Scroll_Initialise()\n{\n\t//remember camera state to restore it later\n\tthis.IsShowingCamera = this.Camera && this.Camera.CameraUI.IsShowing;\n\t//ensure that the target's form is active\n\tForm_SetFocusOnParentWindow(this.TargetHTML);\n\t//loop through all the parents of the html target\n\...
[ "0.63185555", "0.62920606", "0.6264389", "0.6256101", "0.622788", "0.62156516", "0.6108681", "0.60953295", "0.60885096", "0.60488105", "0.60021496", "0.598708", "0.5986958", "0.5963606", "0.5948423", "0.5933909", "0.5926178", "0.5911818", "0.5895173", "0.58496475", "0.5846845...
0.0
-1
Pushes scroll actions to the scrolling queue.
function scrollArray(elem, left, top, delay) { delay || (delay = 1000); directionCheck(left, top); if (options.accelerationMax != 1) { var now = +new Date; var elapsed = now - lastScroll; if (elapsed < options.accelerationDelta) { var factor = (1 + (30 / elapsed)) / 2; if (factor > 1) { factor = Math.min(factor, options.accelerationMax); left *= factor; top *= factor; } } lastScroll = +new Date; } // push a scroll command que.push({ x: left, y: top, lastX: (left < 0) ? 0.99 : -0.99, lastY: (top < 0) ? 0.99 : -0.99, start: +new Date }); // don't act if there's a pending queue if (pending) { return; } var scrollWindow = (elem === document.body); var step = function (time) { var now = +new Date; var scrollX = 0; var scrollY = 0; for (var i = 0; i < que.length; i++) { var item = que[i]; var elapsed = now - item.start; var finished = (elapsed >= options.animationTime); // scroll position: [0, 1] var position = (finished) ? 1 : elapsed / options.animationTime; // easing [optional] if (options.pulseAlgorithm) { position = pulse(position); } // only need the difference var x = (item.x * position - item.lastX) >> 0; var y = (item.y * position - item.lastY) >> 0; // add this to the total scrolling scrollX += x; scrollY += y; // update last values item.lastX += x; item.lastY += y; // delete and step back if it's over if (finished) { que.splice(i, 1); i--; } } // scroll left and top if (scrollWindow) { window.scrollBy(scrollX, scrollY); } else { if (scrollX) elem.scrollLeft += scrollX; if (scrollY) elem.scrollTop += scrollY; } // clean up if there's nothing left to do if (!left && !top) { que = []; } if (que.length) { requestFrame(step, elem, (delay / options.frameRate + 1)); } else { pending = false; } }; // start a new queue of actions requestFrame(step, elem, 0); pending = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dispatch() {\n var currScrollTop = window.pageYOffset;\n\n var appSectionHeight = $('#app-section-1').height();\n\n var scrollInfo = {\n windowHeight: appSectionHeight,\n scrollHeight: $(document.body).prop('scrollHeight'),\n scrollTop: currScrollTop,\n directi...
[ "0.6285056", "0.60334843", "0.59531695", "0.59531695", "0.5939761", "0.5939761", "0.5897734", "0.5850394", "0.58254206", "0.58254206", "0.58254206", "0.58254206", "0.58254206", "0.57792956", "0.57792956", "0.5772229", "0.57711375", "0.57456005", "0.57375705", "0.5733483", "0....
0.57556874
17
Mousedown event only for updating activeElement
function mousedown(event) { activeElement = event.target; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mousedown(event) {\n activeElement = event.target;\n }", "function mousedown(event) {\n activeElement = event.target;\n }", "function mousedown(event) {\r\n activeElement = event.target;\r\n}", "function mousedown(event) {\r\n activeElement = event...
[ "0.8798445", "0.87899625", "0.8754566", "0.8754566", "0.8754566", "0.8754566", "0.8754189", "0.8754189", "0.8754189", "0.8190667", "0.66085976", "0.6604286", "0.6601424", "0.6601424", "0.65757895", "0.65757895", "0.65397", "0.6478562", "0.644599", "0.64423376", "0.6441396", ...
0.875648
9
PULSE Viscous fluid with a pulse for part and decay for the rest. Applies a fixed force over an interval (a damped acceleration), and Lets the exponential bleed away the velocity over a longer interval Michael Herf,
function pulse_(x) { var val, start, expx; // test x = x * options.pulseScale; if (x < 1) { // acceleartion val = x - (1 - Math.exp(-x)); } else { // tail // the previous animation ended here: start = Math.exp(-1); // simple viscous drag x -= 1; expx = 1 - Math.exp(-x); val = start + (expx * (1 - start)); } return val * options.pulseNormalize; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Pulse_(x)\n{\n var val;\n \n // test\n x = x * PulseScale;\n if (x < 1) {val = x - (1 - Math.exp(-x));} \n else {\n // the previous animation ended here:\n var start = Math.exp(-1);\n\n // simple viscous drag\n x -= 1;\n var expx = 1 - Math.exp(-x);\n val = start + (expx * (1.0 - s...
[ "0.6354279", "0.6190717", "0.6190717", "0.6190717", "0.6190717", "0.61040413", "0.60792285", "0.6077523", "0.60416996", "0.60416996", "0.60200083", "0.59077847", "0.5853741", "0.58002824", "0.55639994", "0.54656386", "0.54378134", "0.54291695", "0.5385938", "0.5377736", "0.53...
0.6131738
12
Helper function for reloading list of sites.
function reloadSites() { function reload() { sites.get() .then(function(sites) { $scope.ui.sites = sites; }); } /* * Reload sites mutliple times, because sometimes updates to list of sites * aren't ready immediately. */ // Reload sites immediately. reload(); // Reload sites again after 5 seconds. setTimeout(reload, 1000 * 5); // Reload sites again after 15 seconds. setTimeout(reload, 1000 * 15); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reloadRedirectsList() {\n\t$('input:text').val('http://');\n\tshowSpinner();\n\t$.getJSON($('#website_url').val() + 'backend/backend_seo/loadredirectslist/', function(response) {\n\t\thideSpinner();\n\t\t$('#redirects-list').html(response.redirectsList);\n\t\tcheckboxRadioStyle();\n\t});\n}", "function ...
[ "0.676063", "0.6605304", "0.62483835", "0.611557", "0.6078304", "0.6045507", "0.60063434", "0.59907764", "0.59840554", "0.5963418", "0.5860863", "0.57766455", "0.57648015", "0.5756713", "0.5754364", "0.57331634", "0.57225204", "0.57197", "0.57058656", "0.569878", "0.5688051",...
0.8020586
0
Return the timezone string for this client, e.g. America/Los_Angeles, UTC, etc
getTimezone() { return Intl.DateTimeFormat().resolvedOptions().timeZone; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTimezone() {\n\tvar timezone = jstz.determine();\n\treturn timezone.name();\n}", "function getTimezone() {\n\tvar timezone = jstz.determine();\n\treturn timezone.name();\n}", "function timezone() {\n if (typeof Intl === \"object\" && typeof Intl.DateTimeFormat === \"function\") {\n let op...
[ "0.6910164", "0.6910164", "0.6758558", "0.6547973", "0.6154265", "0.61308426", "0.6064783", "0.5982676", "0.5904349", "0.587135", "0.58712226", "0.580486", "0.580486", "0.580486", "0.580486", "0.58009285", "0.57987136", "0.57770336", "0.5770741", "0.5765046", "0.5700704", "...
0.6491036
4
Create a status record in the backend for this particular instance
async create() { let api = this.app.service('status'); let record = { uuid: this.uuid, flavor: this.options.flavor, timezone: this.getTimezone(), }; return api.create(record, { }) .then((res) => { logger.info('Created a Status record with server side ID %d', res.id); return true; }) .catch((err) => { /* 400 errors are most likely attempts to recreate the same Status for * this instance. * * We need a better way to run a HEAD request to check before POSTing a * new status, but it's unclear whether that's supported in feathersjs * or not */ if (err.code != 400) { logger.error('Failed to create a Status record', err); } else { logger.debug('Status record not changed'); } return false; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async saveStatus(status) {\n const db = FirebaseLib.FIRESTORE_DB;\n try {\n const ref = db.collection(config.DBPaths.HISTORY).doc();\n const now = firebase.firestore.Timestamp.now();\n await ref.set({value: status, startedAt: now});\n this._checkNext(status...
[ "0.63833004", "0.6075187", "0.59555286", "0.58781314", "0.5705293", "0.56948614", "0.56543225", "0.56512386", "0.55166435", "0.54728854", "0.54646176", "0.54108137", "0.5409558", "0.54002345", "0.53843033", "0.53717256", "0.5357016", "0.5357016", "0.5334392", "0.5322327", "0....
0.7883399
0
Collect and report the versions of the software installed on the instance
collectVersions() { const versions = { schema: 1, container: { commit: null, tools: { java: null, }, }, client: { version: null, }, jenkins: { core: null, plugins: { } } }; Object.assign(versions.container.tools, process.versions); versions.jenkins.core = Checksum.signatureFromFile(path.join(Storage.jenkinsHome(), 'jenkins.war')); /* * Grab the version of the container from the root of the filesystem */ const commitFile = '/commit.txt'; if (fs.existsSync(commitFile)) { versions.container.commit = fs.readFileSync(commitFile, 'utf8'); } try { const files = fs.readdirSync(Storage.pluginsDirectory()); files.forEach((file) => { const matched = file.match(/^(.*).hpi$/); if (matched) { const name = matched[1]; const fullPath = path.join(Storage.pluginsDirectory(), file); versions.jenkins.plugins[name] = Checksum.signatureFromFile(fullPath); } }); } catch (err) { if (err.code == 'ENOENT') { logger.warn('No plugins found from which to report versions'); } else { throw err; } } return versions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function showVersions() {\n core.startGroup(\"Show Versions\")\n\n await exec.exec('ruby', ['--version'])\n await exec.exec('ruby', ['-ropenssl', '-e', \"puts OpenSSL::OPENSSL_LIBRARY_VERSION\"])\n await exec.exec('gem', ['--version'])\n await exec.exec('bundle', ['--version'])\n await exec.exec('opens...
[ "0.6531873", "0.65078", "0.5990552", "0.5868773", "0.58498645", "0.5822648", "0.57940197", "0.56587994", "0.5629213", "0.5612266", "0.55770075", "0.5558014", "0.5545226", "0.5485111", "0.5478435", "0.54132485", "0.541075", "0.53867775", "0.5353279", "0.5353034", "0.5349324", ...
0.6691724
0
Searching for anime command
async function getanime(name) { let { body } = await superagent .get("https://api.jikan.moe/v3/search/anime?q=" + name + "&limit=5").catch(error => { console.log(error); return msg.channel.send("Try using another name for the anime"); }); return body.results[0].mal_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startOneCommandArtyom(){\n artyom.fatality();// use this to stop any of\n\n setTimeout(function(){// if you use artyom.fatality , wait 250 ms to initialize again.\n artyom.initialize({\n lang:\"en-GB\",// A lot of languages are supported. Read the docs !\n cont...
[ "0.5481172", "0.5256158", "0.52361685", "0.52190185", "0.51799625", "0.5178809", "0.5128479", "0.50978416", "0.50686944", "0.5059084", "0.5019142", "0.5016738", "0.49653304", "0.49592414", "0.49537578", "0.49046326", "0.4900567", "0.48959118", "0.48891217", "0.48891145", "0.4...
0.5181441
4
TODO: This lifecycle hook will be deprecated with React v17 Refactor with static getDerivedStateFromProps(props, state)
componentWillReceiveProps(props) { this.setState({ active: props.activeForecast === this.props.forecast.time, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getDerivedStateFromProps(props, state) {\n console.log(\"getDrivedStateFromProps: Updating state\");\n return null;\n }", "static getDerivedStateFromProps(props, state) {\n console.log(\"Child getDerivedStateFromProps\");\n return null;\n }", "static getDerivedStateFromProps(nextProps,prev...
[ "0.81477886", "0.8139535", "0.81208605", "0.80505735", "0.8046727", "0.80091935", "0.80007684", "0.796094", "0.7937251", "0.7912501", "0.79065377", "0.7896166", "0.7865269", "0.78490824", "0.7802286", "0.76770043", "0.7635235", "0.758559", "0.7556767", "0.7464512", "0.7346394...
0.0
-1
Hide the loading image
function hideLoader() { document.getElementById('loader').className = 'hide'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hideLoadingView() {\n $loader.css(\"display\", \"none\");\n }", "function hideLoading() {\n _updateState(hotelStates.HIDE_LOADING);\n }", "function hideLoader() {\n\n loader.style.display = \"none\";\n\n }", "function LoadingOn() {\n document.getElementById(\"divLoading\...
[ "0.79757166", "0.7724283", "0.7697707", "0.76916564", "0.7690922", "0.7658675", "0.76100993", "0.7606903", "0.7580012", "0.7580012", "0.7570263", "0.7535159", "0.746239", "0.7429738", "0.7427484", "0.7420167", "0.7413106", "0.7400056", "0.7400056", "0.739585", "0.73936874", ...
0.7395434
20
Loads track dates and colors from the URL. Tracks can be shown for specific dates and colors: map.html?20150918&20150920,a000f0 Or for a date range: map.html?20150918..20150920 Or just show me everything: map.html?all
function loadTracksFromURL () { var params = window.location.search.replace("?","").split("&"); tracks = {}; for (var i = 0; i < params.length; i++) { var track = params[i].split(","), color = track[1], range; if (!track[0] || track[0] == "all") { range = ["2015-03-25", moment().format("YYYY-MM-DD")]; } else { range = parseDateRange(track[0]); } moment.range(range).by("days", function(date) { tracks[date.format("YYYY-MM-DD")] = { file: "gpx/" + date.format("YYYY-MM-DD") + ".gpx", color: "#" + (color || randomColor({luminosity: "dark"})), }; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadTimelineEvents() {\n var chaplainID = window.location.pathname.match( /\\d+/ )[0];\n loadchart(\"svgContent\", window.origin + \"/bojanglers/chaplain/\"+chaplainID+\"/geteventsjson/\");\n}", "function loadTracks() {\n // Remove all Tracks from DOM\n while (resultBody.firstChild) {\n ...
[ "0.59534645", "0.5704004", "0.56738406", "0.5584763", "0.5536832", "0.55356735", "0.54992044", "0.5481779", "0.54745203", "0.53911555", "0.536495", "0.53428376", "0.5298982", "0.52808666", "0.52697635", "0.5224987", "0.5213285", "0.5205841", "0.5203202", "0.5192459", "0.51881...
0.7356602
0
Returns a date range in the form [start, end] given a String: "20151003" or "20151001..20151005"
function parseDateRange(input) { var dateRange = input.split(".."); if(dateRange.length != 2) { dateRange = [dateRange[0], dateRange[0]]; } return dateRange; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getDateRange(dateStr, granularity) {\n var start = new Date(dateStr);\n var end = new Date(dateStr);\n\n switch (granularity) {\n case 'year':\n end.setUTCFullYear(end.getUTCFullYear() + 1);\n break;\n case 'month':\n end.setUTCMonth(end.getUTCMonth...
[ "0.6790015", "0.6536459", "0.65282655", "0.64699554", "0.6451538", "0.635133", "0.63095874", "0.62782454", "0.6273421", "0.62701243", "0.62633735", "0.62612975", "0.6218193", "0.6205334", "0.6139435", "0.61157286", "0.61155343", "0.6115382", "0.6105924", "0.6078665", "0.60738...
0.6494199
3
Returns layer style in the provided color.
function customLayer(color) { return L.geoJson(null, { style: function() { return { color: color, weight: 5, opacity: 0.9 }; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dhtml_getLayerStyle(name) {\r\n var layer = dhtml_getLayer(name);\r\n \r\n if (layer != null) {\r\n if (layer.clip) {\r\n return layer;\r\n } else if (layer.style) {\r\n return layer.style;\r\n }\r\n }\r\n\r\n return null;\r\n}", "function getColorOf(layer) {\n\tvar color = null;...
[ "0.6158692", "0.59079653", "0.5794151", "0.57935196", "0.5780347", "0.573992", "0.5705335", "0.56219923", "0.5560403", "0.5550929", "0.5547376", "0.5528013", "0.55127424", "0.54973453", "0.54871887", "0.54840416", "0.5456992", "0.5448841", "0.544417", "0.54393715", "0.5439133...
0.6332689
0
Fit map bounds to all track layers.
function fitMapBounds() { var mapBounds = L.latLngBounds([]); trackLayerGroup.eachLayer(function (layer) { mapBounds.extend(layer.getBounds()); }); map.fitBounds(mapBounds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fitBoundaries() {\n if (0 < cfg.boundaries.length) {\n cfg.map.fitBounds(cfg.boundaries);\n }\n }", "function fit_markers_to_map(){ \n map.fitBounds(bounds);\n }", "function fitBounds() {\n\tvar bounds = new google.maps.LatLngBounds();\n\t// Extend the boundaries ...
[ "0.7521457", "0.71557564", "0.71422976", "0.7072659", "0.6976199", "0.6955695", "0.6838777", "0.6762365", "0.67474025", "0.666239", "0.6539566", "0.6530219", "0.6440325", "0.64205784", "0.6359347", "0.6307487", "0.62814605", "0.6263117", "0.6219432", "0.6191661", "0.6158303",...
0.86303794
0
Returns true if all the tracks have been loaded into the map
function tracksDoneLoading(){ return trackLayerGroup.getLayers().length == Object.keys(tracks).length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function allLoaded() {\n for (var i = 0; i != images.length; ++i) {\n if (!images[i].loaded) return false;\n }\n return true;\n }", "function ready() {\n for (var i = 0; i < preloadTiles.length; i++) {\n var state = layerAbove.textureStore().query(preloadTiles[i]);\n if (!state.hasTexture) ...
[ "0.6565923", "0.65386176", "0.6477282", "0.6189377", "0.61252046", "0.61227596", "0.6007809", "0.6006434", "0.5997971", "0.5964995", "0.596318", "0.5952259", "0.59013826", "0.5901161", "0.5870644", "0.58436936", "0.583639", "0.5812408", "0.5811183", "0.58018625", "0.57980865"...
0.8189288
0
Adjust the bounds of the map to fit all the loaded tracks and show photos
function presentMap() { if (tracksDoneLoading()) { hideLoader(); fitMapBounds(); loadPhotos(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fitMapBounds() {\n var mapBounds = L.latLngBounds([]);\n\n trackLayerGroup.eachLayer(function (layer) {\n mapBounds.extend(layer.getBounds());\n });\n\n map.fitBounds(mapBounds);\n }", "function showListings() {\n var bounds = new google.maps.LatLngBounds();\n // ...
[ "0.658613", "0.6573251", "0.6514815", "0.6492516", "0.6480385", "0.64699763", "0.6431244", "0.63783616", "0.63783616", "0.6364226", "0.6361222", "0.6350284", "0.6313107", "0.62995785", "0.6281418", "0.6275025", "0.6268973", "0.6231605", "0.62258756", "0.6195677", "0.61910945"...
0.7291711
0
Recursively draw all tracks onto the map.
function drawTracksOnMap(i, dates){ i = i || 0; dates = dates || Object.keys(tracks); var date = dates[i]; if (!date) { presentMap(); return; } var file = tracks[date].file, color = tracks[date].color; var runLayer = omnivore.gpx(file, null, customLayer(color)) .on("ready", function() { runLayer.addTo(trackLayerGroup); runLayer.eachLayer(function (layer) { layer.bindPopup( "<b>" + layer.feature.properties.name + "</b><br/>" + "<a href='map.html?" + date + "' target='_blank'>🔎 View</a><br/>" + "<a href='" + file + "' target='_blank'>💾 Download</a>" ); }); presentMap(); }) .on("error", function() { runLayer.addTo(trackLayerGroup); presentMap(); }); drawTracksOnMap(i+1, dates); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "tracksDraw(tracks) {\n var translateX = -(this.perspective.x - global.screenWidth / 2);\n var translateY = -(this.perspective.y - global.screenHeight / 2);\n this.context2D.translate(translateX, translateY);\n\n this.context2D.fillStyle = \"#bfa372\";\n\n for(var track of tracks)...
[ "0.6676141", "0.6492108", "0.647695", "0.6236691", "0.6162743", "0.6043636", "0.59702027", "0.59164035", "0.58988124", "0.5888678", "0.5800019", "0.56687367", "0.5639436", "0.5628369", "0.56171674", "0.56040055", "0.560241", "0.56004506", "0.55998623", "0.5596481", "0.5578099...
0.6274876
3
Load all photos onto the map as markers
function loadPhotos(){ var geoJson = []; for (var i = 0; i < photoList.length; i++) { var date = photoList[i].filename.slice(0,10); if (tracks[date]) { geoJson.push({ "type": "Feature", "geometry": { "type": "Point", "coordinates": photoList[i].coordinates }, "properties": { "filename": photoList[i].filename, "caption": photoList[i].caption } }); } } photoLayer.on('layeradd', function(e) { var marker = e.layer, feature = marker.feature, filename = feature.properties.filename, caption = feature.properties.caption; var content = '<img width="200px" src="photos/' + filename + '"/><br/>'; if (caption) { content = content + caption + '<br/>'; } content = content + '<a href="https://instagram.com/huntca" target="_blank">' + '📷 instagram/huntca' + '</a>'; marker.bindPopup(content ,{ closeButton: false, minWidth: 220, maxWidth: 220 }); marker.setIcon(L.icon({ "iconUrl": "photos/" + filename, "iconSize": [50, 50], "iconAnchor": [25, 25], "popupAnchor": [0, -25], "className": "dot" })); }); photoLayer.setGeoJSON(geoJson); photoCluster.addLayer(photoLayer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadMarkersAndPictures(markers, data){\n var size = new OpenLayers.Size(5,5);\n var offset = new OpenLayers.Pixel(-(size.w/2), -(size.h/2));\n var occurrence = new OpenLayers.Icon('../images/map/occurrence.png',size,offset);\n var data_occurrence, cloned_occurrence, openlayers_marker...
[ "0.73248", "0.69554245", "0.69378304", "0.6654525", "0.65294784", "0.6458515", "0.6439537", "0.6413455", "0.63685834", "0.6358616", "0.63540405", "0.63523155", "0.63367736", "0.63350266", "0.62722754", "0.626461", "0.62502277", "0.6244922", "0.6225864", "0.6208893", "0.620806...
0.7686972
0
functions that translates the pmt coordinates into svg coorinates
function tpc_pos(array, coords){ try{ return(array_pos[array](coords)) } catch(error) { return(default_pos["tpc"]) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "eventCoordsToSVGCoords(x, y) {\n const svg = this.svgSubjectArea;\n const newPoint = svg.createSVGPoint();\n newPoint.x = x;\n newPoint.y = y;\n const matrixForWindowCoordsToSVGUserSpaceCoords = this.getMatrixForWindowCoordsToSVGUserSpaceCoords();\n const pointforSVGSystem = newPoint.matrixTransf...
[ "0.6470945", "0.61140984", "0.6102308", "0.6078447", "0.6065639", "0.60250956", "0.5984023", "0.5943737", "0.5782876", "0.5709321", "0.569222", "0.5690141", "0.5683105", "0.56683207", "0.5667035", "0.5665734", "0.5662754", "0.56502646", "0.5627933", "0.56071395", "0.5599533",...
0.0
-1
var a=[4, 6, 11, 18, 32]; var b=[1, 7, 13, 15];
function merge(a, b) { var i; var j; var k=0; var c = []; for (i=0; i<a.length; i++) { c[k]=a[i]; k++; } for (j=0; j<b.length; j++) { c[k]=b[j]; k++; } return c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareTriples(a,b){\n //Almacenar puntos\n let Alice = 0;\n let Bob = 0;\n a.map((element, index) => {\n if(element > b[index]){\n Alice +=1;\n }\n if(element < b[index]){\n Bob +=1;\n }\n })\n return [Alice, Bob];\n}", "function mergeS...
[ "0.6740594", "0.6697769", "0.6688354", "0.6688106", "0.66579014", "0.6645594", "0.6621324", "0.6607377", "0.656397", "0.65623593", "0.6493578", "0.64620054", "0.64473486", "0.6423174", "0.6423127", "0.6421911", "0.6401858", "0.6382495", "0.63683295", "0.63400084", "0.6339894"...
0.0
-1
call the constructor method
constructor(props) { //Call the constrictor of Super class i.e The Component super(props); //maintain the state required for this component this.state = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _construct()\n\t\t{;\n\t\t}", "function _ctor() {\n\t}", "constructur() {}", "function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }", "function Constructor() {}", "function Con...
[ "0.80362153", "0.79341316", "0.78611135", "0.7843023", "0.78206825", "0.78206825", "0.78206825", "0.76931036", "0.7557418", "0.7528882", "0.7528882", "0.7528882", "0.7528882", "0.7528882", "0.7528882", "0.7528882", "0.7507304", "0.74755096", "0.7461952", "0.7433301", "0.74325...
0.0
-1
const person = new Person(); person.eat().sleep(1, '1').eat().sleep(3, '2').eat().run();
function Person2() { this.queue = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "eat() {}", "function eat() {\n \n}", "function Sleep() {\n action.call(this);\n}", "function eat(dosomething) {\n\tprocess.nextTick( () => {\n\t\tconsole.log('begin eat');\n\t\tconsole.log('finish eat');\n\n dosomething && dosomething();\n\t});\n\n\n}", "function bob(){\n new Employ(\"Bob Coo...
[ "0.6443813", "0.5992623", "0.5860873", "0.5700551", "0.56858426", "0.5660079", "0.5653109", "0.56131995", "0.5612804", "0.5576446", "0.5573344", "0.55475", "0.55398774", "0.55191934", "0.5517053", "0.54980165", "0.54946274", "0.549077", "0.54788744", "0.54180485", "0.5406966"...
0.0
-1
Easter Bunny HQ App Assumptions/Decisions Grid is comprised of squares, every block is equidistant Dr. Bunny is 'theoretically' moving about the grid in order to compute the location of Easter Bunny HQ and comments below refer to her in this sense Start position is [0,0] on Cartesian grin Track the direction in which Dr. Bunny is facing as she 'theoretically' moves about the grid Initial direction is facing north Cardinal direction vectors in a Cartesian grid: North [0, 1], South [0, 1], East [1,0], West [1,0]
function Direction() { this.cardinalDirectionVectors = [ [0,1], // North [1,0], // East [0,-1], // South [-1, 0] // West ]; // Dr. Bunny initially faces North this.directionVectorIndex = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move (grid) {\n if (this.orientation.dir === Orientation.left) {\n this.position.col--;\n } else if (this.orientation.dir === Orientation.right) {\n this.position.col++;\n } else if (this.orientation.dir === Orientation.up) {\n this.position.row--;\n } else if (this.orientation.dir === O...
[ "0.6330682", "0.6205498", "0.6185677", "0.6027274", "0.60119647", "0.5937379", "0.5936085", "0.5903911", "0.58822656", "0.58730483", "0.5857049", "0.5830025", "0.58142805", "0.5810783", "0.5807623", "0.58011216", "0.5800586", "0.5764752", "0.57612497", "0.576078", "0.5727646"...
0.0
-1
Track the position of Dr. Bunny in the city grid in terms of a Cartesian grid
function Position() { this.x = 0; this.y = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findNeighbors(grid) {\r\n // console.log(`current cell position X:${this.positionX}, Y:${this.positionY}`);\r\n\r\n // items.neighbors = \r\n\r\n //left item position\r\n if (this.positionX - 1 > -1) {\r\n // console.log(`Left neighbor`);\r\n this.neighbors.push(gr...
[ "0.62123626", "0.613259", "0.6118437", "0.60855204", "0.60262376", "0.60201436", "0.5997682", "0.59947187", "0.59845924", "0.59799165", "0.59774256", "0.59708756", "0.5965862", "0.59564", "0.59511924", "0.59474653", "0.5912281", "0.59066796", "0.5904501", "0.5891351", "0.5890...
0.0
-1
Retrieve the absolute room URL.
function getRoomURL() { return location.protocol + "//" + location.host + (location.pathname || "") + "?room=" + getRoom(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRoomURL() {\n return location.protocol + \"//\" + location.host + (location.path || \"\") + \"?room=\" + this.getRoom();\n }", "getHref() {\n switch (this.type) {\n case \"room\":\n return \"room.html?\" + this.id + \"+\" + this.title.split(' ').join('_');\n case \"device\":\n ...
[ "0.85939044", "0.65802443", "0.6441155", "0.63101816", "0.6253491", "0.6249955", "0.6213188", "0.61693436", "0.61632526", "0.6115959", "0.60682034", "0.6053865", "0.6004255", "0.59871596", "0.5970671", "0.5953317", "0.5936661", "0.59359694", "0.5930209", "0.5926616", "0.59254...
0.8568036
1
Determine whether or not we have a querystring.
function hasQueryString() { return location.href.indexOf("?") !== -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasQuery(url) {\n return (url.indexOf(\"?\") === -1);\n }", "function url_query( query ) {\n var results = new RegExp(\"[\\\\?&]\"+query.replace(/[\\[]/,\"\\\\\\[\").replace(/[\\]]/,\"\\\\\\]\")+\"=([^&#]*)\").exec( window.location.href );\n return results !== null ? results[1] : false\n}", "fun...
[ "0.76698405", "0.65296245", "0.64351815", "0.6426441", "0.64160204", "0.63882095", "0.63501287", "0.63081115", "0.63081115", "0.62288004", "0.59654313", "0.59654313", "0.59547794", "0.5949005", "0.59307843", "0.5913201", "0.59105915", "0.5848512", "0.5848331", "0.58311474", "...
0.8351022
0
Handle the user's login and what happens next.
function handleLogin() { // If the user is logging in for the first time... if (okta.token.hasTokensInUrl()) { okta.token.parseTokensFromUrl( function success(res) { // Save the tokens for later use, e.g. if the page gets refreshed: okta.tokenManager.add("accessToken", res[0]); okta.tokenManager.add("idToken", res[1]); // Redirect to this user's dedicated room URL. window.location = getRoomURL(); }, function error(err) { alert("We weren't able to log you in, something horrible must have happened. Please refresh the page."); } ); } // If the user is alrdy logged in... else { okta.session.get(function(res) { if (res.status === "ACTIVE") { // If the user is logged in on the home page, redirect to their room page. if (!hasQueryString()) window.location = getRoomURL(); else return enableVideo(); } // If we get here, the user is not logged in. // If there's a querystring in the URL, it means this person is in a // "room" so we should display our passive login notice. Otherwise, // we'll prompt them for login immediately. if (hasQueryString()) { document.getElementById("login").style.display = "block"; enableVideo(); } else { showLogin(); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async handleLogin () {\n\t\tconst { email, password, teamId } = this.request.body;\n\t\tthis.user = await new LoginCore({\n\t\t\trequest: this\n\t\t}).login(email, password, teamId);\n\t}", "function login() {\n User.login(self.user, handleLogin);\n }", "handleLogin() {\n this.authenticate();\n }", "...
[ "0.7737474", "0.7673588", "0.76700723", "0.7550096", "0.7511059", "0.74928963", "0.7431305", "0.73327184", "0.7306218", "0.72850895", "0.7205128", "0.71557313", "0.7105174", "0.70841163", "0.7081847", "0.7039327", "0.70286876", "0.69903296", "0.69592965", "0.6940444", "0.6856...
0.80480117
0
display the video boxes and initialize the SimpleWebRTC code you just defined
function enableVideo() { document.getElementById("url").style.display = "block"; document.getElementById("remotes").style.visibility = "visible"; loadSimpleWebRTC(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadSimpleWebRTC() {\n var webrtc = new SFU({\n localVideoEl: document.getElementById(\"local\"),\n // the id/element dom element that will hold remote videos\n remoteVideosEl: \"\",\n autoRequestMedia: true,\n debug: false,\n detectSpeakingEvents: true,\n autoAdjustMic: false...
[ "0.7209124", "0.7106987", "0.7102568", "0.70017177", "0.6905392", "0.6817607", "0.68031234", "0.6767405", "0.6732711", "0.673142", "0.67300206", "0.6648506", "0.65940773", "0.6564422", "0.6543409", "0.6532428", "0.65070444", "0.65054464", "0.6497853", "0.6490271", "0.64876515...
0.728624
0
Determines the distance of a point from a line.
static pointDistanceFromLine(point, start, end) { var tPoint = Utils.closestPointOnLine(point, start, end); var tDx = point.x - tPoint.x; var tDy = point.y - tPoint.y; return Math.sqrt(tDx * tDx + tDy * tDy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ClosestPointOnLine (pt, line)\n{\n\tvar X1 = line[0][0], Y1 = line[0][1];\n\tvar X2 = line[1][0], Y2 = line[1][1];\n\tvar px = pt[0], py = pt[1];\n\n\tvar dx = X2 - X1;\n\tvar dy = Y2 - Y1;\n\n\tvar nx,ny;\n\n\tif (dx == 0 && dy == 0)\n\t{\n\t\t// It's a point not a line segment.\n\t\t// dx = px - X1\n\t\...
[ "0.7365339", "0.7024283", "0.69624466", "0.68171215", "0.678794", "0.67519283", "0.6733547", "0.66921794", "0.6650434", "0.65769225", "0.6564171", "0.65492517", "0.6494417", "0.6494271", "0.64810455", "0.6479191", "0.6477092", "0.6468148", "0.64623284", "0.6443253", "0.636801...
0.7728379
0
Gets the projection of a point onto a line.
static closestPointOnLine(point, start, end) { // Inspired by: http://stackoverflow.com/a/6853926 var tA = point.x - start.x; var tB = point.y - start.y; var tC = end.x - start.x; var tD = end.y - start.y; var tDot = tA * tC + tB * tD; var tLenSq = tC * tC + tD * tD; var tParam = tDot / tLenSq; var tXx, tYy; if (tParam < 0 || (start.x === end.x && start.y === end.y)) { tXx = start.x; tYy = start.y; } else if (tParam > 1) { tXx = end.x; tYy = end.y; } else { tXx = start.x + tParam * tC; tYy = start.y + tParam * tD; } return new Vector2(tXx, tYy); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "projectionOfPointToLine(point, line) {\n const {\n p1: {\n x: x1,\n y: y1\n },\n p2: {\n x: x2,\n y: y2\n }\n } = line;\n\n const A = point.x - x1,\n B = point.y - y1,\n ...
[ "0.8686787", "0.71076924", "0.7048802", "0.68417716", "0.6404786", "0.63570285", "0.6310294", "0.62568635", "0.6184332", "0.6183051", "0.61012596", "0.6035388", "0.60039145", "0.6002718", "0.59502435", "0.5930932", "0.59251255", "0.59213686", "0.58848625", "0.58660525", "0.58...
0.53825456
67
Gets the distance of two points.
static distance(start, end) { return Math.sqrt(Math.pow(end.x - start.x, 2) + Math.pow(end.y - start.y, 2)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function distance(p1, p2) {\n var firstPoint;\n var secondPoint;\n var theXs;\n var theYs;\n var result;\n\n firstPoint = new createjs.Point();\n secondPoint = new createjs.Point();\n\n firstPoint.x = p1.x;\n firstPoint.y = p1.y;\n\n secondPoint.x = p2.x;\n secondPoint.y = p2.y;\n\...
[ "0.78335756", "0.78329134", "0.7832853", "0.7808655", "0.7794204", "0.77934986", "0.77529514", "0.7744814", "0.77084076", "0.77018857", "0.77018857", "0.77018857", "0.77018857", "0.7696726", "0.7696226", "0.7676629", "0.7653338", "0.76246905", "0.7623407", "0.76233125", "0.76...
0.0
-1
Gets the angle between point1 > start and 0,0 > point2 (pi to pi)
static angle(start, end) { var tDot = start.x * end.x + start.y * end.y; var tDet = start.x * end.y - start.y * end.x; var tAngle = -Math.atan2(tDet, tDot); return tAngle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAngleBetweenTwoPoints(x1, y1, x2, y2) {\n return Math.atan2(y2 - y1, x2 - x1);\n }", "calcAngleBetweenTwoPoints(p1,p2){\n return Math.atan2(p2.x - p1.x, p2.z - p1.z)/* * 180 / Math.PI */;\n }", "function getAngle(point1, point2) {\n if (!point2) {\n poin...
[ "0.78749985", "0.7868608", "0.7783751", "0.77587044", "0.7610646", "0.7539805", "0.748276", "0.7428623", "0.7391279", "0.7373959", "0.73377174", "0.72937673", "0.7275923", "0.7248865", "0.7173254", "0.71696496", "0.7150021", "0.7071336", "0.70330447", "0.701369", "0.70014757"...
0.7884451
0
shifts angle to be 0 to 2pi
static angle2pi(start, end) { var tTheta = Utils.angle(start, end); if (tTheta < 0) { tTheta += 2.0 * Math.PI; } return tTheta; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function angle(n) {\n\treturn (n - 2) * 180\n}", "function angleMod(angle) {\n return (angle % 360 + 540) % 360 - 180;\n}", "function angleMod(angle) {\n\twhile (angle < 0) { angle += Math.PI * 2 }\n\twhile (angle >= Math.PI * 2) { angle -= Math.PI * 2 }\n\treturn angle\n}", "function angleMod(angle) {\n\...
[ "0.73161286", "0.72989815", "0.72601134", "0.7253099", "0.7253099", "0.7196971", "0.71876895", "0.71613544", "0.6954825", "0.685485", "0.67942953", "0.67721957", "0.6652456", "0.65818274", "0.65807766", "0.6565753", "0.6565753", "0.6526115", "0.652253", "0.652253", "0.652253"...
0.63649106
35
shifts angle to be 0 to 2pi
static getCyclicOrder(points, start = undefined) { if (!start) { start = new Vector2(0, 0); } var angles = []; for (var i = 0; i < points.length; i++) { var point = points[i]; var vect = point.clone().sub(start); var radians = Math.atan2(vect.y, vect.x); var degrees = THREEMath.radToDeg(radians); degrees = (degrees > 0) ? degrees : (degrees + 360) % 360; angles.push(degrees); } var indices = Utils.argsort(angles); var sortedAngles = []; var sortedPoints = []; for (i = 0; i < indices.length; i++) { sortedAngles.push(angles[indices[i]]); sortedPoints.push(points[indices[i]]); } return { indices: indices, angles: sortedAngles, points: sortedPoints }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function angle(n) {\n\treturn (n - 2) * 180\n}", "function angleMod(angle) {\n return (angle % 360 + 540) % 360 - 180;\n}", "function angleMod(angle) {\n\twhile (angle < 0) { angle += Math.PI * 2 }\n\twhile (angle >= Math.PI * 2) { angle -= Math.PI * 2 }\n\treturn angle\n}", "function angleMod(angle) {\n\...
[ "0.73161286", "0.72989815", "0.72601134", "0.7253099", "0.7253099", "0.7196971", "0.71876895", "0.71613544", "0.6954825", "0.685485", "0.67942953", "0.67721957", "0.6652456", "0.65818274", "0.65807766", "0.6565753", "0.6565753", "0.6526115", "0.652253", "0.652253", "0.652253"...
0.0
-1
Checks if an array of points is clockwise.
static isClockwise(points) { // make positive let tSubX = Math.min(0, Math.min.apply(null, Utils.map(points, function(p) { return p.x; }))); let tSubY = Math.min(0, Math.min.apply(null, Utils.map(points, function(p) { return p.x; }))); var tNewPoints = Utils.map(points, function(p) { return { x: p.x - tSubX, y: p.y - tSubY }; }); // determine CW/CCW, based on: // http://stackoverflow.com/questions/1165647 var tSum = 0; for (var tI = 0; tI < tNewPoints.length; tI++) { var tC1 = tNewPoints[tI]; var tC2; if (tI === tNewPoints.length - 1) { tC2 = tNewPoints[0]; } else { tC2 = tNewPoints[tI + 1]; } tSum += (tC2.x - tC1.x) * (tC2.y + tC1.y); } return (tSum >= 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clockwise(cmds) {\n let sum = 0;\n for (let i = 0; i < cmds.length - 1; i++) {\n let a = cmds[i];\n let b = cmds[i + 1];\n if (!(a.hasOwnProperty('x') && b.hasOwnProperty('x'))) {\n continue;\n }\n sum += (b.x - a.x) * (b.y + a.y);\n }\n\n return sum < 0;\n}", "function isInShape...
[ "0.6825948", "0.65444165", "0.63776314", "0.6067621", "0.5941429", "0.5894455", "0.5882528", "0.58608145", "0.5825334", "0.57433397", "0.5739705", "0.57124496", "0.5707815", "0.56963706", "0.56712186", "0.56601596", "0.5654734", "0.5646363", "0.56347936", "0.5605038", "0.5589...
0.7258016
0
both arguments are arrays of corners with x,y attributes
static polygonPolygonIntersect(firstCorners, secondCorners) { for (var tI = 0; tI < firstCorners.length; tI++) { var tFirstCorner = firstCorners[tI], tSecondCorner; if (tI === firstCorners.length - 1) { tSecondCorner = firstCorners[0]; } else { tSecondCorner = firstCorners[tI + 1]; } if (Utils.linePolygonIntersect(tFirstCorner, tSecondCorner, secondCorners)) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCorners(){\n\t\treturn [\n\t\t\t{x:-(this.width/2), y:-(this.height/2)},\n\t\t\t{x:-(this.width/2)+this.width, y:-(this.height/2)},\n\t\t\t{x:-(this.width/2)+this.width, y:-(this.height/2)+this.height},\n\t\t\t{x:-(this.width/2), y:-(this.height/2)+this.height}\n\t\t];\n\t}", "getCorners(){\n //Order f...
[ "0.68733513", "0.6769763", "0.6398585", "0.63596135", "0.63350445", "0.62954396", "0.62164265", "0.61121756", "0.6070231", "0.60623175", "0.60395396", "0.6033291", "0.5939309", "0.5928091", "0.59161675", "0.58897084", "0.5847636", "0.58082026", "0.5794414", "0.5791413", "0.57...
0.0
-1
Corners is an array of points with x,y attributes
static linePolygonIntersect(point, point2, corners) { for (var tI = 0; tI < corners.length; tI++) { var tFirstCorner = corners[tI], tSecondCorner; if (tI === corners.length - 1) { tSecondCorner = corners[0]; } else { tSecondCorner = corners[tI + 1]; } if (Utils.lineLineIntersect(point, point2, { x: tFirstCorner.x, y: tFirstCorner.y }, { x: tSecondCorner.x, y: tSecondCorner.y })) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processCorners() {\n let c;\n let points = {};\n for (let key in corners) {\n if (corners.hasOwnProperty(key)) {\n c = corners[key];\n for (let i = Math.min(c[0][0],c[1][0]); i <= Math.max(c[0][0],c[1][0]); ++i) {\n for (let j = Math.min(c[0][1],c[1][1]); j <= Math.max(c[0][1],c[1][...
[ "0.7152081", "0.710977", "0.71054775", "0.69690377", "0.6883812", "0.68744695", "0.68693686", "0.6867067", "0.6774058", "0.67471164", "0.6579971", "0.6546678", "0.65427226", "0.63573945", "0.6302345", "0.6171074", "0.6074183", "0.6016276", "0.59106755", "0.59104335", "0.59090...
0.0
-1
Checks if all corners of insideCorners are inside the polygon described by outsideCorners
static polygonInsidePolygon(insideCorners, outsideCorners, start) { for (var tI = 0; tI < insideCorners.length; tI++) { let flag = Utils.pointInPolygon(insideCorners[tI], outsideCorners, start); if (!flag) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static polygonOutsidePolygon(insideCorners, outsideCorners, start) {\n for (var tI = 0; tI < insideCorners.length; tI++) {\n if (Utils.pointInPolygon(insideCorners[tI], outsideCorners, start)) {\n return false;\n }\n }\n return true;\n }", "function ch...
[ "0.8327274", "0.6895669", "0.66014713", "0.6582443", "0.6263587", "0.6252742", "0.62435335", "0.6223305", "0.60686684", "0.59998775", "0.597992", "0.5922873", "0.58456063", "0.5843642", "0.5826626", "0.5780555", "0.57796186", "0.57775974", "0.5763631", "0.57547235", "0.572535...
0.83201474
1
Checks if any corners of firstCorners is inside the polygon described by secondCorners
static polygonOutsidePolygon(insideCorners, outsideCorners, start) { for (var tI = 0; tI < insideCorners.length; tI++) { if (Utils.pointInPolygon(insideCorners[tI], outsideCorners, start)) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static polygonPolygonIntersect(firstCorners, secondCorners) {\n for (var tI = 0; tI < firstCorners.length; tI++) {\n var tFirstCorner = firstCorners[tI],\n tSecondCorner;\n if (tI === firstCorners.length - 1) {\n tSecondCorner = firstCorners[0];\n ...
[ "0.8492463", "0.79719144", "0.7253318", "0.65789825", "0.63777953", "0.63655084", "0.63481855", "0.6331432", "0.63139343", "0.6306006", "0.6234206", "0.6219819", "0.6212392", "0.6202383", "0.61774415", "0.6176543", "0.6176543", "0.6176543", "0.61706597", "0.61549556", "0.6141...
0.76078033
2
Remove elements in array if func(element) returns true
static removeIf(array, func) { var tResult = []; array.forEach((element) => { if (!func(element)) { tResult.push(element); } }); return tResult; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dropElements(arr, func) {\n let myArr = arr.map(func);\n arr.splice(0,myArr.indexOf(true));\n if(arr.length === myArr.length && myArr[myArr.length-1] === false){\n return [];\n }\n return arr;\n}", "function dropElements(arr, func) {\n const index = arr.map(item => func(item) ? true : false).in...
[ "0.80194587", "0.8001144", "0.79558223", "0.7896047", "0.7866592", "0.78441274", "0.7832108", "0.7814228", "0.7762214", "0.7645773", "0.7639379", "0.7630885", "0.76181346", "0.7578574", "0.7533573", "0.7452475", "0.7449164", "0.7414614", "0.73758304", "0.73661035", "0.7355633...
0.8209332
0
Shift the items in an array by shift (positive integer)
static cycle(arr, shift) { var tReturn = arr.slice(0); for (var tI = 0; tI < shift; tI++) { var tmp = tReturn.shift(); tReturn.push(tmp); } return tReturn; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShiftArrayValsLeft(arr){\n}", "function shift(array) {\n var newLen = array.length - 1;\n var value = array[0];\n\n for (var i = 0; i < array.length; i++) {\n array[i] = array[i + 1];\n }\n\n array.length = newLen;\n return value;\n}", "function applyShift(array) {\n\t// create a shifted vari...
[ "0.80267024", "0.78786844", "0.77921", "0.7740542", "0.7702695", "0.7626341", "0.7562594", "0.74453676", "0.7431043", "0.74150217", "0.73147315", "0.7275517", "0.72440416", "0.7216972", "0.7190529", "0.7160268", "0.71554637", "0.71386373", "0.712193", "0.7106804", "0.7022292"...
0.6637945
49
Returns in the unique elemnts in arr
static unique(arr, hashFunc) { var tResults = []; var tMap = {}; for (var tI = 0; tI < arr.length; tI++) { if (!tMap.hasOwnProperty(arr[tI])) { tResults.push(arr[tI]); tMap[hashFunc(arr[tI])] = true; } } return tResults; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unique(arr){\n return arr.filter(function(value, index, self){ return self.indexOf(value) === index; });\n }", "function unique(arr) {\n\treturn Array.from(new Set(arr)); //makes an array out of the the set that was made with the initial arr\n\t// this is a cool trick;\n}", "function uniqueArray (...
[ "0.84523433", "0.8208648", "0.81968135", "0.8191207", "0.81726617", "0.81422937", "0.80937445", "0.80785114", "0.8062712", "0.80433774", "0.80433774", "0.80433774", "0.80433774", "0.80433774", "0.80433774", "0.80433774", "0.80433774", "0.80433774", "0.8031896", "0.7985621", "...
0.0
-1
Remove value from array, if it is present
static removeValue(array, value) { for (var tI = array.length - 1; tI >= 0; tI--) { if (array[tI] === value) { array.splice(tI, 1); return tI; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function arrayRemoveByVal(value, arr) {\n return arr.filter(function(ele){return ele != value; });\n}", "arrayRemove(arr, value) {\n return arr.filter(function(ele){\n return ele != value;\n });\n }", "function arrayRemove(arr, value) { \r\n return arr.filter(function(ele){ \r...
[ "0.79086626", "0.79004335", "0.787566", "0.783627", "0.7813778", "0.776556", "0.7745942", "0.7743792", "0.7701474", "0.7677491", "0.7636963", "0.7521625", "0.7455023", "0.7455023", "0.7381038", "0.73625994", "0.72130054", "0.72066367", "0.7154609", "0.7154214", "0.7131632", ...
0.71906763
18
Checks if value is in array
static hasValue(array, value) { for (var tI = 0; tI < array.length; tI++) { if (array[tI] === value) { return true; } } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inArray(value, array){\n\t\t for(var i=0;i<array.length;i++){\n\t\t if(array[i]==value) {return false;}\n\t\t \t}\n\t\t\t}", "function isInArray(value, array) {\n \treturn array.indexOf(value) > -1;\n }", "function isInArray(value, array) {\n return array.indexOf(value) >...
[ "0.85272187", "0.8465186", "0.8425205", "0.8414105", "0.8334011", "0.8334011", "0.8334011", "0.8285396", "0.8243156", "0.8243156", "0.8223024", "0.82207465", "0.8200914", "0.81359303", "0.8045296", "0.80379707", "0.80379707", "0.80379707", "0.802219", "0.8020772", "0.8020772"...
0.78142756
25
Subtracts the elements in subArray from array
static subtract(array, subArray) { return Utils.removeIf(array, function(el) { return Utils.hasValue(subArray, el); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function subtractArrFromSingle(single, array) {\n var subtracted = [];\n for (var i = 0; i < array.length; i++) {\n \tif ( !(single.overlaps(array[i])) ) { continue }\n \telse if (single.isSame(array[i])) {\n return subtracted;\n } else {\n\t subtracted = single.subtract(array[...
[ "0.72379345", "0.7161804", "0.7006875", "0.693381", "0.687383", "0.68192285", "0.673738", "0.6688355", "0.66559446", "0.6539686", "0.6359454", "0.6348116", "0.63152903", "0.6230526", "0.6178454", "0.61597705", "0.6157106", "0.61524355", "0.6150979", "0.61355215", "0.60955304"...
0.86874455
0
Mouse Events for Nodes mouseenter events
function enterThis(p) { //Grow node d3.select(this) .attr("x", -72) .attr("y", -16) .attr("width", 176) .attr("height", 32); //select node parents var nodes = []; nodes.push(p); while(p.parent) { p = p.parent; nodes.push(p); } //color the node parents node.filter(function(d) { if ( nodes.indexOf(d) !== -1) return true;} ) .select('rect') .style("fill", fillhover); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_handleMouseEnter() {\n this._hovered.next(this);\n }", "mouseEnter(event) {\n this.setHover();\n }", "function OnMouseEnter() {\n\tisMouseEnter = true;\n\t\n}", "onMouseEnter() {}", "function nodeMouseEnter(d,i) {\n\t\tvar buttonClassId = 'node-buttons-' + i;\n //TODO: Implement fade-...
[ "0.75314426", "0.7472995", "0.7363172", "0.7354481", "0.7317155", "0.7239587", "0.6869569", "0.6854707", "0.67540354", "0.6735572", "0.67253107", "0.6723072", "0.6722547", "0.6722547", "0.6636972", "0.6628364", "0.6599741", "0.6599741", "0.65604305", "0.6559505", "0.65539724"...
0.5770123
91
links section Create link paths
function diagonal(d) { return "M" + d.y + "," + d.x + "V" + d.parent.x + "H" + d.parent.y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupLinks() {\n\tfor(let i = 0; i < 11; i++) {\n\t\tif(i == 10) { \n\t\t\tlinks[i] = createA('/resilience-repository/about.html', proj_names[i]);\n\t\t}\n\t\telse {\n\t\t\tlinks[i] = createA('/resilience-repository/projects/proj'+i+'.html', proj_names[i]);\n\t\t}\n\t}\n}", "function genLinks(map){\n m...
[ "0.7128191", "0.64805174", "0.6458308", "0.64286697", "0.6373507", "0.63541555", "0.6353787", "0.62928617", "0.6284714", "0.6280411", "0.62643343", "0.62139344", "0.6167139", "0.61422414", "0.61379534", "0.61117446", "0.61057734", "0.6081", "0.6079601", "0.60776377", "0.60775...
0.0
-1
FUNZIONE AGGIUNGI ZERO AD ORARIO
function addZero(number) { if(number < 10) { number = '0' + number; } return number; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unDoIVAGastosVenta(IVAxGtos,costoDesProd,IVA) {\n\nvar nvoIVAGtosVenta;\n\n if (IVAxGtos==0) {\n nvoIVAGtosVenta = 0;\n }else {\n nvoIVAGtosVenta = ((IVAxGtos) + (IVAxGastosVenta(costoDesProd,IVA)));\n }\n return nvoIVAGtosVenta;\n}", "function condiçaoVitoria(){}", "function operacion(){\r\...
[ "0.6326228", "0.62226504", "0.6148622", "0.59948635", "0.59726524", "0.59057826", "0.58613014", "0.5856627", "0.57960993", "0.577517", "0.5767869", "0.5762447", "0.57331544", "0.5719623", "0.5694293", "0.56720793", "0.56613547", "0.56238776", "0.5622329", "0.56171143", "0.561...
0.0
-1
FUNZIONE RISPOSTA DA COMPUTER
function pcMessage(){ var messaggioComputer = $('.template .messaggio').clone(); console.log(messaggioComputer); messaggioComputer.find('.message-text').text('Ok'); messaggioComputer.addClass('computer'); $('.spazio-messaggi').append(messaggioComputer); var data = new Date(); var hours = addZero(data.getHours()); var minutes = addZero(data.getMinutes()); var time = hours +':'+ minutes; messaggioComputer.find('.message-time').text(time); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function comportement (){\n\t }", "function coherencia(objeto){\n // extrae las variables nesesarias para la evaluacion\n var estructura= objeto.structure;\n var nivelagregacion=objeto.aggregationlevel;\n var tipointeractividad=objeto.interactivitytype;...
[ "0.7077941", "0.6485625", "0.62452126", "0.6155984", "0.6072537", "0.5949752", "0.5839933", "0.5764558", "0.5747324", "0.57220936", "0.5703695", "0.57001835", "0.5696839", "0.5659428", "0.56110924", "0.5600231", "0.5597241", "0.559215", "0.55880606", "0.55861753", "0.55481863...
0.0
-1
Nombre : genera_tabla Descripcion : Genera tabla HTML dinamicamente Parametros : Parametro | Descripcion ===================================================== nombrecontenedor | Indica el nombre del contenedor donde sera mostrada la tabla | puede ser un DIV u otra TABLA nombretabla | Indica el id que se le asignara a la tabla Creada : 25/06/2015 Autor : epollongo
function genera_tabla(nombrecontenedor, nombretabla) { //// Obtener la referencia del elemento body //var body = document.getElementsByTagName("body")[0]; //// Crea un elemento <table> y un elemento <tbody> //var tabla = document.createElement("table"); //var tblBody = document.createElement("tbody"); //// Crea las celdas //for (var i = 0; i < 2; i++) { // // Crea las hileras de la tabla // var hilera = document.createElement("tr"); // for (var j = 0; j < 2; j++) { // // Crea un elemento <td> y un nodo de texto, haz que el nodo de // // texto sea el contenido de <td>, ubica el elemento <td> al final // // de la hilera de la tabla // var celda = document.createElement("td"); // var textoCelda = document.createTextNode("celda en la hilera " + i + ", columna " + j); // celda.appendChild(textoCelda); // hilera.appendChild(celda); // } // // agrega la hilera al final de la tabla (al final del elemento tblbody) // tblBody.appendChild(hilera); //} //// posiciona el <tbody> debajo del elemento <table> //tabla.appendChild(tblBody); //// appends <table> into <body> //body.appendChild(tabla); //// modifica el atributo "border" de la tabla y lo fija a "2"; //tabla.setAttribute("border", "2"); //var resultArr = JSON.parse(datos); //alert(resultArr[0].name); var tabla = '<table id="' + nombretabla + '">'; tabla += '<caption>Lista de Items</caption>'; tabla += '<thead>'; tabla += '<tr>'; tabla += '<th>Codigo</th>'; tabla += '<th>Descripcion</th>'; tabla += '<th>Tipo Item</th>'; tabla += '<th>Uni. Med.</th>'; tabla += '<th>Stck. Min.</th>'; tabla += '<th>Stck. Max</th>'; tabla += '<th>Cantidad</th>'; tabla += '<th>Id</th>'; tabla += '</tr>'; tabla += '</thead>'; tabla += '<tr class="color">'; tabla += '<td>11' + datos + '</td>'; tabla += '<td>Daniel</td>'; tabla += '</tr>'; tabla += '<tr class="coloralter">'; tabla += '<td>12</td>'; tabla += '<td>Carlos</td>'; tabla += '</tr>'; tabla += '<tr class="color"">'; tabla += '<td>13</td>'; tabla += '<td>kike</td>'; tabla += '</tr>'; tabla += '</table>'; //var tabla = '<table id="table">'; //tabla += '<tr><td>Celda 1</td><td>Celda 2</td><td> Celda 3</td></tr>'; //tabla += '<tr><td>Celda 1</td><td>Celda 2</td><td> Celda 3</td></tr>'; //tabla += '<tr><td>Celda 1</td><td>Celda 2</td><td> Celda 3</td></tr>'; //tabla += '</table>'; document.getElementById(nombrecontenedor).innerHTML = tabla; //alert('hola'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generarTablaEj (){\r\n buscarEjXNivDocEntrega();\r\n document.querySelector(\"#divEjalumnos\").innerHTML = `<table id=\"tabEjAlumno\" border='2px' style='background-color: #FA047F; position: relative;'>\r\n <th>Título</th><th>Docente</th><th>Nivel</th>`;\r\n for(let iterador = 0; iterador<= ej...
[ "0.82200724", "0.79015505", "0.77582127", "0.7605332", "0.7583132", "0.74891543", "0.74492", "0.742933", "0.741466", "0.737512", "0.7348697", "0.73383087", "0.7257926", "0.72575957", "0.7212558", "0.7209831", "0.72043747", "0.71852994", "0.7161662", "0.71552336", "0.71512365"...
0.8353068
0
Use this method if you have a dataobject
bindData(field) { if (field) { this._fieldNode = field; this._fieldNode.addEventListener('field-value-changed', e => { // TODO we need a solution for complex fields. Currently only scalar values are working properly this.value = e.detail._value; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveData(data)\n{\n\tobjectData = data;\n}", "init(data) {\r\n this.object = data.object;\r\n }", "get data () {return this._data;}", "function getDataObject(state) {\n\t var data = state.data;\n\t if (!data) {\n\t data = state.data = __webpack_require__(198).create(getComponentDataID...
[ "0.6613955", "0.65691936", "0.6275977", "0.6263572", "0.6262527", "0.6169354", "0.61335707", "0.6132601", "0.6128585", "0.6128585", "0.6125784", "0.612326", "0.6077457", "0.60598016", "0.6031358", "0.6031358", "0.6029271", "0.6018686", "0.60073495", "0.59938806", "0.5988676",...
0.0
-1
function to enable or disable tracing
function enableDisable() { if(this.checked()) tr = true; else tr = false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "enableDebugLogging(enable) {\n HyperTrack.enableDebugLogging(enable);\n }", "TraceOnly(...args) { this.do_log(\"TRACE\", args, false); }", "disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider_1.Pr...
[ "0.6727714", "0.6614887", "0.65996647", "0.62511593", "0.62457085", "0.62191814", "0.62191814", "0.61237", "0.610711", "0.598205", "0.584575", "0.5751544", "0.5733407", "0.5699729", "0.56820804", "0.56788826", "0.566025", "0.56535053", "0.5646976", "0.5637084", "0.5622808", ...
0.0
-1
function to trace where the balls are. It also removes elements if there start to be too many.
function tracing() { points.push({xx,yy}); for(let i = 0; i < points.length;i++) { ellipse(points[i].xx, points[i].yy,10); } if(points.length >= maxPoints ) points.splice(0,1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showCannonBalls(ball, index)\n{\n //do 5 and then call the function inside draw() line 85\n ball.display();\n\n //do7 and goto \"CannonBall.js\" for trajectory\n //remove the ball once it hits the ground or out of the canvas\n if(ball.body.position.x >= width ||ball.body.position.y >=height -...
[ "0.6191711", "0.61684376", "0.6167681", "0.6126593", "0.61099666", "0.59927267", "0.59905577", "0.59178716", "0.59087956", "0.58950776", "0.58384323", "0.579178", "0.5789978", "0.57842374", "0.57484835", "0.5722992", "0.57105625", "0.56586874", "0.565653", "0.5636824", "0.562...
0.55718887
23
function to clear the points array
function clearPoints() { points = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() { this._points.length = 0; }", "static clearPoints(){\n pointMarkers = [];\n }", "function resetPoints() {\n funcionPoints = [];\n areaPoints = [];\n insidePoints = [];\n outsidePoints = [];\n }", "function resetCoordinates() {\n console.log('rese...
[ "0.8701126", "0.8368637", "0.79437363", "0.74197924", "0.7246556", "0.72284037", "0.7178039", "0.7170296", "0.7170296", "0.71398", "0.7132375", "0.7105169", "0.70594084", "0.7034979", "0.70067066", "0.7002846", "0.69889235", "0.6975775", "0.6958515", "0.69159013", "0.6910785"...
0.91288203
0
Making a GET request to get information about the place
function makeFoursquareRequest(locationData){ let latLong = locationData.location.lat + "," + locationData.location.lng; let _finalUrl = baseUrl + latLong; return $.getJSON(_finalUrl) .done(function (data) { return (data.response.venues[0]); }).fail(function (error) { console.log(error.responseJSON.meta.errorDetail); return error; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPlaces(){\n // Get places : this function is useful to get the ID of a PLACE\n // Ajust filters, launch search and view results in the log\n // https://developers.jivesoftware.com/api/v3/cloud/rest/PlaceService.html#getPlaces(List<String>, String, int, int, String)\n\n // Filters\n // ?filter=se...
[ "0.72375524", "0.69392", "0.6839881", "0.66801876", "0.6667709", "0.6655008", "0.66491616", "0.664312", "0.6636522", "0.6541243", "0.64995754", "0.6483924", "0.6477088", "0.64559746", "0.6429483", "0.64237016", "0.64232045", "0.6398689", "0.63774294", "0.63665754", "0.6362273...
0.0
-1
SAVE TOOLBOX SETTINGS //////////////////////////////////////////////////// Save the current configuration setup
function mqc_save_config(name, clear, as_default){ if(name === undefined){ return false; } var config = {}; // Collect the toolbox vars config['highlights_f_texts'] = window.mqc_highlight_f_texts; config['highlights_f_cols'] = window.mqc_highlight_f_cols; config['highlight_regex'] = window.mqc_highlight_regex_mode; config['rename_from_texts'] = window.mqc_rename_f_texts; config['rename_to_texts'] = window.mqc_rename_t_texts; config['rename_regex'] = window.mqc_rename_regex_mode; config['hidesamples_mode'] = window.mqc_hide_mode; config['hidesamples_f_texts'] = window.mqc_hide_f_texts; config['hidesamples_regex'] = window.mqc_hide_regex_mode; var prev_config = {}; // Load existing configs (inc. from other reports) try { try { prev_config = localStorage.getItem("mqc_config"); if(prev_config !== null && prev_config !== undefined){ prev_config = JSON.parse(prev_config); } else { prev_config = {}; } // Update config obj with current config if(clear == true){ delete prev_config[name]; } else { prev_config[name] = config; prev_config[name]['last_updated'] = Date(); if (as_default) { for (var c in prev_config) { if (prev_config.hasOwnProperty(c)) { prev_config[c]['default'] = false; } } } prev_config[name]['default'] = as_default; if (as_default) console.log('Set new default config!'); } localStorage.setItem("mqc_config", JSON.stringify(prev_config)); } catch(e){ console.log('Could not access localStorage'); } if(clear == true){ // Remove from load select box $("#mqc_loadconfig_form select option:contains('"+name+"')").remove(); // Successfully deleted message $('<p class="text-danger" id="mqc-cleared-success">Settings deleted.</p>').hide().insertBefore($('#mqc_loadconfig_form .actions')).slideDown(function(){ setTimeout(function(){ $('#mqc-cleared-success').slideUp(function(){ $(this).remove(); }); }, 5000); }); } else { // Remove from load select box $("#mqc_loadconfig_form select option:contains('"+name+"')").remove(); // Add new name to load select box and select it $('#mqc_loadconfig_form select').prepend('<option>'+name+(as_default?' [default]':'')+'</option>').val(name+(as_default?' [default]':'')); // Success message $('<p class="text-success" id="mqc-save-success">Settings saved.</p>').hide().insertBefore($('#mqc_saveconfig_form')).slideDown(function(){ setTimeout(function(){ $('#mqc-save-success').slideUp(function(){ $(this).remove(); }); }, 5000); }); } } catch(e){ console.log('Error updating localstorage: '+e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveSettings() {\n // debug('Saved');\n localStorage.setItem('autoTrimpSettings', JSON.stringify(autoTrimpSettings));\n}", "function saveSettings(){\n\n showMenu();\n\n for (key in settingTmp){\n if (settingTmp.hasOwnProperty(key)){\n setting[key] = settingT...
[ "0.7208599", "0.71810865", "0.7060235", "0.6998985", "0.69691646", "0.6925619", "0.6856062", "0.6810108", "0.680061", "0.6796969", "0.66950786", "0.66673774", "0.66582334", "0.6613587", "0.6612949", "0.6598265", "0.6537663", "0.6528071", "0.65208125", "0.65110993", "0.6477532...
0.643238
28
Clear current default configuration
function mqc_clear_default_config() { try { var config = localStorage.getItem("mqc_config"); if (!config) { return; } else { config = JSON.parse(config); } for (var c in config) { if (config.hasOwnProperty(c)) { config[c]['default'] = false; } } localStorage.setItem("mqc_config", JSON.stringify(config)); $('<p class="text-danger" id="mqc-cleared-success">Unset default.</p>').hide().insertBefore($('#mqc_loadconfig_form .actions')).slideDown(function () { setTimeout(function () { $('#mqc-cleared-success').slideUp(function () { $(this).remove(); }); }, 5000); var name = $('#mqc_loadconfig_form select option:contains("default")').text(); $('#mqc_loadconfig_form select option:contains("default")').remove(); name = name.replace(' [default]', ''); $('#mqc_loadconfig_form select').append('<option>'+name+'</option>').val(name); }); } catch (e) { console.log('Could not access localStorage'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearConfig() {\n config = null;\n}", "resetConfig()\n {\n this.config = this._defaultConfig();\n }", "resetConfig()\n {\n this.config = this._defaultConfig();\n }", "function resetConfig() {\n writeConfig(skyuxConfigOriginal);\n}", "static reset() {\n return config ...
[ "0.7762206", "0.77241397", "0.77241397", "0.74209386", "0.7419752", "0.72771007", "0.70891136", "0.70038307", "0.69577175", "0.6948397", "0.67853403", "0.6777378", "0.6777378", "0.6751369", "0.6686306", "0.6678968", "0.6643902", "0.65610236", "0.6545301", "0.65019447", "0.644...
0.7693023
3
LOAD TOOLBOX SAVE NAMES
function populate_mqc_saveselect(){ var default_config = ''; try { var local_config = localStorage.getItem("mqc_config"); if(local_config !== null && local_config !== undefined){ local_config = JSON.parse(local_config); default_name = false; for (var name in local_config){ if (local_config[name]['default']) { console.log('Loaded default config!'); load_mqc_config(name); default_config = name; name = name+' [default]'; default_name = name; } $('#mqc_loadconfig_form select').append('<option>'+name+'</option>').val(name); } // Set the selected select option if(default_name !== false){ $('#mqc_loadconfig_form select option:contains("'+default_name+'")').prop('selected',true); } else { $('#mqc_loadconfig_form select option:first').prop('selected',true); } } } catch(e){ console.log('Could not load local config: '+e); $('#mqc_saveconfig').html('<h4>Error accessing localStorage</h4>'+ '<p>This feature uses a web browser feature called "localStorage". '+ "We're not able to access this at the moment, which probably means that "+ 'you have the <em>"Block third-party cookies and site data"</em> setting ticked (Chrome) '+ 'or equivalent in other browsers.</p><p>Please '+ '<a href="https://www.google.se/search?q=Block+third-party+cookies+and+site+data" target="_blank">change this browser setting</a>'+ ' to save MultiReport report configs.</p>'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Save() {\n win.name = JSON.stringify(store);\n }", "static get dialogRegisterTable() { \n return ToolDlg.nameRegister;\n }", "function onSellectMenuChange() {\n chrome.storage.sync.get(null, function(items) {\n // var keys = Object.keys(items);\n const curkey = document.getE...
[ "0.5954269", "0.58257085", "0.5644811", "0.55699027", "0.54581124", "0.54412514", "0.54160476", "0.53947806", "0.5393641", "0.5378261", "0.537613", "0.5373785", "0.53468716", "0.53449196", "0.5325007", "0.53202486", "0.53152627", "0.5314203", "0.5299553", "0.5291723", "0.5281...
0.0
-1
Get the balance of a single token for a single address.
function getTokenBalance(url, scriptHash, address) { return __awaiter(this, void 0, void 0, function* () { const sb = new neon_core_1.sc.ScriptBuilder(); abi.decimals(scriptHash)(sb); abi.balanceOf(scriptHash, address)(sb); const script = sb.str; try { const res = yield neon_core_1.rpc.Query.invokeScript(script).execute(url); const decimals = neon_core_1.rpc.IntegerParser(res.result.stack[0]); return neon_core_1.rpc .Fixed8Parser(res.result.stack[1]) .mul(Math.pow(10, 8 - decimals)); } catch (err) { log.error(`getTokenBalance failed with : ${err.message}`); throw err; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTokenBalance(address, tokenName) {\n\n\tvar result = null;\n\n\ttokenAddress = getTokenAddress(tokenName);\n\n var scriptUrl = \"https://\" + network + \".etherscan.io/api?module=account&action=tokenbalance&contractaddress=\" + tokenAddress + \"&address=\" + address + \"&tag=latest&apikey=\"+ apiKey...
[ "0.81202614", "0.79067683", "0.78906536", "0.78245914", "0.7817337", "0.70537084", "0.6981081", "0.6966627", "0.69659144", "0.69415474", "0.68787974", "0.68284637", "0.6746437", "0.6735614", "0.6703413", "0.66860366", "0.66718316", "0.6648983", "0.6628021", "0.6615178", "0.66...
0.70385855
6
Get token balances for an address.
function getTokenBalances(url, scriptHashArray, address) { return __awaiter(this, void 0, void 0, function* () { const sb = new neon_core_1.sc.ScriptBuilder(); scriptHashArray.forEach((scriptHash) => { abi.symbol(scriptHash)(sb); abi.decimals(scriptHash)(sb); abi.balanceOf(scriptHash, address)(sb); }); const res = yield neon_core_1.rpc.Query.invokeScript(sb.str).execute(url); const tokenList = {}; if (!res || !res.result || !res.result.stack || res.result.stack.length !== 3 * scriptHashArray.length) { throw new Error("Stack returned was invalid"); } try { for (let i = 0; i < res.result.stack.length; i += 3) { try { const symbol = neon_core_1.rpc.StringParser(res.result.stack[i]); const decimals = neon_core_1.rpc.IntegerParser(res.result.stack[i + 1]); tokenList[symbol] = neon_core_1.rpc .Fixed8Parser(res.result.stack[i + 2]) .mul(Math.pow(10, 8 - decimals)); } catch (e) { log.error(`single call in getTokenBalances failed with : ${e.message}`); throw e; } } return tokenList; } catch (err) { log.error(`getTokenBalances failed with : ${err.message}`); throw err; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getTokenBalanceAtAddress(token_contract_address, address) {\n const erc20Contract = new ERC20Contract(this.client, token_contract_address);\n let p_token_balance = erc20Contract.balanceOf(address).call();\n let p_decimals = erc20Contract.decimals().call();\n return Promise.all([p_...
[ "0.7731881", "0.7414648", "0.725718", "0.7127482", "0.71188504", "0.69222885", "0.69140357", "0.6754907", "0.67506003", "0.6740307", "0.6739598", "0.6652038", "0.664575", "0.66367024", "0.6601324", "0.6573403", "0.6526781", "0.6526321", "0.6477333", "0.6447593", "0.6403037", ...
0.6761924
7
Retrieves the complete information about a token.
function getToken(url, scriptHash, address) { return __awaiter(this, void 0, void 0, function* () { const parser = address ? parseTokenInfoAndBalance : parseTokenInfo; const sb = new neon_core_1.sc.ScriptBuilder(); abi.name(scriptHash)(sb); abi.symbol(scriptHash)(sb); abi.decimals(scriptHash)(sb); abi.totalSupply(scriptHash)(sb); if (address) { abi.balanceOf(scriptHash, address)(sb); } const script = sb.str; try { const res = yield neon_core_1.rpc.Query.invokeScript(script) .parseWith(parser) .execute(url); const result = { name: res[0], symbol: res[1], decimals: res[2], totalSupply: res[3].div(Math.pow(10, 8 - res[2])).toNumber(), }; if (address) { result.balance = res[4].div(Math.pow(10, 8 - res[2])); } return result; } catch (err) { log.error(`getToken failed with : ${err.message}`); throw err; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getToken() {\n return token;\n }", "getToken() { return this.token.getToken(); }", "function getToken() {\n return token || null;\n }", "getToken() {\n return _token;\n }", "function getToken() {\n\t\treturn store.getItem(key);\n\t}", "async getTokenInfo() {\n try {\n ...
[ "0.75403905", "0.7270433", "0.69792247", "0.69213736", "0.68810505", "0.6831757", "0.67906076", "0.66510165", "0.6624024", "0.6595013", "0.65682405", "0.6557997", "0.65265566", "0.6496171", "0.64702255", "0.6447858", "0.6411056", "0.6406262", "0.6383095", "0.637837", "0.63364...
0.0
-1
Retrieves the complete information about a list of tokens.
function getTokens(url, scriptHashArray, address) { return __awaiter(this, void 0, void 0, function* () { try { const sb = new neon_core_1.sc.ScriptBuilder(); scriptHashArray.forEach((scriptHash) => { abi.name(scriptHash)(sb); abi.symbol(scriptHash)(sb); abi.decimals(scriptHash)(sb); abi.totalSupply(scriptHash)(sb); if (address) { abi.balanceOf(scriptHash, address)(sb); } }); const res = yield neon_core_1.rpc.Query.invokeScript(sb.str).execute(url); const result = []; const step = address ? 5 : 4; for (let i = 0; i < res.result.stack.length; i += step) { const name = neon_core_1.rpc.StringParser(res.result.stack[i]); const symbol = neon_core_1.rpc.StringParser(res.result.stack[i + 1]); const decimals = neon_core_1.rpc.IntegerParser(res.result.stack[i + 2]); const totalSupply = neon_core_1.rpc .Fixed8Parser(res.result.stack[i + 3]) .dividedBy(Math.pow(10, decimals - neon_core_1.rpc.IntegerParser(res.result.stack[i + 2]))) .toNumber(); const balance = address ? neon_core_1.rpc .Fixed8Parser(res.result.stack[i + 4]) .dividedBy(Math.pow(10, decimals - neon_core_1.rpc.IntegerParser(res.result.stack[i + 2]))) : undefined; const obj = { name, symbol, decimals, totalSupply, balance, }; if (!obj.balance) { delete obj.balance; } result.push(obj); } return result; } catch (err) { log.error(`getTokens failed with : ${err.message}`); throw err; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async loadTokensList() {\n return null;\n }", "async getTokens() {\n const apiURL = `${this.dxApiURL}/v1/tokens`\n const res = await fetcher(apiURL)\n\n return res.data\n }", "static loadTokensList() {\n const { availableTokens, network, walletAddress } = store.getState();\n\n if (network !...
[ "0.68495333", "0.6633653", "0.66241413", "0.6487117", "0.64436954", "0.6350066", "0.61923903", "0.6089832", "0.6050164", "0.6036188", "0.5912731", "0.59013", "0.58604354", "0.583489", "0.57921827", "0.57819235", "0.5742525", "0.56838816", "0.5644512", "0.56025696", "0.560115"...
0.0
-1
parameter: listName Name of the list element & attrName name of the attribute jerome orio 11.11.2010
function getListAttributeValue(listName,attrName) { return $(listName).options[$(listName).selectedIndex].getAttribute(attrName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sort(list, attrName){\n for(var i=0; i<list.length-1; i++)\n for(var j=i+1; j<list.length; j++){\n var left = list[i],\n right = list[j];\n if (left[attrName] > right[attrName]){\n list[i] = list[...
[ "0.6432026", "0.5935259", "0.59318656", "0.5926807", "0.59242356", "0.5908996", "0.5741406", "0.56504714", "0.56498724", "0.5624665", "0.5615267", "0.5597061", "0.55547196", "0.55153906", "0.54967004", "0.5494294", "0.5491306", "0.5460358", "0.54411495", "0.54212165", "0.5397...
0.75287646
0
========================================================================= LOCAL LOGIN ============================================================= =========================================================================
function checkUser(user){ console.log('check User called'); console.log(user); User.findOne({ 'email' : user.email }, function(err, usr) { if(err) console.log('Check user fetch record failed : '+err); else { console.log('Checking user status'); if(usr.status==false){ console.log('removing the user'); User.remove({'email': usr.email, 'status':false},function(err,doc){ if(err) console.log('Remove User id failed during cleanup') else{ console.log('Remove status for user:'+ usr.email+': '+doc); } }) } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function login() {}", "function localLogin() {\n Message.loading();\n User.login({}, LoginModel.form).$promise\n .then(function(userWrapper) {\n Message.hide();\n console.log(\"---------- userWrapper ----------\");\n console.log(userWrapper);\n AppStorage.user...
[ "0.74511665", "0.72027874", "0.7157384", "0.69809806", "0.68003917", "0.6781398", "0.6776692", "0.67684656", "0.6767623", "0.6723946", "0.67120516", "0.6645907", "0.66311973", "0.6523413", "0.6509918", "0.646389", "0.6451152", "0.6446156", "0.6435909", "0.63758534", "0.637576...
0.0
-1
var cod = document.getElementById("producto").value;
function calculateSubTot(priceTot,state){ var tax; switch(state){ case "UT": tax = 0.0665; break; case "NV": tax = 0.08; break; case "TX": tax = 0.0625; break; case "AL": tax = 0.04; break; case "CA": tax = 0.0825; break; default: break; } return priceTot+(priceTot*tax); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtener_datos (){\n\n var nombre = document.getElementById(\"NOMBRE\").value;\n\n comprobar_datos(nombre);\n}", "function buscar_paisseleccionado() {\r\n\tvar pais_seleccionado = document.getElementById(\"pais\").value;\r\n\talert(\"Pais seleccionado \" + pais_seleccionado);\r\n\r\n}", "function...
[ "0.7785914", "0.7774", "0.75766546", "0.75711584", "0.7112004", "0.7110357", "0.71027386", "0.7030439", "0.70247114", "0.697413", "0.6845972", "0.6806636", "0.6799121", "0.6771392", "0.6767987", "0.6752583", "0.67392886", "0.67181855", "0.67161065", "0.6697322", "0.66824687",...
0.0
-1
1000 3% 3000 5% 7000 7% 10000 10% 30000 15%
function calculateDiscount(total) { var discount = 0; if(total>= 30000){ discount = 0.15; } else if(total>= 10000){ discount = 0.10; } else if(total>= 7000){ discount = 0.07; } else if(total>= 3000){ diacaunt = 0.05; } else if(total>= 1000){ discount = 0.03; } return (total*discount); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toBarPerc(n) {\nreturn (-1 + n) * 100;\n}", "function fin(percent){\r\n return 1 - Math.pow(2,-Math.min(percent,1)*6); \r\n}", "function calcPercent(value, sum) {\r\n return (100*value/sum);\r\n}", "function percentage() {\n return percent;\n}", "function percentOf(val, percent) {\r\n r...
[ "0.6742586", "0.6714021", "0.6441697", "0.64266217", "0.64233595", "0.63799506", "0.6362564", "0.63609844", "0.6344192", "0.6338266", "0.62694126", "0.62694126", "0.62694126", "0.62694126", "0.62694126", "0.62694126", "0.62694126", "0.62694126", "0.62694126", "0.62694126", "0...
0.0
-1
Generate random values for the gauge
function random() { let value = Math.floor(Math.random() * maxValue * 0.4) + maxValue * 0.8; chart.arrows[0].setValue(value); chart.axes[0].setTopText(Math.round(value).toLocaleString('en-us') + " kW/h"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function creategemValues() {\n oneValue = Math.floor(Math.random() * 12 + 2);\n twoValue = Math.floor(Math.random() * 12 + 2);\n threeValue = Math.floor(Math.random() * 12 + 2);\n fourValue = Math.floor(Math.random() * 12 + 2);\n}", "function generateVal() {\n return Math.floor((Math.random() ...
[ "0.7302268", "0.7206264", "0.71878165", "0.7127715", "0.7121928", "0.70863444", "0.70213896", "0.70187676", "0.6965383", "0.6933345", "0.69160336", "0.6881424", "0.68804747", "0.6871457", "0.68393356", "0.68283546", "0.67420745", "0.6732205", "0.67090523", "0.668194", "0.6679...
0.6871723
13
only referenced locally for async methods; could export in basic creators somewhere else to be loaded into a separate async actions file
function fetchOrganizationsRequest(requested) { return { type : ActionTypes.FETCH_ORGANIZATIONS_REQUEST, requested }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async method(){}", "async method(){}", "async init () {}", "async init() {\n\n }", "async init() {}", "async init() {}", "async function asyncWrapperFunction() {\r\n await htmlRouting();\r\n await videoRouting();\r\n const data = await dataProcessing();\r\n const nodes = await nodes...
[ "0.7208191", "0.6556505", "0.6473654", "0.6440973", "0.6331468", "0.6331468", "0.6171207", "0.609891", "0.6090381", "0.60726297", "0.6059348", "0.6027579", "0.6027579", "0.6003493", "0.59877723", "0.5961575", "0.59286803", "0.592296", "0.5906168", "0.5889659", "0.58638275", ...
0.0
-1
Make a function named `isTrue(boolean)`
function isTtrue(bool){ return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myBoolean() {\n return true;\n}", "function myBooleanIf(boolean) {\n return boolean;\n}", "function Boolean() {}", "function isSomethingTrue(x){\n return x;\n}", "function ourTrueOrFalse(isItTrue) {\n if (isItTrue) {\n return \"yes, it´ss true\";\n }\n return \"no,it´s false\";\n}", ...
[ "0.7214063", "0.721057", "0.70971394", "0.7060919", "0.70456284", "0.7031977", "0.7029641", "0.7013029", "0.70077807", "0.69793", "0.69496655", "0.68128514", "0.6784592", "0.676499", "0.674007", "0.67277616", "0.66881925", "0.6681328", "0.66734797", "0.6671486", "0.6656702", ...
0.62383515
47
console.log(isTtrue()) Make a function named `isFalse(boolean)`
function isFalse(bool){ return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ourTrueOrFalse(isItTrue) {\n if (isItTrue) {\n return \"yes, it´ss true\";\n }\n return \"no,it´s false\";\n}", "function ourTrueOrFalse(isItTrue) {\n if (isItTrue) { \n return \"Yes, it's true\";\n }\n return \"No, it's false\";\n}", "function ourTrueOrFalse(isItTrue) {\n if (isItTrue) {...
[ "0.7304226", "0.71651804", "0.71545833", "0.71322954", "0.71314174", "0.71189004", "0.70679635", "0.70129466", "0.6970516", "0.69522035", "0.6923313", "0.6893958", "0.68898535", "0.68472606", "0.6825665", "0.6817069", "0.675288", "0.67489725", "0.67489725", "0.6729673", "0.67...
0.68307036
14
console.log(isFalse()) Make a function named `isTruthy(input)`, remember that values other than true will behave like true
function isTruthy(input){ return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isTruthy(input){\n return input == 1;\n}", "function isTruthy(input) {\n return input ? 1 : 0;\n}", "function isTruthy(input) {\n return input ? 0 : 1;\n}", "function checkTruthy(input) {\n console.log(`\ninput = ${input}, and is typeof: ${typeof(input)}\nand input is ${!!input}`)\n}", "...
[ "0.8556152", "0.8516337", "0.8494826", "0.8107228", "0.80138284", "0.7965969", "0.79117936", "0.79117936", "0.790146", "0.7832918", "0.77528334", "0.77528334", "0.77528334", "0.77019244", "0.75359106", "0.75277805", "0.75245583", "0.7475308", "0.74746376", "0.7324626", "0.720...
0.86541396
0
Make a function named `isFalsy(input)`, remember that values other than false behave like false
function isFalsy(input){ return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFalsy(input){\n\n}", "function isFalsy(input) {\n return ((bool) || (!bool)) !== true;\n }", "function isFalsy(v) {\n return !v;\n}", "function isNotFalsy(value) {\n\t\t return Boolean(value);\n\t }", "function falsy(x) {\n return !truthy(x);\n}", "function is_falsy(value) {\n ret...
[ "0.9250993", "0.824536", "0.76063955", "0.7515067", "0.7494229", "0.7477422", "0.74131924", "0.73669183", "0.73364145", "0.719547", "0.70905435", "0.7022575", "0.7012945", "0.6961829", "0.6892721", "0.6877432", "0.6794678", "0.6555195", "0.6506004", "0.6465143", "0.6456403", ...
0.84964114
1
Page object condensed map
function Acre() { this.terrain = ""; this.features = new Collection(); this.npcs = new Collection(); this.pcs = new Collection(); this.localLight = {}; this.localSound = {}; this.topSound = ""; this.x; this.y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pageInfo() {\n var nums = numbers(),\n pages = pager.pages(),\n pdata = sparse(pages),\n res;\n\n //Get the hashes.\n $scope.info.forEach(copyHash);\n\n //Get the info\n res = nums.map(info);\n\n ...
[ "0.6034592", "0.594794", "0.59019357", "0.58593", "0.57251716", "0.56497014", "0.5644141", "0.5531095", "0.5525818", "0.5457853", "0.54391676", "0.54372543", "0.5435536", "0.54354775", "0.52721846", "0.52569765", "0.5239252", "0.52341205", "0.5191993", "0.51610845", "0.515577...
0.0
-1
Map Object one per map.
function GameMap() { this.data = []; // Each entry in the array will be an Object with .terrain, .features, and .npcs this.enterx = 65; this.entery = 70; this.name = ""; this.features = new Collection(); // list of all features on the map this.npcs = new Collection(); // list of all NPCs on the map this.pcs = new Collection(); // list of all PCs on the map - usually one, but support exists for parties // these three will be maintained concurrently with collections on individual tiles/acres this.desc = ""; this.longdesc = ""; this.music = ""; this.exitTo = {}; this.exitTo.mapname = "darkunknown"; this.exitTo.x = 65; this.exitTo.y = 70; this.wrap = "None"; this.returnmap = "darkunknown"; this.returnx = 27; this.returny = 43; this.returninfused = 0; this.linkedMaps = []; this.seeBelow = ""; this.lightLevel = "bright"; this.alwaysRemember = 0; this.scale = 1; this.backgroundimage = ''; this.underground = 0; this.undergroundDesc = ""; this.noiseSources = {}; this.savename = ''; this.exitScript = ""; this.exitTestScript = ""; this.enterScript = ""; this.enterTestScript = ""; this.pathGrid = {}; this.network = []; this.opacity = .6; this.lightsList = {}; this.soundList = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ObjectWithMap(){\r\n\t\r\n\tthis.map = (func) => {\r\n\t\t\r\n\t\tfor (let i in this){\r\n\t\t\tif(i != 'map') this[i] = func(this[i]);\r\n\t\t}\r\n\t\t\r\n\t}\r\n}", "function ObjectMap ()\n\t{\n\t\t\n\t\t/**\n\t\t * Key value pairs\n\t\t * \n\t\t * @type {array of objects}\n\t\t */\n\t\tthis._keyValue...
[ "0.69574267", "0.65020543", "0.6464171", "0.64509696", "0.64199173", "0.629329", "0.62646365", "0.6237649", "0.6237649", "0.6197769", "0.61852235", "0.61793655", "0.6131195", "0.6104524", "0.6101688", "0.6035231", "0.6014405", "0.6007991", "0.5989648", "0.5976659", "0.5935087...
0.0
-1
Turns Degree into Wind Direction
function getDir(num) { const val = parseInt(num / 45 + 0.5) const dir = ['N', 'NE', 'E', 'SE', 'S', 'SW', 'W', 'NW'] return dir[val % dir.length] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function windDirection(degree) {\n if (degree <= 25 || degree >= 335 ) {\n return \"N\";\n } else if (degree > 25 && degree <= 65) {\n return \"NE\";\n } else if (degree > 65 && degree <= 115) {\n return \"E\";\n } else if (degree > 115 && degree <= 155) {\n return \"SE\";\n } else if (degree > 15...
[ "0.77208745", "0.754105", "0.7521744", "0.7380625", "0.7198231", "0.700218", "0.69751173", "0.6755742", "0.6693821", "0.6653324", "0.65619564", "0.65607464", "0.6305419", "0.6290804", "0.6284115", "0.6247079", "0.61833525", "0.6182476", "0.60951704", "0.60674006", "0.60642713...
0.57645273
46
Turns weekday number into day
function getWeekDay(date) { const weekdays = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ] date = new Date(date * 1000).getDay() return weekdays[date] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dayConvert(day) {\n\t\tday = parseInt(day);\n\t\t\n\t\t// just handle the cases for numbers 1-31\n\t\tif (day===1 || day===21 || day===31) {\n\t\t\treturn day + 'st';\n\t\t}\n\t\telse if (day===2 || day===22) {\n\t\t\treturn day + 'nd';\n\t\t}\n\t\telse if (day===3 || day===23) {\n\t\t\treturn day + 'rd';...
[ "0.718631", "0.71509033", "0.70874995", "0.70505434", "0.70122325", "0.6974612", "0.68139863", "0.6798424", "0.676559", "0.67217565", "0.6688863", "0.66465515", "0.6643206", "0.6592927", "0.65855384", "0.6578126", "0.65620816", "0.6560162", "0.6550533", "0.65100604", "0.65054...
0.0
-1
Get Coordinates bas off Zip
function getZip(zip) { return new Promise((resolve, reject) => { openDataZip(zip) .then((data) => { const location = JSON.parse(data).records[0].fields resolve({ city: location.city, lon: location.longitude, lat: location.latitude }) }) .catch((error) => { reject(error) }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCoordsFromZip(zipCode) {\n var coords;\n\n $.ajax({\n method: \"GET\",\n url: \"/weather/zipCode\",\n data: {\n zipCode: zipCode,\n },\n async: false,\n success: function (data) {\n coords = {\n lat: data.coord.lat,\n lon: data.coord.lon,\n cityName: d...
[ "0.6737198", "0.64400226", "0.63169974", "0.6311418", "0.62919027", "0.6291482", "0.6290736", "0.6288351", "0.6284496", "0.6283507", "0.62823826", "0.6279578", "0.6264625", "0.6264372", "0.626406", "0.62629193", "0.62580687", "0.625564", "0.6255397", "0.62530696", "0.62506586...
0.6870564
0
Get Coordinates bas off IP
function getIP(ip) { return new Promise((resolve, reject) => { // ipStack Call ipStack('GET', ip) // ip Stack Call Successful .then((data) => { const location = JSON.parse(data) resolve({ lat: location.latitude, lon: location.longitude, city: location.city }) }) .catch((error) => { reject(error) }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCoordinatesFromIP(ip) {\n var ipgeolocationAPIURL = 'https://api.ipgeolocation.io/ipgeo?apiKey=API_KEY&ip=1.1.1.1'\n const options = createOptionsForIPGeolocation(ipgeolocationAPIURL, ip);\n \n return new Promise(function (resolve, reject) {\n request(options, function (error, response, body) {\...
[ "0.76628095", "0.67472225", "0.6660772", "0.6607999", "0.64724123", "0.64639056", "0.6397776", "0.63898885", "0.63345534", "0.6307049", "0.62988114", "0.62868416", "0.62708515", "0.6198325", "0.6154751", "0.61232394", "0.60993254", "0.60466605", "0.6034098", "0.6026477", "0.6...
0.6705905
2
A function to create the marker and set up the event window Dont try to unroll this function. It has to be here for the function closure Each instance of the function preserves the contends of a different instance of the "marker" and "html" variables which will be needed later when the event triggers.
function createMarker(point,html) { var marker = new GMarker(point); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); return marker; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMarker(setMap, latlng, name, address1, address2, html){\n \n var map;\n var infoWindow;\n \n if(setMap == \"mapTop\"){\n map = mapTop;\n infoWindow = infoWindowTop;\n } else if (setMap == \"mapBottom\"){\n map = mapBottom;\n infoWindow = infoWindowBottom;\n } else i...
[ "0.7090899", "0.7054651", "0.6969521", "0.69187415", "0.6893246", "0.6861639", "0.6760341", "0.675333", "0.66674376", "0.6643152", "0.66400373", "0.6633825", "0.6627645", "0.6620509", "0.66078234", "0.65950453", "0.65369093", "0.65237635", "0.65182996", "0.6516053", "0.651574...
0.70177126
2