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
file input display image
function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#demo-img').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_img(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function(e) {\n $('.display_img')\n .attr('src', e.target.result)\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n}", "function...
[ "0.7873604", "0.76137674", "0.7537815", "0.7387745", "0.7329627", "0.73230183", "0.73168683", "0.7313166", "0.719928", "0.719796", "0.71181434", "0.71169096", "0.7093971", "0.70890105", "0.7072366", "0.70507735", "0.7035596", "0.7028494", "0.7017445", "0.7016131", "0.7000254"...
0.6667267
64
regex per la ricerca del nome dei prodotti
function escapeRegex(text) { return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regexVarII() {\n var re = /^(Mr|Mrs|Ms|Dr|Er)(\\.)([a-zA-Z]+$)/;\n return re;\n }", "function regExControleName (a){ \n if(/^(([a-zA-ZÀ-ÿ]+[\\s\\-]{1}[a-zA-ZÀ-ÿ]+)|([a-zA-ZÀ-ÿ]+))$/.test(a)){ \n return true;\n }else{ \n alert( `veuiller saisir que des lettres!!` );\n return...
[ "0.6632051", "0.6234149", "0.6168827", "0.6119626", "0.60707146", "0.58405125", "0.5699214", "0.5652003", "0.56446403", "0.5627968", "0.562362", "0.5615079", "0.55968195", "0.55546296", "0.5537735", "0.55130035", "0.55130035", "0.54991126", "0.54923964", "0.5487662", "0.54690...
0.0
-1
Set current properties of this edge to given properties
setProperties(properties) { for (const [key, value] of properties.entries()) { switch(key) { case "type": this.type = value; break; case "startArrowHead": this.startArrowHead = value; break; case "endArrowHead": this.endArrowHead = value; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTransitionProperties() {\n TransitionProperties.next = next;\n TransitionProperties.current = current;\n }", "function setTransitionProperties() {\n TransitionProperties.toState = toState;\n TransitionProperties.toParams = toParams;\n TransitionProperties.fromS...
[ "0.6100874", "0.6052847", "0.60270846", "0.60270846", "0.59366655", "0.5885472", "0.57240963", "0.56944996", "0.566307", "0.55880666", "0.54899", "0.5487572", "0.5454063", "0.54103035", "0.54077095", "0.53778654", "0.5364762", "0.53610855", "0.53460854", "0.5340886", "0.53094...
0.61721617
0
Abstract Get bounds of this edge.
getBounds() { throw "Abstract method" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get bounds() {}", "get bounds() { return this._bounds; }", "get bounds() {\n // Optimization to reduct calculations.\n // The result should be exactly the same if this is removed.\n if (this._bounds !== undefined) {\n return this._bounds;\n }\n\n if (this.$el == nu...
[ "0.81855094", "0.7830251", "0.76891845", "0.75247926", "0.742921", "0.7290647", "0.71162474", "0.70314974", "0.70314974", "0.7021087", "0.68655705", "0.67333686", "0.6725534", "0.6609773", "0.65945303", "0.65812236", "0.6570898", "0.6553765", "0.6548136", "0.64800644", "0.646...
0.7073846
7
Get two endpoints of this edge on the connected nodes
getConnectionPoints() { let startBound = this.startNode.getBounds() let endBound = this.endNode.getBounds() let startCenterX = (startBound.x + startBound.width) / 2 let startCenterY = (startBound.y + startBound.height) / 2 let endCenterX = (endBound.x + endBound.width) / 2 let endCenterY = (endBound.y + endBound.height) / 2 return [startNode.getConnectionPoint(endCenterX, endCenterY), endNode.getConnectionPoint(startCenterX, startCenterY)] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextEdge(side1, side2) {\r\n return side1 + side2 - 1;\r\n}", "function nextEdge(side1, side2) {\n return side1 + side2 - 1;\n}", "function nextEdge(side1, side2) {\n return (side1+side2)-1;\n}", "endpoints() {\n if (isNaN(this.theta)) {\n console.log(\"NaN for \" + this.p...
[ "0.6389285", "0.63676345", "0.6340149", "0.62521285", "0.61468995", "0.60395706", "0.60263973", "0.6009545", "0.59150165", "0.5859681", "0.58456075", "0.57369953", "0.57300323", "0.5711641", "0.5696568", "0.5692356", "0.5692356", "0.5691076", "0.56648374", "0.56533456", "0.56...
0.6542258
0
Download offline will check the RESOURCES for all files not in the cache and populate them.
async function downloadOffline() { var resources = []; var contentCache = await caches.open(CACHE_NAME); var currentContent = {}; for (var request of await contentCache.keys()) { var key = request.url.substring(origin.length + 1); if (key == "") { key = "/"; } currentContent[key] = true; } for (var resourceKey in Object.keys(RESOURCES)) { if (!currentContent[resourceKey]) { resources.push(resourceKey); } } return contentCache.addAll(resources); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentCont...
[ "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "...
0.7781333
8
Attempt to download the resource online before falling back to the offline cache.
function onlineFirst(event) { return event.respondWith( fetch(event.request).then((response) => { return caches.open(CACHE_NAME).then((cache) => { cache.put(event.request, response.clone()); return response; }); }).catch((error) => { return caches.open(CACHE_NAME).then((cache) => { return cache.match(event.request).then((response) => { if (response != null) { return response; } throw error; }); }); }) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentCont...
[ "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "...
0.6743336
79
Helper method for defining associations. This method is not a part of Sequelize lifecycle. The `models/index` file will call this method automatically.
static associate(models) { // define association here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static associate(models) {\n // define association here\n // This is how Sequelize knows to create \"magic methods\"\n // These are functions that can automatically pull\n // related data.\n // For example: If I have a User object\n // I can call `await user.getContacts()` to get an\n...
[ "0.76413774", "0.75078297", "0.7312548", "0.7306819", "0.7306819", "0.7306819", "0.7294662", "0.72838104", "0.7278665" ]
0.0
-1
Pass the new task to parent component and clear text input
handleSubmit(e){ e.preventDefault(); this.props.addTask(this.state); this.setState({ taskInput: "" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleAddTask() {\n this.props.addTask(this.state.input);\n this.setState({\n input: ''\n });\n }", "handleSubmit(e) {\n e.preventDefault();\n //not saving empty task\n if (this.state.toDoItem === '' || \n this.state.toDoItem == null ||\n ...
[ "0.6971168", "0.68635994", "0.6832812", "0.67408884", "0.6643608", "0.6583071", "0.6569322", "0.6560445", "0.65240586", "0.6503201", "0.648561", "0.64801806", "0.64697164", "0.6417042", "0.64090383", "0.6385186", "0.6384941", "0.63502544", "0.634172", "0.63192946", "0.6304765...
0.6557596
8
Maintain the input's state
handleChange(e){ let value = e.target.value; this.setState({ taskInput: value }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n\t this.value = this.originalInputValue;\n\t }", "update() {\n\t if (this.originalInputValue === '') {\n\t this._reset();\n\t }\n\t }", "update() {\n if (this.originalInputValue === '') {\n this._reset();\n }\n }", "setInput(input)...
[ "0.685485", "0.6784478", "0.6682718", "0.6661171", "0.6625464", "0.66195035", "0.6618487", "0.6459816", "0.64494205", "0.6446994", "0.64464784", "0.64404863", "0.6416027", "0.6390154", "0.6361348", "0.6342858", "0.6339924", "0.6317014", "0.62590057", "0.6246866", "0.624581", ...
0.0
-1
You are given an oddlength array of integers, in which all of them are the same, except for one single number. Complete the method which accepts such an array, and returns that single different number. The input array will always be valid! (oddlength >= 3) Examples [1, 1, 2] ==> 2 [17, 17, 3, 17, 17, 17, 17] ==> 3
function stray(n) { n = n.sort((a, b) => a - b); return n[0] === n[1] ? n[n.length - 1] : n[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doubleOddNumbers(arr) {}", "function solution (A) {\n const N = A.length\n\n if (N === 0) {\n // Empty A\n return A\n }\n\n if (N % 2 === 0 || N > 1000000) {\n // A does not contain an odd number of elements\n return A\n }\n\n if (A.find(x => (x < 1 || x > 1000000))) {\n // An A ele...
[ "0.7448977", "0.7037943", "0.70129853", "0.69723076", "0.6881864", "0.6853335", "0.6852994", "0.68240374", "0.68217665", "0.6784107", "0.6717896", "0.67043287", "0.67025167", "0.6680658", "0.6666755", "0.66442657", "0.6635107", "0.65713984", "0.65646994", "0.6556372", "0.6527...
0.0
-1
callback function when we get the response from the script on the tab
function getResponse(handleResponse, handleError) { // reset the result textarea resultTextarea.value = ""; var matches = handleResponse.results; for (var i = 0; i < matches.length; i++) { resultTextarea.value += matches[i]; } if (matches.length == 0 || matches == undefined){ matchesCount.innerText = "No Matches Found"; } else { matchesCount.innerText = `${matches.length} match${ matches.length > 1 ? 'es' : '' } found`; } // store current values in the storage so user doesn't have to type again when he comes back to popup storeCurrent(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callbackOnExecuteScript() {\n console.log(\"tabID \" + tabId);\n chrome.tabs.sendMessage(tabId, message);\n }", "function extract_data() {\n setChildTextNode(\"resultsRequest\", \"running...\");\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n var tab = t...
[ "0.6489205", "0.64500654", "0.61856866", "0.6150769", "0.6064036", "0.60603017", "0.6057351", "0.6000076", "0.5987592", "0.5979499", "0.59670115", "0.59537065", "0.5947971", "0.59200096", "0.5915242", "0.5898453", "0.5849637", "0.5836895", "0.58346117", "0.5831618", "0.582631...
0.0
-1
callback function when we get the response from the script on the tab
function getResponse(handleResponse, handleError) { try { var matches = handleResponse.results; if (handleResponse.selectedItemIndex > 0) { selectedItemIndex = handleResponse.selectedItemIndex storeCurrent(); return } selectedItemIndex = handleResponse.selectedItemIndex // reset the result textarea if (selectedItemIndex <= 0) { resultTextarea.value = ""; for (var i = 0; i < matches.length; i++) { resultTextarea.value += matches[i] + "\n"; } if (matches.length == 0 || matches == undefined) { matchesCount.innerText = "No Matches Found"; } else { matchesCount.innerText = `${matches.length} match${matches.length > 1 ? 'es' : ''} found`; } } // store current values in the storage so user doesn't have to type again when he comes back to popup storeCurrent(); } catch (ex) { window.eval(`console.error(ex)`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callbackOnExecuteScript() {\n console.log(\"tabID \" + tabId);\n chrome.tabs.sendMessage(tabId, message);\n }", "function extract_data() {\n setChildTextNode(\"resultsRequest\", \"running...\");\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n var tab = t...
[ "0.648892", "0.6451841", "0.61868155", "0.61511195", "0.6065421", "0.6059933", "0.60576016", "0.60009533", "0.59871465", "0.59802985", "0.5968581", "0.5953474", "0.5948605", "0.59204245", "0.5915501", "0.58991325", "0.585046", "0.58371705", "0.5834777", "0.5832256", "0.582895...
0.0
-1
callback function when we get the response from the script on the tab
function getResponse(handleResponse, handleError) { try { var matches = handleResponse.results; if (handleResponse.selectedItemIndex != matches.length -1) { selectedItemIndex = handleResponse.selectedItemIndex; storeCurrent(); return } selectedItemIndex = handleResponse.selectedItemIndex // reset the result textarea resultTextarea.value = ""; for (var i = 0; i < matches.length; i++) { resultTextarea.value += matches[i] + "\n"; } if (matches.length == 0 || matches == undefined) { matchesCount.innerText = "No Matches Found"; } else { matchesCount.innerText = `${matches.length} match${matches.length > 1 ? 'es' : ''} found`; } // store current values in the storage so user doesn't have to type again when he comes back to popup storeCurrent(); } catch (ex) { window.eval(`console.error(ex)`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callbackOnExecuteScript() {\n console.log(\"tabID \" + tabId);\n chrome.tabs.sendMessage(tabId, message);\n }", "function extract_data() {\n setChildTextNode(\"resultsRequest\", \"running...\");\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n var tab = t...
[ "0.6489205", "0.64500654", "0.61856866", "0.6150769", "0.6064036", "0.60603017", "0.6057351", "0.6000076", "0.5987592", "0.5979499", "0.59670115", "0.59537065", "0.5947971", "0.59200096", "0.5915242", "0.5898453", "0.5849637", "0.5836895", "0.58346117", "0.5831618", "0.582631...
0.0
-1
A function returns REGEX flags depending on user choices
function getFlags() { var flags = ""; // start with empty flags if (globalCheckbox.checked) { flags += "g"; } if (caseInsensitiveCheckbox.checked) { flags += "i"; } if (multilineCheckbox.checked) { flags += "m"; } return flags; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regex( text, flags){\n\treturn nr(new RegExp( text, flags))\n}", "function regex(flags) {\n return function(source) {\n return new RegExp (source, flags);\n };\n }", "function makeRegex(text,searchType){\n\tvar regex;\n\tswitch(searchType){\n\t\tcase 'starts_with':\n\t\t\tregex = new RegEx...
[ "0.6451156", "0.6443066", "0.63861513", "0.6315296", "0.62972987", "0.61596215", "0.60786945", "0.60277104", "0.5983477", "0.5976712", "0.5868753", "0.5815714", "0.58036554", "0.5798222", "0.5787266", "0.5777028", "0.5745256", "0.5745256", "0.57423306", "0.57413614", "0.57378...
0.54602486
47
Update save model inputs
function updateSaveModal() { regexInput_modal.value = regexInput.value; templateInput_modal.value = templateInput.value; globalCheckbox_modal.checked = globalCheckbox.checked; caseInsensitiveCheckbox_modal.checked = caseInsensitiveCheckbox.checked; multilineCheckbox_modal.checked = multilineCheckbox.checked; IgnoreHTMLCheckbox_modal.checked = IgnoreHTMLCheckbox.checked; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save() {\n this._mutateModel();\n\n this._super(...arguments);\n }", "saveAndClose() {\n this._mutateModel();\n\n this._super(...arguments);\n }", "function save(model) {\n // who knows what this does\n }", "async doUpdate () {\n\t\tif (Object.keys(this.changes).length ===...
[ "0.70475394", "0.6449124", "0.63459206", "0.6293932", "0.6222519", "0.61563414", "0.6123099", "0.61211646", "0.6061492", "0.6024969", "0.60214436", "0.6011942", "0.5996104", "0.5996104", "0.5978218", "0.5975524", "0.59657776", "0.5953566", "0.59368324", "0.5912318", "0.590681...
0.58771473
21
=== Storage functions === store current data for the next session if the user exits by mistake
function storeCurrent() { let currentData = { regexInput: regexInput.value, templateInput: templateInput.value, globalCheckbox: globalCheckbox.checked, caseInsensitiveCheckbox: caseInsensitiveCheckbox.checked, multilineCheckbox: multilineCheckbox.checked, IgnoreHTMLCheckbox: IgnoreHTMLCheckbox.checked, resultTextarea: resultTextarea.value, selectedItemIndex:selectedItemIndex, smallForm: smallFormCheckbox.checked }; let store = browser.storage.local.set({ currentData }); store.then(onError, onError); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storedData() {\n localStorage.setItem(\"journalEntry\", newEvent);\n const storedInput = localStorage.getItem(\"journalEntry\");\n\n // if(storageInput) {\n\n // }\n}", "function save_data() {\r\n\tsessionStorage.setItem('pieces', JSON.stringify(Data.pieces))\r\n\tsessionStorage.setItem('stamps', ...
[ "0.72164243", "0.69078696", "0.69077885", "0.68588465", "0.68042034", "0.67897797", "0.6754741", "0.6673833", "0.6599614", "0.65931696", "0.6576787", "0.6572222", "0.65469", "0.6545906", "0.6539699", "0.6535965", "0.65321773", "0.65283936", "0.6527254", "0.6526677", "0.650098...
0.68700665
3
Get last user input, called when we start the script
function getCurrent() { let store = browser.storage.local.get({ currentData: { regexInput: "", templateInput: "", globalCheckbox: false, caseInsensitiveCheckbox: false, multilineCheckbox: false, IgnoreHTMLCheckbox: false, resultTextarea: "", selectedItemIndex:-1, smallForm: false, }, highlightColor: "yellow", highlightBorderColor: "magenta" }); store.then(function(results) { regexInput.value = results.currentData.regexInput; templateInput.value = results.currentData.templateInput; globalCheckbox.checked = results.currentData.globalCheckbox; caseInsensitiveCheckbox.checked = results.currentData.caseInsensitiveCheckbox; multilineCheckbox.checked = results.currentData.multilineCheckbox; IgnoreHTMLCheckbox.checked = results.currentData.IgnoreHTMLCheckbox; resultTextarea.value = results.currentData.resultTextarea; selectedItemIndex = results.currentData.selectedItemIndex; highlightColor = results.highlightColor; highlightBorderColor= results.highlightBorderColor, smallFormCheckbox.checked = results.currentData.smallForm; smallFormCheckboxChange("") updateSaveModal(); }, onError); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setLastUserInput(state, log) {\n state.lastUserInput = log;\n }", "function readCommandLine() {\n var userInput = commandLine.value;\n return userInput;\n }", "function getCommandInput() {\n prompt.get(['command'], function (err, input) {\n if (err) {\n con...
[ "0.67734796", "0.6524693", "0.6403255", "0.6395485", "0.6395485", "0.6227213", "0.6221293", "0.61659324", "0.6143708", "0.61336666", "0.60619575", "0.6057589", "0.6013684", "0.5946944", "0.59444785", "0.5932793", "0.5904025", "0.5903121", "0.58831954", "0.5877108", "0.5867934...
0.0
-1
add profile to the storage then update the profiles in the list
function addProfile(profile) { let store = browser.storage.local.get({ profiles: [] }); store.then(function(results) { var profiles = results.profiles; profiles.push(profile); let store = browser.storage.local.set({ profiles }); store.then(null, onError); displayProfiles(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static addProfileToStorage(profile) {\n let profiles;\n // When first profile is added or if there is no profiles key in local storage, assign empty array to profiles\n if (localStorage.getItem('profiles') === null) {\n profiles = [];\n } else {\n // Get the existi...
[ "0.798796", "0.692687", "0.69028205", "0.68246216", "0.6731733", "0.65848434", "0.6579571", "0.651487", "0.6506095", "0.64843076", "0.6480021", "0.6432133", "0.63392556", "0.62683576", "0.6239034", "0.62026125", "0.619816", "0.6182858", "0.614194", "0.61022836", "0.6068736", ...
0.80723757
0
Get the profiles from storage then display them in the list
function displayProfiles() { let store = browser.storage.local.get({ profiles: [] }); store.then(function(results) { var profiles = results.profiles; for (var i = 0; i < profiles.length; i++) { addProfileToAList(profiles[i]); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "async function showProfiles() {\n const userId = localStorage.getItem('currentAccount...
[ "0.81912386", "0.7726208", "0.749142", "0.7314501", "0.71633613", "0.7153221", "0.71326655", "0.69910026", "0.6809023", "0.6690777", "0.6689355", "0.66671264", "0.66576064", "0.6651746", "0.6596602", "0.6596602", "0.65773606", "0.65120834", "0.6487844", "0.6434193", "0.642578...
0.89017963
0
simple function to append a profile to the list
function addProfileToAList(profile) { var listItem = document.createElement("li"); listItem.innerHTML = '<a href="#" class="profile" storageID="' + profile.id + '">' + profile.name + '</a>'; profilesList.appendChild(listItem); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addProfile(profile) {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n profiles.push(profile);\r\n let store = browser.storage.local.set({\r\n profiles\r\n });\r\n store.then(null, onE...
[ "0.74825114", "0.68396777", "0.6788901", "0.65672934", "0.63543403", "0.62696093", "0.6196134", "0.6146733", "0.61103535", "0.605347", "0.5871462", "0.58407044", "0.57896614", "0.5737176", "0.5734181", "0.5618927", "0.56093657", "0.56024736", "0.5590593", "0.5580317", "0.5576...
0.7308846
1
Get a profile from storage using its name then add its data to the input fields
function getProfile(profileId) { let store = browser.storage.local.get({ profiles: [] }); store.then(function(results) { var profiles = results.profiles; for (var i = 0; i < profiles.length; i++) { if (profileId == profiles[i].id) { regexInput.value = profiles[i].regex; templateInput.value = profiles[i].template; globalCheckbox.checked = profiles[i].globalFlag; caseInsensitiveCheckbox.checked = profiles[i].caseInsensitiveFlag; multilineCheckbox.checked = profiles[i].multilineFlag; IgnoreHTMLCheckbox.checked = profiles[i].IgnoreHTML ? true : false; break; } } }, onError); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadProfileData() {\n\ttry {\n\t\tvar userData = localStorage.getItem(\"profile\");\n\t\tvar user = JSON.parse(userData);\n\t\tif(user != undefined || user != null) {\n\t\t\tdocument.getElementById(\"profileName\").value = user.name;\n\t\t\tdocument.getElementById(\"userAge\").value = user.age;\n\t\t\tdoc...
[ "0.69459546", "0.6834408", "0.666196", "0.6636763", "0.658222", "0.6564242", "0.6538307", "0.643693", "0.63872206", "0.6359476", "0.6335426", "0.62667614", "0.62357306", "0.623473", "0.6229562", "0.6228444", "0.6181745", "0.61217964", "0.6081109", "0.6072671", "0.6029728", ...
0.6888832
1
to log errors :D
function onError(err) { console.error(err); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function error(msg){\r\n rootLogger.error(msg)\r\n}", "function errorlogging(err) \r\n{\r\n\talert(\"Error processing SQL: Main err\"+err.code);\r\n}", "function logError (err) {\n util.log('error:', err)\n}", "function error_log(error){\n console.log(error.message);\n }", "static logError(error) {...
[ "0.72854203", "0.7235557", "0.7231614", "0.7219788", "0.7082443", "0.70444876", "0.7014929", "0.7005933", "0.6995414", "0.6964137", "0.6909824", "0.68992114", "0.6894756", "0.6855484", "0.68475187", "0.6841918", "0.68389374", "0.68288094", "0.6823875", "0.6817356", "0.6817052...
0.66241056
56
clicking on cells on a row to select/deselect that row...
checkChanged(indx){ //update checkbox status when checkboxes are checked... this.props.selectionChanged(indx); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _select(e,row) {\n let { checked } = e.target;\n let index = rows.indexOf(row);\n rows[index].checked = checked;\n getCheckedRows();\n }", "selectRow() {\n if (!this.owner.enableSelection) {\n return;\n }\n this.selectTableRow();\n }", "function...
[ "0.7867484", "0.7771549", "0.76807773", "0.7652376", "0.74898666", "0.7440918", "0.730385", "0.730385", "0.71745074", "0.71107453", "0.7093224", "0.7038621", "0.7003956", "0.69792247", "0.6968329", "0.695336", "0.69454914", "0.69077355", "0.69077355", "0.6887717", "0.68843216...
0.0
-1
For this game, the ball just starts in the middle.
function nextRound(game) { let gameId = game.gameId; if (gameId == null || gameId == undefined) { console.log("Unknown game!") return; } if (game.gameStates.length == 0) { console.log("Not gameState!"); return; } let idx = game.gameStates.length-1; let gameState = game.gameStates[idx]; let ballId = gameState.balls[0].uuid; let ball = randomBall(ballId); let nextRound = { type: "nextRound", gameId: game.gameId, balls: [ball] } gameState.sequence = 0; game.players.forEach(function(player) { let connection = getConnectionFromAlias(player); if (connection === undefined) { console.log("XXXXXXXXXXXXX Bad connection!"); } else { connection.send(JSON.stringify(nextRound)); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start(){\n \t// si la balle est au centre (après le reset)\n\t\tif (this.ball.mouv.x === 0 && this.ball.mouv.y === 0){\n\t\t\t // balle bouge vars la gauche (joueur 1) lorsque la partie reprend\n\t\t\t this.ball.mouv.x = - 300,\n\t\t\t // 1 chance sur deux que la balle se dirige vers le ba...
[ "0.7489963", "0.73889536", "0.73438424", "0.72446686", "0.7232999", "0.720319", "0.7152269", "0.7126559", "0.7043286", "0.70104784", "0.6984164", "0.696131", "0.6956806", "0.69281054", "0.6904723", "0.69002414", "0.68799525", "0.6836017", "0.68121886", "0.67816716", "0.677030...
0.0
-1
corresponding to whether that string is a palindrome (spelled the same backwards and forwards). Our palindrome check should be caseinsensitive. Examples isPal('car') => false isPal('racecar') => true isPal('RaCecAr') => true isPal('!? 100 ABCcba 001 ?!') => true
function isPal(str) { const lowerCaseStr = str.toLowerCase(); let reversedStr = ''; for (let i = lowerCaseStr.length - 1; i > -1; i--) { reversedStr += lowerCaseStr[i]; } if (lowerCaseStr === reversedStr) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPalindrome(str) {\n\n}", "function palindrome(str) {\n return true;\n}", "function isPalidrome(str){\n let reverseStrArray = str.split('').reverse();\n let reverseStr = reverseStrArray.join(''); \n \n if (str === reverseStr){\n return true;\n }\n \n return false;\n }", "fun...
[ "0.81695557", "0.8011625", "0.79444754", "0.7903679", "0.78936017", "0.7867636", "0.7860524", "0.7860463", "0.7858169", "0.7855762", "0.78327435", "0.77949005", "0.7786259", "0.7775405", "0.77577746", "0.77576137", "0.7754082", "0.7751388", "0.7750053", "0.7749725", "0.774728...
0.80870146
1
Create a function that takes an id or DOM element and:
function solve() { function toggleShowHideState(element) { if (element.innerHTML === 'show') { element.innerHTML = 'hide'; } else if (element.innerHTML === 'hide') { element.innerHTML = 'show'; } else { throw new Error('Invalid element!'); } } function toggleDisplayMode(element) { if (element.style.display === 'none') { element.style.display = ''; } else { element.style.display = 'none'; } } return function (selector) { var selectedElement, buttonElements, i, len; if (typeof selector !== 'string') { throw new Error('Invalid input selector!'); } selector = selector.substring(1, selector.length); //console.log(selector); selectedElement = document.querySelector(selector); if (selectedElement === null) { throw new Error('Invalid id selector!'); } buttonElements = selectedElement.getElementsByClassName('button'); for (i = 0,len = buttonElements.length; i < len; i+=1) { buttonElements[i].innerHTML = 'hide'; } selectedElement.addEventListener('click', function (ev) { var currentButton = ev.target, nextElementSibling, previuosElementSibling; if (ev.target.className === 'button') { nextElementSibling = currentButton.nextElementSibling; previuosElementSibling = currentButton.previousElementSibling; while (previuosElementSibling) { if (previuosElementSibling.className === 'button') { toggleShowHideState(previuosElementSibling); } if (previuosElementSibling.className === 'content') { break; } previuosElementSibling = previuosElementSibling.previousElementSibling; } while (nextElementSibling) { if (nextElementSibling.className === 'button'){ toggleShowHideState(nextElementSibling); } if (nextElementSibling.className === 'content') { toggleShowHideState(currentButton); toggleDisplayMode(nextElementSibling); break; } nextElementSibling = nextElementSibling.nextElementSibling; } } }, false); var contentElements = selectedElement.getElementsByClassName('content'); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function id(el){\n return document.getElementById(el);\n}", "function elementId(id){\n const inputId = document.getElementById(id);\n return inputId;\n}", "function el(id) {\n return document.getElementById(id);\n}", "function $id(id) {\n return document.getElementById(id);\n}", "function ...
[ "0.74873775", "0.7376615", "0.7207702", "0.71791726", "0.71574765", "0.71574765", "0.71261096", "0.7117003", "0.7091389", "0.70861197", "0.70832306", "0.7058443", "0.70461386", "0.70310533", "0.6997405", "0.6997405", "0.6997405", "0.6996946", "0.69908327", "0.69908327", "0.69...
0.0
-1
Smart Search of Global Code Categories starts here
function OnGCodeCategorySelection(e) { var dataItem = this.dataItem(e.item.index()); $("#txtDescription").val(dataItem.Name); $('#txtOrderSetValue').val(dataItem.CodeValue); $('#hfCodeValue').val(dataItem.CodeValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _search()\n {\n var allCategoryNames = [];\n // Incorporate all terms into\n var oepterms = $scope.selectedOepTerms ? $scope.selectedOepTerms : [];\n var situations = $scope.selectedSituations ? $scope.selectedSituations : [];\n var allCategories = oepterms.concat(situations);\n allCate...
[ "0.6503081", "0.62249935", "0.6120937", "0.6091419", "0.6001836", "0.59314936", "0.5883683", "0.5880309", "0.58211994", "0.5689806", "0.5647416", "0.55702066", "0.5556883", "0.5548632", "0.55471855", "0.5543056", "0.55282634", "0.5520167", "0.55167305", "0.5499745", "0.548848...
0.0
-1
Smart Search of Global Code Categories ends here
function SortLabTestOrderList(event) { var url = "/LabTestOrderSet/SortLabTestOrderList"; if (event.data != null && (event.data.msg != null || event.data.msg != undefined || event.data.msg != '')) { url += "?" + "&" + event.data.msg; } $.ajax({ type: "POST", url: url, async: false, contentType: "application/json; charset=utf-8", dataType: "html", data: null, success: function (data) { $("#collapseLabTestOrderSetList").empty(); $("#collapseLabTestOrderSetList").html(data); //$('#LabTest').fixedHeaderTable({ cloneHeadToFoot: true, altClass: 'odd', autoShow: true }); //BindLabTestDetails(data); }, error: function (msg) { } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _search()\n {\n var allCategoryNames = [];\n // Incorporate all terms into\n var oepterms = $scope.selectedOepTerms ? $scope.selectedOepTerms : [];\n var situations = $scope.selectedSituations ? $scope.selectedSituations : [];\n var allCategories = oepterms.concat(situations);\n allCate...
[ "0.6649075", "0.6353675", "0.62846303", "0.6212454", "0.60889447", "0.60212547", "0.59802705", "0.59317213", "0.5916298", "0.57603437", "0.56630903", "0.56363976", "0.563162", "0.5629121", "0.5614036", "0.5611835", "0.5607619", "0.56047654", "0.5583509", "0.557324", "0.556428...
0.0
-1
show console messages if debugging variable is on
function debug(message) { if(debugging) { console.log(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function debugMessage() {\n if (debug) console.debug(arguments);\n}", "function debug(message) {\n if ($.fn.track.defaults.debug && typeof console !== 'undefined' && typeof console.debug !== 'undefined') {\n console.debug(message);\n }\n }", "debug() {}", "function debug_log(msg) {\n\n if (wi...
[ "0.76454496", "0.75051767", "0.73131984", "0.72947127", "0.71841234", "0.717526", "0.7170721", "0.71669", "0.714148", "0.71316284", "0.71206737", "0.7116414", "0.71032894", "0.71029335", "0.70863664", "0.7054463", "0.70291215", "0.7027945", "0.70245713", "0.70236945", "0.7020...
0.73899746
2
update visuals of the timers
function onTrackedVideoFrame(currentTime, duration){ $("#current").text(currentTime); $("#duration").text(duration); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statusChanged(){\n resetTimer();\n renderTimer();\n}", "function updateUI(){\n\t\n\t$('elapsed').innerText = timeElapsed();\n\t$('timer').innerText = countdown;\n\t$('shots').innerText = min_elapsed;\n\t$('bottles').innerText = toBottles(min_elapsed);\n\t$('ml').innerText = toMl(min_elapsed);\n\t$('oz...
[ "0.7118416", "0.6842594", "0.68326455", "0.68129057", "0.6699384", "0.6657453", "0.6656695", "0.65983874", "0.6570122", "0.65315324", "0.6479246", "0.64557", "0.6449253", "0.64016545", "0.63803715", "0.63573533", "0.633589", "0.63297486", "0.6316345", "0.63009256", "0.6291041...
0.0
-1
playpause toggle of the video element
function action_toggle_play() { if (video.paused) { video.play(); change_icon('play'); } else { video.pause(); change_icon('pause'); } delay = delay_value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle () {\n if (this.video.paused) {\n this.play();\n }\n else {\n this.pause();\n }\n }", "function togglePlayPause() {\r\n if (video.paused) {\r\n playVideo();\r\n } else {\r\n pauseVideo();\r\n }\r\n}", "function togglePlay() {\n video[video.p...
[ "0.8368461", "0.83267105", "0.8311592", "0.82392395", "0.82229155", "0.8166258", "0.8025651", "0.79920286", "0.7987903", "0.7981648", "0.7961293", "0.7922364", "0.78738517", "0.7838555", "0.777426", "0.77668166", "0.7728154", "0.77083886", "0.77076787", "0.76838326", "0.76807...
0.76019377
30
Takes a snapshot of the video
function action_snapshot() { //dimensions this.width = w; this.height = h; //create canvas old-school style this.element = document.createElement('canvas'); $('.screenshots').append('<div class="screenshot screenshot_'+new_screenshot_index+'"></div>'); //update attributes $(this.element) .attr('id', 'screenshot_'+new_screenshot_index) .text('unsupported browser') .width(this.width) .height(this.height) .appendTo('.screenshot_'+new_screenshot_index); //some fake data var fake_data_html = '<b>title:</b> Ex Machina | <b>user:</b> Gary' + '<br><b>time:</b> ' + $('#current').text() + 's'; $('.screenshot_'+new_screenshot_index).append('<div class="description" value="'+$("#current").text()+'"></div>'); $('.screenshot_'+new_screenshot_index+' .description').html(fake_data_html); $('.screenshot_'+new_screenshot_index).click(function(){ $('.screenshot').removeClass('selected'); $(this).addClass('selected'); countdown = 5; adjusted_time = parseFloat($(this).find('.description').attr('value')) - countdown; if(adjusted_time < 0){adjusted_time = 0;} video.currentTime = adjusted_time; video.play(); change_icon ('countdown', countdown); }); this.context = this.element.getContext("2d"); // Get a handle on the 2d context of the canvas element //var context = canvas.element.get(0).getContext('2d'); this.context.fillRect(0, 0, w, h); this.context.drawImage(video, 0, 0, w, h); //just slowly add the screenshot and scroll to the bottom new_screenshot_index++; $('.screenshots').animate({ scrollTop: $('.screenshots').get(0).scrollHeight }, 2000); //blink with the heart change_icon('love'); //configure fingerprint var mar_100 = parseInt($('.fingerprint').css('width').replace('px', '')); var mar = -15 + Math.floor(mar_100*parseFloat($("#current").text())/parseFloat($("#duration").text())); $('.fingerprint').append('<i style="color: #FFF; float:left; margin-top: -55px; position:relative; left:'+mar+'px;" class="fa fa-arrows-v fa-2x"></i>'); delay = delay_value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function takeSnap() {\n\n // get video element\n var vid = document.querySelector('video');\n // get canvas element\n var canvas = document.querySelector('canvas');\n // get its context\n var ctx = canvas.getContext('2d');\n // set its size to the one of the video\n canvas.width = vid.video...
[ "0.80400956", "0.7973131", "0.7972817", "0.77883387", "0.7710764", "0.7617289", "0.7552318", "0.7249978", "0.72290224", "0.7144497", "0.7114868", "0.7094358", "0.6973082", "0.68949175", "0.6882829", "0.68615514", "0.6840102", "0.6826717", "0.6655729", "0.6649953", "0.664293",...
0.64909995
26
blinking confirmation beakon effect
function change_icon (action, countdown) { countdown = countdown || 0; $('.overlay').html(''); $('.overlay').css('opacity', '1'); if(action == 'play'){ $('.overlay').html('<i class="fa fa-play fa-2x"></i>'); } else if (action == 'pause') { $('.overlay').html('<i class="fa fa-pause fa-2x"></i>'); } else if (action == 'love') { $('.overlay').html('<i class="fa fa-heart fa-2x"></i>'); } else if (action == 'countdown' && countdown > 0) { $('.overlay').html('<i class="fa fa-clock-o fa-2x"></i>'+countdown); countdown--; console.log(countdown); setTimeout( function() { change_icon('countdown', countdown); }, 1000); } $('.overlay').animate( { opacity: 0 }, 800 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setSuccess(blink) {\n blink.fadeToRGB(500, 0, 100, 0); // millisec, r, g, b: 0 - 255\n}", "function blinkingText() {\r\n if ($(\"#start-game-btn\").hasClass(\"dark-green\")) {\r\n $(\"#start-game-btn\").removeClass(\"dark-green\").addClass(\"off-white\");\r\n }\r\n ...
[ "0.6652335", "0.6583782", "0.65703756", "0.6560736", "0.6434304", "0.6403273", "0.6356119", "0.6345212", "0.6330613", "0.6327562", "0.6323953", "0.6289518", "0.6214727", "0.6199736", "0.61682945", "0.6107219", "0.60986316", "0.6095831", "0.6078128", "0.6062919", "0.6060506", ...
0.0
-1
Main Type and Public API / QB The primary type of the qb package
function QB (options) { if (!(this instanceof QB)) { return new QB(options); } // Super constructor MiddlewareProvider.call(this); var qb = this; // Init qb._options = defaults(options, default_options) qb._types = {} qb._aliases = {} qb.name = qb._options.name // TODO process this into .alias _processAliasOptions(qb, qb._options.aliases) qb.log = book.default(); if (qb._options.catch_sigterm_end) handleSigterm(qb); _listen(qb) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FQB() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var graphEndpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n _classCallCheck(this, FQB);\n\n this._graphNode; // the GraphNode we are working with\n this._grap...
[ "0.57055616", "0.53903157", "0.53299206", "0.53047425", "0.5253266", "0.52337986", "0.52337986", "0.51918304", "0.51918304", "0.51918304", "0.51670724", "0.5165274", "0.51415485", "0.51081216", "0.51041734", "0.50775146", "0.5075952", "0.5066737", "0.5036762", "0.5034327", "0...
0.60240555
0
update profile image in state
handleImage(image) { this.setState({ profile: image }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateProfileImageTEMP () {\n\t\tvar signedinListitems = createProfileMenuSignedin(),\n\t\t\tsignedinData = {\n\t\t\t\tlinkContents: \"\",\n\t\t\t\tlinkAlt: IBM.common.translations.data.v18main.misc.welcomeback,\n\t\t\t\tbackgroundImage: \"\",\n\t\t\t\ttype: \"default\"\n\t\t\t};\n\n\t\t// Change the menu...
[ "0.7243879", "0.72405624", "0.72354543", "0.70856494", "0.6900407", "0.6855687", "0.68529993", "0.6851334", "0.68011844", "0.6798323", "0.6741892", "0.672388", "0.6718735", "0.67142665", "0.67111516", "0.6693026", "0.66868806", "0.66364396", "0.6601799", "0.6591476", "0.65565...
0.73725945
0
see if interest was checked or not
handleInterest(interest) { if (this.state.interests.includes(interest)) { const newstate = [...this.state.interests]; const index = newstate.indexOf(interest); newstate.splice(index, 1); this.setState({ interests: newstate }); } else { this.setState({ interests: [...this.state.interests, interest] }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleInterestExplanation() {\n let interestDisplay = document.getElementById(\"toggle-other-interests\");\n if(otherInterest.checked) {\n interestDisplay.style.display = \"block\";\n otherChecked = true;\n } else {\n interestDisplay.style.display = \"none\";\n otherCh...
[ "0.63409495", "0.6039327", "0.59244394", "0.59244394", "0.5739927", "0.57265437", "0.5707265", "0.5700423", "0.5676368", "0.56758946", "0.56711775", "0.5646167", "0.5592462", "0.5574645", "0.55585474", "0.55336857", "0.54885525", "0.5485758", "0.54471666", "0.5441228", "0.543...
0.0
-1
render display of interests
renderInterests() { const interestItems = interests.map((interest) => { if (this.state.interests.includes(interest)) { return ( <TouchableOpacity style={styles.checked} key={interest} onPress={() => { this.handleInterest(interest); }}> <Text style={styles.interestText}>{interest}</Text> </TouchableOpacity> ); } else { return ( <TouchableOpacity style={styles.unchecked} key={interest} onPress={() => { this.handleInterest(interest); }}> <Text style={styles.interestText}>{interest}</Text> </TouchableOpacity> ); } }); return ( <View style={styles.interests}> {interestItems} </View> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderInterests(data) {\n if (data) {\n var results = JSON.parse(data);\n\n // Early exit if user hasn't added any favorites\n if (results.length === 0) {\n return '';\n }\n\n function getInterests() {\n var interestsList = [];\n\n res...
[ "0.7195199", "0.63879454", "0.6261766", "0.62493545", "0.62136143", "0.60883844", "0.60799474", "0.60360473", "0.6021716", "0.60103846", "0.5989388", "0.59637976", "0.59454286", "0.5902918", "0.5887821", "0.58539325", "0.58304095", "0.58293194", "0.58273584", "0.5824763", "0....
0.0
-1
render list of profile options
renderImage(item) { if (this.state.profile === item) { return ( <TouchableOpacity key={item} onPress={(event) => { this.handleImage(item); }}> <Image style={styles.checkedImage} source={item} /> </TouchableOpacity> ); } else { return ( <TouchableOpacity key={item} onPress={(event) => { this.handleImage(item); }}> <Image style={styles.uncheckedImage} source={item} /> </TouchableOpacity> ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_options() {\n\n\tvar profiles = get_profiles();\n\n\tvar t = $.template('<tr><td rowspan=\"2\">${name}</td><td>Live:</td><td>${live}</td><td rowspan=\"2\"><button type=\"button\" class=\"btnDeleteProfile\" data-index=\"${index}\">Del</button></td></tr><tr><td>Dev:</td><td>${dev}</td></tr>');\n\tfor (...
[ "0.6789768", "0.6744866", "0.66457903", "0.60738605", "0.60689616", "0.60122687", "0.59874", "0.59765035", "0.595397", "0.5855576", "0.58369917", "0.5817204", "0.58073306", "0.58072084", "0.5797266", "0.57872474", "0.5787049", "0.5732487", "0.5687231", "0.5664628", "0.5641935...
0.0
-1
Start a new game
function newGame() { freshStart = true; removals = 0; // Remove the gameover overlay document.getElementById("postgame-message").style.display = "none"; // Clear the board for (var row = 0; row <= 3; row++) { for (var column = 0; column <= 3; column++) { if (tileArray[row][column] != null) { $(tileArray[row][column]).remove(); tileArray[row][column] = null; } } } // Set the colors yellowActivated = false; greenActivated = false; purpleActivated = false; orangeActivated = false; pinkActivated = false; tealActivated = false; brownActivated = false; grayActivated = false; blackActivated = false; whiteActivated = false; // Reset the color array colorArray = []; colorArray.push("firebrick"); colorArray.push("darkblue"); // Reset scores document.getElementById("current-score").innerHTML = "0"; document.getElementById("gameover-score").innerHTML = "0"; // Make a random "old" future tile and add a tile to the board of that color //newFutureTile(); futureColor = pickColor(); newTile(); // Make another random "old" future tile and add another tile to the board of that color //newFutureTile(); futureColor = pickColor(); newTile(); // Re-enable the fadeIns for center and future tiles freshStart = false; // Make the first center tile newCenterTile(); // Make the real future tile at the top newFutureTile(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startNewGame() {\n const newGame = new GameLoop();\n newGame.startGame(true);\n}", "function StartNewGame() {\n\tsnowStorm.stop();\n\tsnowStorm.freeze();\n\n\tvar params = {\n\t\tchosen: \"riley\"\n\t};\n\n\t_gameObj = new Game();\n\t_gameObj.SetupCanvas(params);\n\t$j(window).resize(function () {\n\t...
[ "0.8278555", "0.80758935", "0.77411234", "0.7467077", "0.74592555", "0.7443089", "0.74224275", "0.7417059", "0.74104816", "0.7316804", "0.7302208", "0.73010427", "0.7268494", "0.72651684", "0.7259647", "0.7253097", "0.7244614", "0.724415", "0.71853125", "0.7175703", "0.717407...
0.0
-1
These events happen when you move a tile Check if the tile is on an edge
function isEdge(row, column) { if (row == 0 || row == 3 || column == 0 || column == 3) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n...
[ "0.7157723", "0.70985484", "0.7089717", "0.69289976", "0.68215036", "0.66167843", "0.6593307", "0.6401328", "0.64008695", "0.63955015", "0.6383461", "0.6352068", "0.63304555", "0.6320106", "0.6320106", "0.62783194", "0.6273222", "0.6261163", "0.6261163", "0.6249336", "0.61947...
0.0
-1
Move ALL tiles downward
function moveTilesDown() { for (var column = 3; column >= 0; column--) { for (var row = 2; row >= 0; row--) { if (checkBelow(row, column) && tileArray[row][column] != null) { moveTileDown(row, column); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n ...
[ "0.7319744", "0.72963244", "0.72792137", "0.7199269", "0.70286226", "0.70277596", "0.696229", "0.689661", "0.682219", "0.68153536", "0.6743534", "0.6680645", "0.66574603", "0.64544666", "0.6424538", "0.6403815", "0.63727856", "0.63361466", "0.6322985", "0.6305963", "0.6297543...
0.7606728
0
Move ALL tiles upward
function moveTilesUp() { for (var column = 3; column >= 0; column--) { for (var row = 1; row <= 3; row++) { if (checkAbove(row, column) && tileArray[row][column] != null) { moveTileUp(row, column); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionFixup(){\n\t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t\t\tvar layout = returnBalanced(maxCols, maxHeight);\n\t\t\tvar t = $('#'+tiles[i]);\n\t\t\tt.attr({\n\t\t\t\t'row': layout[tiles.length-1][i].row(maxHeight),\n\t\t\t\t'col': layout[tiles.length-1][i].col(maxCols),\n\t\t\t\t'sizex': la...
[ "0.7357319", "0.73486304", "0.7348536", "0.73415923", "0.7213197", "0.712264", "0.7102516", "0.7087443", "0.6967448", "0.69236034", "0.6907207", "0.6762628", "0.6739732", "0.6722844", "0.6708591", "0.6645257", "0.662945", "0.6612544", "0.6590713", "0.6563467", "0.6547967", ...
0.77202564
0
Move ALL tiles left
function moveTilesLeft() { for (var column = 1; column <= 3; column++) { for (var row = 3; row >= 0; row--) { if (checkLeft(row, column) && tileArray[row][column] != null) { moveTileLeft(row, column); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i...
[ "0.7500292", "0.7400394", "0.7333599", "0.73320657", "0.73221576", "0.7276573", "0.725312", "0.7243681", "0.722043", "0.72151256", "0.72095245", "0.72088295", "0.7208449", "0.72031623", "0.71905416", "0.7183518", "0.7159868", "0.7144131", "0.71268165", "0.7115274", "0.7046571...
0.7914101
0
Move ALL tiles right
function moveTilesRight() { for (var column = 2; column >= 0; column--) { for (var row = 3; row >= 0; row--) { if (checkRight(row, column) && tileArray[row][column] != null) { moveTileRight(row, column); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i...
[ "0.7736971", "0.74954706", "0.7475571", "0.7469078", "0.74665296", "0.74237514", "0.69887", "0.69273347", "0.6892154", "0.68891096", "0.6882489", "0.6860779", "0.6857235", "0.68368024", "0.68307424", "0.68184775", "0.6813281", "0.6803559", "0.6780032", "0.67656094", "0.674368...
0.7752994
0
Make sure the tile space below is clear
function checkBelow(row, column) { if (!isEdge(row + 1, column) && tileArray[row][column] != null) { if (document.getElementById("center-tile").style.backgroundColor == tileArray[row][column].style.backgroundColor) { return true; } else { return false; } } else { return !tileArray[row + 1][column]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearBoard() {\n\tbgTileLayer.removeChildren();\n\tpieceLayer.removeChildren();\n\tfgTileLayer.removeChildren();\n}", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n ...
[ "0.6844949", "0.67106986", "0.67106986", "0.66439617", "0.65255076", "0.65245396", "0.64574426", "0.63810587", "0.63665944", "0.63475156", "0.6323941", "0.627285", "0.62297314", "0.62206644", "0.6212618", "0.6185795", "0.6182601", "0.6160372", "0.6149189", "0.6120846", "0.611...
0.0
-1
Make sure the tile space above is clear
function checkAbove(row, column) { if (!isEdge(row - 1, column) && tileArray[row][column] != null) { if (document.getElementById("center-tile").style.backgroundColor == tileArray[row][column].style.backgroundColor) { return true; } else { return false; } } else { return !tileArray[row - 1][column]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearBoard() {\n\tbgTileLayer.removeChildren();\n\tpieceLayer.removeChildren();\n\tfgTileLayer.removeChildren();\n}", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n ...
[ "0.6855285", "0.67363054", "0.67363054", "0.65975475", "0.6558319", "0.65490043", "0.6464617", "0.6380991", "0.62969166", "0.6284454", "0.62422603", "0.61964566", "0.61819565", "0.6151586", "0.61448246", "0.613089", "0.60987", "0.6084378", "0.6078584", "0.60715395", "0.606338...
0.0
-1
Make sure the tile space to the left is clear
function checkLeft(row, column) { if (!isEdge(row, column - 1) && tileArray[row][column] != null) { if (document.getElementById("center-tile").style.backgroundColor == tileArray[row][column].style.backgroundColor) { return true; } else { return false; } } else { return !tileArray[row][column - 1]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveTilesLeft() {\n for (var column = 1; column <= 3; column++) {\n for (var row = 3; row >= 0; row--) {\n if (checkLeft(row, column) && tileArray[row][column] != null) {\n moveTileLeft(row, column);\n }\n }\n }\n }", ...
[ "0.6782965", "0.64945406", "0.64813364", "0.6479679", "0.6474976", "0.6473858", "0.6466099", "0.6459601", "0.645585", "0.64152783", "0.6413282", "0.63957596", "0.63832474", "0.6348916", "0.63137734", "0.6259685", "0.6243375", "0.62421334", "0.6195912", "0.61550045", "0.615003...
0.62167746
18
Make sure the tile space to the right is clear
function checkRight(row, column) { if (!isEdge(row, column + 1) && tileArray[row][column] != null) { if (document.getElementById("center-tile").style.backgroundColor == tileArray[row][column].style.backgroundColor) { return true; } else { return false; } } else { return !tileArray[row][column + 1]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkBoundaries( tile, x, y) {\n if (x <= 0) {\n tile.top = false;\n }\n if (y <= 0) {\n tile.left = false;\n }\n if (x >= 11) {\n tile.bottom = false;\n }\n if (y >= 11) {\n tile.right = false;\n }\n}", "outOfBounds() {\n const minX = this.x >= 0...
[ "0.6677942", "0.6524666", "0.6500134", "0.64232445", "0.6380648", "0.63684976", "0.62648344", "0.6247605", "0.62409747", "0.6210571", "0.6178751", "0.61766344", "0.6162244", "0.61588746", "0.6158244", "0.61513054", "0.6140652", "0.6139852", "0.6134956", "0.6134351", "0.613392...
0.5888432
42
Move A SINGLE tile downward
function moveTileDown(row, column) { //This happens as soon as the player makes a move if (checkRemove(row + 1, column)) { doubleColor = tileArray[row][column].style.backgroundColor; removals++; if (removals == 1) { // This will cause the creation of a new center tile, once all movements have been processed createNewCenterTile = true; } } // This is the animation $(tileArray[row][column]).animate({ "top": "+=" + shiftValue }, 80, "linear", function () { //This happens at the end of each tile's movement if (checkRemove(row + 1, column)) { $(tileArray[row + 1][column]).remove(); tileArray[row + 1][column] = null; } else { tileArray[row + 1][column].setAttribute("id", "tile-" + (parseInt(tileArray[row + 1][column].id.slice(5)) + 4)); } }); tileArray[row + 1][column] = tileArray[row][column]; tileArray[row][column] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveTile() {\n moveTileHelper(this);\n }", "function moveTilesDown() {\n for (var column = 3; column >= 0; column--) {\n for (var row = 2; row >= 0; row--) {\n if (checkBelow(row, column) && tileArray[row][column] != null) {\n moveTileDown(ro...
[ "0.7703539", "0.7260513", "0.70357674", "0.7021616", "0.697812", "0.6881911", "0.68533874", "0.6827446", "0.6824876", "0.681101", "0.67644966", "0.670336", "0.6680959", "0.66520804", "0.664044", "0.66145885", "0.6565055", "0.65553063", "0.65411097", "0.6536853", "0.6535573", ...
0.7377649
1
Move A SINGLE tile upward
function moveTileUp(row, column) { //This happens as soon as the player makes a move if (checkRemove(row - 1, column)) { doubleColor = tileArray[row][column].style.backgroundColor; removals++; if (removals == 1) { // This will cause the creation of a new center tile, once all movements have been processed createNewCenterTile = true; } } // This is the animation $(tileArray[row][column]).animate({ "top": "-=" + shiftValue }, 80, "linear", function () { // This happens at the end of each tile's movement if (checkRemove(row - 1, column)) { $(tileArray[row - 1][column]).remove(); tileArray[row - 1][column] = null; } else { tileArray[row - 1][column].setAttribute("id", "tile-" + (parseInt(tileArray[row - 1][column].id.slice(5)) - 4)); } }); tileArray[row - 1][column] = tileArray[row][column]; tileArray[row][column] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "up () {\n let first = this.props.game.getTileList();\n this.props.game.board.moveTileUp();\n let second = this.props.game.getTileList();\n if (this.moveWasLegal(first, second) === false) {\n this.updateBoard();\n return;\n } else {\n this.props.game.placeTile();\n this.updateBoard();...
[ "0.7645715", "0.7620801", "0.7438366", "0.74352807", "0.7302458", "0.71444833", "0.7093712", "0.69303703", "0.6896559", "0.6891586", "0.68888384", "0.6869615", "0.6844837", "0.67976063", "0.67976063", "0.67746973", "0.67518926", "0.6737065", "0.6716795", "0.67129356", "0.6703...
0.75509495
2
Move A SINGLE tile left
function moveTileLeft(row, column) { //This happens as soon as the player makes a move if (checkRemove(row, column - 1)) { doubleColor = tileArray[row][column].style.backgroundColor; removals++; if (removals == 1) { // This will cause the creation of a new center tile, once all movements have been processed createNewCenterTile = true; } } // This is the animation $(tileArray[row][column]).animate({ "left": "-=" + shiftValue }, 80, "linear", function () { // This happens at the end of each tile's movement if (checkRemove(row, column - 1)) { $(tileArray[row][column - 1]).remove(); tileArray[row][column - 1] = null; } else { tileArray[row][column - 1].setAttribute("id", "tile-" + (parseInt(tileArray[row][column - 1].id.slice(5)) - 1)); } }); tileArray[row][column - 1] = tileArray[row][column]; tileArray[row][column] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "moveLeft() {\n dataMap.get(this).moveX = -5;\n }", "function moveLeft()\r\n {\r\n undraw()\r\n const isAtLeftEdge = currentTetromino.some(index => (currentPosition + index) % width === 0)\r\n\r\n if(!isAtLeftEdge)\r\n currentPosition -= 1\r\n if(current...
[ "0.76739264", "0.7643933", "0.758759", "0.75747824", "0.7569376", "0.75636613", "0.7511753", "0.74948204", "0.74897724", "0.74803", "0.74449575", "0.7443422", "0.74400276", "0.7432567", "0.74157345", "0.73869175", "0.73726445", "0.72654706", "0.725234", "0.72474647", "0.72321...
0.7645088
1
Move A SINGLE tile right
function moveTileRight(row, column) { //This happens as soon as the player makes a move if (checkRemove(row, column + 1)) { doubleColor = tileArray[row][column].style.backgroundColor; removals++; if (removals == 1) { // This will cause the creation of a new center tile, once all movements have been processed createNewCenterTile = true; } } // This is the animation $(tileArray[row][column]).animate({ "left": "+=" + shiftValue }, 80, "linear", function () { // This happens at the end of each tile's movement if (checkRemove(row, column + 1)) { $(tileArray[row][column + 1]).remove(); tileArray[row][column + 1] = null; } else { tileArray[row][column + 1].setAttribute("id", "tile-" + (parseInt(tileArray[row][column + 1].id.slice(5)) + 1)); } }); tileArray[row][column + 1] = tileArray[row][column]; tileArray[row][column] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveTile() {\n moveTileHelper(this);\n }", "function moveRight() {\n undraw()\n const reachedRightEdge = curT.some(index => (curPos + index) % width === width - 1)\n if (!reachedRightEdge) curPos += 1\n if (curT.some(index => squares[curPos + index].classList.contai...
[ "0.79783547", "0.7548235", "0.75283843", "0.75170714", "0.7513188", "0.74976325", "0.7497593", "0.749314", "0.74784356", "0.74557966", "0.74305856", "0.7400828", "0.73980963", "0.7367278", "0.7363921", "0.7336984", "0.732208", "0.73014694", "0.7295661", "0.72582906", "0.72347...
0.7479671
8
Check to see if a particular tile should be removed from the board
function checkRemove(row, column) { if (!isEdge(row, column)) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkChow(tile) {\n return Evaluator.getDiscardedChow(this, tile).length > 0;\n }", "function canMove(tile) {\n\tvar left = parseInt(tile.getStyle(\"left\"));\n\tvar top = parseInt(tile.getStyle(\"top\"));\n\tvar otherLeft = parseInt(row) * TILE_AREA;\n\tvar otherTop = parseInt(col) * TILE_AREA;\n\t\n\...
[ "0.7087761", "0.685844", "0.676607", "0.67254937", "0.6694265", "0.6622946", "0.6621785", "0.6582375", "0.6571928", "0.6532176", "0.64792377", "0.64521396", "0.644777", "0.6444754", "0.6408108", "0.6398222", "0.63977015", "0.63729423", "0.63494104", "0.63188803", "0.6317402",...
0.6373808
17
Finish the old animations
function finishAnimations() { for (var row = 0; row <= 3; row++) { for (var column = 0; column <= 3; column++) { if (row + 1 <= 3 && column + 1 <= 3) { if (tileArray[row + 1][column + 1] != null) { $(tileArray[row + 1][column + 1]).finish(); } } if (row - 1 >= 0 && column + 1 <= 3) { if (tileArray[row - 1][column + 1] != null) { $(tileArray[row - 1][column + 1]).finish(); } } if (row + 1 <= 3 && column - 1 >= 0) { if (tileArray[row + 1][column - 1] != null) { $(tileArray[row + 1][column - 1]).finish(); } } if (row - 1 >= 0 && column - 1 >= 0) { if (tileArray[row - 1][column - 1] != null) { $(tileArray[row - 1][column - 1]).finish(); } } } } // Remove the "remove"-marked tiles clearTimeout(removeRemovesId); removeRemoves(); // End the queue of the center tile //$("#center-tile").clearQueue(); // Hurry the newCenterTile function if the player plays too quickly clearTimeout(newCenterTileId); if (newCenterTileFinished == false) { newCenterTile(); } document.getElementById("center-tile").style.opacity = 1; document.getElementById("center-tile").style.display = "inline"; // Hurry the newTile function if the player plays too quickly clearTimeout(newTileId); if (newTileFinished == false ) { newTile(); } newTileFinished = false; // Hurry the newFutureTile function if the player plays too quickly clearTimeout(newFutureTileId); if (newFutureTileFinished == false) { newFutureTile(); } newFutureTileFinished = false; // Hurry the checkGameOver function if the player plays too quickly clearTimeout(checkGameOverId); if (checkGameOverFinished == false) { checkGameOver(); } checkGameOverFinished = false; // Finish the sounds swooshSound.pause(); swooshSound.currentTime = 0; removeSound.pause(); removeSound.currentTime = 0; gameOverSound.pause(); gameOverSound.currentTime = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finishAllAnimations() {\n runningAnimations.forEach(function (animation) {\n animation.finishNow();\n });\n clearTimeout(fadeInTimer);\n clearTimeout(animateHeightTimer);\n clearTimeout(animationsCompleteTimer);\n runningAnimations.length = 0;\n }", "function finishAnimations() {...
[ "0.76933557", "0.7533821", "0.75074375", "0.74322736", "0.7414079", "0.7368151", "0.7252725", "0.7156907", "0.7146061", "0.71236247", "0.7083577", "0.7074186", "0.70485705", "0.7039695", "0.7009224", "0.70079917", "0.69916004", "0.6941543", "0.691798", "0.6880823", "0.6879925...
0.6279877
52
The operations of each turn Add a new tile
function newTile() { // Create a new tile createdTile = document.createElement("div"); createdTile.setAttribute("position", "absolute"); createdTile.setAttribute("class", "tile"); // Find the empty corners var emptyCorners = []; if (!tileArray[0][0]) { emptyCorners.push("tile-1"); } if (!tileArray[0][3]) { emptyCorners.push("tile-4"); } if (!tileArray[3][0]) { emptyCorners.push("tile-13"); } if (!tileArray[3][3]) { emptyCorners.push("tile-16"); } // Of the empty corners, pick a corner for the tile to go into var newTileCorner = Math.floor(Math.random() * emptyCorners.length); if (emptyCorners.length > 0) { // Pick a corner to put the tile in createdTile.setAttribute("id", emptyCorners[newTileCorner]); // Insert the tile into the corner $("#tile-container").append(createdTile); // Insert the tile into the array of tiles if (emptyCorners[newTileCorner] == "tile-1") { tileArray[0][0] = createdTile; } else if (emptyCorners[newTileCorner] == "tile-4") { tileArray[0][3] = createdTile; } else if (emptyCorners[newTileCorner] == "tile-13") { tileArray[3][0] = createdTile; } else if (emptyCorners[newTileCorner] == "tile-16") { tileArray[3][3] = createdTile; } // Access the tile with jquery var $activeTile = $("#" + createdTile.id); $activeTile.hide().fadeIn(100); // Make the new tile the same color as the old future tile createdTile.style.backgroundColor = futureColor; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTiles(){\n\tvar tile_1 = CLICKED_TILE_1;\n\tvar tile_2 = CLICKED_TILE_2;\n\ttile_1.sum(tile_2);\n\treplaceTile(tile_1);\n\treplaceTile(tile_2);\n}", "addTile(tile, wallSize) {\n this.currentGame.turn++;\n this.currentGame.wallSize = wallSize;\n this.tiles.push(tile);\n this.ai.tracker.gai...
[ "0.77908856", "0.7364638", "0.71191174", "0.6857791", "0.6789964", "0.67565113", "0.6755169", "0.67516005", "0.67269", "0.66869366", "0.66544044", "0.66258484", "0.6590509", "0.6589216", "0.65753096", "0.65384907", "0.65145385", "0.64770585", "0.645853", "0.6451343", "0.64446...
0.6740896
8
Check to see if there are any doubles
function checkDoubles() { if (removals == 2) { for (var row = 0; row <= 3; row++) { for (var column = 0; column <= 3; column++) { if (tileArray[row][column] != null && ((row != 1 && row != 2) || (column != 1 & column != 2))) { if (tileArray[row][column].style.backgroundColor == doubleColor) { removeArray[row][column] = "remove"; removals++; doubleAchieved = true; } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function St(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function mt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function _isDouble(v)...
[ "0.65419596", "0.6404784", "0.6147087", "0.6108118", "0.6108118", "0.6108118", "0.6108118", "0.6108118", "0.5971159", "0.5955504", "0.5906189", "0.5902372", "0.5897305", "0.5834508", "0.5652023", "0.5634096", "0.56276983", "0.56192017", "0.55845326", "0.55735224", "0.55661243...
0.55850255
18
Remove the "remove"marked tiles
function removeRemoves() { if (doubleAchieved == true) { for (var doubleRow = 0; doubleRow <= 3; doubleRow++) { for (var doubleColumn = 0; doubleColumn <= 3; doubleColumn++) { if (removeArray[doubleRow][doubleColumn] == "remove") { $(document.getElementById("tile-" + (4 * doubleRow + doubleColumn + 1).toString())).remove(); tileArray[doubleRow][doubleColumn] = null; removeArray[doubleRow][doubleColumn] = null; } } } doubleAchieved = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeHelper(tile){\n\t \tif(parseInt(tile.attr('sizex')) <= 0 || parseInt(tile.attr('sizey')) <= 0){\n\t \t\t$.when(tile.fadeOut()).then(function(){\n\t \t\t\ttile.remove();\n\t \t\t});\n\t \t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t \t\t\tif(tiles[i] == tile.attr('id')){\n\t \t\t...
[ "0.7442869", "0.7130446", "0.71193093", "0.7031106", "0.700747", "0.6990069", "0.6916172", "0.6899759", "0.6811951", "0.6783727", "0.67684627", "0.6762249", "0.67551816", "0.67551816", "0.67507064", "0.67451876", "0.67447823", "0.6722273", "0.66993564", "0.66795224", "0.66774...
0.7422738
1
Pick a random color from the available options
function pickColor() { if (colorArray.length > 1) { var oldColorIndex = colorArray.indexOf(document.getElementById("center-tile").style.backgroundColor); if (freshStart == true) { oldColorIndex = -1; } if (oldColorIndex > -1) { var oldColor = colorArray[oldColorIndex]; colorArray.splice(oldColorIndex, 1); } var colorToReturn = colorArray[Math.floor(Math.random() * colorArray.length)]; if (oldColorIndex > -1) { colorArray.push(oldColor); } return colorToReturn; } else { return colorArray[Math.floor(Math.random() * colorArray.length)]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickColor() {\n let colorOptions = ['#FF6F61', '#D69C2F', '#343148', '#7F4145', '#BD3D3A', '#766F57'];\n let max = colorOptions.length - 1;\n let min = 0;\n let pickRandom = Math.random() * (max - min) + min\n let randomColor = colorOptions[Math.floor(pickRandom)]\n return randomColor;\n}", "funct...
[ "0.83027124", "0.8246643", "0.8227273", "0.81926966", "0.8187323", "0.8177419", "0.815972", "0.81530535", "0.81469685", "0.8146544", "0.8146544", "0.8143488", "0.8134871", "0.81300324", "0.8119088", "0.8110944", "0.8108727", "0.8097088", "0.8093781", "0.8093238", "0.808617", ...
0.0
-1
Add new tile colors to the colorArray
function addColors() { var currentScore = parseInt(document.getElementById("current-score").innerHTML); if (currentScore >= 10 && !yellowActivated) { yellowActivated = true; colorArray.push("gold"); } if (currentScore >= 20 && !greenActivated) { greenActivated = true; colorArray.push("green"); } if (currentScore >= 50 && !purpleActivated) { purpleActivated = true; colorArray.push("darkmagenta"); } if (currentScore >= 100 && !orangeActivated) { orangeActivated = true; colorArray.push("darkorange"); } if (currentScore >= 200 && !pinkActivated) { pinkActivated = true; colorArray.push("deeppink"); } if (currentScore >= 500 && !tealActivated) { tealActivated = true; colorArray.push("#33ADD6"); } if (currentScore >= 1000 && !brownActivated) { brownActivated = true; colorArray.push("saddlebrown"); } if (currentScore >= 2000 && !grayActivated) { grayActivated = true; colorArray.push("dimgrey"); } if (currentScore >= 5000 && !blackActivated) { blackActivated = true; colorArray.push("black"); } if (currentScore >= 10000 && !whiteActivated) { whiteActivated = true; colorArray.push("ghostwhite"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateColorArray () {\n // IF USER IN IN MIDDLE OF COLOR ARRAY\n // REMOVE ALL ELEMENTS BEYOND THEIR POSITION\n var l = colors.length - 1;\n if (colorsIndex < l) {\n colors.splice(colorsIndex + 1, l - colorsIndex);\n }\n\n // ADD NEW COLOR TO ARRAY\n colors.push([r, g, b]);\n colorsIndex++;\n}"...
[ "0.6962366", "0.6930402", "0.6530913", "0.6521381", "0.64124763", "0.6340911", "0.63011795", "0.62997216", "0.62706476", "0.62381256", "0.62065375", "0.61399883", "0.6120787", "0.6118701", "0.6065621", "0.6060733", "0.6052911", "0.60239565", "0.6018926", "0.60079074", "0.6006...
0.5692077
67
get button value and send it to be processed
function getBtnValue(e) { var entry = e.currentTarget.value; processInput(entry); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleButton(data) {\r\n console.log('Button: ', data);\r\n buttonValue = Number(data);\r\n}", "btnClick() {\n\t\tthis.socket.emit(\"btn state\", this.props.btnValue);\n\t}", "function buttonClicked () {\n let clickedButton = event.target;\n\n valueHTML();\n\n}", "function handleBtn() {\r\n ...
[ "0.7202997", "0.70763826", "0.6636706", "0.6595606", "0.6515036", "0.64495564", "0.64141", "0.6387366", "0.6357575", "0.6326639", "0.6323272", "0.6304418", "0.6219654", "0.6204986", "0.6149941", "0.60825926", "0.6076404", "0.60505676", "0.60413074", "0.6036376", "0.60333276",...
0.7282178
0
process input based on button pressed, perform next appropriate operation
function processInput(input) { switch (input) { case "=": calculate(); break; case "ce": clearEntry(); break; case "ac": clearAll(); break; case "/": case "*": case "+": case "-": case ".": case "0": validateInput(input); break; default: updateDisplay(input); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onButton(){\n input();\n output();\n\n}", "function input(btn) {\n // If button is number or'.'\n if (!isNaN(btn) || btn === '.') {\n // If button is a '.'\n if (btn === '.') {\n if (preButton === '=' || mathOpPressed) {\n currentNum = '0';\n ...
[ "0.719733", "0.6718038", "0.66552764", "0.66339606", "0.6568104", "0.648824", "0.6469685", "0.6455676", "0.6441677", "0.6415753", "0.64050627", "0.6402349", "0.63438404", "0.63095206", "0.63086486", "0.62896854", "0.62779814", "0.62677115", "0.62342805", "0.6220707", "0.62156...
0.57955366
81
function determines how display will be updated
function updateDisplay(input) { //if display is blank and input isn't zero or solution has been returned if ((display.innerHTML === "0" && input !== "0") || opChain === 0 || solutionReturned === true) { //if solution is displayed and input is an operator or display is blank and input is an operator if ((solutionReturned === true && !isNumeric(input)) || (display.innerHTML === "0" && !isNumeric(input))) { //set solution to false because operation chain is increasing solutionReturned = false; //add input to the chain chainOperation(input); //add input to the display display.innerHTML += input; } else { //if above conditions not met, clear the chain, input replaces blank display state of 0 and replaces default 0 in operation chain solutionReturned = false; clearOpChain(); display.innerHTML = input; opChain.push(input); } } else { //if not starting from blank state, add input to display and operation chain display.innerHTML += input; chainOperation(input); } displaySub.innerHTML = opChain.join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onUpdateDisplay() {}", "function changeDisplay(){\n}", "function updateDisplay () {\n\n showValue('.held-value',heldValue);\n showValue('.next-Value',nextValue);\n}", "function updateDisplay() {\n\tshowValue(\".next-value\", nextValue);\n\tshowValue(\".held-value\", heldValue);\n}", "function updateDisp...
[ "0.82514054", "0.75685805", "0.7340831", "0.72750336", "0.71918446", "0.71705085", "0.7140407", "0.70949256", "0.69561136", "0.6907062", "0.68984854", "0.68923265", "0.6882047", "0.68600696", "0.685814", "0.67818236", "0.67525893", "0.6725731", "0.67174685", "0.670241", "0.66...
0.0
-1
function validates 0, operators, and decimals
function validateInput(input) { var currentDisplay = display.innerHTML; //if input is zero and display isn't, or input is the first decimal in display and solution is not displayed if ((input === "0" && currentDisplay !== "0") || (input === "." && currentDisplay.indexOf(".") < 0 && solutionReturned === false)) { //update display updateDisplay(input); } //if input is an operator if (input === "/" || input === "*" || input === "-" || input === "+") { var lastChar = opChain[opChain.length - 1]; //if last character was a number if (isNumeric(lastChar)) { //update display updateDisplay(input); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testFloat(valueOFinput, plusORnegative, decimal){\r\n\tvalueOFinput = valueOFinput.replace(/(^\\s*)|(\\s*$)/g, \"\");\r\n\tplusORnegative = plusORnegative.replace(/(^\\s*)|(\\s*$)/g, \"\");\r\n\tdecimal = decimal.replace(/(^\\s*)|(\\s*$)/g, \"\");\r\n\t\r\n\tif(valueOFinput==null || valueOFinput==\"\"){\r...
[ "0.69139385", "0.6816431", "0.67309296", "0.6696356", "0.66922146", "0.66899997", "0.6625281", "0.6612892", "0.66054374", "0.66033256", "0.6542331", "0.6487446", "0.64622116", "0.63859946", "0.6340719", "0.63181967", "0.6305245", "0.62423027", "0.62367165", "0.6158495", "0.61...
0.688854
1
checks whether given character is a number
function isNumeric(value) { return (value == Number(value)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNumber(character) {\n return Number.isInteger(parseInt(character))\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "fu...
[ "0.8518806", "0.84560513", "0.84560513", "0.84560513", "0.8431379", "0.83283424", "0.8242123", "0.82182574", "0.82069254", "0.82069254", "0.8205346", "0.8205346", "0.8205346", "0.8205346", "0.8205346", "0.8205346", "0.8205346", "0.8205346", "0.8203583", "0.81995386", "0.81980...
0.0
-1
clears chain of operations
function clearOpChain() { opChain.length = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n this.currOperand = ''\n this.prevOperand = ''\n this.operation = undefined\n }", "clear() {\n this.currentOperand = ''\n this.previousOperand = ''\n this.operation = undefined\n }", "clear() {\n this.currentOperand = '', this.previousOperand = ''...
[ "0.7352157", "0.73210645", "0.7275615", "0.72470576", "0.71738577", "0.70581996", "0.6985693", "0.6970416", "0.696341", "0.69626373", "0.68605435", "0.6835106", "0.6824505", "0.6766492", "0.67252326", "0.671317", "0.6704351", "0.6685185", "0.66244817", "0.6595804", "0.6594925...
0.81701005
0
clears display, sub display, and sets chain of operations to default 0
function clearAll() { opChain = [0]; display.innerHTML = "0"; displaySub.innerHTML = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearDisplay() {\n result = 0;\n recentOp = \"\";\n keySelect.display.value = \"\";\n newNum = true;\n }", "function clearDisplay(){\n display.textContent = '0'\n num1=0;\n num2 =0;\n chosen_operator =''\n}", "function allClear () {\n calcDisplay.displayValue = '0';\n calc...
[ "0.7642439", "0.7552297", "0.74829113", "0.7460566", "0.73396623", "0.72979945", "0.72206306", "0.7214373", "0.7211371", "0.7208351", "0.7188226", "0.7113221", "0.71071565", "0.7026092", "0.6990063", "0.6955391", "0.6926576", "0.6892196", "0.6890156", "0.6865154", "0.6855168"...
0.75701004
1
adds to chain of operations
function chainOperation(input) { opChain.push(input); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "chain(operator, expression) {\n\n this.operators.push(operator);\n this.operands.push(expression);\n return this;\n }", "chain (_) {\n return this \n }", "chain(_) {\n return this\n }", "add (commands) {\n if (isArray(commands)) {\n let len = commands.length\n whi...
[ "0.6641294", "0.6493197", "0.64390445", "0.61071974", "0.5921481", "0.5884627", "0.5813475", "0.57667667", "0.57667667", "0.5704637", "0.5665793", "0.5635599", "0.5581032", "0.5575363", "0.5545236", "0.55403394", "0.55314416", "0.5528152", "0.5498994", "0.5491902", "0.5483171...
0.7090993
0
Initializes the gameplay mode.
function mode_distance_init(playerLocation) { loadQuests(function(response) { // Parse JSON string into object var questLog = JSON.parse(response); questLog.forEach(function(e,i){ var x = Math.random() < 0.5 ? -1 : 1; var y = Math.random() < 0.5 ? -1 : 1; spawnQuestPoint(playerLocation, 'Quest Start', questLog[i].action[0].icon, x*10*(Math.floor(Math.random() * 24) + 1), y*10*(Math.floor(Math.random() * 24) + 1), function(err, marker) { if (err) { console.log(err); return; } markersPos.push({ marker: marker, lat: marker.getPosition().lat(), lng: marker.getPosition().lng() }); marker.addListener('click', function() { if (questInRange(playerCircle, marker)) { checkPosition(questLog, marker, markersPos, map); } }); }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n setupModeButtons();\n setupSquares();\n resetGame();\n}", "function initialize(){\n playing=true;\n lhor=false;\n lver=false;\n victory=false;\n turns=0;\n}", "init() {\n this.isCanvasSupported() ? this.ctx = this.canvas.getContext('2d') : false;\n\n if...
[ "0.73185444", "0.72844154", "0.7277071", "0.7221245", "0.72065634", "0.71785426", "0.71742207", "0.7157667", "0.7115493", "0.71100134", "0.7105247", "0.7063858", "0.7056287", "0.7055043", "0.7039079", "0.701134", "0.69453603", "0.6911621", "0.6891891", "0.68816084", "0.686559...
0.0
-1
Updates the gameplay elements according to the player's current location. This gets called whenever the player's location changes.
function mode_distance_update(playerLocation) { // Currently, we don't do anything special // when the location gets updated. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLocation() {\n \"use strict\";\n\n var location = g.player.location;\n $(\"title\").text(location.name);\n $(\"#location-header\").text(location.name);\n $(\"#location-description1\").text(location.descA);\n $(\"#location-description2\").text(location.descB);\n}", "function Updat...
[ "0.71629494", "0.70017856", "0.67695576", "0.67542666", "0.6727447", "0.6599812", "0.65100306", "0.65043557", "0.65041083", "0.6487639", "0.6445459", "0.64274156", "0.6424457", "0.64056915", "0.6399257", "0.6381615", "0.63728845", "0.637215", "0.63614714", "0.6353402", "0.634...
0.6179953
35
Loads all quests from a file resource.
function loadQuests(callback) { var xobj = new XMLHttpRequest(); xobj.overrideMimeType("application/json"); xobj.open('GET', './js/quests.json', true); xobj.onreadystatechange = function () { if (xobj.readyState == 4 && xobj.status == "200") { // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode callback(xobj.responseText); } }; xobj.send(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadWholeQuestion(){\n\t\tloadQuestion();\n\t\tloadChoices();\n\t\tloadHint();\n\t\tshowQuestionNumber();\n\t}", "function loadReminders(cb) {\n fs.readFile(reminderFile(), 'utf8', (err, data) => {\n if(err) {\n if(err.code == 'ENOENT') {\n clearReminders()\n ...
[ "0.5813219", "0.5687898", "0.5666737", "0.5622956", "0.56163317", "0.55856526", "0.55742043", "0.5552638", "0.5504943", "0.55047065", "0.5498483", "0.54903716", "0.5488381", "0.5447533", "0.5399579", "0.5355739", "0.53542084", "0.534991", "0.53460056", "0.53425", "0.5315725",...
0.67883503
0
Helpers to create specific types of items
function canInsert(state, nodeType) { let $from = state.selection.$from for (let d = $from.depth; d >= 0; d--) { let index = $from.index(d) if ($from.node(d).canReplaceWith(index, index, nodeType)) return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _makeItem(){\n var index = Utils.randMath(0, allItems.length - 1);\n var item = allItems[index];\n var retItem = undefined;\n\n if ((item.type == Melee)||(item.type == Ranged)) {\n if (item.type == Ranged) {\n retItem = new item.type(item.name,item.icon,item.desc,item.value,item.type,item.dama...
[ "0.7197482", "0.7146529", "0.68308496", "0.67928225", "0.6587072", "0.653712", "0.6481185", "0.64514804", "0.64091825", "0.6336129", "0.6305419", "0.6256475", "0.62311375", "0.6228659", "0.6220129", "0.62082875", "0.6174438", "0.6171067", "0.6159202", "0.61288214", "0.611361"...
0.0
-1
add a request promise property to the object
getAppointments() { return rp(`${BASE_URL}/appointments`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PromiseRequest() {\n\t superagent.Request.apply(this, arguments);\n\t }", "function PromiseRequest() {\n superagent.Request.apply(this, arguments);\n }", "function wrapRequest(request){return new PersistencePromise(function(resolve,reject){request.onsuccess=function(event){var result=event.tar...
[ "0.65106565", "0.64869684", "0.6383279", "0.6112009", "0.603034", "0.603034", "0.603034", "0.6021356", "0.60123956", "0.59619546", "0.59558696", "0.59558696", "0.59558696", "0.5939239", "0.5891431", "0.5884499", "0.5836", "0.5836", "0.58249813", "0.5726395", "0.5718238", "0...
0.0
-1
add a request promise property to the object. The id determines the customer that is be queried
getInformationById(id) { let url = `${BASE_URL}/customer_byId/${id}`; console.log("The URL is: ", url); return rp(url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRequest(id){\n let dfr = Q.defer();\n Request.findOne({_id: id, status: Data.getRequestStatus().pending})\n .populate({\n path: 'verifyTransactionUser1',\n })\n .populate({\n path: 'user1',\n populate: {path: 'community'},\n select:...
[ "0.57371026", "0.5726311", "0.56998897", "0.56142217", "0.5473995", "0.5470161", "0.546724", "0.53741705", "0.53485656", "0.5319109", "0.5238272", "0.51673985", "0.5058932", "0.50512016", "0.5049005", "0.5038349", "0.50360566", "0.5020217", "0.50159633", "0.4987162", "0.49686...
0.5070518
12
add a request promise property to the object. The id is being sent to the server and a prediction is being conducted
doPrediction(options) { return rp(options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "promise({ payload, request }) {\n return request.create({ data: payload })\n }", "promise({ payload, request }) {\n return request.update(payload)\n }", "function PromiseRequest() {\n\t superagent.Request.apply(this, arguments);\n\t }", "function addPerson(object) {\n var promise = $http({\n ...
[ "0.6012331", "0.5901183", "0.5692562", "0.55865765", "0.5539898", "0.5520077", "0.5489616", "0.54841393", "0.54266644", "0.54266644", "0.5402808", "0.53662944", "0.5362702", "0.5324244", "0.5316133", "0.5299805", "0.52629435", "0.5257433", "0.52171266", "0.520496", "0.5204188...
0.0
-1
getter get the current player time
function getCurrentTime() { var currentTime = editor.player.prop("currentTime"); currentTime = isNaN(currentTime) ? 0 : currentTime.toFixed(4); return parseFloat(currentTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get currentTime () {\n return this.player.currentTime();\n }", "getPlayTime() {\n return this.time;\n }", "function getCurrentTime(playerId){\n\t\treturn mPlayers[playerId].currentTime;\n\t}", "getCurrentTime() {\r\n\t\treturn new Promise(res => {\r\n\t\t\tswitch (this.source) {\r\n\t\t\t...
[ "0.80028486", "0.7827482", "0.7630825", "0.7301636", "0.73012066", "0.72712994", "0.72541434", "0.72366214", "0.7227915", "0.7201809", "0.7123555", "0.7030311", "0.6959288", "0.6953379", "0.69412917", "0.685612", "0.6833286", "0.67971516", "0.67957175", "0.67777544", "0.67711...
0.75910133
3
get the media duration
function getDuration() { var duration = editor.player.prop("duration"); duration = isNaN(duration) ? 0 : parseFloat(duration).toFixed(4); return duration; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "duration() {\n return this.d || (this.context && this.context.song && this.context.song.duration())\n }", "getDuration() {\n return this.video.duration;\n }", "function getMediaFileDuration (filePath, cb) {\n getMetaData(filePath, function (metadata) {\n cb(metadata ? metadata['format']...
[ "0.78902626", "0.785044", "0.7828204", "0.7708677", "0.76273453", "0.76043266", "0.7511164", "0.72955537", "0.72340304", "0.719466", "0.71198857", "0.71154904", "0.70839185", "0.7070688", "0.7070688", "0.7039953", "0.6942243", "0.6933155", "0.69329107", "0.69018793", "0.68817...
0.7805124
3
get whether the player has been paused or not
function getPlayerPaused() { var paused = editor.player.prop("paused"); return paused; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isPaused() {\n return this._isPaused;\n }", "function isPaused() {\n\n return dom.wrapper.classList.contains('paused');\n\n }", "get isPaused() {\n return this._isPaused;\n }", "get isPaused() {\n return this._isPaused;\n }", "get isPaused() {\n return this._isPause...
[ "0.8146443", "0.7982244", "0.7923395", "0.7923395", "0.78216994", "0.76568264", "0.7545798", "0.75006855", "0.71019584", "0.70721483", "0.70696163", "0.70139784", "0.70139784", "0.70109344", "0.7008581", "0.69728094", "0.6925451", "0.6913184", "0.688491", "0.68564856", "0.685...
0.80056185
1
get the current split item by time
function getCurrentSplitItem() { if (editor.splitData && editor.splitData.splits) { var currentTime = getCurrentTime(); for (var i = 0; i < editor.splitData.splits.length; ++i) { var splitItem = editor.splitData.splits[i]; if ((splitItem.clipBegin <= (currentTime + 0.1)) && (currentTime < (splitItem.clipEnd - 1))) { splitItem.id = i; return splitItem; } } } return currSplitItem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get itemTime(){ return this._itemTime; }", "function playCurrentSplitItem() {\n var splitItem = getCurrentSplitItem();\n if (splitItem != null) {\n pauseVideo();\n var duration = (splitItem.clipEnd - splitItem.clipBegin) * 1000;\n setCurrentTime(splitItem.clipBegin);\n\n clearEv...
[ "0.62600136", "0.591658", "0.5677979", "0.5582088", "0.54742885", "0.5412713", "0.53113586", "0.52732044", "0.5257456", "0.5254671", "0.5227693", "0.52125865", "0.52115387", "0.52070105", "0.5190759", "0.5184162", "0.51258206", "0.5114176", "0.51020133", "0.50994325", "0.5061...
0.70029855
0
get the timefield begin time
function getTimefieldTimeBegin() { return parseFloat($('#clipBegin').timefield('option', 'value')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStartTime() {\n // YYYY-MM-DD-HH.MM.SS.XXXXXX\n return this.transactionMetaData[TransMeta.TIME_START];\n }", "function timeStart()\n{\n var ds = new Date();\n var hs = addZero(ds.getHours());\n var ms = addZero(ds.getMinutes());\n var ss = addZero(ds.getSeconds());\n ...
[ "0.74440545", "0.7116336", "0.71033245", "0.7048362", "0.69733655", "0.678038", "0.678038", "0.67653894", "0.66260076", "0.6594966", "0.64558536", "0.638636", "0.63836277", "0.63806134", "0.6375121", "0.63515353", "0.6351411", "0.6349188", "0.6327187", "0.63231933", "0.631647...
0.76334107
0
get the timefield end time
function getTimefieldTimeEnd() { return parseFloat($('#clipEnd').timefield('option', 'value')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get endTime() {\n let result = null;\n if (this.ended) {\n result = new Date(this.startTime.getTime() + this.duration);\n }\n return result;\n }", "function getEndBackendTime () {\n return testPlayerService.getServerEndTime()\n .then(function (re...
[ "0.7059088", "0.67957705", "0.6776984", "0.67444104", "0.6702129", "0.66810405", "0.667555", "0.66578704", "0.6602731", "0.6601408", "0.65993005", "0.646885", "0.646175", "0.643442", "0.63469785", "0.63437325", "0.63234955", "0.6297058", "0.62777525", "0.6275761", "0.62388605...
0.76559126
0
setter enable/disable a split item
function setEnabled(uuid, enabled) { if (!continueProcessing && editor.splitData && editor.splitData.splits) { editor.splitData.splits[uuid].enabled = enabled; editor.updateSplitList(false, !zoomedIn()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleSplitting() {\n\t\tvar splitOK = document.getElementById(\"split\").checked;\n\t\tif (splitOK) {\n\t\t\tsplitting.activate();\n\t\t} else {\n\t\t\tsplitting.deactivate();\n\t\t}\n}", "_enableDisableHandler() {\n const that = this;\n\n if (that.disabled) {\n for (let i = 0;...
[ "0.666054", "0.6252897", "0.6178935", "0.6178935", "0.6178935", "0.6178935", "0.6093752", "0.6026537", "0.59687215", "0.59179777", "0.59003985", "0.59003985", "0.59003985", "0.58593225", "0.5776507", "0.5776507", "0.5768296", "0.575326", "0.5749773", "0.56509095", "0.56509095...
0.6601855
1
set current time as the new inpoint of selected item
function setCurrentTimeAsNewInpoint() { if (!continueProcessing && (editor.selectedSplit != null)) { setTimefieldTimeBegin(getCurrentTime()); okButtonClick(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCurrentTimeAsNewOutpoint() {\n if (!continueProcessing && (editor.selectedSplit != null)) {\n setTimefieldTimeEnd(getCurrentTime());\n okButtonClick();\n }\n}", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.co...
[ "0.62714416", "0.62331015", "0.6183065", "0.61612344", "0.6085788", "0.6074017", "0.60612965", "0.604484", "0.60360765", "0.5992111", "0.5984996", "0.59785086", "0.59667486", "0.5951836", "0.5931392", "0.5917668", "0.5917668", "0.59151584", "0.5908623", "0.59054035", "0.58931...
0.6974967
0
set current time as the new outpoint of selected item
function setCurrentTimeAsNewOutpoint() { if (!continueProcessing && (editor.selectedSplit != null)) { setTimefieldTimeEnd(getCurrentTime()); okButtonClick(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCurrentTimeAsNewInpoint() {\n if (!continueProcessing && (editor.selectedSplit != null)) {\n setTimefieldTimeBegin(getCurrentTime());\n okButtonClick();\n }\n}", "function selectTime() {\n var pos = d3.mouse(fullMareyForeground.node());\n var y = pos[1];\n var x = p...
[ "0.635821", "0.6237138", "0.6138255", "0.6116868", "0.6115421", "0.58868694", "0.58804727", "0.58680177", "0.5820091", "0.58084935", "0.5727909", "0.5727909", "0.5710188", "0.5709297", "0.5661444", "0.56611395", "0.56587696", "0.56521726", "0.5648474", "0.56421804", "0.561900...
0.6594209
0
set timefield begin time
function setTimefieldTimeBegin(time) { if (!continueProcessing) { $('#clipBegin').timefield('option', 'value', time); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set time(value) {}", "function setTime( t ){\n\n this.time = t;\n\n }", "start_time(val) {\n this._start_time = val;\n return this;\n }", "set_time( t ){ this.current_time = t; this.draw_fg(); return this; }", "set startTime(value) { this._startTime = value || new Date(); }", "chronoRese...
[ "0.70391136", "0.6932435", "0.6772772", "0.6754524", "0.6752003", "0.6709831", "0.67033005", "0.66664654", "0.662759", "0.6590096", "0.65732306", "0.6529109", "0.64972186", "0.64684945", "0.6466609", "0.6464031", "0.6460689", "0.6431454", "0.6429534", "0.6400319", "0.6389779"...
0.8049476
0
set timefield end time
function setTimefieldTimeEnd(time) { if (!continueProcessing) { $('#clipEnd').timefield('option', 'value', time); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tpEndSelect( time, startTimePickerInst ) {\n $('#eventStartTime').timepicker('option', {\n maxTime: {\n hour: startTimePickerInst.hours,\n minute: startTimePickerInst.minutes\n }\n });\n}", "set time(value) {}", "function setTimefieldTimeBegin(time) {\n if (!cont...
[ "0.6944746", "0.6912715", "0.68328804", "0.6588861", "0.65853816", "0.65724087", "0.65648", "0.65302044", "0.64314586", "0.63855743", "0.63351274", "0.6267155", "0.62645155", "0.62510645", "0.62456816", "0.6239142", "0.62227875", "0.62070245", "0.6161373", "0.6156201", "0.612...
0.79997814
0
helper return all strings in str starting with startStr and ending with endStr
function getAllStringsOf(str, startStr, endStr) { var result = new Array(); var strCpy = str; while ((strCpy.indexOf(startStr) != -1) && (strCpy.indexOf(endStr) != -1)) { var tmp = strCpy.substring(strCpy.indexOf(startStr), strCpy.indexOf(endStr) + endStr.length); if (tmp && (tmp != "")) { result[result.length] = tmp; } strCpy = strCpy.substring(str.indexOf(endStr) + endStr.length, strCpy.length); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function substringByStartAndEnd(input, start, end) {}", "function between(string, start, end){\n var startAt = string.indexOf(start) + start.length;\n var endAt = string.indexOf(end, startAt);\n \n return string.slice(startAt, endAt);\n}", "function substring(str, start, end) {\n var result = '';\...
[ "0.77393335", "0.6890976", "0.68833405", "0.68177956", "0.68177956", "0.6675158", "0.641572", "0.64070594", "0.6401717", "0.63012564", "0.6281236", "0.62812346", "0.6237426", "0.62294114", "0.62258595", "0.6225195", "0.62236726", "0.6216225", "0.61335677", "0.61140746", "0.61...
0.7948158
0
formatting a time string to hh:MM:ss.mm
function formatTime(seconds) { if (typeof seconds == "string") { seconds = parseFloat(seconds); } var h = "00"; var m = "00"; var s = "00"; if (!isNaN(seconds) && (seconds >= 0)) { var tmpH = Math.floor(seconds / 3600); var tmpM = Math.floor((seconds - (tmpH * 3600)) / 60); var tmpS = Math.floor(seconds - (tmpH * 3600) - (tmpM * 60)); var tmpMS = seconds - tmpS; h = (tmpH < 10) ? "0" + tmpH : (Math.floor(seconds / 3600) + ""); m = (tmpM < 10) ? "0" + tmpM : (tmpM + ""); s = (tmpS < 10) ? "0" + tmpS : (tmpS + ""); ms = tmpMS + ""; var indexOfSDot = ms.indexOf("."); if (indexOfSDot != -1) { ms = ms.substr(indexOfSDot + 1, ms.length); } ms = ms.substr(0, 2); while (ms.length < 2) { ms += "0"; } } return h + ":" + m + ":" + s + "." + ms; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatTime(time) {\n if (time == -1) { return \"N/A\" }\n time = +time;\n let cs = time % 1000;\n let s = time % (1000 * 60) - cs;\n let m = time - s - cs;\n\n // Since the values returned above is suffixed\n // we have to divide afterwards\n cs = Math.floor(cs / 10);\n s = Math.floor(s / 1000);\...
[ "0.7658685", "0.7616554", "0.7511847", "0.7473244", "0.7466628", "0.74091184", "0.7402683", "0.738053", "0.7376499", "0.73480487", "0.73474777", "0.7342646", "0.732661", "0.7291758", "0.7290072", "0.72811013", "0.7273684", "0.7263158", "0.72305983", "0.72154325", "0.71999687"...
0.69667846
47
checks check whether toCheck is in Interval [lower, upper]
function isInInterval(toCheck, lower, upper) { return (toCheck >= lower) && (toCheck <= upper); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInRanges(value) {\n if (typeof value !== 'number') {\n return false;\n }\n return value >= this.lower && value <= this.upper;\n}", "function isBetween(lowerBound, upperBound, value)\n{\n\treturn (lowerBound < value && value < upperBound);\n}", "between(num, lower, upper) {\n return ...
[ "0.69556093", "0.681553", "0.68121004", "0.6519247", "0.6519247", "0.6497305", "0.6477554", "0.6477554", "0.64601785", "0.64601785", "0.64577633", "0.64570135", "0.6412107", "0.6401274", "0.63492453", "0.63332367", "0.62239164", "0.6223806", "0.62148833", "0.62131405", "0.620...
0.85438925
0
check whether clipBegin is in the right format
function checkClipBegin() { if (!continueProcessing) { var clipBegin = getTimefieldTimeBegin(); if (isNaN(clipBegin) || (clipBegin < 0)) { displayMsg("The inpoint is too low or the format is not correct. Correct format: hh:MM:ss.mm. Please check.", "Check inpoint"); return false; } return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkClipEnd() {\n if (!continueProcessing) {\n var clipEnd = getTimefieldTimeEnd();\n var duration = getDuration();\n if (isNaN(clipEnd) || (clipEnd > duration)) {\n displayMsg(\"The outpoint is too high or the format is not correct. Correct format: hh:MM:ss.mm. Please ...
[ "0.6477681", "0.5709964", "0.56755257", "0.5662904", "0.5561524", "0.5528435", "0.54918784", "0.5472061", "0.5451166", "0.54392606", "0.5405298", "0.53580517", "0.53441745", "0.5315367", "0.5315367", "0.52833945", "0.52833945", "0.52623165", "0.5254665", "0.5254665", "0.52466...
0.74173105
0
check whether clipEnd is in the right format
function checkClipEnd() { if (!continueProcessing) { var clipEnd = getTimefieldTimeEnd(); var duration = getDuration(); if (isNaN(clipEnd) || (clipEnd > duration)) { displayMsg("The outpoint is too high or the format is not correct. Correct format: hh:MM:ss.mm. Please check.", "Check outpoint"); return false; } return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkClipBegin() {\n if (!continueProcessing) {\n var clipBegin = getTimefieldTimeBegin();\n if (isNaN(clipBegin) || (clipBegin < 0)) {\n displayMsg(\"The inpoint is too low or the format is not correct. Correct format: hh:MM:ss.mm. Please check.\",\n \"Check inp...
[ "0.69289625", "0.6233361", "0.5959626", "0.5959626", "0.5913432", "0.5913432", "0.5912402", "0.5912402", "0.5844448", "0.5832057", "0.5832057", "0.5774688", "0.57372904", "0.5627085", "0.5627085", "0.5604283", "0.54683375", "0.54639304", "0.54264635", "0.5424951", "0.5414993"...
0.78991425
0
checks previous and next segments
function checkPrevAndNext(id, checkTimefields) { if (!continueProcessing) { checkTimefields = checkTimefields || false; var inserted = false; if (editor.splitData && editor.splitData.splits) { var duration = getDuration(); var current = editor.splitData.splits[id]; // new first item if (id == 0) { var clipBegin = parseFloat(current.clipBegin); var clipEnd = parseFloat(current.clipEnd); if (editor.splitData.splits.length > 1) { var next = editor.splitData.splits[1]; next.clipBegin = clipEnd; } if ((!checkTimefields || (checkTimefields && (getTimefieldTimeBegin() != 0))) && (clipBegin > minSegmentLength)) { ocUtils.log("Inserting a first split element (cpan - auto): (" + 0 + " - " + clipBegin + ")"); var newSplitItem = { clipBegin: 0, clipEnd: clipBegin, enabled: true }; inserted = true; // add new item to front editor.splitData.splits.splice(0, 0, newSplitItem); insertedFirstItem = true; } else if (clipBegin > 0) { ocUtils.log("Extending the first split element to (cpan - auto): (" + 0 + " - " + clipEnd + ")"); current.clipBegin = 0; } } // new last item else if ((editor.splitData.splits.length > 0) && (id == editor.splitData.splits.length - 1)) { if ((!checkTimefields || (checkTimefields && (getTimefieldTimeEnd() != duration))) && (current.clipEnd < (duration - minSegmentLength))) { ocUtils.log("Inserting a last split element (cpan - auto): (" + current.clipEnd + " - " + duration + ")"); var newLastItem = { clipBegin: parseFloat(current.clipEnd), clipEnd: parseFloat(duration), enabled: true }; inserted = true; // add the new item to the end editor.splitData.splits.push(newLastItem); var prev = editor.splitData.splits[id - 1]; prev.clipEnd = parseFloat(current.clipBegin); insertedLastItem = true; } else { ocUtils.log("Extending the last split element to (cpan - auto): (" + current.clipBegin + " - " + duration + ")"); current.clipEnd = parseFloat(duration); } } // in the middle else if ((id > 0) && (id < (editor.splitData.splits.length - 1))) { var prev = editor.splitData.splits[id - 1]; var next = editor.splitData.splits[id + 1]; if (checkTimefields && (getTimefieldTimeBegin() <= prev.clipBegin)) { displayMsg("The inpoint is lower than the begin of the last segment. Please check.", "Check inpoint"); return { ok: false, inserted: false }; } if (checkTimefields && (getTimefieldTimeEnd() >= next.clipEnd)) { displayMsg("The outpoint is bigger than the end of the next segment. Please check.", "Check outpoint"); return { ok: false, inserted: false }; } prev.clipEnd = parseFloat(current.clipBegin); next.clipBegin = parseFloat(current.clipEnd); } } return { ok: true, inserted: inserted }; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function previousSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id - 1;\n new_id = (...
[ "0.6279939", "0.61847574", "0.6064243", "0.5875473", "0.5785764", "0.5714955", "0.56907463", "0.56884146", "0.5667187", "0.5667187", "0.5667187", "0.5667187", "0.5667187", "0.56662804", "0.566206", "0.5639163", "0.5626988", "0.5625037", "0.5624068", "0.5616481", "0.5615542", ...
0.5889478
3
click click handler for saving data in editing box
function okButtonClick() { if (!continueProcessing && checkClipBegin() && checkClipEnd()) { id = $('#splitUUID').val(); if (id != "") { var current = editor.splitData.splits[id]; var tmpBegin = parseFloat(current.clipBegin); var tmpEnd = parseFloat(current.clipEnd); var duration = getDuration(); id = parseInt(id); if (getTimefieldTimeBegin() > getTimefieldTimeEnd()) { displayMsg("The inpoint is bigger than the outpoint. Please check and correct it.", "Check and correct inpoint and outpoint"); selectSegmentListElement(id); return; } if (checkPrevAndNext(id, true).ok) { if (editor.splitData && editor.splitData.splits) { current.clipBegin = getTimefieldTimeBegin(); current.clipEnd = getTimefieldTimeEnd(); if (id > 0) { if (current.clipBegin > editor.splitData.splits[id - 1].clipBegin) { editor.splitData.splits[id - 1].clipEnd = current.clipBegin; } else { displayMsg("The inpoint is bigger than the inpoint of the segment before this segment. Please check and correct it.", "Check and correct inpoint"); setTimefieldTimeBegin(editor.splitData.splits[id - 1].clipEnd); selectSegmentListElement(id); return; } } var last = editor.splitData.splits[editor.splitData.splits.length - 1]; if (last.clipEnd < duration) { ocUtils.log("Inserting a last split element (auto): (" + current.clipEnd + " - " + duration + ")"); var newLastItem = { clipBegin: parseFloat(last.clipEnd), clipEnd: parseFloat(duration), enabled: true }; // add the new item to the end editor.splitData.splits.push(newLastItem); } for (var i = 0; i < editor.splitData.splits.length; ++i) { if (checkPrevAndNext(i, false).inserted) { i = 0; } } } editor.updateSplitList(true, !zoomedIn()); $('#videoPlayer').focus(); selectSegmentListElement(id); } else { current.clipBegin = tmpBegin; current.clipEnd = tmpEnd; selectSegmentListElement(id); } } } else { selectCurrentSplitItem(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save(e) {\n let saveBtn = e.target;\n let inputBox = event.target.parentNode.lastChild;\n event.target.parentNode.firstChild.textContent = inputBox.value;\n inputBox.style.display = \"none\";\n saveBtn.style.display=\"none\";\n let editBtn = event.target.nextSibli...
[ "0.7242012", "0.71921414", "0.70357245", "0.6986772", "0.6932385", "0.6876298", "0.68186235", "0.6808715", "0.6793268", "0.6784878", "0.6772735", "0.67662305", "0.6670292", "0.6652917", "0.66483825", "0.663244", "0.66323435", "0.6631246", "0.66231805", "0.65830576", "0.657058...
0.0
-1
click handler for canceling editing
function cancelButtonClick() { if (!continueProcessing) { $('#splitUUID').val(''); $('#splitDescription').val(""); setTimefieldTimeBegin(0); setTimefieldTimeEnd(0); $('#splitIndex').html('#'); $('.splitItem').removeClass('splitItemSelected'); $('.splitSegmentItem').removeClass('splitSegmentItemSelected'); editor.selectedSplit = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editCancelFunc(){\n setEdit(null);\n }", "function handleCancelEdit() {\n updateIsEditMode(false);\n }", "function cancelEdit(e){\n e.preventDefault();\n \n Session.set('editingPost', null);\n}", "function cancelEdit(){\n //close edit box\n closeEditBox();\n}", "function can...
[ "0.8243242", "0.80517614", "0.8039719", "0.7993903", "0.790349", "0.77952075", "0.7659383", "0.76372707", "0.7633507", "0.7616949", "0.76094365", "0.7607123", "0.7562926", "0.7552121", "0.75511426", "0.7503841", "0.7441928", "0.74407935", "0.74384713", "0.74026483", "0.738111...
0.0
-1
click/shortcut handler for removing current split item
function splitRemoverClick() { if (!continueProcessing) { item = $(this); var id = item.prop('id'); if (id != undefined) { id = id.replace("splitItem-", ""); id = id.replace("splitRemover-", ""); id = id.replace("splitAdder-", ""); } else { id = ""; } if (id == "" || id == "deleteButton") { id = $('#splitUUID').val(); } id = parseInt(id); if (editor.splitData && editor.splitData.splits && editor.splitData.splits[id]) { if (editor.splitData.splits[id].enabled) { $('#splitItemDiv-' + id).addClass('disabled'); $('#splitRemover-' + id).hide(); $('#splitAdder-' + id).show(); $('.splitItem').removeClass('splitItemSelected'); setEnabled(id, false); if (!zoomedIn()) { if (getCurrentSplitItem().id == id) { // if current split item is being deleted: // try to select the next enabled segment, if that fails try to select the previous enabled item var sthSelected = false; for (var i = id; i < editor.splitData.splits.length; ++i) { if (editor.splitData.splits[i].enabled) { sthSelected = true; selectSegmentListElement(i, true); break; } } if (!sthSelected) { for (var i = id; i >= 0; --i) { if (editor.splitData.splits[i].enabled) { sthSelected = true; selectSegmentListElement(i, true); break; } } } } selectCurrentSplitItem(); } } else { $('#splitItemDiv-' + id).removeClass('disabled'); $('#splitRemover-' + id).show(); $('#splitAdder-' + id).hide(); setEnabled(id, true); } } cancelButtonClick(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeItem(_item) { }", "remove(item) {\n const that = this;\n\n if (typeof (item) === 'number') {\n item = that._items[item];\n }\n else if (typeof item === 'string') {\n item = document.getElementById(item);\n }\n\n if (!(item instanceof JQX.TabsW...
[ "0.67586964", "0.67105514", "0.66337395", "0.65762204", "0.655698", "0.6534118", "0.6534021", "0.6523169", "0.64637107", "0.64483404", "0.6435547", "0.640026", "0.6388109", "0.6386598", "0.63692826", "0.6365542", "0.6363257", "0.63500273", "0.6345777", "0.634439", "0.63393974...
0.69454867
0
click handler for selecting a split item in segment bar or list
function splitItemClick() { if (!continueProcessing) { if (!isSeeking || (isSeeking && ($(this).prop('id').indexOf('Div-') == -1))) { now = new Date(); } if ((now - lastTimeSplitItemClick) > 80) { lastTimeSplitItemClick = now; if (editor.splitData && editor.splitData.splits) { // if not seeking if ((isSeeking && ($(this).prop('id').indexOf('Div-') == -1)) || !isSeeking) { // get the id of the split item id = $(this).prop('id'); id = id.replace('splitItem-', ''); id = id.replace('splitItemDiv-', ''); id = id.replace('splitSegmentItem-', ''); $('#splitUUID').val(id); if (id != lastId) { if (!inputFocused) { lastId = id; // remove all selected classes $('.splitSegmentItem').removeClass('splitSegmentItemSelected'); $('.splitItem').removeClass('splitItemSelected'); $('.splitItemDiv').removeClass('splitSegmentItemSelected'); $('#clipItemSpacer').remove(); $('#clipBegin').remove(); $('#clipEnd').remove(); $('.segmentButtons', '#splitItem-' + id).append('<span class="clipItem" id="clipBegin"></span><span id="clipItemSpacer"> - </span><span class="clipItem" id="clipEnd"></span>'); setSplitListItemButtonHandler(); $('#splitSegmentItem-' + id).removeClass('hover'); // load data into the segment var splitItem = editor.splitData.splits[id]; editor.selectedSplit = splitItem; editor.selectedSplit.id = parseInt(id); setTimefieldTimeBegin(splitItem.clipBegin); setTimefieldTimeEnd(splitItem.clipEnd); $('#splitIndex').html(parseInt(id) + 1); // add the selected class to the corresponding items $('#splitSegmentItem-' + id).addClass('splitSegmentItemSelected'); $('#splitItem-' + id).addClass('splitItemSelected'); $('#splitItemDiv-' + id).addClass('splitSegmentItemSelected'); currSplitItem = splitItem; if (!timeoutUsed) { if (!currSplitItemClickedViaJQ) { setCurrentTime(splitItem.clipBegin); } // update the current time of the player $('.video-timer').html(formatTime(getCurrentTime()) + "/" + formatTime(getDuration())); } } } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectSegmentListElement(number, dblClick) {\n dblClick = dblClick ? dblClick : false;\n if (!continueProcessing && editor.splitData && editor.splitData.splits) {\n var spltItem = editor.splitData.splits[number];\n if (spltItem) {\n setCurrentTime(spltItem.clipBegin);\n ...
[ "0.72758037", "0.6840291", "0.64373934", "0.63681453", "0.6326161", "0.62780905", "0.62780905", "0.62433374", "0.62055355", "0.61304724", "0.60904366", "0.60104275", "0.59891665", "0.5966041", "0.59533817", "0.5951616", "0.5951444", "0.5919155", "0.59091485", "0.5903462", "0....
0.7076937
1
click/shortcut handler for adding a split item at current time
function splitButtonClick() { if (!continueProcessing && editor.splitData && editor.splitData.splits) { var currentTime = getCurrentTime(); for (var i = 0; i < editor.splitData.splits.length; ++i) { var splitItem = editor.splitData.splits[i]; splitItem.clipBegin = parseFloat(splitItem.clipBegin); splitItem.clipEnd = parseFloat(splitItem.clipEnd); if ((splitItem.clipBegin < currentTime) && (currentTime < splitItem.clipEnd)) { newEnd = 0; if (editor.splitData.splits.length == (i + 1)) { newEnd = splitItem.clipEnd; } else { newEnd = editor.splitData.splits[i + 1].clipBegin; } var newItem = { clipBegin: parseFloat(currentTime), clipEnd: parseFloat(newEnd), enabled: true } splitItem.clipEnd = currentTime; editor.splitData.splits.splice(i + 1, 0, newItem); // TODO Make splitSegments clickable when zoomed in editor.updateSplitList(false, !zoomedIn()); selectSegmentListElement(i + 1); return; } } } selectCurrentSplitItem(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitItemClick() {\n if (!continueProcessing) {\n if (!isSeeking || (isSeeking && ($(this).prop('id').indexOf('Div-') == -1))) {\n now = new Date();\n }\n\n if ((now - lastTimeSplitItemClick) > 80) {\n lastTimeSplitItemClick = now;\n\n if (editor.sp...
[ "0.7065139", "0.6649288", "0.64635265", "0.63123125", "0.62849987", "0.61835575", "0.60692406", "0.604714", "0.603421", "0.59861404", "0.5957507", "0.5953882", "0.593272", "0.59280634", "0.59276676", "0.5897413", "0.58803916", "0.58702517", "0.5869334", "0.5869334", "0.586933...
0.62014264
5
select select the split segment at the current time
function selectCurrentSplitItem(excludeDeletedSegments) { if (!continueProcessing && !isSeeking) { excludeDeletedSegments = excludeDeletedSegments || false; var splitItem = getCurrentSplitItem(); if (splitItem != null) { var idFound = false; var id = -1; if (excludeDeletedSegments) { if (splitItem.enabled) { id = splitItem.id; idFound = true; } else if (editor.splitData && editor.splitData.splits) { for (var i = splitItem.id; i < editor.splitData.splits.length; ++i) { if (editor.splitData.splits[i].enabled) { idFound = true; id = i; break; } } if (!idFound) { for (var i = splitItem.id; i >= 0; --i) { if (editor.splitData.splits[i].enabled) { idFound = true; id = i; break; } } } } } else { id = splitItem.id; idFound = true; } if (idFound) { currSplitItemClickedViaJQ = true; if (!zoomedIn()) { $('#splitSegmentItem-' + id).click(); } lastId = -1; $('#descriptionCurrentTime').html(formatTime(getCurrentTime())); } else { ocUtils.log("Could not find an enabled ID"); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jumpToSegment() {\n if (editor.splitData && editor.splitData.splits) {\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n setCurrentTime(editor.splitData.splits[id].cl...
[ "0.7093804", "0.6068697", "0.60346407", "0.5950914", "0.56174904", "0.56151795", "0.5594618", "0.5548036", "0.553676", "0.5416807", "0.5397532", "0.5369994", "0.53435373", "0.53273463", "0.531828", "0.5265542", "0.5252907", "0.5221186", "0.51980644", "0.51615274", "0.5142735"...
0.67163014
1
selects the split segment with the number number
function selectSegmentListElement(number, dblClick) { dblClick = dblClick ? dblClick : false; if (!continueProcessing && editor.splitData && editor.splitData.splits) { var spltItem = editor.splitData.splits[number]; if (spltItem) { setCurrentTime(spltItem.clipBegin); currSplitItemClickedViaJQ = true; if ($('#splitItemDiv-' + number)) { if (dblClick) { $('#splitItemDiv-' + number).dblclick(); } else { $('#splitItemDiv-' + number).click(); // TODO } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jumpToSegment() {\n if (editor.splitData && editor.splitData.splits) {\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n setCurrentTime(editor.splitData.splits[id].cl...
[ "0.58365625", "0.56602407", "0.558479", "0.54980344", "0.54977524", "0.5444909", "0.5412685", "0.54056525", "0.5391442", "0.53397375", "0.532957", "0.52322525", "0.52041924", "0.51975554", "0.51450396", "0.5118003", "0.5106339", "0.50947833", "0.50938", "0.5037182", "0.503579...
0.5839195
0
visual displays a graphical message
function displayMsg(msg, title, displayOKButton) { if (!messageShown) { messageShown = true; if (displayOKButton == undefined) { displayOKButton = true; } if (displayOKButton) { jQMsg = $('<div />').html(msg).dialog({ title: title, resizable: false, buttons: { OK: function() { $(this).dialog("close"); } }, close: function(event, ui) { messageShown = false; } }); } else { $('<div />').html(msg).dialog({ title: title, resizable: false, close: function(event, ui) { messageShown = false; } }); } } else { if (jQMsg != undefined) { jQMsg.append("<br/>" + msg); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayMessage(msg, character) {\r\n self.displayMessage(msg, character);\r\n }", "function showStatus() \n{\n\t/* score */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"score:\"+score, 5, 16);\n\t/* level */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"level:\"+level, 5, 32);\n\t/* bul...
[ "0.6781029", "0.6562934", "0.6557501", "0.6468709", "0.6403867", "0.63917327", "0.63595766", "0.6345752", "0.6311521", "0.6285033", "0.62070215", "0.6192124", "0.61890095", "0.6188552", "0.61875176", "0.61860394", "0.6182458", "0.6149878", "0.6148623", "0.6141957", "0.6141940...
0.0
-1