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
fn_load_school_purcahse() Function is used to load the school purchase
function fn_load_school_purcahse() { $("#reports-pdfviewer").hide("fade").remove(); var dataparam = "oper=showschoolpurchase"; $.ajax({ type: 'post', url: 'reports/password/reports-password-passwordajax.php', data: dataparam, beforeSend: function(){ $('#schools').html('<img src="img/loader.gif" width="20...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fn_load_home_purcahse()\n{\t\n\t$(\"#reports-pdfviewer\").hide(\"fade\").remove();\n\tvar dataparam = \"oper=showhomepurchase\";\n\t$.ajax({\n\t\ttype: 'post',\n\t\turl: 'reports/password/reports-password-passwordajax.php',\n\t\tdata: dataparam,\n\t\tbeforeSend: function(){\n\t\t\t$('#schools').html('<img...
[ "0.6431883", "0.5829596", "0.5656028", "0.55800223", "0.5552572", "0.54555124", "0.52609116", "0.5246365", "0.522876", "0.52285165", "0.518842", "0.51813775", "0.5135511", "0.51215196", "0.5117196", "0.5114703", "0.5071495", "0.50480306", "0.5035886", "0.500024", "0.49660468"...
0.6988721
0
fn_load_home_purcahse() Function is used to load the home purchase
function fn_load_home_purcahse() { $("#reports-pdfviewer").hide("fade").remove(); var dataparam = "oper=showhomepurchase"; $.ajax({ type: 'post', url: 'reports/password/reports-password-passwordajax.php', data: dataparam, beforeSend: function(){ $('#schools').html('<img src="img/loader.gif" width="200" ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupPurchase() {\r\n // Get chosen package information\r\n var depFlight = JSON.parse(localStorage.getItem('departure'));\r\n var hotel = JSON.parse(localStorage.getItem('hotel'));\r\n var retFlight = JSON.parse(localStorage.getItem('return'));\r\n\r\n // Display correct package price numb...
[ "0.5872807", "0.5842248", "0.5825057", "0.5810927", "0.57901454", "0.5661886", "0.56291795", "0.55649114", "0.5533075", "0.5473618", "0.5473618", "0.5473618", "0.5473618", "0.5473618", "0.5473618", "0.54444516", "0.54407036", "0.53864187", "0.5386049", "0.53751254", "0.534480...
0.65504223
0
Author: Shah Arafat Date: 1st January 2021
function largestOfFour(arr) { let largestNumber = Number.NEGATIVE_INFINITY ; let largestArray = []; for (let i = 0; i < arr.length; i++) { for (let j = 0; j < arr[i].length; j++) { if (arr[i][j] > largestNumber) { largestNumber = arr[i][j]; } } largestArray.push(largestN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function date(){\n return ;\n }", "function getDate() {\n let m = moment().format('YYYY-MM-DD');\n console.log('Generating PDF at: ', m)\n return m\n }", "function dateString() {\n recipe.forEach(date => {\n let d...
[ "0.5974938", "0.59651744", "0.5939666", "0.59133637", "0.5817353", "0.5801905", "0.5774086", "0.5732668", "0.57285935", "0.5720729", "0.5719709", "0.57170564", "0.56894374", "0.56731546", "0.5645527", "0.5644227", "0.5644227", "0.56350744", "0.5626087", "0.5617335", "0.561279...
0.0
-1
Used to generate a unique value for chunk key (like a primary identity column)
_incrementGlobalCounter(increment) { if (this.globalCounter > 1000000) { this.globalCounter = 0; } else { this.globalCounter += increment; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uniqueId() {\n\t\tuniqueId.i = uniqueId.i || 0;\n\t\treturn '__' + uniqueId.i++;\n\t}", "_uniqueID() {\n const chr4 = () => Math.random().toString(16).slice(-4);\n return `${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;\n }", "function nextKey () {\n return (un...
[ "0.6733179", "0.6647665", "0.65921116", "0.6484724", "0.6483806", "0.6470402", "0.6456965", "0.6429625", "0.6426437", "0.64121026", "0.63932925", "0.6392386", "0.63807994", "0.63548845", "0.6353547", "0.63059634", "0.6302441", "0.6268485", "0.6265738", "0.6243644", "0.6232343...
0.0
-1
Use of this source code is governed by a BSDstyle license that can be found in the LICENSE file.
function createHtmlGetter(element) { return function() { return element.outerHTML.toLowerCase(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "static final private internal function m106() {}", "transient private protected internal function m182() {}", "static private internal function m121() {}", "transient private internal fu...
[ "0.7138844", "0.6836572", "0.65234625", "0.64995927", "0.62373906", "0.6188715", "0.6166126", "0.61660075", "0.6161704", "0.61002314", "0.6043187", "0.6040458", "0.5952893", "0.5912806", "0.58842987", "0.58625877", "0.5859433", "0.5784148", "0.5691889", "0.56607383", "0.56458...
0.0
-1
state internal variables props external variables
function HomePage(props) { // console.log("props", props); return ( <div className="home"> {props.headerName} {props.pageNumber} </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get props() { return this._props }", "constructor(props) { //Genero al constructor para inicializar propiedas y variables\n super(props); //Declaramos super para adaptar las propiedades en React\n this.state = { //Declaramos los ...
[ "0.6656771", "0.650231", "0.6469803", "0.64241827", "0.637783", "0.634033", "0.63090277", "0.6253098", "0.62230515", "0.61807054", "0.61611533", "0.6156391", "0.6140048", "0.6077585", "0.6077412", "0.6061398", "0.6057853", "0.6048403", "0.6039909", "0.6039807", "0.6038152", ...
0.0
-1
convert to functional component < convert state to use hooks
function ForecastContextProvider(props) { // *** BETA *** // HOOKS // for sending fetch for current const [location, setLocation] = useState('') // // for fetched current weather data const [currentDetails, setCurrentDetails] = useState({}) // // for fetched weekly weather data const [weekly...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UseStateBasic() {\n \n console.log(useState(\"Hola World\"));\n return (\n <div>\n \n </div>\n )\n}", "function Example2(){\r\n const [age, setAge] = useState(18)\r\n\r\n // React Hooks 不能出现在条件判断语句中,因为它必须有完全一样的渲染顺序\r\n // 下面的代码会报错: React Hook \"useState\" ...
[ "0.6642843", "0.6548363", "0.6515986", "0.643645", "0.63553953", "0.62484753", "0.6218339", "0.61861885", "0.6164237", "0.61149675", "0.6060701", "0.6060701", "0.6057014", "0.6028332", "0.6028028", "0.5984227", "0.596687", "0.595226", "0.59452736", "0.59371245", "0.5931909", ...
0.0
-1
BETA setup handleChange for passing to Main form
function handleChange(e){ const {name, value} = e.target this.setState({ [name]: value }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleChange(event) {\n\n }", "handleChange(event){\n changeHandler(event,this);\n }", "handleChange(event) {\n let elemName = event.target.name;\n let value = event.target.value;\n //reason picklist is selected\n if (elemName === \"reasonCombo\"){\n this.obj...
[ "0.7411099", "0.737957", "0.734496", "0.7333393", "0.72065455", "0.7167103", "0.7150879", "0.70848995", "0.7080383", "0.7039038", "0.7014029", "0.69864756", "0.6986112", "0.69594747", "0.69520205", "0.69161785", "0.68880194", "0.68861747", "0.6870932", "0.6869663", "0.6846598...
0.0
-1
BETA move JSON saving, methods, and state information to this component for prop passing and context passing throughout doc google geolocate key AIzaSyD7DFW5jTwvLp_GDarjWKlyO1T1vDkERY, geocoding AIzaSyA2PuW8IVNsVkIO3dZwgw82zkc5BRXsCPA) convert w hook syntax
function locationSubmit(e){ e.preventDefault() this.setState({ location: '' }) setLocation('') // translates location for receival by fetch below (changes spaces into +) var location = this.state.location.split(' ').join('+'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ForecastContextProvider(props) {\n// *** BETA ***\n // HOOKS\n // for sending fetch for current\n const [location, setLocation] = useState('')\n // // for fetched current weather data\n const [currentDetails, setCurrentDetails] = useState({})\n // // for fetched weekly weather data\n ...
[ "0.6039802", "0.58681196", "0.56109387", "0.5561972", "0.5499236", "0.54984546", "0.54764456", "0.54157853", "0.54157466", "0.5367439", "0.53603756", "0.5276864", "0.5215197", "0.5199294", "0.5162452", "0.51446277", "0.511292", "0.51055", "0.5085923", "0.50585777", "0.5047642...
0.4914233
34
Inititializes the notifications utility.
constructor(firebaseHelper) { this.firebaseHelper = firebaseHelper; // Firebase SDK this.auth = firebase.auth(); try { this.messaging = firebase.messaging(); } catch(e) { if (e.code === 'messaging/unsupported-browser') { console.warn('This Browser does not suport FCM. Notificati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initNotifications () {\n const periodSymbols = {\n Brunch: localize('symbols/brunch'),\n Lunch: localize('symbols/lunch'),\n Flex: localize('symbols/flex'),\n SELF: localize('symbols/self'),\n A: localize('symbols/period-a'),\n B: localize('symbols/period-b'),\n C: localize('symbols/...
[ "0.66774434", "0.6567164", "0.64157104", "0.6403306", "0.63651776", "0.6325462", "0.6303779", "0.62941605", "0.62301123", "0.6147992", "0.60731286", "0.60237926", "0.5991171", "0.59584594", "0.5952665", "0.5914194", "0.5896114", "0.5896114", "0.5892803", "0.5867105", "0.58350...
0.5958143
14
Saves the token to the database if available. If not request permissions.
async saveToken() { try { const currentToken = await this.messaging.getToken(); if (currentToken) { await this.firebaseHelper.saveNotificationToken(currentToken); console.log('Notification Token saved to database'); } else { this.requestPermission(); } } catch(err...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save(token) {\n this._$window.localStorage[this._AppConstants.jwtKey] = token;\n }", "function saveUserToken(token){\n userCacheSvc.set(USER_TOKEN_KEY, token);\n }", "SAVE_TOKEN(state, token) {\n localStorage.setItem(\"auth-token\", token);\n }", "storeToke...
[ "0.6995308", "0.6634594", "0.6632128", "0.65943503", "0.6579605", "0.6450248", "0.6376748", "0.63526076", "0.63434905", "0.632796", "0.6307876", "0.62931955", "0.6260994", "0.6259269", "0.6251007", "0.6210727", "0.62024635", "0.62006253", "0.61888885", "0.6178341", "0.6177483...
0.69152296
1
Requests permission to send notifications on this browser.
async requestPermission() { console.log('Requesting permission...'); // TODO: Blackout the entire screen and show a message saying why we need the permissions. // e.g. "If you would like to receive notifications on this device, grant permission above." try { await this.messaging.requestPermi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function requestNotificationsPermissions() {\n // TODO 11: Request permissions to send notifications.\n}", "function requestPermission(message) {\n Notification.requestPermission().then(app.ports.receivePermission.send)\n}", "function requestNotificationsPermissions() {\n console.log('Requesting notificatio...
[ "0.76177883", "0.69438076", "0.6916064", "0.68822455", "0.68601876", "0.6840103", "0.6824238", "0.6711603", "0.6695213", "0.6683101", "0.6620322", "0.6536873", "0.6525623", "0.6499291", "0.6480818", "0.64790773", "0.646453", "0.63758755", "0.6349812", "0.6298654", "0.62735206...
0.7138681
1
Called when the app is in focus.
onMessage(payload) { console.log('Notifications received.', payload); // If we get a notification while focus on the app if (payload.notification) { const userId = payload.notification.click_action.split('/user/')[1]; let data = { message: payload.notification.body, actionHandl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onAppFocus () {\n mainView.send('application-focus');\n}", "onFocusIn() {\n this.updateFocused(true);\n }", "function focusHandler(){\n isWindowFocused = true;\n }", "function focusHandler(){\n isWindowFocused = true;\n }", "function focusHandler(){\r...
[ "0.7767453", "0.76175386", "0.7436363", "0.7436363", "0.74001455", "0.7260788", "0.7203647", "0.7078299", "0.7043678", "0.68407434", "0.6768401", "0.676349", "0.6717406", "0.66878325", "0.6680105", "0.6572916", "0.65684676", "0.6542351", "0.6528596", "0.6452538", "0.6451262",...
0.0
-1
Triggered when the user changes the "Notifications Enabled" checkbox.
onEnableNotificationsChange() { const checked = this.enableNotificationsCheckbox.prop('checked'); this.enableNotificationsCheckbox.prop('disabled', true); return this.firebaseHelper.toggleNotificationEnabled(checked); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "trackNotificationsEnabledStatus() {\n if (this.auth.currentUser) {\n this.firebaseHelper.registerToNotificationEnabledStatusUpdate((data) => {\n this.enableNotificationsCheckbox.prop('checked', data.val() !== null);\n this.enableNotificationsCheckbox.prop('disabled', false);\n this.ena...
[ "0.78454936", "0.6841273", "0.67312014", "0.65313035", "0.6469188", "0.644136", "0.6278241", "0.62433577", "0.6208752", "0.61752844", "0.6069606", "0.601973", "0.6009058", "0.5920579", "0.59125376", "0.5905594", "0.5887332", "0.5867612", "0.5832288", "0.580286", "0.57777655",...
0.8071517
0
Starts tracking the "Notifications Enabled" checkbox status.
trackNotificationsEnabledStatus() { if (this.auth.currentUser) { this.firebaseHelper.registerToNotificationEnabledStatusUpdate((data) => { this.enableNotificationsCheckbox.prop('checked', data.val() !== null); this.enableNotificationsCheckbox.prop('disabled', false); this.enableNotific...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startNotificationWatcher() {\n notificationCheck(true);\n notificationWatcher = setInterval(notificationCheck, 5000);\n}", "async toggleNotifications() {\n \n // Are notifications enabled\n let enabled = await this.checkStatus();\n\n // Notifications are currently on\n if( enabled =...
[ "0.67558783", "0.6700018", "0.663093", "0.66075385", "0.630345", "0.6154739", "0.613518", "0.60735244", "0.60387254", "0.5907347", "0.5874909", "0.5871583", "0.586476", "0.5851559", "0.5787612", "0.5705304", "0.5698726", "0.5696773", "0.5676153", "0.5657352", "0.56331915", ...
0.769647
0
example: Build a isometric RPG where you rescue a toad
function generate() { return [getRand(categories), getRand(gameType), 'where you', getRand(action), getRand(thing)].join(' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run() {\n let insp = random(1, 6);\n if(insp > 3){\n return \"The pig escapes from the wolf\"\n }\n else{\n return \"The wolf eats the pig\"\n }\n}", "function trapdoorscube(loc, size,material){\n\n\tvar f = new Drone( loc );\n\n\t//Realiza el mismo movimiento para disponer la referencia en el...
[ "0.599315", "0.5928004", "0.588408", "0.5873218", "0.5831875", "0.5808475", "0.5792296", "0.57839143", "0.5783104", "0.57813615", "0.5780989", "0.57722193", "0.5771452", "0.57504165", "0.5750024", "0.57262915", "0.57182246", "0.57106024", "0.56956106", "0.56873393", "0.568651...
0.0
-1
Show the form for opening a new ticket.
* create(request, response) { const categories = yield Category.pair('id', 'name') yield response.sendView('tickets.create', {categories: categories}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAddCommitmentForm() {\n vm.form.data = {\n category: null,\n question: null,\n name: null,\n description: null,\n status: null,\n dueDate: null\n };\n vm.form.title = \"Add Commit...
[ "0.65264446", "0.6346948", "0.60520005", "0.60331327", "0.59834397", "0.5907729", "0.5832866", "0.5816585", "0.5788862", "0.57882845", "0.57439953", "0.57416004", "0.5727804", "0.57239383", "0.57203114", "0.57154405", "0.57105696", "0.57072103", "0.56951445", "0.56670785", "0...
0.0
-1
Store a newly created ticket in database.
* store(request, response) { const user = request.currentUser // validate form input const validation = yield Validator.validateAll(request.all(), { title: 'required', category: 'required', priority: 'required', message: 'required' }) // show error messages upon val...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insert(ticket) {\n return db('tickets').insert(ticket);\n}", "async create(ctx) {\n // insert this new ticket into db\n const result = await this.app.mysql.insert('ticket', { \n name: ctx.request.body.ticketName, \n price: ctx.request.body.ticketPrice, \n })...
[ "0.70680285", "0.69611704", "0.66185474", "0.62724864", "0.6235325", "0.6223188", "0.6179157", "0.61231184", "0.59710807", "0.5894357", "0.58342105", "0.571854", "0.55884236", "0.55315906", "0.5508435", "0.5506573", "0.5459277", "0.5454154", "0.5445254", "0.54240817", "0.5418...
0.53651005
21
Setting weapon image based on the weapon name
function setWeaponImage(containerElement, weaponName) { gunMapping.forEach((gun) => { if (weaponName === gun.name) { containerElement.src = gun.src; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function weaponPlayerAssignment (icon) {\n if (icon == 'rock') {\n playerChoice.src = rockIcon;\n playerWeapon = icon;\n } else if (icon == 'paper') {\n playerChoice.src = paperIcon;\n playerWeapon = icon;\n } else if (icon == 'scissors') {\n playerChoice.src = scissorsI...
[ "0.710829", "0.6640846", "0.66322595", "0.66272134", "0.65480137", "0.65415466", "0.64893544", "0.64797086", "0.6458564", "0.63958925", "0.6280904", "0.623483", "0.62327385", "0.6230453", "0.6185353", "0.61763954", "0.6165413", "0.6080262", "0.6079513", "0.60696834", "0.60541...
0.816896
0
self contained method in each component.
handlepick() { alert('i was clicked'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "execute(){\n\t\tvar component;\n\n\t\tfor (component in this.components){\n\t\t\tthis.components[component]();\n\t\t}\n\t}", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "onComponentConstructed() {}", "onComponentConstructed() {}", "_generateComponents (){\n...
[ "0.698948", "0.6337888", "0.6337888", "0.6337888", "0.6337888", "0.62305695", "0.62305695", "0.61894476", "0.616054", "0.60788363", "0.5986224", "0.59804755", "0.5956027", "0.5952708", "0.5938018", "0.5931703", "0.5931703", "0.5931703", "0.5931703", "0.59223765", "0.58785355"...
0.0
-1
constructor of the react componenet gets called on the props object
constructor(props) { super(props); this.handleRemoveAll = this.handleRemoveAll.bind(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(props){\n //Call the constrictor of Super class i.e The Component\n super(props);\n }", "constructor(props) {\n this.component = props;\n }", "constructor(props) {\n this.component = props;\n }", "constructor(props)\n {\n super(props)\n\n }", "c...
[ "0.82161516", "0.80070007", "0.80070007", "0.7908103", "0.78991663", "0.78859776", "0.7885674", "0.7878665", "0.7878665", "0.78255963", "0.78108555", "0.7810639", "0.7809877", "0.7809165", "0.7809165", "0.7807782", "0.7807782", "0.7807782", "0.7807782", "0.7807782", "0.780778...
0.0
-1
Actions to be dispatched
function getLastMessages() { return { type: messagingConst.GET_LAST_MESSAGES }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dispatch() {\r\n }", "dispatch(action, parameters) {\n const callbacks = this.events[action];\n\n if (this.disable) {\n return;\n }\n\n if (!callbacks) {\n throw new Error();\n }\n\n for(var index = 0; index < callbacks.length; index++) {\n callbacks[index].apply(this, [th...
[ "0.75500697", "0.72584486", "0.7202588", "0.7141435", "0.70483714", "0.7048022", "0.69718", "0.6971427", "0.6929826", "0.6881139", "0.68695855", "0.68577427", "0.68398166", "0.6789123", "0.6757739", "0.6725263", "0.6667793", "0.6658308", "0.66471183", "0.6634533", "0.66276973...
0.0
-1
4. The API will call this function when the video player is ready.
function onPlayerReady(event) { player.loadPlaylist(viewmodel.Hindivideolist()); player.setShuffle(true); player.setLoop(true); //event.target.playVideo(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function videoReady() { }", "function onPlayerReady(event) {\n Controller.load_video();\n }", "function videoReady() {\n console.log('Video is ready!!!');\n}", "function onPlayerReady(event) {\n event.target.loadVideo();\n }", "function onPlayerReady(event) {\n event.target.loadV...
[ "0.8809266", "0.84680945", "0.8242693", "0.81014603", "0.8078377", "0.80781144", "0.7913824", "0.7900221", "0.78976697", "0.78976697", "0.78976697", "0.7878247", "0.786907", "0.78670055", "0.78372014", "0.78191036", "0.7817895", "0.7813743", "0.7796985", "0.7770719", "0.77563...
0.0
-1
Operate in Strict mode such that variables must be declared before used!
function BodyNode(shader, name, xPivot, yPivot) { SceneNode.call(this, shader, name, false); // For debug ---- this.dPivotArray = []; // End Debug ---- var xf = this.getXform(); xf.setPivot(xPivot, yPivot); var leftArm = new SceneNode(shader, name + "_leftArm", false); var rightArm = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function forgettingDeclaringVariablesBeforeUseingDeclaresThemOnTheGlobalObject(){\n i = 1;//ReferenceError in strict mode.\n}", "function nonStrictMode() {\n let x = 34;\n\n //..\n 'use strict';\n //..\n }", "function strictly() {\n 'use strict';\n\n}", "function bar() {\n // this code is also ...
[ "0.7439191", "0.728352", "0.6733023", "0.66540575", "0.6624303", "0.6598933", "0.6545386", "0.6465165", "0.64420354", "0.64311683", "0.6263079", "0.62130183", "0.62130183", "0.6105969", "0.60774195", "0.60695267", "0.60197157", "0.6011858", "0.6008408", "0.5972724", "0.596111...
0.0
-1
CSS TRANSITION SUPPORT (Shoutout: ============================================================
function transitionEnd() { var el = document.createElement('bootstrap') var transEndEventNames = { WebkitTransition : 'webkitTransitionEnd', MozTransition : 'transitionend', OTransition : 'oTransitionEnd otransitionend', transition : 'transitionend' } for (var nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "turnOn() {\n this.wrapper.style[Modernizr.prefixed('transition')] = Modernizr.prefixed('transform') + ' .25s';\n return this;\n }", "function reverseTranslate(newFrom){return $animateCss(target,{to:newFrom||from,addClass:options.transitionOutClass,removeClass:options.transitionInClas...
[ "0.6392744", "0.6336694", "0.61152184", "0.603246", "0.5985097", "0.5920243", "0.589604", "0.58891743", "0.58410776", "0.5778032", "0.5748832", "0.5748832", "0.57402384", "0.57361704", "0.5695837", "0.5676943", "0.5676943", "0.5676943", "0.5670192", "0.5670192", "0.5670192", ...
0.0
-1
jshint ;_; / SCROLLSPY CLASS DEFINITION ==========================
function ScrollSpy( element, options) { var process = $.proxy(this.process, this) , $element = $(element).is('body') ? $(window) : $(element) , href this.options = $.extend({}, $.fn.scrollspy.defaults, options) this.$scrollElement = $element.on('scroll.scroll.data-api', process) this.selecto...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setupScrollspy() {\n if (!this.scrollContent) {\n return;\n }\n\n new ScrollSpy(document.querySelector(this.scrollContent), {\n target: this.menu,\n // Top offset position of the sticky menu\n offset: 220\n });\n }", "function ScrollSpy(element,options){this.$body=$(document.bod...
[ "0.68440765", "0.67996883", "0.67996883", "0.6723707", "0.6567618", "0.6544376", "0.6544376", "0.6544376", "0.65257955", "0.65257955", "0.65257955", "0.65257955", "0.65257955", "0.6525693", "0.6506215", "0.64940846", "0.6491081", "0.6476088", "0.6474999", "0.6474999", "0.6474...
0.0
-1
setSameElementHeight Required variables: e = selector value to find and set to the same height This function finds every element that matches the passed selector string, saves the height of the tallest item, and then sets all of the matched elements to the tallest height. It also temporarily resets the height of an ele...
function setSameElementHeight(e) { var tallest = 0; $(e).each(function() { $(this).css('height','auto'); // reset height in case an empty div has been populated if ($(this).height() > tallest) { tallest = $(this).height(); } }); $(e).height(tallest); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchHeightHelper(selArr) {\n\t for(var j = 0; j < selArr.length; j++) {\n\t var sel = selArr[j];\n\t // make sure there are elements on the page that match the selector\n\t if( $(sel).length ) {\n\t // clear old height for accurate measurement\n\t $(sel).css('height', 'auto');\n\t ...
[ "0.67833513", "0.6525358", "0.64224046", "0.6351736", "0.6280414", "0.61768836", "0.6132958", "0.6101878", "0.6036109", "0.60324675", "0.6019086", "0.59024817", "0.58953327", "0.5807551", "0.5799747", "0.5746203", "0.57375926", "0.5725656", "0.5690069", "0.56412184", "0.56018...
0.7818179
0
resetElementHeight Required variables: e = selector value to find and set to the same height This function finds every element that matches the passed selector string, and sets its height to auto. This is generally used in conjunction with setSameElementHeight() to revert heights back for mobile
function resetElementHeight(e) { $(e).each(function() { $(this).css('height','auto'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setSameElementHeight(e) {\n\tvar tallest = 0;\n\t$(e).each(function() {\n\t\t$(this).css('height','auto'); // reset height in case an empty div has been populated\n\t\tif ($(this).height() > tallest) {\n\t\t\ttallest = $(this).height();\n\t\t}\n\t});\n\t$(e).height(tallest);\n}", "updateElementsHeight()...
[ "0.67031777", "0.63438714", "0.62515247", "0.59461105", "0.5764954", "0.5652481", "0.5639162", "0.5639162", "0.5639162", "0.5639162", "0.56122065", "0.5550073", "0.55346936", "0.552124", "0.5486958", "0.54816955", "0.54521483", "0.54421", "0.5432171", "0.5404341", "0.5374381"...
0.7665021
0
The getProductGridPrices function is called for the teaser product grid display view when it is used to display a single sku and has a product id (pid) populated. It finds all items that contain a hidden form field containing the pid, stores the div that is found in, then calls the DR API and updates the div with the p...
function getProductGridPrices() { var POP = "value-add"; var dr_pid =""; var stx_store = false; var dr_locale = ""; var ecomm_currency = ""; var ecomm_locale = getEcommLocale(); if (ecomm_locale !=""){ stx_store = true; } else { return; } for (i = 0; i < ecommLocaleMap.ecommLocalesList.length; i++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllProductDetailsForBooked(){\r\n\r\n\t\t//Grid for Retail if it is checked \r\n\t\tif (document.getElementById('retail1').checked) {\r\n\t\t\tjQuery(\"#jqGrid1\").trigger('reloadGrid');\r\n\r\n\t\t\tvar input1 = document.getElementById('fk_cat_id1'),\r\n\t\t\tlist = document.getElementById('cat_drop1'...
[ "0.5938198", "0.59044766", "0.5792558", "0.574482", "0.5715055", "0.5710066", "0.5656826", "0.5644227", "0.56200945", "0.5609698", "0.55965406", "0.5595211", "0.55749357", "0.556557", "0.5520627", "0.5514979", "0.54986197", "0.548621", "0.54837775", "0.54809546", "0.5471809",...
0.8627456
0
The teaserProductGridItemHeight function resizes elements of the teaser product grid display view so that all items are the same height based on the tallest item.
function teaserProductGridItemHeight() { if ($(window).width() > 767) { setSameElementHeight(".teaser-product-grid-item-name"); setSameElementHeight(".teaser-product-grid-item-message"); setSameElementHeight(".teaser-product-grid-item-proposition"); } else { resetElementHeight(".teaser-product-grid-i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get gridItemHeight() {\n return windowHeight / maxIconsPerCol * this.percent;\n }", "get gridItemHeight() {\n return windowHeight / maxIconsPerCol * this.percent;\n }", "function adaptiveHeight() {\n\t\tlet takeHeihgt = [];\n\t\t$('.header_slider__item').each(function(item, index) {\n\t\t\ttake...
[ "0.6628904", "0.6628904", "0.6367901", "0.62751836", "0.62701565", "0.6238445", "0.61662686", "0.61018604", "0.6072601", "0.6072467", "0.6006219", "0.59920126", "0.58992094", "0.58905363", "0.58602774", "0.5828805", "0.582736", "0.58164686", "0.5803387", "0.5790651", "0.57585...
0.76759976
0
The stickyHeaders function is executed on the onScroll event. It is setup to be a global function. It is enabled for an element by applying an empty placeholder div immediately before the element with a stickyheaderplaceholder class and adding the .stickyheader class to the element that you want to have the sticky head...
function stickyHeaders() { /* Based on http://jsfiddle.net/BCtP8/3/ */ var stickyHeaders = $('.sticky-header'); for (var i=0; i<stickyHeaders.length; i++) { var header = $(stickyHeaders[i]); var nextHeader = $(stickyHeaders[i+1]); var holder = header.prev('.sticky-header-placeholder'); var windowTop = $(this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function headerScroll() {\n // if the user scrolls (pageYOffset) past the header's position, add the sticky class\n if (window.pageYOffset > sticky) {\n header.classList.add(\"sticky\");\n } else {\n header.classList.remove(\"sticky\");\n }\n}", "function stickyHeader() {\n if (window.pageYOffset ...
[ "0.79887015", "0.7907858", "0.7825723", "0.782157", "0.78081536", "0.7758892", "0.7739793", "0.76908517", "0.76538855", "0.75890774", "0.7550495", "0.74886096", "0.7425619", "0.7396423", "0.73906", "0.7382175", "0.73224276", "0.7238122", "0.72139597", "0.7210222", "0.7186182"...
0.79011494
2
Initializes a new instance of the StringBuilder class and appends the given value if supplied
function StringBuilder(value) { this.strings = new Array(""); this.append(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function StringBuilder(value) {\r\n\r\n this.strings = [\"\"];\r\n this.append(value);\r\n}", "function StringBuilder(value) {\n this.strings = new Array(\"\");\n this.append(value);\n}", "function StringBuilder() {\n\t\t\tthis.strings = new Array(\"\");\n\t\t\t//this.append(value);\n\t\t}", "functio...
[ "0.7842982", "0.75986224", "0.75942475", "0.75785846", "0.75785846", "0.7553114", "0.7553114", "0.7165282", "0.7016541", "0.64919466", "0.6067849", "0.55735064", "0.549459", "0.5269491", "0.5269491", "0.52143073", "0.52143073", "0.5182782", "0.5132974", "0.50930387", "0.49316...
0.7574832
5
on parcours le tableau pour avoir chaque lettre
function writte() { setInterval(() => { if (words.length > 0) { p.innerText += words.shift(); } owl.style.opacity = 1; }, 70); // if (p == "...") { setInterval(() => { if (count <= 99) { count++; counter.innerText = " "...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remplirTableau() {\r\n tabIsEmpty = false;\r\n tbody.empty();\r\n var html = \"\";\r\n data.forEach(function (element) {\r\n html = '<tr>' +\r\n '<th>' + element.order + '</th>' +\r\n '<td>' + element.activity + '</td>' +\r\n ...
[ "0.6911271", "0.6523778", "0.65083444", "0.64792675", "0.6472725", "0.6451917", "0.64241314", "0.64137614", "0.64126223", "0.6384731", "0.6371406", "0.63379425", "0.6310608", "0.6310608", "0.6297713", "0.6279049", "0.62749434", "0.6233206", "0.62084365", "0.61992913", "0.6190...
0.0
-1
delete posts from main page
function _delete_post(post_id) { if(confirm('Do you realy want to delete post #' + post_id + '?')) { endpoint = '/admin/post/'; var params = new Array(); params['setting'] = 'delete'; params['value_0'] = post_id; params['csrf_token'] = document.getElementById('__csrf_token...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deletePost(id) {\n // console.log(id)\n $.ajax({\n method: \"DELETE\",\n url: \"api/private/\" + id\n })\n .then(function() {\n getPosts() // show me posts after deleting\n\n });\n }", "function handlePostDelete() {\n\n var currentId = $(this).attr(\"entryID...
[ "0.7716834", "0.76356757", "0.74711335", "0.7454055", "0.73917", "0.73689896", "0.7346363", "0.7345904", "0.7345904", "0.7291039", "0.7289877", "0.72324175", "0.7220309", "0.71776897", "0.7051149", "0.7036126", "0.7028328", "0.7004104", "0.6990545", "0.6966569", "0.6955092", ...
0.66363096
37
var todoDone = false;
function toggleTodo(index, rowCheckmark){ var selectedTodo = Alloy.Collections.todo.at(index); var isDone = selectedTodo.get("done"); isDone = (isDone == "true") ? "false" : "true"; selectedTodo.set("done", isDone); if (Alloy.Globals.useCloud) { var selectedTodoParse = new TodoParse(); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function completeToDo(e) {\n e.classList.toggle(CHECK);\n e.classList.toggle(UNCHECK);\n e.parentNode.querySelector(\".text\").classList.toggle(LINE_THROUGH);\n\n LIST[e.id].done = LIST[e.id].done ? false : true;\n}", "function isdone(un,bln) {\n let array = JSON.parse(localStorage.getItem(\"tasks...
[ "0.7204961", "0.7051674", "0.69545585", "0.6930532", "0.68894625", "0.68856114", "0.685423", "0.67571414", "0.6751695", "0.6744289", "0.66877973", "0.6679129", "0.6641685", "0.6638991", "0.66333735", "0.66222256", "0.65936506", "0.65886515", "0.6557458", "0.65384245", "0.6518...
0.63472307
38
drawBall() Creates ball at the bottom of the screen that the player uses to match their value to the gates falling.
function drawBall(){ ctx.beginPath(); ctx.arc(ball.x, ball.y, ball.radius, 0, Math.PI*2); ctx.fillStyle = "#000000"; ctx.fill(); ctx.closePath(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n fill(255, 60);\n rect(0, 0, width, height);\n //Now, we draw the ball\n fill(255, 0, 0);\n ellipse(x, y, 20, 20)\n //Now, we account for wall bounce\n if (x === 390) {\n xSpeed = -1;\n }\n if (x === 10) {\n xSpeed = 1\n }\n if (y === 290) {\n ...
[ "0.7713316", "0.7580799", "0.7569361", "0.7449818", "0.7416193", "0.7334952", "0.732453", "0.7311124", "0.730016", "0.7282086", "0.7254228", "0.7248622", "0.72469914", "0.7243396", "0.71887034", "0.71831393", "0.71790713", "0.7158089", "0.71560246", "0.71542686", "0.715387", ...
0.67459506
81
drawGate() Creates a gate, given the x and y coordinates and an integer value represtening which gate type to draw. Gate Types: AND 8 different AND gate images. OR 8 differet OR gate images. NAND to be added?? XOR to be added??
function drawGate(x, y, gate){ ctx.beginPath(); ctx.drawImage(gateType[gate],x ,y ,60,120); ctx.closePath(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw_gate (spec) {\n var i,\n ret = ['g'],\n ys = [],\n ymin,\n ymax,\n ilen = spec.length;\n\n for (i = 2; i < ilen; i++) {\n ys.push(spec[i][1]);\n }\n\n ymin = Math.min.apply(null, ys);\n ymax = Math.max.apply(null, ys);\n\n ret.push(\n ...
[ "0.6154801", "0.59823376", "0.5825527", "0.54296106", "0.53465545", "0.52524704", "0.5141969", "0.5122808", "0.5097895", "0.49741167", "0.48362964", "0.4822554", "0.48157933", "0.48091984", "0.47631317", "0.47324973", "0.47310448", "0.46776852", "0.46624207", "0.4655242", "0....
0.72430986
0
changeGate() Function called to change the gates that are output. Each gate has a value that will satisfy the logic. The value is randomly slected between 0 or 1. For now the number that determines the gate, that is the value that satisfies that "gate".
function changeGate(gate){ //V Change value of the first gate V if(gate == 1){ temp = Math.floor(Math.random() * 16); gate1.type = temp; gate1.need = gateValue[temp]; } //V change the value of the second gate V if(gate == 2){ temp = Math.floor(Math.random() * 16); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetGates(gate){\n\n if(gate == 1){\n changeGate(1);\n gate1.rate = Math.floor((Math.random() * 4) +1);\n while(gate1.rate == gate2.rate || gate1.rate == gate3.rate){\n gate1.rate = Math.floor((Math.random() * 4) +1);\n }\n gate1.y = -200;\n }\n else...
[ "0.69447815", "0.6291983", "0.52065533", "0.51745045", "0.5163794", "0.5128209", "0.5096309", "0.5060874", "0.50429666", "0.50413483", "0.5006424", "0.4989567", "0.49674228", "0.496282", "0.4950667", "0.49502653", "0.4944337", "0.49368823", "0.48938832", "0.48930472", "0.4879...
0.84059536
0
checkMatch() Function called to check whether the player's value matches the gate the player grabbed. If the needed value equals 2 then that means either a player vlaue of 0 or 1 would satisfy the gate.
function checkMatch(gate){ if(gate == "gate1"){ if(gate1.need == player.value || gate1.need == 2){ if(collected2x == true) player.score+= 200; else player.score += 100; collection.play(); } else { player.lives.pop(); mi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchCheck(){\n return (points == match);\n }", "function checkMatch() {\n if (app.firstCard.dataset.avenger === app.secondCard.dataset.avenger) {\n disableCards();\n cardMatchSound();\n app.matchedCards.push(app.firstCard.dataset.avenger);\n gameComplete();\n ...
[ "0.6987358", "0.6576862", "0.6447641", "0.6305959", "0.6295817", "0.6111251", "0.6100235", "0.60817975", "0.60703653", "0.6069781", "0.60667354", "0.6060064", "0.6004762", "0.5999859", "0.5964349", "0.5961916", "0.5959863", "0.594268", "0.5930503", "0.5921367", "0.59175026", ...
0.7073263
0
resets all of the y gate coordinates and set a new random fall rate to each gate.
function resetGates(gate){ if(gate == 1){ changeGate(1); gate1.rate = Math.floor((Math.random() * 4) +1); while(gate1.rate == gate2.rate || gate1.rate == gate3.rate){ gate1.rate = Math.floor((Math.random() * 4) +1); } gate1.y = -200; } else if(gate == 2){...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetSpawnRate() {\n this.spawnTimer = 0;\n this.spawnDelay = GageLib.math.getRandom(\n this.spawnRate[0],\n this.spawnRate[1]\n );\n }", "reset()\n\t{\n\t\tthis.x = width/2;\n\t\tthis.y = height/2;\n\t\tlet angle = random(-PI/4, PI/4);\n\t\tthis.xspeed = 5 * Math.cos(angle);\n\t\tthis.yspeed...
[ "0.6689202", "0.6600446", "0.65110546", "0.650274", "0.64670324", "0.63828677", "0.63056356", "0.6277962", "0.61809856", "0.61786985", "0.6150141", "0.6129771", "0.6065068", "0.6004773", "0.5998629", "0.5994012", "0.5983108", "0.59690976", "0.59658915", "0.59473825", "0.59358...
0.738515
0
checkCollision() This function is called everytime the screen is drawn. It checks whether the gates have either hit the bottom of the window or have hit the ball. This is done by checking the the x and y coordinates of the ball and the gates. If the gates hit the bottom of the window, they are reset and the player lose...
function checkCollision(){ if((gate1.y-10) >= canvas.height){ resetGates(1); } if((gate2.y-10) >= canvas.height){ resetGates(2); } if((gate3.y-10) >= canvas.height){ resetGates(3); } if(ball.x >=gate1.x && ball.x <= (gate1.x+60) && (gate1.y+120) >= (ball.radius + bal...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkBallCollision() {\n // Top Wall Check\n if (this.ball.Y - this.ball.R === 1) {\n this.ball.dy = 2;\n }\n // Bottom Wall Check\n if (this.ball.Y - this.ball.R === 641) {\n this.ball.dy = -2;\n /* If the ball hits the bottom wall then the user loses hence\n we reset the score ...
[ "0.73388815", "0.7230656", "0.69346005", "0.6921919", "0.6896794", "0.6885116", "0.68432015", "0.68300164", "0.67793655", "0.67629915", "0.67560875", "0.675521", "0.67548823", "0.66970223", "0.6692022", "0.6673956", "0.66621536", "0.6648272", "0.663809", "0.66366094", "0.6630...
0.7193087
2
setUpScreen() This function takes care of all the items that need to be put on the screen.
function setUpScreen(time){ var FPS = Math.floor(1000 / (time - previousFrameTime)); //var fpsSTRING = FPS.toString(); document.getElementById("framesPerSecond").innerHTML = FPS + " FPS"; previousFrameTime = time; ctx.font = "12px Verdana"; ctx.clearRect(0, 0, canvas.width, canvas.height); //ct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initScreen() {\n\t\tthis.wrapper = Ti.UI.createTableView({\n\t\t\tdata: this._tableData\n\t\t});\n\n\t\tthis.window.add(this.wrapper);\n\t}", "function initMainScreen() {\n //Initialize the user list for \"Contacts\" tab\n initContactList();\n\n //Initialize the chat list for \"Chats\" tab\n initChat...
[ "0.67374045", "0.6691583", "0.66045445", "0.6584127", "0.6545084", "0.65436095", "0.6465041", "0.64514804", "0.6447722", "0.6424898", "0.6414118", "0.63842446", "0.6297793", "0.6289214", "0.62440246", "0.6228883", "0.6215355", "0.6171864", "0.6167873", "0.6167873", "0.6140312...
0.0
-1
changePlayerValue() This function is called when the mouse has been clicked. It will change playerValue from a 1 to a 0 or a 0 to a 1.
function changePlayerValue(){ if(player.value == 0){ player.value = 1; } else{ player.value = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changePlayer() {\n player = player + 1;\n }", "function ChangePlayer( changeValue:int )\n{\n\tcurrentPlayer += changeValue;\n\t\n\tif ( currentPlayer > playerList.Length - 1 ) currentPlayer = 0;\n\tif ( currentPlayer < 0 ) currentPlayer = playerList.Length - 1;\n\t\n\tSetPlayer(currentPlayer);...
[ "0.68892634", "0.67349434", "0.6705895", "0.66826", "0.65323275", "0.6500239", "0.6496638", "0.6354832", "0.63327944", "0.6235082", "0.6192803", "0.61636263", "0.611896", "0.6109451", "0.6077873", "0.6074246", "0.60517967", "0.60437644", "0.6029482", "0.6019459", "0.6016297",...
0.8082237
0
pause() > this function changes the value of the variable playing (causing the game to pause)
function pause(){ if (paused == false){ paused = !paused; } else{ paused = !paused; requestAnimationFrame(draw); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pause() {\r\n player.pause();\r\n }", "function pauseGame() {\n\tpause = true;\n\tstart = false;\n}", "function pause () {\n if (globalVariables.whichGame !== \"opening scene\" && globalVariables.whichGame !== \"victory scene\") {\n globalVariables.paused = ...
[ "0.8144701", "0.8139039", "0.8073421", "0.7951207", "0.79185206", "0.7863102", "0.7863102", "0.7797977", "0.7788538", "0.7788538", "0.7763091", "0.7740293", "0.77072954", "0.7689653", "0.7675866", "0.76687366", "0.76429826", "0.76416606", "0.7589954", "0.7560665", "0.7554215"...
0.7224049
44
draw() This is the main function that draws the screen which includes the three gates, ball, score, lives, and FPS. The rate that the screen is drawn at varries.This is what frames per second(FPS) is in the top corner of the screen. IF the left or right arrows are pressed the x coordinate of the ball is chnaged; right ...
function draw(time) { setUpScreen(time); checkCollision(); drawGate(gate1.x, gate1.y, gate1.type); drawGate(gate2.x, gate2.y, gate2.type); drawGate(gate3.x, gate3.y, gate3.type); drawBall(); ctx.fillStyle = "#FF0000"; ctx.fillText(player.value, ball.x - 4, ball.y + 3); var curr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n topWall.draw();\n ball.draw();\n paddle.draw();\n playerIndexDigit.draw();\n playerBallIndexDigit.draw();\n\n // draw the currently act\n for (var i = 0; i < 112; i++) {\n playerBricks[activePlayer][playerLevel[activePlayer]][i].draw();\n }\n\n ...
[ "0.772726", "0.7429054", "0.7391578", "0.7376733", "0.7354354", "0.7342704", "0.732791", "0.73208576", "0.7224815", "0.72230387", "0.7220064", "0.72142416", "0.72101325", "0.7199317", "0.71727556", "0.71564126", "0.71337026", "0.7132722", "0.711722", "0.70790964", "0.7077874"...
0.6773338
77
sets animation loop so cursor blinks for a few times before writing gate grabber
function firstFrame(){ $(".mainMenuAnimation").hide(); $("#frame2").show(); if(blinkTime < 1){ setTimeout(secondFrame, 530) ++blinkTime; } else{ setTimeout(thirdFrame, 400) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animloop(){\n\tdraw();\n\trequestAnimFrame(animloop);\n}", "function animloop() \n{\n\tdraw();\n\trequestAnimFrame(animloop);\n}", "function animloop() {\n\tinit = window.requestAnimationFrame(animloop);\n\tdraw();\n}", "function animloop() {\n\tinit = requestAnimFrame(animloop);\n\tdraw();\n}", "...
[ "0.7256141", "0.7203415", "0.7198688", "0.7170438", "0.7162851", "0.71218777", "0.70669407", "0.6976535", "0.68810195", "0.6815078", "0.6801284", "0.678933", "0.675428", "0.6739622", "0.6617986", "0.6566423", "0.656287", "0.65618664", "0.6541423", "0.65259945", "0.65071464", ...
0.0
-1
Below function is used for generating POPUP
function showModal(message) { // get the modal var modal = document.getElementById("modal"); modal.style.display = "block"; document.getElementById("text").innerHTML = message; var modalButton = document.getElementById("modalButton"); modalButton.onclick = function() { modal.sty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPopUp() {\n\n}", "function pop_up_window(abbrev,def)\r\n {\r\n //\r\n var generator=window.open('','info','height=' + \r\n info_window_height + ',width=' +\r\n info_window_width + ',resizabl...
[ "0.7846343", "0.72605157", "0.71736765", "0.709881", "0.70524323", "0.7013759", "0.69912934", "0.69843185", "0.69068164", "0.6864733", "0.6836974", "0.6832167", "0.68145686", "0.67239386", "0.6676478", "0.6666436", "0.6654945", "0.66338986", "0.6617934", "0.6600505", "0.65733...
0.0
-1
function to set the style for the active result box
function activeResultStyle() { var classValue = document.getElementsByClassName("output_name_disabled"); for (var i = 0; i < classValue.length; i + 1) { classValue[i].classList.add("output_name"); classValue[i].classList.remove("output_name_disabled"); } var outputClass = document.get...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LK_applySelectedStyle(elem, value) {\n elem.style.fontWeight = 'bold';\n elem.style.backgroundColor = LK_MAPPINGS[value].color;\n}", "function _highlightResult(item) {\n\n \n\n if (item == null) return;\n\n \n\n item.addClass(...
[ "0.64781857", "0.63527614", "0.6037988", "0.60301536", "0.59515995", "0.5928954", "0.5928932", "0.5855728", "0.58549756", "0.5830923", "0.58080953", "0.578505", "0.5768048", "0.5733551", "0.57211155", "0.5718721", "0.57061124", "0.5679624", "0.5672427", "0.5669648", "0.566882...
0.0
-1
function to set the style for the empty result box
function deactiveResultStyle() { var classValue = document.getElementsByClassName("output_name"); for (var i = 0; i < classValue.length; i + 1) { classValue[i].classList.add("output_name_disabled"); classValue[i].classList.remove("output_name"); } var outputClass = document.getElement...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emptyStyle() {\n\t$(\".pick\").each(function(){\n\t\t$(this).empty();\n\t});\n}", "function emptyResultBox() {\n while (resultBox.hasChildNodes())\n {\n resultBox.removeChild(resultBox.lastChild);\n } \n }", "function resetSearchBox() {\n this.style.color = \"#252...
[ "0.6409725", "0.6385608", "0.6223482", "0.59717315", "0.5919979", "0.5883576", "0.5859428", "0.58567435", "0.5800671", "0.5796367", "0.5734225", "0.57289076", "0.5727543", "0.57210016", "0.57200664", "0.57074577", "0.57012004", "0.56958663", "0.56779987", "0.56596285", "0.564...
0.0
-1
Redirect to the given url (defaults to '/')
function redirect(url) { url = url || '/start'; $location.path( url ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirect(url) {\r\n url = url || 'index.html';\r\n location.href = url;\r\n }", "function redirect(url) {\n url = url || '/'\n $location.path(url)\n }", "function redirect(url){\n\t\turl = url || '/';\n\t\t$location.path(url);\n\t}", "function redirect(url) {\n url =...
[ "0.8082194", "0.7985732", "0.7904144", "0.77986884", "0.77986884", "0.77986884", "0.7760651", "0.76147234", "0.7441327", "0.74405247", "0.74214137", "0.74140954", "0.73385537", "0.73348767", "0.7265876", "0.72233516", "0.72211087", "0.7105962", "0.70597535", "0.70438236", "0....
0.7928329
2
End of enable 6 / Enable Controls for all buttons
function loadControls(data) { // var data = [ { id:'1', location:"Living Room", status:1, timer:1, timerbox:60, toggle:1 }, // { id:'2', location:"Kitchen", status:1, timer:0, timerbox:0, toggle:0 }, // { id:'3', location:"Laundry", status:1, timer:1, timerbox:40, toggle:1 }, // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enableAllControls() {\n enableKeyPress();\n enableMouseMove();\n enableMouseClick();\n enableKeyRelease();\n enableMouseRelease();\n }", "function enableButtons()\n {\n //show buttons for updating and creating new workflow\n...
[ "0.7524913", "0.73761773", "0.7292618", "0.7228984", "0.7162048", "0.71392274", "0.7064762", "0.6986601", "0.69498706", "0.6921753", "0.6915314", "0.6865249", "0.6863647", "0.6862419", "0.6841512", "0.68139535", "0.67883176", "0.67752284", "0.6760659", "0.67234766", "0.671766...
0.0
-1
console.log(getAllDirectors(movies)); _Bonus_: It seems some of the directors had directed multiple movies so they will pop up multiple times in the array of directors. How could you "clean" a bit this array and make it unified (without duplicates)? // Iteration 2: Steven Spielberg. The best? How many drama movies did ...
function howManyMovies (array) { const directorSpielberg = array.filter((movie) => { if (movie.director === 'Steven Spielberg' && movie.genre.includes('Drama')) { return movie } }) const onlyTitle = directorSpielberg.map(movie => movie.title) return onlyTitle.length }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllDirectors(movies) {\n const directors = movies.map(function(movie){\n return movie.director\n })\n const copy = [...directors]\n for (let i = copy.length - 1; i >= 0; i--) {\n if (copy.indexOf(copy[i]) !== i) {\n copy.splice(i, 1)\n }\n }\n return copy\n}", "function getAllDire...
[ "0.81295073", "0.7976967", "0.7678931", "0.766345", "0.7428437", "0.73904717", "0.7269803", "0.71802574", "0.7044803", "0.7017838", "0.70173806", "0.6952401", "0.6917148", "0.67813915", "0.6579297", "0.65265244", "0.6497759", "0.6480515", "0.62441593", "0.62181807", "0.621502...
0.5467403
65
console.log(howManyMovies(movies)) // Iteration 3: All rates average Get the average of all rates with 2 decimals
function ratesAverage (array) { const sumRatingCalc = array.reduce((total, movie) => { return (total + (movie.rate || 0)) // Does this make sense??? [6, , ] should average out to 6 not 2 }, 0) const averageCalc = sumRatingCalc / array.length || 0 return Math.round(averageCalc * 100) / 100 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ratesAverage(movies) {\n return +(sum() / +(movies.length).toFixed(2));\n}", "function ratesAverage(movies) {\n\nlet sumOfRates = movies.map(movie => movie.rate).reduce((acc, cv) => acc + cv)\nreturn sumOfRates / movie.length\n}", "function ratesAverage(movies){\n var ratesAverage = movies.reduce(...
[ "0.869231", "0.8641963", "0.8610919", "0.86098886", "0.8599521", "0.85386544", "0.84984446", "0.8484031", "0.84700423", "0.8466774", "0.8454585", "0.84539264", "0.84521043", "0.8442542", "0.8441136", "0.8415635", "0.83768743", "0.8374918", "0.83587027", "0.83572716", "0.83451...
0.0
-1
console.log(ratesAverage(movies)); Iteration 4: Drama movies Get the average of Drama Movies This function receives and array of movies and calculates the average rating of movies whose genre is drama The plan: Separate drama movies from the rest of the movies Use our already made function ratesAverage to calculate the...
function dramaMoviesRate (array) { const dramaMovies = array.filter(movie => movie.genre.includes('Drama')) return ratesAverage(dramaMovies) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dramaMoviesRate(movies) {\n var filterMovies = movies.filter(function(movie) {\n var filterGenres = movie.genre.filter(function(genre) {\n return genre === \"Drama\"; \n })\n //console.log(filterGenres);\n return filterGenres.length > 0;\n })\n console.log(filterMovies);\n return rate...
[ "0.8736937", "0.8672856", "0.8588869", "0.8508138", "0.8497094", "0.8489193", "0.84459025", "0.8440111", "0.84269327", "0.842293", "0.8393645", "0.8384539", "0.8376006", "0.83740884", "0.8363227", "0.8358917", "0.83575016", "0.8350802", "0.8323851", "0.8304717", "0.8292583", ...
0.7996874
39
console.log(dramaMovieRates(movies)); // Iteration 5: Ordering by year Order by year, ascending (in growing order) This function (orderByYear) will order the movies in a chronological order by looking at the production year and sort them accordingly.
function orderByYear (array) { const clone = Array.from(array) return clone.sort((movieA, movieB) => { if (movieA.year < movieB.year) { return -1 } else if (movieA.year > movieB.year) { return 1 } else { if (movieA.title < movieB.title) { return -1 } else if (movieA.title...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bestYearAvg(movies){\n if(movies.length === 0) return;\n\n var yearsMovie = [];\n movies.forEach(function(movie){\n var added=false;\n yearsMovie.forEach(function(objYear){\n if(objYear.year === movie.year)\n {\n var movieCopy = Object.assign({},...
[ "0.7552861", "0.7449208", "0.7381236", "0.737985", "0.73767054", "0.7347755", "0.73473114", "0.7265577", "0.72651947", "0.7259455", "0.72503793", "0.72487164", "0.7210853", "0.71993333", "0.7198544", "0.719412", "0.71903044", "0.71851796", "0.71583104", "0.7155198", "0.715012...
0.0
-1
Iteration 6: Alphabetic Order Order by title and print the first 20 titles This function will print the first 20 movies of the array "movies" in an alphabetical order
function orderAlphabetically (array) { const clone = Array.from(array) const sorted = clone.sort((movieA, movieB) => { if (movieA.title < movieB.title) { return -1 } else if (movieA.title > movieB.title) { return 1 } else { return 0 } }) return sorted.reduce((total, movie) => {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderAlphabetically(movies)\n{\n //ordenar per title\n //print els primers 20\n\n var moviesOrdered = movies.sort(function(movieA, movieB){\n if (movieA.title > movieB.title) return 1;\n else return -1;\n });\n var movies20 = moviesOrdered.slice(0,20);\n\n var titles = [];\...
[ "0.86294067", "0.8610719", "0.8483049", "0.84759176", "0.8427656", "0.84173167", "0.8409927", "0.8398933", "0.8385805", "0.836751", "0.8318751", "0.83091635", "0.8304015", "0.82977104", "0.8293156", "0.82873315", "0.8256801", "0.82528216", "0.82517296", "0.8235019", "0.821816...
0.75850946
88
BONUS Iteration 7: Time Format Turn duration of the movies from hours to minutes
function turnHoursToMinutes(array) { // 1h 22min // 2h // 30min const hourRegex = /(\d+)h/g const minuteRegex = /(\d+)min/g const test = array.map(movie => { const hours = hourRegex.exec(movie.duration)[1] const minutes = minuteRegex.exec(movie.duration)[1] const cloneMovie = { ...movie } cl...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function turnHoursToMinutes (movie){\n for (var i=0; i<movie.length;i++){\n var horas=parseInt(movie[i].duration.split(\" \")[0].toString().replace('h',''));\n var minutos=parseInt(movie[i].duration.split(\" \")[1].toString().replace('min',''));\n var tiempo=(horas*60)+minutos\n movie[i].dur...
[ "0.8143044", "0.7869449", "0.7805549", "0.7800938", "0.7800938", "0.7790644", "0.7754126", "0.7683387", "0.7663275", "0.76035506", "0.7591031", "0.75895154", "0.7580537", "0.7562647", "0.7520696", "0.7493738", "0.74856365", "0.7462699", "0.7459281", "0.7454895", "0.74397296",...
0.6481531
89
Initializes the form to all zero values
function initialize() { var budgetValues = document.getElementsByName("budVal"); document.getElementById("income").value = 0; for(var i = 0; i < budgetValues.length; i++) { budgetValues[i].value = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "makeEmpty() {\n this.setValue(0);\n }", "function makeFormEmpty() {\n for (let i = 0; i < _formLength; i++) {\n // console.log(form[i].type)\n if (_FORM[i].type === \"text\") {\n _FORM[i].value = ''; // remove all value\n }\n\n if(_FORM[i].type === \"select-one...
[ "0.7269027", "0.6753067", "0.64561695", "0.6391949", "0.6358461", "0.6348138", "0.62453437", "0.62256634", "0.616913", "0.61652553", "0.6126761", "0.6126124", "0.6098762", "0.60685843", "0.60662067", "0.6059365", "0.6056502", "0.60496044", "0.601639", "0.60061455", "0.5998702...
0.65880185
2
resets the animationState to its initial setting
function resetAnimationState() { animationState = { time: 0, ballHeight: guiParams.maxBallHeight, // fall from maximum height ballPositionX: guiParams.ballInitialX, // reset to initial X position }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_resetAnimation() {\n // @breaking-change 8.0.0 Combine with _startAnimation.\n this._panelAnimationState = 'void';\n }", "function reset() {\n element[0].style.transitionDuration = 0;\n element.removeClass(initClass + ' ' + activeClass + ' ' + animation);\n }", "function re...
[ "0.79945636", "0.7737506", "0.7725965", "0.7725965", "0.7725965", "0.7725965", "0.77040344", "0.76130164", "0.753597", "0.7472954", "0.72241145", "0.7209036", "0.7190727", "0.71621776", "0.7105685", "0.7068682", "0.70591486", "0.7047518", "0.70378876", "0.7005311", "0.7004739...
0.8311637
0
Add a "backwall" to behind the basketball hoop which is akin to a mat behind an actual basketball hoop in a gym
function drawBackWall() { var backWall = new THREE.Mesh( new THREE.BoxGeometry( sceneParams.boxWidth / 3, sceneParams.boxHeight / 5, sceneParams.backWallThickness ), new THREE.MeshBasicMaterial({ color: sceneParams.backWallColor }) ); // Position the backwall behind the hoop and per...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawBrokenBottle() {\n addObject(currentSauceImage, broken_bottle_x, broken_bottle_y, 0.25);\n}", "function waller(wallThis) {\n wallThis.canMove = false;\n wallThis.description = \"A wall\";\n \twallThis.terrainType = \"wall\";\n wallThis.symbol = \"^\";\n wallThis.color = \"wall\";\n ...
[ "0.6960893", "0.6482027", "0.62585443", "0.6201572", "0.6191333", "0.61350083", "0.61211294", "0.61064005", "0.60767514", "0.6060228", "0.60276556", "0.60206074", "0.6003202", "0.5940545", "0.59390014", "0.59328926", "0.5896143", "0.5895825", "0.5893501", "0.58922935", "0.587...
0.6845417
1
============ Animation functions ============ Using an animation similar to Mandel's positional animation of a ball
function linearMap(x, minx, maxx, miny, maxy) { // t is in the range [0,1] t = (x - minx) / (maxx - minx); y = t * (maxy - miny) + miny; return y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function step(timestamp){\n\n //update css variable\n positionLeft1 += speedX1;\n positionTop1 += speedY1;\n\n positionLeft2 += speedX2;\n positionTop2 += speedY2;\n\n positionLeft3 += speedX3;\n positionTop3 += speedY3;\n\n //change speed and direction variable if the ball hits the edge of the screen\n i...
[ "0.73022497", "0.7112435", "0.7096928", "0.7059657", "0.70447844", "0.7044597", "0.7002784", "0.69870037", "0.69727707", "0.69539195", "0.6943139", "0.69340837", "0.69249517", "0.69016117", "0.6887642", "0.6869082", "0.68531525", "0.6830689", "0.6830548", "0.68233293", "0.681...
0.0
-1
sets the position of the ball based on current time
function setBallPosition(time) { // rescale the time dimension so that the period of bouncing maps to pi var angle = (time * Math.PI) / guiParams.ballBouncePeriod; var abs_cos = Math.abs(Math.sin(angle)); var ballHeight = linearMap( abs_cos, 0, 1, guiParams.ballRadius - sceneParams.boxHeight / 2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateBallPosition() {\n ball.x += ball.speedX;\n ball.y += ball.speedY;\n }", "playBallAnimation() {\n\t\tthis.ballTimeDiff = new Date().getTime() - this.presentBallTime;\n\t\tif(this.ball.y < this.groundBoundary)\n\t\t\tthis.ballPathMovement();\n\t\telse \n\t\t\tthis.resetBowlingpositions();\n\...
[ "0.7443314", "0.70676076", "0.69971913", "0.68915343", "0.6768015", "0.67660785", "0.67557716", "0.6746076", "0.67359793", "0.67178524", "0.6710352", "0.670639", "0.6683671", "0.66769326", "0.66304463", "0.66127604", "0.6595703", "0.65872943", "0.6566483", "0.65615284", "0.64...
0.74763095
0
resets the ball to the initial state and renders the scene
function firstState() { resetAnimationState(); var state = setBallPosition(animationState.time); animationState.ballPositionX = state[0]; animationState.ballHeight = state[1]; TW.render(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset() {\n this.ball.pos.x = this._canvas.width / 2;\n this.ball.pos.y = this._canvas.height / 2;\n this.ball.velocity.x = 0;\n this.ball.velocity.y = 0;\n }", "function resetBall() {\r\n ball.x = canvas.width / 2;\r\n ball.y = canvas.height / 2;\r\n ball.velocityX = -b...
[ "0.79715604", "0.78211594", "0.77132165", "0.7705932", "0.76834714", "0.7673495", "0.7673495", "0.7520755", "0.75028354", "0.74884874", "0.7471026", "0.7450597", "0.74473643", "0.72889316", "0.70915574", "0.7036049", "0.70304114", "0.6956383", "0.6956316", "0.69553113", "0.69...
0.6996645
17
updates the state of the animation (time and ballHeight)
function updateState() { animationState.time += guiParams.deltaT; var state = setBallPosition(animationState.time); animationState.ballPositionX = state[0]; animationState.ballHeight = state[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "playBallAnimation() {\n\t\tthis.ballTimeDiff = new Date().getTime() - this.presentBallTime;\n\t\tif(this.ball.y < this.groundBoundary)\n\t\t\tthis.ballPathMovement();\n\t\telse \n\t\t\tthis.resetBowlingpositions();\n\t}", "function animate() {\n\n // Calls the Animation Method again\n requestAnimationFrame...
[ "0.7157748", "0.69027466", "0.68106455", "0.6719793", "0.6640782", "0.6587863", "0.65764874", "0.6541725", "0.6517748", "0.65076727", "0.6476376", "0.6463494", "0.64140177", "0.6394931", "0.637359", "0.63444704", "0.6335558", "0.62830263", "0.62790686", "0.6251107", "0.622347...
0.8244972
0
Function to redraw the scene based on the gui parameter.
function redoScene() { drawBox(guiParams.mode); TW.render(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "redraw() {\n\t\tthis.scene.project.clear();\n\t\tthis.draw();\n\t}", "function redraw(oa){\n\t\t// debug('\\n REDRAW - START');\n\t\t// debug('\\t oa: ' + json(oa));\n\t\toa = oa || {};\n\t\t_UI.redraw.redrawcanvas = isval(oa.redrawcanvas) ? oa.redrawcanvas : true;\n\t\t_UI.redraw.redrawtools = isval(oa.redrawto...
[ "0.67887545", "0.6666646", "0.65568876", "0.6431131", "0.6400535", "0.6386124", "0.6275738", "0.6157804", "0.6094546", "0.60270506", "0.59916556", "0.5971332", "0.59290254", "0.5898704", "0.5888675", "0.58560854", "0.585044", "0.5815412", "0.58143777", "0.5813679", "0.5813452...
0.68699604
0
On submit, insert the data.
submit(data, formRef) { const date = new Date(); const { condition } = data; const owner = Meteor.user().username; Check.collection.insert({ date, condition, owner }, (error) => { if (error) { swal('Error', error.message, 'error'); } else { swal('Success', 'Stat...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "submit(data) {\n const { description, seller, item, itemName } = data;\n Reports.insert({ description, seller, item, itemName }, this.insertCallback);\n }", "function onSubmitInsert(url) {\n var formArray= $(\"form\").serializeArray();\n var data={};\n for (index in formArray){\n data[form...
[ "0.69120216", "0.6639683", "0.65950716", "0.65593135", "0.6539076", "0.6483761", "0.6470256", "0.64624494", "0.645538", "0.64499307", "0.6440467", "0.63948613", "0.6364957", "0.6360523", "0.6353165", "0.6348074", "0.63314676", "0.6299601", "0.6281364", "0.62599564", "0.625542...
0.601961
44
Creates a new coin. Depending on the type of amount, it will be converted to an integer coin or decimal coin.
function Coin(denom, amount) { var _this = _super.call(this) || this; _this.denom = denom; _this.amount = numeric_1.Numeric.parse(amount); return _this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "insertCoin(type) {\n if (type === \"quarter\") {\n this.cashTendered += 25; \n } else if (type === \"dime\") {\n this.cashTendered += 10;\n } else if (type === \"nickel\") {\n this.cashTendered += 5;\n } else if (type=== \"penny\") {\n this.ca...
[ "0.63613045", "0.6043316", "0.5874642", "0.58228046", "0.5803215", "0.57182854", "0.5667832", "0.5650551", "0.56311345", "0.5626322", "0.5541294", "0.551189", "0.5498779", "0.54983217", "0.54769135", "0.5454608", "0.54252046", "0.5410219", "0.5408721", "0.53916466", "0.539153...
0.6415971
0
Split's the array in chunks of 5
function chunkArray(array) { let result = []; let size = 5; for (let i = 0; i < array.length; i += size) { let chunk = array.slice(i, i + size); result.push(chunk); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "chunk (array, size) {\n if(size == null){\n size = 1;\n }\n const arrayChuncks = [];\n for(let i = 0; i<array.length; i+=size) {\n const arrayChunck = array.slice(i, i+size);\n arrayChuncks.push(arrayChunck);\n }\n return arrayChuncks;\n }", "function chunkArrayInGroups(arr, siz...
[ "0.78315485", "0.7510897", "0.7510664", "0.7410273", "0.73560816", "0.7348879", "0.7338256", "0.73338103", "0.7327581", "0.7313619", "0.730819", "0.7304095", "0.7299009", "0.7295068", "0.72795665", "0.7251525", "0.72464716", "0.7232048", "0.7227359", "0.7226113", "0.7215937",...
0.8167255
0
cookies are important for some reason
function getCookie(cname){ var name = cname + "="; var ca = document.cookie.split(';'); for( var i=0; i<ca.length; i++){ var c=ca[i]; while (c.charAt(0) == ' '){ c=c.substring(1); } if(c.indexOf(name) == 0){ return c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function aceptarCookies () {\n // Oculta el HTML de cookies\n ocultarAviso();\n // Guarda que ha aceptado\n miLocal.setItem('cookie', true);\n\n}", "function setCookies(){\n if (Cookies.get('cookiebar') == \"CookieAllowed\"){\n let todos = document.querySelector('.list-group');\n Cookies.set('to...
[ "0.73353297", "0.70509374", "0.7021593", "0.700545", "0.698482", "0.6931522", "0.69205487", "0.6910152", "0.69036365", "0.68818355", "0.68812615", "0.68389106", "0.68307483", "0.6788142", "0.67555696", "0.6702957", "0.667338", "0.66677046", "0.6642336", "0.66351813", "0.66337...
0.0
-1
Verification of the age once hit the submit button
function ageVerification(){ var month = 0; var year = 0; var day = 0; $("#confirmationBtn").on("click", function(){ age['month'] = $("#selectMonth").val(); age['year']=$("#selectYear").val(); age['day']= $("#selectDay").val(); console.log(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifAge(age){\n // convertir l' age en nombre\n var age = parseInt(age);\n // l'age doit un nombre et supérieur à 18\n if(isNaN(age) || age < 18 )\n {\n alert (ageError.value);\n document.getElementById(\"submit\").disabl...
[ "0.777594", "0.753883", "0.7498994", "0.74842817", "0.74261624", "0.7320069", "0.7127336", "0.70953", "0.7042148", "0.70187455", "0.70006955", "0.6986099", "0.6926488", "0.6922717", "0.69032437", "0.69029623", "0.688352", "0.6848324", "0.6826754", "0.6795477", "0.6784756", ...
0.69765365
12
compare the input date with compareDate
function compareDate(){ if(age.month == 'none' || age.day == 'none' || age.year == 'none'){ // Fade if error for all $('#age-error').css('visibility','visible').hide().fadeIn('slow'); //ideal is if any are invalid then redirect somewhere else //if month invalid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareDate(dos, rd) {\n\n }", "function compareDateFunction(date1,date2){\r\n\tvar leftDate;\r\n\tvar rightDate;\r\n\tif(typeof(date1) == \"object\"){\r\n\t\tleftDate = date1;\r\n\t}else{\r\n\t\tleftDate = convertStr2Date(date1);\r\n\t}\r\n\tif(typeof(date2) == \"object\"){\r\n\t\trightDate = da...
[ "0.74789196", "0.73038733", "0.7293569", "0.7274329", "0.72044766", "0.7163878", "0.7049771", "0.7023864", "0.70094866", "0.69851905", "0.69829845", "0.69669306", "0.68971014", "0.68879235", "0.6881689", "0.6846738", "0.6798278", "0.67646176", "0.67534536", "0.6748773", "0.67...
0.0
-1
Responsible for registering message with message bus
registerMessage(msg) { let self = this; if (typeof msg !== "string") { throw new TypeError(`Register Message Error: Message argument should be of type string`); } if (!self.messages.hasOwnProperty(msg) && !self.listeners.hasOwnProperty(msg)) { self.messages[msg...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerForMessages() {\r\n\t$W().Push.registerEventHandler( 'END_CONVERSATION_NOTIFICATION', endConversationReceived);\r\n $W().Push.registerEventHandler( 'END_CONVERSATION_BY_SUPERVISOR_NOTIFICATION', overrideConversation);\r\n $W().Push.registerEventHandler( 'START_CONVERSATION_NOTIFICATION', sta...
[ "0.6559538", "0.65313345", "0.648388", "0.64547193", "0.64257824", "0.63800234", "0.63761103", "0.6218329", "0.6164847", "0.6149303", "0.613471", "0.61121166", "0.6109386", "0.61031115", "0.60854566", "0.607434", "0.60335183", "0.60241336", "0.60152715", "0.6003622", "0.60026...
0.6575318
0
Responsible for unregistering message with message bus
unregisterMessage(msg) { let self = this; if (typeof msg !== "string") { throw new TypeError(`Unregister Message Error: Message argument should be of type string`); } delete self.messages[msg]; delete self.listeners[msg]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_removeMessageListener() {\n handlers.remove(this.componentId);\n }", "function onMessageReceivedUnsubscribe() {\n self.registration.pushManager.getSubscription()\n .then(subscription => subscription.unsubscribe())\n .then(() => {\n // OPTIONALLY IMPLEMENT: Forward the...
[ "0.68973535", "0.6591663", "0.6524799", "0.64716256", "0.64484483", "0.643899", "0.639521", "0.6356292", "0.632915", "0.631808", "0.6301358", "0.6298495", "0.62764156", "0.6266704", "0.62445974", "0.6241306", "0.6231691", "0.6226196", "0.6221919", "0.6211666", "0.6209762", ...
0.7695534
0
Display the Team's Name and Score onChange event will watch the input changes and update the state onChange method will trigger state update that will be passed to the child input value and rendered on the screen. Whenever we need to update state from child component, we need to pass the function that will handle updat...
render() { return ( <section> <h2 className="name">{this.state.teamName}</h2> <p>{this.state.score}</p> <ul> <li> <label>Update team Name</label> <input type='text' value={this.state.teamName} onChange={this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n return (\n <div>\n <div>\n <span>\n <h3>{this.props.name}:</h3>\n </span>\n <span>\n <input type=\"text\" value={this.props.score} onChange={(evt) => {\n ...
[ "0.63501817", "0.62438715", "0.6238909", "0.6033135", "0.58841085", "0.58714974", "0.56230575", "0.56201917", "0.5367199", "0.53543454", "0.5332611", "0.529283", "0.5265438", "0.52563405", "0.5240196", "0.52294207", "0.52265453", "0.5225489", "0.5197977", "0.5169573", "0.5128...
0.68294936
0
Unistroke class: a unistroke template
function Unistroke(name, points) // constructor { this.Name = name; this.Points = Resample(points, NumPoints); var radians = IndicativeAngle(this.Points); this.Points = RotateBy(this.Points, -radians); this.Points = ScaleTo(this.Points, SquareSize); this.Points = TranslateTo(this.Points, Origin); this.Ve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "template() { }", "function inlinedTemplates() { }", "function TemplateInput() {}", "constructor() {\n super(template);\n }", "function u$2(u,e){t$i`\n /*\n * ${e.name}\n * ${0===e.output?\"RenderOutput: Color\":1===e.output?\"RenderOutput: Depth\":3===e.output?\"RenderOutput: Shadow\":2===e....
[ "0.57544506", "0.5653109", "0.5599466", "0.5589051", "0.5549329", "0.55275136", "0.5505229", "0.5505229", "0.5438622", "0.54264057", "0.5420456", "0.5401925", "0.5401925", "0.5401925", "0.5401925", "0.5386047", "0.5385411", "0.53351057", "0.531736", "0.5301286", "0.52908176",...
0.52874583
23
Golden Ratio DollarRecognizer class
function DollarRecognizer() // constructor { // // one built-in unistroke per gesture type // this.Unistrokes = new Array(NumUnistrokes); this.Unistrokes[0] = new Unistroke("triangle", new Array(new Point(137,139),new Point(135,141),new Point(133,144),new Point(132,146),new Point(130,149),new Point(128,151)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DollarRecognizer() {\n // constructor\n //\n // one built-in unistroke per gesture type\n //\n this.Unistrokes = new Array(NumUnistrokes);\n this.Unistrokes[0] = new Unistroke(\n \"triangle\",\n new Array(\n new Point(137, 139),\n new Point(135, 141),\n new Point(133, 144),\n ...
[ "0.6600989", "0.6527765", "0.6169168", "0.60954946", "0.5920529", "0.54118204", "0.53936154", "0.53170854", "0.5303212", "0.52927285", "0.52384", "0.5158184", "0.5131399", "0.5104369", "0.5078999", "0.50457543", "0.5038015", "0.5026925", "0.4968236", "0.49561405", "0.4948142"...
0.6155638
3
Private helper functions from this point down
function Resample(points, n) { var I = PathLength(points) / (n - 1); // interval length var D = 0.0; var newpoints = new Array(points[0]); for (var i = 1; i < points.length; i++) { var d = Distance(points[i - 1], points[i]); if ((D + d) >= I) { var qx = points[i - 1].X + ((I - D) / d) * (points[...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "private public function m246() {}", "transient protected internal function m189() {}", "transient final protected internal function m174() {}", "transient private i...
[ "0.6948579", "0.67970425", "0.6666063", "0.6646659", "0.6430443", "0.62884736", "0.62666035", "0.6264332", "0.62161744", "0.60167193", "0.59703875", "0.5952727", "0.5910304", "0.5882343", "0.5879835", "0.57299453", "0.5706141", "0.5687746", "0.56595296", "0.5641604", "0.56271...
0.0
-1
Used for redirecting to another page
function redirect(url) { window.location.replace(url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirectPage() {\n window.location = s.linkLocation;\n }", "function redirectByUrl() {\n location.href = u;\n }", "redirect() {\n const hash = Radio.request('utils/Url', 'getHash');\n\n // Redirect back only if it's notebooks page\n if (ha...
[ "0.7926441", "0.74927324", "0.74066633", "0.73173606", "0.7285936", "0.71941525", "0.718537", "0.7135962", "0.7135817", "0.7100984", "0.70903546", "0.7087515", "0.7085292", "0.7074821", "0.7071253", "0.70609117", "0.70563275", "0.7049433", "0.70379657", "0.7033582", "0.701260...
0.6921771
28
Enabled Angular 2 debug tools that are accessible via your browser's developer console. Usage: 1. Open developer console (e.g. in Chrome Ctrl + Shift + j) 1. Type `ng.` (usually the console will show autocomplete suggestion) 1. Try the change detection profiler `ng.profiler.timeChangeDetection()` then hit Enter.
function enableDebugTools(ref) { context.ng = new common_tools_1.AngularTools(ref); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enableDebugTools(ref){exportNgVar(PROFILER_GLOBAL_NAME,new AngularProfiler(ref));return ref;}", "function enableDebugTools(ref) {\n exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref));\n return ref;\n}", "function enableDebugTools(ref) {\n exportNgVar(PROFILER_GLOBAL_NAME, new Angular...
[ "0.71098983", "0.6697461", "0.6697461", "0.6697461", "0.6697461", "0.6697461", "0.6697461", "0.6697461", "0.6697461", "0.6697461", "0.6655852", "0.6655852", "0.6653434", "0.6365312", "0.62050843", "0.6148449", "0.6048174", "0.602629", "0.5587293", "0.5566236", "0.5465867", ...
0.6318386
14
Disables Angular 2 tools.
function disableDebugTools() { delete context.ng; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function disableDebugTools() {\n delete context.ng;\n}", "function disableDebugTools() {\n delete context.ng;\n}", "function enableDebugTools(ref) {\n context.ng = new common_tools_1.AngularTools(ref);\n }", "disableActiveTool() {\n this.project.view.off('mousedown');\n this.proje...
[ "0.7640431", "0.76073635", "0.6515458", "0.6482958", "0.6481175", "0.62495404", "0.61888456", "0.6086324", "0.6086324", "0.6086324", "0.6086324", "0.6086324", "0.60624164", "0.6042441", "0.6000482", "0.59855443", "0.5964426", "0.59317", "0.592075", "0.5915674", "0.5913142", ...
0.76208496
1
The RecorderController is responsible for toggling the recording in the content process and getting the data. It also manages a list of past recordings and allows to get them as stringified json for exporting.
function RecorderController(toolbox) { this.mm = toolbox.target.tab.linkedBrowser.messageManager; this.mm.loadFrameScript(FRAME_SCRIPT_URL, false); this.onRecord = this.onRecord.bind(this); this.mm.addMessageListener("PageRecorder:OnChange", this.onRecord); this.sessions = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get recorder () {\n\t\treturn this._recorder;\n\t}", "function startRecording() {\n recorder.record();\n}", "record_() {\n this.checkSupport_();\n\n var recorder = this.getRecorder();\n launchRecordingUI(recorder);\n }", "constructor() {\n\n const recordingTimeInterval = configRecording.rec...
[ "0.61425763", "0.59036875", "0.58246803", "0.5770369", "0.56208915", "0.55726856", "0.5553623", "0.55521405", "0.5482947", "0.5482064", "0.5453024", "0.54469085", "0.5393202", "0.53588927", "0.5356888", "0.5316547", "0.53156066", "0.5315381", "0.53137696", "0.5313232", "0.530...
0.67431414
0
The RecorderPanel is responsible for the UI of the tool.
function RecorderPanel(win, toolbox) { this.controller = new RecorderController(toolbox); this.win = win; this.doc = this.win.document; this.toolbox = toolbox; this.toggle = this.toggle.bind(this); this.onRecord = this.onRecord.bind(this); this.search = this.search.bind(this); this.initUI(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RecorderController(toolbox) {\n this.mm = toolbox.target.tab.linkedBrowser.messageManager;\n this.mm.loadFrameScript(FRAME_SCRIPT_URL, false);\n\n this.onRecord = this.onRecord.bind(this);\n this.mm.addMessageListener(\"PageRecorder:OnChange\", this.onRecord);\n\n this.sessions = [];\n}", "record_(...
[ "0.6270706", "0.6128006", "0.58395755", "0.571322", "0.56458515", "0.56203127", "0.5568646", "0.5549928", "0.5480188", "0.54776305", "0.5431861", "0.539732", "0.5361548", "0.5351524", "0.5320751", "0.5306581", "0.52935505", "0.5291519", "0.52819943", "0.52485466", "0.5223546"...
0.80049735
0
0 is nothing, 1 is snake head, 2 is snake body, 3 is food
function start() { COLS = 44; ROWS = 21; DIR = RIGHT; GAME_OVER = false; PLAYER = [ {x: Math.floor(COLS/2), y: Math.floor(ROWS/2)} ]; BOARD = []; for(var i = 0; i < ROWS; i++){ var arr = []; for(var j = 0; j < COLS; j++){ arr.push(EMPTY); } BOARD.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function snake_eat(foodObject) {\n if (foodObject.x == bodyShape[bodyShape.length - 1].x * snake_seg &&\n foodObject.y == bodyShape[bodyShape.length - 1].y * snake_seg) {\n noms.x = randomize15();\n noms.y = randomize15();\n score += 1;\n switch (direction) {\n case...
[ "0.70583826", "0.67237484", "0.6554544", "0.6473315", "0.64628947", "0.639706", "0.6382145", "0.6377435", "0.634565", "0.6329784", "0.6319052", "0.6280819", "0.626272", "0.62474585", "0.6230153", "0.6228436", "0.6196236", "0.619433", "0.61934745", "0.61828446", "0.6181084", ...
0.0
-1
place a food randomly in the board
function createFood() { food = {}; food.x = Math.floor(random(COLS)); food.y = Math.floor(random(ROWS)); if(BOARD[food.y][food.x] == SNAKE){ createFood(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Food() {\n var food_x = Math.floor(Math.random() * backWidth);\n var food_y = Math.floor(Math.random() * backHeight);\n\n board[food_y][food_x].food = 1;\n }", "function placeFood() {\n var x = generateRandom(5, MAX_X - 5);\n var y = generateRandom(5, MAX_Y - 5);\n //che...
[ "0.83746105", "0.81062293", "0.8013391", "0.79807836", "0.79400957", "0.7898781", "0.78649193", "0.7845949", "0.7804314", "0.7726516", "0.76923215", "0.7685117", "0.7656126", "0.76403725", "0.7620334", "0.75949645", "0.758342", "0.7581374", "0.7533989", "0.75110745", "0.74682...
0.77390873
9
DETERMINES IF STRINGS ARE PALINDROMES
function compareWords(oldWord, newWord, oldReversedWord) { console.log("oldReversedWord: " + oldReversedWord); console.log("pureStr: " + oldWord); console.log("reversedWord: " + newWord); if (newWord == oldWord) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pal1(str) {\n return str.split('').reduce((acc, val) => val + acc, '') === str;\n}", "function pal4(str) {\n return str.split('').every((el, i) => {\n return el === str[str.length - 1 - i];\n })\n}", "function removePairs(char = '', char2 = '') {\n let res = [];\n\n for (let i = 0; i...
[ "0.61712766", "0.5894941", "0.5854327", "0.5771711", "0.5698669", "0.5653311", "0.559091", "0.5575762", "0.54958427", "0.54667836", "0.5449161", "0.5449112", "0.54414994", "0.5434531", "0.5433382", "0.5396545", "0.53692305", "0.5366012", "0.5357709", "0.53555906", "0.53541505...
0.0
-1
function is called when connection is established successfully
function onConnectionSuccess(){ console.log("onConnectionSuccess getting my display Name ::: " + _roomCredentials.name); _room = _connection.initJitsiConference(_roomCredentials.name, _roomConfOptions); _room.on(JitsiMeetJS.events.conference.TRACK_ADDED, onRemoteTrack); _room.on(JitsiMeetJ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onConnectionSuccess() {\n console.log(\"connection established successfully!\");\n this.joinConferenceRoom();\n\n this.connectedFunction();\n }", "function connectionEstablished() {\n log.info('Connected to OpenTSDB.');\n\n opentsdb = socket;\n\n // Handle errors on thi...
[ "0.7211916", "0.71478385", "0.70622313", "0.6977884", "0.69742954", "0.6932792", "0.69045573", "0.6873555", "0.68565327", "0.6856193", "0.6821896", "0.681865", "0.6817443", "0.67894727", "0.6761072", "0.6760801", "0.675756", "0.6752872", "0.6746568", "0.67397374", "0.6729376"...
0.0
-1
This function is called when the connection fail.
function onConnectionFailed(){ console.error("Connection Failed!") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onConnectionFailed() {\r\n\t\t console.error('Connection Failed!');\r\n\t\t}", "_lostConnection(error) {\n this._stream._lostConnection(error);\n }", "function connectionError(err) {\n // Record failure in statsd\n statsClient.increment('ope...
[ "0.7840931", "0.74904656", "0.73809755", "0.72930366", "0.72693646", "0.72246075", "0.7217806", "0.71260065", "0.7102657", "0.70825833", "0.69957596", "0.6945207", "0.69430494", "0.69430494", "0.6931982", "0.6873984", "0.686051", "0.6859041", "0.68336546", "0.6823843", "0.679...
0.76111525
1
That function is executed when the conference is joined
function onConferenceJoined(){ console.log("conference joined!"); isJoined = true; for(var i = 0; i < _localTracks.length; i++) { _room.addTrack(_localTracks[i]); } console.log("tracks ::: "+ _localTracks[0]); _myTrack = _localTracks[0]; _room.setDi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onConferenceJoined() {\n console.log('INFO (join.js): Conference joined!');\n isJoined = true;\n for (let i = 0; i < localTracks.length; i++) {\n room.addTrack(localTracks[i]);\n }\n /*$('#mainBtn').attr('disabled', false);*/ //No one leaves untill 5th person joins\n $.toast({\n ...
[ "0.79206777", "0.76183665", "0.7369597", "0.7272144", "0.72017336", "0.68061626", "0.677065", "0.66018575", "0.65411216", "0.6507687", "0.6383267", "0.63587904", "0.62856287", "0.6254175", "0.623198", "0.62204635", "0.6142105", "0.6140055", "0.61259687", "0.612457", "0.610275...
0.8098385
0
builtin functions, like alert(message), prompt(message, default) and confirm(question)
function showMessage() { alert( 'Hello everyone!' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function confirm(str) {}", "function ask(question, yes, no) \n{\n if (confirm(question))\n { \n yes()\n }\n else \n {\n no();\n }\n}", "function prompt(str) {}", "function ask(question, yes, no) {\n if (confirm(question)) yes()\n else no()\n}", "function annoyingPopups...
[ "0.70618004", "0.6993349", "0.691663", "0.677806", "0.66586393", "0.66055954", "0.65921855", "0.6536845", "0.6519673", "0.65156835", "0.64331675", "0.6429367", "0.63488454", "0.63286924", "0.62882245", "0.6267181", "0.6235376", "0.6235141", "0.62255186", "0.618118", "0.615658...
0.0
-1
LOCAL VARIABLES (A variable declared inside a function is only visible inside that function.)
function showMessage() { let message = "Hello, I'm JavaScript!"; // local variable alert( message ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function someFunc() {\r\n\t\tvar somevar = 1;\r\n\t\t// local variable\r\n\t\tconsole.log(\"somevar is now 1\");\r\n\t}", "function TempVars() {\n}", "function foo(){\n var i = \"local\";//declaramos la misma variable i como local\n console.log(i);// mostrar local\n}", "function myFunction()\n{\nx = 7; /...
[ "0.738932", "0.7303001", "0.72216266", "0.71697444", "0.7157686", "0.71354884", "0.6955092", "0.6939928", "0.6938055", "0.6928796", "0.69246876", "0.68916595", "0.6883371", "0.6847574", "0.6794559", "0.67553073", "0.6744966", "0.67447466", "0.6732904", "0.67202157", "0.671267...
0.0
-1
John, unchanged, the function did not access the outer variable PARAMETERS(We can pass arbitrary data to functions using parameters (also called function arguments))
function showMessage(from, text) { // arguments: from, text alert(from + ': ' + text); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function parameterUnderstanding(gotParam) {\n\tconsole.log(\"Stored in gotParam in function: \"+gotParam)\n}", "function Parameter() {}", "function innerFunc(){\n console.log(\"Number 1:\" + number1);\n console.log(\"Number 2:\" + number2);\n console.log(\"Param is: \" + param);\n }", ...
[ "0.6286479", "0.6257447", "0.61919403", "0.61715627", "0.6158521", "0.61049366", "0.609554", "0.60833555", "0.604891", "0.59529036", "0.59479684", "0.59111106", "0.58975697", "0.5886258", "0.58699006", "0.5840995", "0.5802512", "0.5783267", "0.5783081", "0.5783081", "0.577975...
0.0
-1
Ann: What's up? () we have a variable from and pass it to the function. Please note: the function changes from, but the change is not seen outside, because a function always gets a copy of the value:
function showMessage(from, text) { from = '*' + from + '*'; // make "from" look nicer alert( from + ': ' + text ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function captureAndChangeValue(variable){\n variable='changed-value';\n return function logValue(){\n console.log(variable);\n }\n}", "function travel(destination, myFunc){\n console.log(\"travelling to \" + destination);\n let a = myFunc(); //our a variable is equal to \"apples\"\n return a;\n}",...
[ "0.67228115", "0.642046", "0.6358858", "0.6358858", "0.6358858", "0.6358858", "0.6324202", "0.6258452", "0.6257114", "0.62440175", "0.62440175", "0.62440175", "0.62440175", "0.62440175", "0.62440175", "0.62440175", "0.62440175", "0.62440175", "0.62440175", "0.62440175", "0.62...
0.0
-1
Ann: no text given or
function showMessage(from, text = anotherFunction()) { // anotherFunction() only executed if no text given // its result becomes the value of text }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function n(a){return!!a&&\"undefined\"!=typeof a.text}", "function cleanUnknownText(text){\n if (text != undefined){\n return text;\n }\n else{\n return 'N/A';\n }\n}", "function ontext (text) {\n return text;\n}", "validateNone(node) {\n if (classifyNodeText(node) === TextClassification....
[ "0.63675207", "0.62206304", "0.5950229", "0.593596", "0.59326947", "0.59326947", "0.5868751", "0.58484656", "0.58309346", "0.5792526", "0.5786059", "0.57355773", "0.5687914", "0.5687914", "0.5687914", "0.56866443", "0.5677384", "0.5677384", "0.56619185", "0.56537104", "0.5645...
0.0
-1
A function with an empty return or without it returns undefined
function doNothing() { /* empty */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nothing(){// parameters are optional within functions\n return undefined // will return undefined as a single value of the function\n}", "function returnUndefined() {}", "function noReturn() {}", "function emptyReturn() {return;}", "function f () {\n return undefined;\n }", "function retu...
[ "0.8206277", "0.8149916", "0.739154", "0.7291723", "0.72893524", "0.71194565", "0.7060487", "0.70497525", "0.70497525", "0.70497525", "0.70497525", "0.70205027", "0.70022345", "0.6893155", "0.68631846", "0.68222827", "0.68108803", "0.6634852", "0.6625153", "0.64922595", "0.64...
0.0
-1
true FUNCTIONS == COMMENTS
function showPrimes(n) { for (let i = 2; i < n; i++) { if (!isPrime(i)) continue; alert(i); // a prime } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Ejemplo(){return true}", "tengoFuncionAnidada(nodo) {\n if (!(nodo instanceof Object))\n return false;\n return nodo.hijos.some((item) => item.label == 'DECLARACION_FUNCION');\n }", "checkCurrentFunctionCPP() {\n var cursorPosition = this.currentEditor.getCursorBuffe...
[ "0.62348515", "0.6007335", "0.5962844", "0.5914743", "0.58963364", "0.58963364", "0.5750678", "0.56961316", "0.56427413", "0.55693424", "0.55502063", "0.5510239", "0.5507619", "0.5488387", "0.5461377", "0.54428715", "0.5441826", "0.5440343", "0.54235345", "0.54088783", "0.539...
0.0
-1
al inicio, en sessionStorage guarda dtos del cliente
function guardarSesion(nombre,contraseña,id){ sessionStorage.setItem('nombre',nombre); sessionStorage.setItem('contraseña',contraseña); sessionStorage.setItem('id',id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "guardarStorage() {\n localStorage.setItem('usuario', JSON.stringify(this.usuario));\n }", "function guardarDetalles(){\r\n if(detallesOrden.length > 0){\r\n sessionStorage.setItem(\"DetallesOrden\",JSON.stringify(detallesOrden));\r\n }\r\n return;\r\n}", "constructor(storage) {\n ...
[ "0.698313", "0.6697138", "0.65717745", "0.6539036", "0.652675", "0.6497281", "0.6450994", "0.64400816", "0.64245576", "0.6350558", "0.63304", "0.6327335", "0.62143594", "0.62136436", "0.6186381", "0.61773497", "0.6147539", "0.61402017", "0.613514", "0.6084879", "0.6071355", ...
0.6322735
12
entrar a la pagina ya sea de cliente o como administrador..
function entrar(){ var inputNombre = document.getElementById('nombreActivar').value; var inputPassw = document.getElementById('passwordActivar').value; var listaClientes = JSON.parse(localStorage.getItem("listaClientes")); for (var i=0;i<listaClientes.length;i++){ if((listaClientes[i].usuario ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function usuarios(){\n window.location = config['url']+\"Administrador/modulo?vista=usuarios\"\n}", "function activarNuevosUsuarios(path)\r\n{\r\n\tvar url = path + \"/administrarUsuarios.htm\"; \r\n\t//alert(alta);\r\n\tdocument.location.href = url; \r\n}", "function acceder(usuario){\n console.log(...
[ "0.64992553", "0.6450194", "0.6346576", "0.63367885", "0.6321399", "0.63095343", "0.62716734", "0.62395966", "0.62302667", "0.6189548", "0.6138172", "0.6137871", "0.6125299", "0.6124978", "0.6094861", "0.6049416", "0.60006654", "0.59986645", "0.59964156", "0.5988326", "0.5988...
0.5384464
98
Calls the parent's constructor
constructor (element) { super(element); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor () {\n // Run super\n super();\n }", "constructor () {\n // Run super\n super();\n }", "constructor(value){\n //\n //Construct the parent.\n super(value);\n }", "constructor() {\n\t\tsuper(...arguments);\n\t}", "constructor() {\r\n super()\r\n thi...
[ "0.77159894", "0.77159894", "0.77104217", "0.7636554", "0.7525753", "0.75214183", "0.7491191", "0.7490335", "0.7464402", "0.74458665", "0.74000126", "0.73501813", "0.73501813", "0.7306149", "0.7297059", "0.7286682", "0.72763526", "0.72718555", "0.7263214", "0.7199066", "0.719...
0.0
-1
Upon success resets a form and closes the window with a form
onSubmit (options) { Project.update(options, ( e, response ) => { if (e === null && response) { App.update(); this.element.reset(); const modal = App.getModal('translateProject'); modal.close(); }; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function success_form(response, status, xhr, form){\n if (successForm(response, status, xhr, form)) {\n form.clearForm();\n }\n else {\n }\n}", "function exitNewBookForm() {\n form.reset()\n form.style.visibility = 'hidden'\n}", "closeLoginForm() {\n document.getElementById(\"sh...
[ "0.70833987", "0.70292586", "0.69723403", "0.6856293", "0.68125993", "0.678791", "0.672224", "0.66956407", "0.66572976", "0.663648", "0.66340697", "0.66170436", "0.6604636", "0.65995777", "0.6598624", "0.6590013", "0.6561825", "0.6542738", "0.65108246", "0.65068245", "0.64926...
0.0
-1
Define Global Variables End Global Variables Start Helper Functions Check if the element is within the viewport Returns true if it is, false otherwise
function isInViewport(el) { const rect = el.getBoundingClientRect(); console.log(rect); console.log(window.innerHeight); console.log(document.documentElement.clientHeight); console.log(rect.bottom<=(window.innerHeight || document.documentElement.clientHeight)); return ( rect.top <= 150 &...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inViewport() {\n return $elem.offset().top + $elem.outerHeight() >= $window.scrollTop() && $elem.offset().top <= $window.scrollTop() + $window.height();\n }", "function viewportChecker(elem) {\n let secPosition = elem.getBoundingClientRect();\n return (secPosition.top >= 0);\n}", "fu...
[ "0.7861896", "0.7721337", "0.76474696", "0.75564593", "0.74842423", "0.7474426", "0.7448926", "0.7414149", "0.7411488", "0.74031675", "0.73914784", "0.73858356", "0.7382525", "0.7371658", "0.7352715", "0.7342278", "0.73349667", "0.7329594", "0.7297793", "0.7297743", "0.729497...
0.72460794
25